7152169: TEST_BUG: sun/security/tools/jarsigner/ec.sh occasionally fail due to keytool error on sparc

Reviewed-by: mullan
This commit is contained in:
Vinnie Ryan 2012-04-13 19:00:08 +01:00
parent 9fd5ef2141
commit 34af18cd40

View File

@ -87,8 +87,8 @@ public final class ECParameters extends AlgorithmParametersSpi {
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];