From 78a4d4300bd4571c50f6f38908aeeefde47736ae Mon Sep 17 00:00:00 2001 From: Nathan Harold Date: Fri, 8 Dec 2017 18:42:43 -0800 Subject: [PATCH] Fix IpSecAlgorithm Lengths in IpSecManagerTest Update the key lengths for SHA1 and MD5 authentication to pass the new tighter range checks. Bug: 70324823 Test: this Change-Id: I8f533f043d16b0571bac628d21878e31027fe853 --- .../src/android/net/cts/IpSecManagerTest.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/cts/net/src/android/net/cts/IpSecManagerTest.java b/tests/cts/net/src/android/net/cts/IpSecManagerTest.java index 75bc5284be..9f3ad2fb44 100644 --- a/tests/cts/net/src/android/net/cts/IpSecManagerTest.java +++ b/tests/cts/net/src/android/net/cts/IpSecManagerTest.java @@ -326,56 +326,56 @@ public class IpSecManagerTest extends AndroidTestCase { public void testAesCbcHmacMd5Tcp4() throws Exception { IpSecAlgorithm crypt = new IpSecAlgorithm(IpSecAlgorithm.CRYPT_AES_CBC, CRYPT_KEY); IpSecAlgorithm auth = new IpSecAlgorithm( - IpSecAlgorithm.AUTH_HMAC_MD5, getAuthKey(256), 128); + IpSecAlgorithm.AUTH_HMAC_MD5, getAuthKey(128), 96); checkTransform(IPPROTO_TCP, IPV4_LOOPBACK, crypt, auth); } public void testAesCbcHmacMd5Tcp6() throws Exception { IpSecAlgorithm crypt = new IpSecAlgorithm(IpSecAlgorithm.CRYPT_AES_CBC, CRYPT_KEY); IpSecAlgorithm auth = new IpSecAlgorithm( - IpSecAlgorithm.AUTH_HMAC_MD5, getAuthKey(256), 128); + IpSecAlgorithm.AUTH_HMAC_MD5, getAuthKey(128), 96); checkTransform(IPPROTO_TCP, IPV6_LOOPBACK, crypt, auth); } public void testAesCbcHmacMd5Udp4() throws Exception { IpSecAlgorithm crypt = new IpSecAlgorithm(IpSecAlgorithm.CRYPT_AES_CBC, CRYPT_KEY); IpSecAlgorithm auth = new IpSecAlgorithm( - IpSecAlgorithm.AUTH_HMAC_MD5, getAuthKey(256), 128); + IpSecAlgorithm.AUTH_HMAC_MD5, getAuthKey(128), 96); checkTransform(IPPROTO_UDP, IPV4_LOOPBACK, crypt, auth); } public void testAesCbcHmacMd5Udp6() throws Exception { IpSecAlgorithm crypt = new IpSecAlgorithm(IpSecAlgorithm.CRYPT_AES_CBC, CRYPT_KEY); IpSecAlgorithm auth = new IpSecAlgorithm( - IpSecAlgorithm.AUTH_HMAC_MD5, getAuthKey(256), 128); + IpSecAlgorithm.AUTH_HMAC_MD5, getAuthKey(128), 96); checkTransform(IPPROTO_UDP, IPV6_LOOPBACK, crypt, auth); } public void testAesCbcHmacSha1Tcp4() throws Exception { IpSecAlgorithm crypt = new IpSecAlgorithm(IpSecAlgorithm.CRYPT_AES_CBC, CRYPT_KEY); IpSecAlgorithm auth = new IpSecAlgorithm( - IpSecAlgorithm.AUTH_HMAC_SHA1, getAuthKey(256), 128); + IpSecAlgorithm.AUTH_HMAC_SHA1, getAuthKey(160), 96); checkTransform(IPPROTO_TCP, IPV4_LOOPBACK, crypt, auth); } public void testAesCbcHmacSha1Tcp6() throws Exception { IpSecAlgorithm crypt = new IpSecAlgorithm(IpSecAlgorithm.CRYPT_AES_CBC, CRYPT_KEY); IpSecAlgorithm auth = new IpSecAlgorithm( - IpSecAlgorithm.AUTH_HMAC_SHA1, getAuthKey(256), 128); + IpSecAlgorithm.AUTH_HMAC_SHA1, getAuthKey(160), 96); checkTransform(IPPROTO_TCP, IPV6_LOOPBACK, crypt, auth); } public void testAesCbcHmacSha1Udp4() throws Exception { IpSecAlgorithm crypt = new IpSecAlgorithm(IpSecAlgorithm.CRYPT_AES_CBC, CRYPT_KEY); IpSecAlgorithm auth = new IpSecAlgorithm( - IpSecAlgorithm.AUTH_HMAC_SHA1, getAuthKey(256), 128); + IpSecAlgorithm.AUTH_HMAC_SHA1, getAuthKey(160), 96); checkTransform(IPPROTO_UDP, IPV4_LOOPBACK, crypt, auth); } public void testAesCbcHmacSha1Udp6() throws Exception { IpSecAlgorithm crypt = new IpSecAlgorithm(IpSecAlgorithm.CRYPT_AES_CBC, CRYPT_KEY); IpSecAlgorithm auth = new IpSecAlgorithm( - IpSecAlgorithm.AUTH_HMAC_SHA1, getAuthKey(256), 128); + IpSecAlgorithm.AUTH_HMAC_SHA1, getAuthKey(160), 96); checkTransform(IPPROTO_UDP, IPV6_LOOPBACK, crypt, auth); }