Skip to content

Commit 38e55cd

Browse files
authored
Adjust reload keystore test to pass in FIPS (#56889) (#56940)
In KeystoreWrapper class we determine if the error to decrypt a given keystore is caused by a wrong password based on the exception that the SunJCE implementation of AES is throwing(AEADBadTagException). Other implementations from other Security Providers fail with a different exception and as such we cannot differentiate between a corrupted file and a wrong password in a foolproof way. As in other tests such as in KeyStoreWrapperTests#testDecryptKeyStoreWithWrongPassword we handle this by matching both possible exception messages.
1 parent 0f233b1 commit 38e55cd

File tree

1 file changed

+3
-1
lines changed
  • rest-api-spec/src/main/resources/rest-api-spec/test/nodes.reload_secure_settings

1 file changed

+3
-1
lines changed

rest-api-spec/src/main/resources/rest-api-spec/test/nodes.reload_secure_settings/10_basic.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ setup:
1818
- is_true: nodes
1919
- is_true: cluster_name
2020
- match: { nodes.$node_id.reload_exception.type: "security_exception" }
21-
- match: { nodes.$node_id.reload_exception.reason: "Provided keystore password was incorrect" }
21+
- match: { nodes.$node_id.reload_exception.reason:
22+
/^(Provided\skeystore\spassword\swas\sincorrect|
23+
Keystore\shas\sbeen\scorrupted\sor\stampered\swith)$/ }
2224

2325
---
2426
"node_reload_secure_settings test correct(empty) password":

0 commit comments

Comments
 (0)