merge in nyc-bugfix-release history after reset to nyc-dev
diff --git a/luni/src/test/java/libcore/java/net/URLTest.java b/luni/src/test/java/libcore/java/net/URLTest.java
index 629015f..789e3e9 100644
--- a/luni/src/test/java/libcore/java/net/URLTest.java
+++ b/luni/src/test/java/libcore/java/net/URLTest.java
@@ -757,26 +757,4 @@
assertEquals("/some/path", new URL("http://foobar.com/some/path#").getFile());
assertEquals("/some/path", new URL("http://foobar.com/some/path?#").getFile());
}
-
- // http://b/31858037
- public void testFragmentWithSlash() throws Exception {
- final String host = "example.com";
- final String fragment = "@not-a-host-name/a";
- URL url = new URL(String.format("http://%s#%s", host, fragment));
- assertNull(url.getUserInfo());
- assertEquals(host, url.getAuthority());
- assertEquals(host, url.getHost());
- assertEquals(fragment, url.getRef());
- }
-
- // http://b/31858037
- public void testFragmentWithQuery() throws Exception {
- final String host = "example.com";
- final String fragment = "@not-a-host-name?a";
- URL url = new URL(String.format("http://%s#%s", host, fragment));
- assertNull(url.getUserInfo());
- assertEquals(host, url.getAuthority());
- assertEquals(host, url.getHost());
- assertEquals(fragment, url.getRef());
- }
}
diff --git a/luni/src/test/java/libcore/javax/crypto/CipherTest.java b/luni/src/test/java/libcore/javax/crypto/CipherTest.java
index a75a66d..13e2b7c 100644
--- a/luni/src/test/java/libcore/javax/crypto/CipherTest.java
+++ b/luni/src/test/java/libcore/javax/crypto/CipherTest.java
@@ -3374,9 +3374,6 @@
}
}
- // 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";
@@ -3389,12 +3386,14 @@
(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(12, tag.length);
+ assertEquals(16, tag.length);
}
public void testAES_ECB_PKCS5Padding_ShortBuffer_Failure() throws Exception {
diff --git a/ojluni/src/main/java/java/net/URLStreamHandler.java b/ojluni/src/main/java/java/net/URLStreamHandler.java
index ddea036..e177363 100755
--- a/ojluni/src/main/java/java/net/URLStreamHandler.java
+++ b/ojluni/src/main/java/java/net/URLStreamHandler.java
@@ -175,14 +175,6 @@
i = limit;
}
- // ----- BEGIN android -----
- // i may become greater than limit
- // b/31858037
- if (i > limit) {
- i = limit;
- }
- // ----- END android -----
-
host = authority = spec.substring(start, i);
int ind = authority.indexOf('@');