--- old/test/jdk/sun/security/pkcs11/KeyAgreement/SupportedDHKeys.java 2020-05-20 18:07:28.326681982 -0700 +++ new/test/jdk/sun/security/pkcs11/KeyAgreement/SupportedDHKeys.java 2020-05-20 18:07:27.942674609 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -109,14 +109,11 @@ BigInteger leftOpen = BigInteger.ONE; BigInteger rightOpen = p.subtract(BigInteger.ONE); - // ignore the private key range checking on Solaris at present - if (!provider.getName().equals("SunPKCS11-Solaris")) { - BigInteger x = privateKey.getX(); - if ((x.compareTo(leftOpen) <= 0) || - (x.compareTo(rightOpen) >= 0)) { - throw new Exception( - "X outside range [2, p - 2]: x: " + x + " p: " + p); - } + BigInteger x = privateKey.getX(); + if ((x.compareTo(leftOpen) <= 0) || + (x.compareTo(rightOpen) >= 0)) { + throw new Exception( + "X outside range [2, p - 2]: x: " + x + " p: " + p); } BigInteger y = publicKey.getY();