diff options
author | Jessica Wagantall <jwagantall@cyngn.com> | 2016-09-07 12:40:29 -0700 |
---|---|---|
committer | Jessica Wagantall <jwagantall@cyngn.com> | 2016-09-07 12:40:29 -0700 |
commit | decc54501c266ef9277049cc1ce68a8ae65f232c (patch) | |
tree | a4c9fdf401d36f505fbf34888e53de3bc2727d64 | |
parent | 7e191c4204235e56c0a9b129f81b58b56b70e3a0 (diff) | |
parent | c95c72ec796254f98e12d108d6f6d0e06d01bcd3 (diff) | |
download | libcore-decc54501c266ef9277049cc1ce68a8ae65f232c.zip libcore-decc54501c266ef9277049cc1ce68a8ae65f232c.tar.gz libcore-decc54501c266ef9277049cc1ce68a8ae65f232c.tar.bz2 |
Merge tag 'android-6.0.1_r66' into HEAD
Android 6.0.1 release 66
# gpg: Signature made Tue 06 Sep 2016 09:26:59 AM PDT using DSA key ID 9AB10E78
# gpg: Can't check signature: public key not found
-rw-r--r-- | luni/src/test/java/libcore/javax/crypto/CipherTest.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/luni/src/test/java/libcore/javax/crypto/CipherTest.java b/luni/src/test/java/libcore/javax/crypto/CipherTest.java index 0f642cf..398c688 100644 --- a/luni/src/test/java/libcore/javax/crypto/CipherTest.java +++ b/luni/src/test/java/libcore/javax/crypto/CipherTest.java @@ -3203,6 +3203,9 @@ public final class CipherTest extends TestCase { } } + // Test that when reading GCM parameters encoded using ASN1, a value for the tag size + // not present indicates a value of 12. + // https://b/29876633 public void test_DefaultGCMTagSizeAlgorithmParameterSpec() throws Exception { final String AES = "AES"; final String AES_GCM = "AES/GCM/NoPadding"; @@ -3215,14 +3218,12 @@ public final class CipherTest extends TestCase { (byte) 14, // DER encoding : total length (byte) 4, // DER encoding : tag_OctetString (byte) 12, // DER encoding : counter length - // Note that IV's size 12 bytes is recommended, but authentication tag size should be 16 - // bytes. (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0 }); cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key, AES), param); byte[] ciphertext = cipher.update(input); byte[] tag = cipher.doFinal(); - assertEquals(16, tag.length); + assertEquals(12, tag.length); } public void testAES_ECB_PKCS5Padding_ShortBuffer_Failure() throws Exception { |