Sunday, January 30, 2011

taintdroid code reading 2.

These are diffs for framework/base/telephony.

diff --git a/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java b/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java
index a5188ce..78904c5 100755
--- a/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java
@@ -78,6 +78,10 @@ import java.net.Socket;
 import java.util.ArrayList;
 import java.util.List;
 
+// begin WITH_TAINT_TRACKING
+import dalvik.system.Taint;
+// end WITH_TAINT_TRACKING
+
 /**
  * {@hide}
  */
@@ -1276,6 +1280,9 @@ public class GSMPhone extends PhoneBase {
                 }
 
                 mImei = (String)ar.result;
+  // begin WITH_TAINT_TRACKING
+  Taint.addTaintString(mImei, Taint.TAINT_IMEI);
+  // end WITH_TAINT_TRACKING
             break;
 
             case EVENT_GET_IMEISV_DONE:

This diff is to store IMEI number to Taint object. Taint.addTaintString(mImei, Taint.TAINT_IMEI); is called in public void setMsisdnNumber(String alphaTag, String number, Message onComplete).


diff --git a/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java b/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java
index d711a80..6beee1b 100644
--- a/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java
+++ b/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java
@@ -38,6 +38,9 @@ import com.android.internal.telephony.MccTable;
 
 import java.util.ArrayList;
 
+// begin WITH_TAINT_TRACKING
+import dalvik.system.Taint;
+// end WITH_TAINT_TRACKING
 
 /**
  * {@hide}
@@ -236,6 +239,9 @@ public final class SIMRecords extends IccRecords {
             Message onComplete) {
 
         msisdn = number;
+ // begin WITH_TAINT_TRACKING
+ Taint.addTaintString(msisdn, Taint.TAINT_PHONE_NUMBER);
+ // end WITH_TAINT_TRACKING
         msisdnTag = alphaTag;
 
         if(DBG) log("Set MSISDN: " + msisdnTag +" " + msisdn);
@@ -488,6 +494,11 @@ public final class SIMRecords extends IccRecords {
                 }
 
                 imsi = (String) ar.result;
+  // begin WITH_TAINT_TRACKING
+  //if (imsi != null) {
+      //Taint.addTaintString(imsi, Taint.TAINT_IMSI);
+  //}
+  // end WITH_TAINT_TRACKING
 
                 // IMSI (MCC+MNC+MSIN) is at least 6 digits, but not more
                 // than 15 (and usually 15).
@@ -617,6 +628,9 @@ public final class SIMRecords extends IccRecords {
                 adn = (AdnRecord)ar.result;
 
                 msisdn = adn.getNumber();
+  // begin WITH_TAINT_TRACKING
+  Taint.addTaintString(msisdn, Taint.TAINT_PHONE_NUMBER);
+  // end WITH_TAINT_TRACKING
                 msisdnTag = adn.getAlphaTag();

Summary

These changes stores IMEI, Phone number (ISDN) and ICCID in Taint object

Quesion

When are these values stored in Taint object?

Next, I'll read services/java/com/android/server/LocationManagerService.java.

No comments: