Merge "Add support for auth-only transforms"

This commit is contained in:
Treehugger Robot
2018-03-20 18:36:04 +00:00
committed by Gerrit Code Review
2 changed files with 15 additions and 1 deletions

View File

@@ -37,6 +37,13 @@ import java.util.Arrays;
public final class IpSecAlgorithm implements Parcelable { public final class IpSecAlgorithm implements Parcelable {
private static final String TAG = "IpSecAlgorithm"; private static final String TAG = "IpSecAlgorithm";
/**
* Null cipher.
*
* @hide
*/
public static final String CRYPT_NULL = "ecb(cipher_null)";
/** /**
* AES-CBC Encryption/Ciphering Algorithm. * AES-CBC Encryption/Ciphering Algorithm.
* *

View File

@@ -1491,6 +1491,13 @@ public class IpSecService extends IIpSecService.Stub {
IpSecAlgorithm crypt = c.getEncryption(); IpSecAlgorithm crypt = c.getEncryption();
IpSecAlgorithm authCrypt = c.getAuthenticatedEncryption(); IpSecAlgorithm authCrypt = c.getAuthenticatedEncryption();
String cryptName;
if (crypt == null) {
cryptName = (authCrypt == null) ? IpSecAlgorithm.CRYPT_NULL : "";
} else {
cryptName = crypt.getName();
}
mSrvConfig mSrvConfig
.getNetdInstance() .getNetdInstance()
.ipSecAddSecurityAssociation( .ipSecAddSecurityAssociation(
@@ -1505,7 +1512,7 @@ public class IpSecService extends IIpSecService.Stub {
(auth != null) ? auth.getName() : "", (auth != null) ? auth.getName() : "",
(auth != null) ? auth.getKey() : new byte[] {}, (auth != null) ? auth.getKey() : new byte[] {},
(auth != null) ? auth.getTruncationLengthBits() : 0, (auth != null) ? auth.getTruncationLengthBits() : 0,
(crypt != null) ? crypt.getName() : "", cryptName,
(crypt != null) ? crypt.getKey() : new byte[] {}, (crypt != null) ? crypt.getKey() : new byte[] {},
(crypt != null) ? crypt.getTruncationLengthBits() : 0, (crypt != null) ? crypt.getTruncationLengthBits() : 0,
(authCrypt != null) ? authCrypt.getName() : "", (authCrypt != null) ? authCrypt.getName() : "",