Tracking Variables
"Where does this variable come from?"
1. Identify variable of interest. The variable we are concerned with is the PrivateKey
variable priv
used in the method changePassword
.
2. The variable is set by a call to the decodePrivate
method in PubkeyUtils
. Let's have a look at this method.
3. The implementation here is simple; the parameters are passed along to another method of the same name. In the event that a secret
is provided, the encoded parameter is decrypted first.
We can use the Smart View to inspect this method more easily. The Forward Call script will show us all methods called when generating our PrivateKey
. Through the course of evaluating this method, eighteen library methods are called from android.jar
. For easy viewing, we can click the minimize button in the upper left corner of the graph element to collapse it.
4. This graph provides insight into a few points of interest. The conditional call to decrypt
represents the bulk of the calls required for this operation. After encoded
is decrypted, the rest of the work is handled in the overloaded method decodePrivate
.
Now we know that a data flow analysis extending as far as this method will show us information that is exchanged in generating our PrivateKey
. The Connection view can build this dataflow graph for us. Enter changePassword
in the Roots pane and decodePrivate
into the Leaves pane of the view.
The Connection View shows the two parameters being passed into the method, across packages. The provided type parameter is used to acquire the appropriate KeyFactory
from the library.