diff options
| author | Benedict Wong <benedictwong@google.com> | 2018-01-09 18:31:14 +0000 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2018-01-09 18:31:14 +0000 |
| commit | c93df5ca1c974960f1694647d28b157b512d9ceb (patch) | |
| tree | cbbd8fed262a2957185b8e857c458c66e2415db9 /core/java | |
| parent | d14b30205cd7b980cece26a80692b2970ea11542 (diff) | |
| parent | a954f20f468fd9f9a6a8a45f3f49dbab3df75e30 (diff) | |
Merge "Add validation to IpSecConfig algorithm setters"
am: a954f20f46
Change-Id: I7d241a4348fd1339ff7475ee9301c7fe6c7453c0
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/net/IpSecAlgorithm.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/core/java/android/net/IpSecAlgorithm.java b/core/java/android/net/IpSecAlgorithm.java index f82627b942c3..7d752e89e6f6 100644 --- a/core/java/android/net/IpSecAlgorithm.java +++ b/core/java/android/net/IpSecAlgorithm.java @@ -231,6 +231,31 @@ public final class IpSecAlgorithm implements Parcelable { } } + /** @hide */ + public boolean isAuthentication() { + switch (getName()) { + // Fallthrough + case AUTH_HMAC_MD5: + case AUTH_HMAC_SHA1: + case AUTH_HMAC_SHA256: + case AUTH_HMAC_SHA384: + case AUTH_HMAC_SHA512: + return true; + default: + return false; + } + } + + /** @hide */ + public boolean isEncryption() { + return getName().equals(CRYPT_AES_CBC); + } + + /** @hide */ + public boolean isAead() { + return getName().equals(AUTH_CRYPT_AES_GCM); + } + @Override public String toString() { return new StringBuilder() |
