@@ -46,7 +46,7 @@ public void setUp() throws Exception {
46
46
// restore the same state as before running the tests.
47
47
public static void removeSunJCE () {
48
48
if (inFipsJvm ()) {
49
- SecurityProviderManager .excludeSunJCE ();
49
+ SecurityProviderManager .removeNonCompliantFipsProviders ();
50
50
}
51
51
}
52
52
@@ -57,7 +57,7 @@ public void testCipherRC4() throws Exception {
57
57
assertEquals (SUN_JCE , cipher .getProvider ().getName ());
58
58
59
59
// when
60
- SecurityProviderManager .excludeSunJCE ();
60
+ SecurityProviderManager .removeNonCompliantFipsProviders ();
61
61
62
62
// then
63
63
expectThrows (NoSuchAlgorithmException .class , () -> Cipher .getInstance (RC_4 ));
@@ -70,7 +70,7 @@ public void testCipherAES() throws Exception {
70
70
assertEquals (TOP_PRIO_CIPHER_PROVIDER , cipher .getProvider ().getName ());
71
71
72
72
// when
73
- SecurityProviderManager .excludeSunJCE ();
73
+ SecurityProviderManager .removeNonCompliantFipsProviders ();
74
74
75
75
// then
76
76
if (inFipsJvm ()) {
@@ -89,7 +89,7 @@ public void testCipher3Des() throws Exception {
89
89
assertEquals (TOP_PRIO_CIPHER_PROVIDER , cipher .getProvider ().getName ());
90
90
91
91
// when
92
- SecurityProviderManager .excludeSunJCE ();
92
+ SecurityProviderManager .removeNonCompliantFipsProviders ();
93
93
94
94
// then
95
95
if (inFipsJvm ()) {
@@ -108,7 +108,7 @@ public void testCipherDes() throws Exception {
108
108
assertEquals (SUN_JCE , cipher .getProvider ().getName ());
109
109
110
110
// when
111
- SecurityProviderManager .excludeSunJCE ();
111
+ SecurityProviderManager .removeNonCompliantFipsProviders ();
112
112
113
113
// then
114
114
expectThrows (NoSuchAlgorithmException .class , () -> Cipher .getInstance (DES ));
@@ -121,7 +121,7 @@ public void testCipherPBE() throws Exception {
121
121
assertEquals (SUN_JCE , cipher .getProvider ().getName ());
122
122
123
123
// when
124
- SecurityProviderManager .excludeSunJCE ();
124
+ SecurityProviderManager .removeNonCompliantFipsProviders ();
125
125
126
126
// then
127
127
expectThrows (NoSuchAlgorithmException .class , () -> Cipher .getInstance (PBE ));
@@ -134,15 +134,15 @@ public void testCipherBlowfish() throws Exception {
134
134
assertEquals (SUN_JCE , cipher .getProvider ().getName ());
135
135
136
136
// when
137
- SecurityProviderManager .excludeSunJCE ();
137
+ SecurityProviderManager .removeNonCompliantFipsProviders ();
138
138
139
139
// then
140
140
expectThrows (NoSuchAlgorithmException .class , () -> Cipher .getInstance (BLOWFISH ));
141
141
}
142
142
143
143
public void testGetPosition () {
144
144
assertTrue (SUN_JCE + " is installed" , SecurityProviderManager .getPosition (SUN_JCE ) > 0 );
145
- SecurityProviderManager .excludeSunJCE ();
145
+ SecurityProviderManager .removeNonCompliantFipsProviders ();
146
146
assertTrue (SUN_JCE + " is uninstalled" , SecurityProviderManager .getPosition (SUN_JCE ) < 0 );
147
147
}
148
148
0 commit comments