392 393 // size of the authentication tag, only applicable to cipher suites in 394 // Galois Counter Mode (GCM) 395 // 396 // As far as we know, all supported GCM cipher suites use 128-bits 397 // authentication tags. 398 final int tagSize = 16; 399 400 // runtime availability 401 private final boolean isAvailable; 402 403 private final Map.Entry<ReadCipherGenerator, 404 ProtocolVersion[]>[] readCipherGenerators; 405 private final Map.Entry<WriteCipherGenerator, 406 ProtocolVersion[]>[] writeCipherGenerators; 407 408 // Map of Ciphers listed in jdk.tls.keyLimits 409 private static final HashMap<String, Long> cipherLimits = new HashMap<>(); 410 411 // Keywords found on the jdk.tls.keyLimits security property. 412 final static String tag[] = {"KEYUPDATE"}; 413 414 static { 415 final long max = 4611686018427387904L; // 2^62 416 String prop = AccessController.doPrivileged( 417 new PrivilegedAction<String>() { 418 @Override 419 public String run() { 420 return Security.getProperty("jdk.tls.keyLimits"); 421 } 422 }); 423 424 if (prop != null) { 425 String propvalue[] = prop.split(","); 426 427 for (String entry : propvalue) { 428 int index; 429 // If this is not a UsageLimit, goto to next entry. 430 String values[] = entry.trim().toUpperCase().split(" "); 431 432 if (values[1].contains(tag[0])) { 433 index = 0; 434 } else { 435 if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { 436 SSLLogger.fine("jdk.tls.keyLimits: Unknown action: " + 437 entry); 438 } 439 continue; 440 } 441 442 long size; 443 int i = values[2].indexOf("^"); 444 try { 445 if (i >= 0) { 446 size = (long) Math.pow(2, 447 Integer.parseInt(values[2].substring(i + 1))); 448 } else { 449 size = Long.parseLong(values[2]); 450 } | 392 393 // size of the authentication tag, only applicable to cipher suites in 394 // Galois Counter Mode (GCM) 395 // 396 // As far as we know, all supported GCM cipher suites use 128-bits 397 // authentication tags. 398 final int tagSize = 16; 399 400 // runtime availability 401 private final boolean isAvailable; 402 403 private final Map.Entry<ReadCipherGenerator, 404 ProtocolVersion[]>[] readCipherGenerators; 405 private final Map.Entry<WriteCipherGenerator, 406 ProtocolVersion[]>[] writeCipherGenerators; 407 408 // Map of Ciphers listed in jdk.tls.keyLimits 409 private static final HashMap<String, Long> cipherLimits = new HashMap<>(); 410 411 // Keywords found on the jdk.tls.keyLimits security property. 412 final static String[] tag = {"KEYUPDATE"}; 413 414 static { 415 final long max = 4611686018427387904L; // 2^62 416 String prop = AccessController.doPrivileged( 417 new PrivilegedAction<String>() { 418 @Override 419 public String run() { 420 return Security.getProperty("jdk.tls.keyLimits"); 421 } 422 }); 423 424 if (prop != null) { 425 String[] propvalue = prop.split(","); 426 427 for (String entry : propvalue) { 428 int index; 429 // If this is not a UsageLimit, goto to next entry. 430 String[] values = entry.trim().toUpperCase().split(" "); 431 432 if (values[1].contains(tag[0])) { 433 index = 0; 434 } else { 435 if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { 436 SSLLogger.fine("jdk.tls.keyLimits: Unknown action: " + 437 entry); 438 } 439 continue; 440 } 441 442 long size; 443 int i = values[2].indexOf("^"); 444 try { 445 if (i >= 0) { 446 size = (long) Math.pow(2, 447 Integer.parseInt(values[2].substring(i + 1))); 448 } else { 449 size = Long.parseLong(values[2]); 450 } |