< prev index next >

test/jdk/sun/security/pkcs11/Cipher/TestKATForGCM.java

Print this page
rev 59107 : imported patch security


 308     public void main(Provider p) throws Exception {
 309         Cipher c;
 310         String transformation = "AES/GCM/NoPadding";
 311         try {
 312             c = Cipher.getInstance(transformation, p);
 313         } catch (GeneralSecurityException e) {
 314             System.out.println("Skip testing " + p.getName() +
 315                     ", no support for " + transformation);
 316             return;
 317         }
 318         try {
 319             if (execute(testValues, c)) {
 320                 System.out.println("Test Passed!");
 321             }
 322         } catch (Exception e) {
 323             System.out.println("Exception occured using " + p.getName() + " version " + p.getVersionStr());
 324 
 325             if (isNSS(p)) {
 326                 double ver = getNSSInfo("nss");
 327                 String osName = System.getProperty("os.name");
 328                 if (ver < 3.251d && osName.equals("SunOS")) {
 329                     // buggy behaviour from solaris on 11.2 OS (nss < 3.251)
 330                     System.out.println("Skipping: SunPKCS11-NSS: Old NSS: " + ver);
 331                     return; // OK
 332                 } else if (ver > 3.139 && ver < 3.15 && osName.equals("Linux")) {
 333                     // warn about buggy behaviour on Linux with nss 3.14
 334                     System.out.println("Warning: old NSS " + ver + " might be problematic, consider upgrading it");
 335                 }
 336             }
 337             throw e;
 338         }
 339     }
 340 }
 341 


 308     public void main(Provider p) throws Exception {
 309         Cipher c;
 310         String transformation = "AES/GCM/NoPadding";
 311         try {
 312             c = Cipher.getInstance(transformation, p);
 313         } catch (GeneralSecurityException e) {
 314             System.out.println("Skip testing " + p.getName() +
 315                     ", no support for " + transformation);
 316             return;
 317         }
 318         try {
 319             if (execute(testValues, c)) {
 320                 System.out.println("Test Passed!");
 321             }
 322         } catch (Exception e) {
 323             System.out.println("Exception occured using " + p.getName() + " version " + p.getVersionStr());
 324 
 325             if (isNSS(p)) {
 326                 double ver = getNSSInfo("nss");
 327                 String osName = System.getProperty("os.name");
 328                 if (ver > 3.139 && ver < 3.15 && osName.equals("Linux")) {




 329                     // warn about buggy behaviour on Linux with nss 3.14
 330                     System.out.println("Warning: old NSS " + ver + " might be problematic, consider upgrading it");
 331                 }
 332             }
 333             throw e;
 334         }
 335     }
 336 }
 337 
< prev index next >