src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11TlsRsaPremasterSecretGenerator.java
--- a/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11TlsRsaPremasterSecretGenerator.java Wed Sep 19 10:50:25 2018 +0200
+++ b/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11TlsRsaPremasterSecretGenerator.java Wed Sep 12 13:09:51 2018 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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
@@ -89,15 +89,14 @@
TlsRsaPremasterSecretParameterSpec spec =
(TlsRsaPremasterSecretParameterSpec) params;
-
- int version = (spec.getMajorVersion() << 8) | spec.getMinorVersion();
+ int tlsVersion = (spec.getMajorVersion() << 8) | spec.getMinorVersion();
- if ((version == 0x0300 && !supportSSLv3) || (version < 0x0300) ||
- (version > 0x0302)) {
+ if ((tlsVersion == 0x0300 && !supportSSLv3) ||
+ (tlsVersion < 0x0300) || (tlsVersion > 0x0303)) {
throw new InvalidAlgorithmParameterException
("Only" + (supportSSLv3? " SSL 3.0,": "") +
- " TLS 1.0, and TLS 1.1 are supported (0x" +
- Integer.toHexString(version) + ")");
+ " TLS 1.0, TLS 1.1 and TLS 1.2 are supported (" +
+ tlsVersion + ")");
}
this.spec = spec;
}