summaryrefslogtreecommitdiff
path: root/core/java/android/net/IpSecManager.java
diff options
context:
space:
mode:
authorNathan Harold <nharold@google.com>2017-08-23 13:46:33 -0700
committerNathan Harold <nharold@google.com>2017-10-03 19:45:55 -0700
commita10003d5de52339f4d30fedd7294941378e5f13c (patch)
tree2ec4a2c155a9b379aa330905c0e04ca61df2780e /core/java/android/net/IpSecManager.java
parent1704df64ceaa282c8f91f886204261af1f4395a2 (diff)
Input Validation for IpSecService
All of the input to IpSecService over the Binder interface needs to be validated both for sanity and for safety. -Sanity check all the parameters coming from binder. -Added setters for IpSecConfig to decouple the test from the IpSecManager. This was needed because the input validation caused the tests to fail due to a null parameter that was previously un-tested. -Added the mode flag to the IpSecConfig bundle this oversight was found during testing. -Expose the getResourceId() methods for testing in UdpEncapsulationSocket, SecurityParameterIndex, and IpSecTransform classes. -Remove the unneeded getIpSecConfig() from IpSecTransform: unneeded now that we can synthesize configs. Bug: 38397094 Test: runtest frameworks-net Change-Id: I5241fc7fbfa9816d54219acd8d81a9f7eef10dd4
Diffstat (limited to 'core/java/android/net/IpSecManager.java')
-rw-r--r--core/java/android/net/IpSecManager.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/net/IpSecManager.java b/core/java/android/net/IpSecManager.java
index d7908c8ceef8..d7b325613fee 100644
--- a/core/java/android/net/IpSecManager.java
+++ b/core/java/android/net/IpSecManager.java
@@ -26,6 +26,8 @@ import android.os.RemoteException;
import android.util.AndroidException;
import android.util.Log;
+import com.android.internal.annotations.VisibleForTesting;
+
import dalvik.system.CloseGuard;
import java.io.FileDescriptor;
@@ -188,7 +190,8 @@ public final class IpSecManager {
}
/** @hide */
- int getResourceId() {
+ @VisibleForTesting
+ public int getResourceId() {
return mResourceId;
}
}
@@ -489,7 +492,8 @@ public final class IpSecManager {
}
/** @hide */
- int getResourceId() {
+ @VisibleForTesting
+ public int getResourceId() {
return mResourceId;
}
};