7152169: TEST_BUG: sun/security/tools/jarsigner/ec.sh occasionally fail due to keytool error on sparc
authorvinnie
Fri, 13 Apr 2012 19:00:08 +0100
changeset 12436 1dc3d95b3bc9
parent 12435 554e573ebb1b
child 12437 9fb493dfdfa7
7152169: TEST_BUG: sun/security/tools/jarsigner/ec.sh occasionally fail due to keytool error on sparc Reviewed-by: mullan
jdk/src/share/classes/sun/security/ec/ECParameters.java
--- a/jdk/src/share/classes/sun/security/ec/ECParameters.java	Fri Apr 13 09:49:41 2012 -0400
+++ b/jdk/src/share/classes/sun/security/ec/ECParameters.java	Fri Apr 13 19:00:08 2012 +0100
@@ -87,8 +87,8 @@
         if ((data.length == 0) || (data[0] != 4)) {
             throw new IOException("Only uncompressed point format supported");
         }
-        int n = (curve.getField().getFieldSize() + 7 ) >> 3;
-        if (data.length != (n * 2) + 1) {
+        int n = data.length / 2;
+        if (n > ((curve.getField().getFieldSize() + 7 ) >> 3)) {
             throw new IOException("Point does not match field size");
         }
         byte[] xb = new byte[n];