author | chegar |
Thu, 17 Oct 2019 20:54:25 +0100 | |
branch | datagramsocketimpl-branch |
changeset 58679 | 9c3209ff7550 |
parent 58678 | 9cf78a70fa4f |
parent 58420 | 35cbd86e088a |
permissions | -rw-r--r-- |
55332
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
1 |
/* |
57563
2116221e2dde
8228645: Don't run sun/security/pkcs11/Cipher/TestKATForGCM.java on buggy NSS solaris versions
coffeys
parents:
55332
diff
changeset
|
2 |
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. |
55332
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
4 |
* |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
8 |
* |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
13 |
* accompanied this code). |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
14 |
* |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
18 |
* |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
21 |
* questions. |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
22 |
*/ |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
23 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
24 |
/* |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
25 |
* @test |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
26 |
* @bug 8080462 |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
27 |
* @library /test/lib .. |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
28 |
* @modules jdk.crypto.cryptoki |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
29 |
* @run main TestKATForGCM |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
30 |
* @summary Known Answer Test for AES cipher with GCM mode support in |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
31 |
* PKCS11 provider. |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
32 |
*/ |
58420
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
33 |
import java.security.GeneralSecurityException; |
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
34 |
import java.security.Provider; |
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
35 |
import java.util.Arrays; |
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
36 |
import javax.crypto.Cipher; |
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
37 |
import javax.crypto.SecretKey; |
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
38 |
import javax.crypto.spec.GCMParameterSpec; |
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
39 |
import javax.crypto.spec.SecretKeySpec; |
55332
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
40 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
41 |
public class TestKATForGCM extends PKCS11Test { |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
42 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
43 |
// Utility methods |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
44 |
private static byte[] HexToBytes(String hexVal) { |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
45 |
if (hexVal == null) return new byte[0]; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
46 |
byte[] result = new byte[hexVal.length()/2]; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
47 |
for (int i = 0; i < result.length; i++) { |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
48 |
// 2 characters at a time |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
49 |
String byteVal = hexVal.substring(2*i, 2*i +2); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
50 |
result[i] = Integer.valueOf(byteVal, 16).byteValue(); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
51 |
} |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
52 |
return result; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
53 |
} |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
54 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
55 |
private static class TestVector { |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
56 |
SecretKey key; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
57 |
byte[] plainText; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
58 |
byte[] aad; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
59 |
byte[] cipherText; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
60 |
byte[] tag; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
61 |
GCMParameterSpec spec; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
62 |
String info; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
63 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
64 |
TestVector(String key, String iv, String pt, String aad, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
65 |
String ct, String tag) { |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
66 |
this.key = new SecretKeySpec(HexToBytes(key), "AES"); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
67 |
this.plainText = HexToBytes(pt); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
68 |
this.aad = HexToBytes(aad); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
69 |
this.cipherText = HexToBytes(ct); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
70 |
this.tag = HexToBytes(tag); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
71 |
this.spec = new GCMParameterSpec(this.tag.length * 8, HexToBytes(iv)); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
72 |
this.info = "key=" + key + ", iv=" + iv + ", pt=" + pt + |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
73 |
",aad=" + aad + ", ct=" + ct + ", tag=" + tag; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
74 |
} |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
75 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
76 |
public String toString() { |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
77 |
return info; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
78 |
} |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
79 |
} |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
80 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
81 |
// These test vectors are found off NIST's CAVP page |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
82 |
// http://csrc.nist.gov/groups/STM/cavp/index.html |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
83 |
// inside the link named "GCM Test Vectors", i.e. |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
84 |
// http://csrc.nist.gov/groups/STM/cavp/documents/mac/gcmtestvectors.zip |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
85 |
// CAVS 14.0, set of test vectors w/ count = 0, keysize = 128 |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
86 |
private static TestVector[] testValues = { |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
87 |
// 96-bit iv w/ 128/120/112/104/96-bit tags |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
88 |
// no plain text, no aad |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
89 |
new TestVector("11754cd72aec309bf52f7687212e8957", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
90 |
"3c819d9a9bed087615030b65", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
91 |
null, null, null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
92 |
"250327c674aaf477aef2675748cf6971"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
93 |
new TestVector("272f16edb81a7abbea887357a58c1917", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
94 |
"794ec588176c703d3d2a7a07", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
95 |
null, null, null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
96 |
"b6e6f197168f5049aeda32dafbdaeb"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
97 |
new TestVector("81b6844aab6a568c4556a2eb7eae752f", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
98 |
"ce600f59618315a6829bef4d", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
99 |
null, null, null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
100 |
"89b43e9dbc1b4f597dbbc7655bb5"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
101 |
new TestVector("cde2f9a9b1a004165ef9dc981f18651b", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
102 |
"29512c29566c7322e1e33e8e", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
103 |
null, null, null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
104 |
"2e58ce7dabd107c82759c66a75"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
105 |
new TestVector("b01e45cc3088aaba9fa43d81d481823f", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
106 |
"5a2c4a66468713456a4bd5e1", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
107 |
null, null, null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
108 |
"014280f944f53c681164b2ff"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
109 |
// 96-bit iv w/ 128/120/112/104/96-bit tags |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
110 |
// no plain text, 16-byte aad |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
111 |
new TestVector("77be63708971c4e240d1cb79e8d77feb", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
112 |
"e0e00f19fed7ba0136a797f3", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
113 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
114 |
"7a43ec1d9c0a5a78a0b16533a6213cab", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
115 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
116 |
"209fcc8d3675ed938e9c7166709dd946"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
117 |
new TestVector("da0b615656135194ba6d3c851099bc48", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
118 |
"d39d4b4d3cc927885090e6c3", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
119 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
120 |
"e7e5e6f8dac913036cb2ff29e8625e0e", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
121 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
122 |
"ab967711a5770461724460b07237e2"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
123 |
new TestVector("7e0986937a88eef894235aba4a2f43b2", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
124 |
"92c4a631695907166b422d60", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
125 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
126 |
"85c185f8518f9f2cd597a8f9208fc76b", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
127 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
128 |
"3bb916b728df94fe9d1916736be1"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
129 |
new TestVector("c3db570d7f0c21e86b028f11465d1dc9", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
130 |
"f86970f58ceef89fc7cb679e", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
131 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
132 |
"c095240708c0f57c288d86090ae34ee1", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
133 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
134 |
"e043c52160d652e82c7262fcf4"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
135 |
new TestVector("bea48ae4980d27f357611014d4486625", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
136 |
"32bddb5c3aa998a08556454c", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
137 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
138 |
"8a50b0b8c7654bced884f7f3afda2ead", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
139 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
140 |
"8e0f6d8bf05ffebe6f500eb1"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
141 |
// 96-bit iv w/ 128/120/112/104/96-bit tags |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
142 |
// no plain text, 20-byte aad |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
143 |
new TestVector("2fb45e5b8f993a2bfebc4b15b533e0b4", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
144 |
"5b05755f984d2b90f94b8027", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
145 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
146 |
"e85491b2202caf1d7dce03b97e09331c32473941", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
147 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
148 |
"c75b7832b2a2d9bd827412b6ef5769db"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
149 |
new TestVector("9bf406339fcef9675bbcf156aa1a0661", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
150 |
"8be4a9543d40f542abacac95", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
151 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
152 |
"7167cbf56971793186333a6685bbd58d47d379b3", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
153 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
154 |
"5e7968d7bbd5ba58cfcc750e2ef8f1"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
155 |
new TestVector("a2e962fff70fd0f4d63be728b80556fc", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
156 |
"1fa7103483de43d09bc23db4", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
157 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
158 |
"2a58edf1d53f46e4e7ee5e77ee7aeb60fc360658", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
159 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
160 |
"fa37f2dbbefab1451eae1d0d74ca"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
161 |
new TestVector("6bf4fdce82926dcdfc52616ed5f23695", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
162 |
"cc0f5899a10615567e1193ed", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
163 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
164 |
"3340655592374c1da2f05aac3ee111014986107f", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
165 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
166 |
"8ad3385cce3b5e7c985908192c"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
167 |
new TestVector("4df7a13e43c3d7b66b1a72fac5ba398e", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
168 |
"97179a3a2d417908dcf0fb28", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
169 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
170 |
"cbb7fc0010c255661e23b07dbd804b1e06ae70ac", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
171 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
172 |
"37791edae6c137ea946cfb40"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
173 |
// 96-bit iv w/ 128-bit tags, 13/16/32/51-byte plain text, no aad |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
174 |
new TestVector("fe9bb47deb3a61e423c2231841cfd1fb", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
175 |
"4d328eb776f500a2f7fb47aa", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
176 |
"f1cc3818e421876bb6b8bbd6c9", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
177 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
178 |
"b88c5c1977b35b517b0aeae967", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
179 |
"43fd4727fe5cdb4b5b42818dea7ef8c9"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
180 |
new TestVector("7fddb57453c241d03efbed3ac44e371c", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
181 |
"ee283a3fc75575e33efd4887", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
182 |
"d5de42b461646c255c87bd2962d3b9a2", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
183 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
184 |
"2ccda4a5415cb91e135c2a0f78c9b2fd", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
185 |
"b36d1df9b9d5e596f83e8b7f52971cb3"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
186 |
new TestVector("9971071059abc009e4f2bd69869db338", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
187 |
"07a9a95ea3821e9c13c63251", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
188 |
"f54bc3501fed4f6f6dfb5ea80106df0bd836e6826225b75c0222f6e859b35983", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
189 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
190 |
"0556c159f84ef36cb1602b4526b12009c775611bffb64dc0d9ca9297cd2c6a01", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
191 |
"7870d9117f54811a346970f1de090c41"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
192 |
new TestVector("594157ec4693202b030f33798b07176d", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
193 |
"49b12054082660803a1df3df", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
194 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
195 |
"3feef98a976a1bd634f364ac428bb59cd51fb159ec1789946918dbd50ea6c9d594a3a31a5269b0da6936c29d063a5fa2cc8a1c", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
196 |
null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
197 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
198 |
"c1b7a46a335f23d65b8db4008a49796906e225474f4fe7d39e55bf2efd97fd82d4167de082ae30fa01e465a601235d8d68bc69", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
199 |
"ba92d3661ce8b04687e8788d55417dc2"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
200 |
// 96-bit iv w/ 128-bit tags, 16-byte plain text, 16/20/48/90-byte aad |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
201 |
new TestVector("c939cc13397c1d37de6ae0e1cb7c423c", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
202 |
"b3d8cc017cbb89b39e0f67e2", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
203 |
"c3b3c41f113a31b73d9a5cd432103069", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
204 |
"24825602bd12a984e0092d3e448eda5f", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
205 |
"93fe7d9e9bfd10348a5606e5cafa7354", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
206 |
"0032a1dc85f1c9786925a2e71d8272dd"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
207 |
new TestVector("d4a22488f8dd1d5c6c19a7d6ca17964c", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
208 |
"f3d5837f22ac1a0425e0d1d5", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
209 |
"7b43016a16896497fb457be6d2a54122", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
210 |
"f1c5d424b83f96c6ad8cb28ca0d20e475e023b5a", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
211 |
"c2bd67eef5e95cac27e3b06e3031d0a8", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
212 |
"f23eacf9d1cdf8737726c58648826e9c"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
213 |
new TestVector("89850dd398e1f1e28443a33d40162664", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
214 |
"e462c58482fe8264aeeb7231", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
215 |
"2805cdefb3ef6cc35cd1f169f98da81a", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
216 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
217 |
"d74e99d1bdaa712864eec422ac507bddbe2b0d4633cd3dff29ce5059b49fe868526c59a2a3a604457bc2afea866e7606", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
218 |
"ba80e244b7fc9025cd031d0f63677e06", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
219 |
"d84a8c3eac57d1bb0e890a8f461d1065"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
220 |
new TestVector("bd7c5c63b7542b56a00ebe71336a1588", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
221 |
"87721f23ba9c3c8ea5571abc", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
222 |
"de15ddbb1e202161e8a79af6a55ac6f3", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
223 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
224 |
"a6ec8075a0d3370eb7598918f3b93e48444751624997b899a87fa6a9939f844e008aa8b70e9f4c3b1a19d3286bf543e7127bfecba1ad17a5ec53fccc26faecacc4c75369498eaa7d706aef634d0009279b11e4ba6c993e5e9ed9", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
225 |
"41eb28c0fee4d762de972361c863bc80", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
226 |
"9cb567220d0b252eb97bff46e4b00ff8"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
227 |
// 8/1024-bit iv w/ 128-bit tag, no plain text, no aad |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
228 |
new TestVector("1672c3537afa82004c6b8a46f6f0d026", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
229 |
"05", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
230 |
null, null, null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
231 |
"8e2ad721f9455f74d8b53d3141f27e8e"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
232 |
new TestVector("d0f1f4defa1e8c08b4b26d576392027c", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
233 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
234 |
"42b4f01eb9f5a1ea5b1eb73b0fb0baed54f387ecaa0393c7d7dffc6af50146ecc021abf7eb9038d4303d91f8d741a11743166c0860208bcc02c6258fd9511a2fa626f96d60b72fcff773af4e88e7a923506e4916ecbd814651e9f445adef4ad6a6b6c7290cc13b956130eef5b837c939fcac0cbbcc9656cd75b13823ee5acdac", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
235 |
null, null, null, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
236 |
"7ab49b57ddf5f62c427950111c5c4f0d"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
237 |
// 8-bit iv w/ 128-bit tag, 13-byte plain text, 90-byte aad |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
238 |
new TestVector("9f79239f0904eace50784b863e723f6b", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
239 |
"d9", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
240 |
"bdb0bb10c87965acd34d146171", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
241 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
242 |
"44db436089327726c5f01139e1f339735c9e85514ccc2f167bad728010fb34a9072a9794c8a5e7361b1d0dbcdc9ac4091e354bb2896561f0486645252e9c78c86beece91bfa4f7cc4a8794ce1f305b1b735efdbf1ed1563c0be0", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
243 |
"7e5a7c8dadb3f0c7335b4d9d8d", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
244 |
"6b6ef1f53723a89f3bb7c6d043840717"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
245 |
// 1024-bit iv w/ 128-bit tag, 51-byte plain text, 48-byte aad |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
246 |
new TestVector("141f1ce91989b07e7eb6ae1dbd81ea5e", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
247 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
248 |
"49451da24bd6074509d3cebc2c0394c972e6934b45a1d91f3ce1d3ca69e194aa1958a7c21b6f21d530ce6d2cc5256a3f846b6f9d2f38df0102c4791e57df038f6e69085646007df999751e248e06c47245f4cd3b8004585a7470dee1690e9d2d63169a58d243c0b57b3e5b4a481a3e4e8c60007094ef3adea2e8f05dd3a1396f", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
249 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
250 |
"d384305af2388699aa302f510913fed0f2cb63ba42efa8c5c9de2922a2ec2fe87719dadf1eb0aef212b51e74c9c5b934104a43", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
251 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
252 |
"630cf18a91cc5a6481ac9eefd65c24b1a3c93396bd7294d6b8ba323951727666c947a21894a079ef061ee159c05beeb4", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
253 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
254 |
"f4c34e5fbe74c0297313268296cd561d59ccc95bbfcdfcdc71b0097dbd83240446b28dc088abd42b0fc687f208190ff24c0548", |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
255 |
"dbb93bbb56d0439cd09f620a57687f5d"), |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
256 |
}; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
257 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
258 |
public boolean execute(TestVector[] testValues, Cipher c) throws Exception { |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
259 |
boolean testFailed = false; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
260 |
for (int i = 0; i < testValues.length; i++) { |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
261 |
try { |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
262 |
c.init(Cipher.ENCRYPT_MODE, testValues[i].key, testValues[i].spec); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
263 |
c.updateAAD(testValues[i].aad); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
264 |
byte[] ctPlusTag = c.doFinal(testValues[i].plainText); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
265 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
266 |
c.init(Cipher.DECRYPT_MODE, testValues[i].key, testValues[i].spec); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
267 |
c.updateAAD(testValues[i].aad); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
268 |
byte[] pt = c.doFinal(ctPlusTag); // should fail if tag mismatched |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
269 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
270 |
// check encryption/decryption results just to be sure |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
271 |
if (!Arrays.equals(testValues[i].plainText, pt)) { |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
272 |
System.out.println("PlainText diff failed for test# " + i); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
273 |
testFailed = true; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
274 |
} |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
275 |
int ctLen = testValues[i].cipherText.length; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
276 |
if (!Arrays.equals(testValues[i].cipherText, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
277 |
Arrays.copyOf(ctPlusTag, ctLen))) { |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
278 |
System.out.println("CipherText diff failed for test# " + i); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
279 |
testFailed = true; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
280 |
} |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
281 |
int tagLen = testValues[i].tag.length; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
282 |
if (!Arrays.equals |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
283 |
(testValues[i].tag, |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
284 |
Arrays.copyOfRange(ctPlusTag, ctLen, ctLen+tagLen))) { |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
285 |
System.out.println("Tag diff failed for test# " + i); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
286 |
testFailed = true; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
287 |
} |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
288 |
} catch (Exception ex) { |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
289 |
// continue testing other test vectors |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
290 |
System.out.println("Failed Test Vector: " + testValues[i]); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
291 |
ex.printStackTrace(); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
292 |
testFailed = true; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
293 |
continue; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
294 |
} |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
295 |
} |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
296 |
if (testFailed) { |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
297 |
throw new Exception("Test Failed"); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
298 |
} |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
299 |
// passed all tests...hooray! |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
300 |
return true; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
301 |
} |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
302 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
303 |
public static void main(String[] args) throws Exception { |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
304 |
main(new TestKATForGCM(), args); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
305 |
} |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
306 |
|
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
307 |
@Override |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
308 |
public void main(Provider p) throws Exception { |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
309 |
Cipher c; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
310 |
String transformation = "AES/GCM/NoPadding"; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
311 |
try { |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
312 |
c = Cipher.getInstance(transformation, p); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
313 |
} catch (GeneralSecurityException e) { |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
314 |
System.out.println("Skip testing " + p.getName() + |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
315 |
", no support for " + transformation); |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
316 |
return; |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
317 |
} |
57563
2116221e2dde
8228645: Don't run sun/security/pkcs11/Cipher/TestKATForGCM.java on buggy NSS solaris versions
coffeys
parents:
55332
diff
changeset
|
318 |
try { |
2116221e2dde
8228645: Don't run sun/security/pkcs11/Cipher/TestKATForGCM.java on buggy NSS solaris versions
coffeys
parents:
55332
diff
changeset
|
319 |
if (execute(testValues, c)) { |
2116221e2dde
8228645: Don't run sun/security/pkcs11/Cipher/TestKATForGCM.java on buggy NSS solaris versions
coffeys
parents:
55332
diff
changeset
|
320 |
System.out.println("Test Passed!"); |
2116221e2dde
8228645: Don't run sun/security/pkcs11/Cipher/TestKATForGCM.java on buggy NSS solaris versions
coffeys
parents:
55332
diff
changeset
|
321 |
} |
2116221e2dde
8228645: Don't run sun/security/pkcs11/Cipher/TestKATForGCM.java on buggy NSS solaris versions
coffeys
parents:
55332
diff
changeset
|
322 |
} catch (Exception e) { |
58420
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
323 |
System.out.println("Exception occured using " + p.getName() + " version " + p.getVersionStr()); |
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
324 |
|
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
325 |
if (isNSS(p)) { |
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
326 |
double ver = getNSSInfo("nss"); |
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
327 |
String osName = System.getProperty("os.name"); |
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
328 |
if (ver < 3.251d && osName.equals("SunOS")) { |
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
329 |
// buggy behaviour from solaris on 11.2 OS (nss < 3.251) |
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
330 |
System.out.println("Skipping: SunPKCS11-NSS: Old NSS: " + ver); |
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
331 |
return; // OK |
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
332 |
} else if (ver > 3.139 && ver < 3.15 && osName.equals("Linux")) { |
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
333 |
// warn about buggy behaviour on Linux with nss 3.14 |
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
334 |
System.out.println("Warning: old NSS " + ver + " might be problematic, consider upgrading it"); |
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
335 |
} |
57563
2116221e2dde
8228645: Don't run sun/security/pkcs11/Cipher/TestKATForGCM.java on buggy NSS solaris versions
coffeys
parents:
55332
diff
changeset
|
336 |
} |
58420
35cbd86e088a
8231357: sun/security/pkcs11/Cipher/TestKATForGCM.java fails on SLES11 using mozilla-nss-3.14
mbaesken
parents:
57563
diff
changeset
|
337 |
throw e; |
55332
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
338 |
} |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
339 |
} |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
340 |
} |
f492567244ab
8080462: Update SunPKCS11 provider with PKCS11 v2.40 support
valeriep
parents:
diff
changeset
|
341 |