Skip to content

Commit 55b56f8

Browse files
authored
Fix key usage in SamlAuthenticatorTests (elastic#57124) (elastic#57130)
In elastic#51089 where SamlAuthenticatorTests were refactored, we missed to update one test case which meant that a single key would be used both for signing and encryption in the same run. As explained in elastic#51089, and due to FIPS 140 requirements, BouncyCastle FIPS provider will block RSA keys that have been used for signing from being used for encryption and vice versa This commit changes testNoAttributesReturnedWhenTheyCannotBeDecrypted to always use the specific keys we have added for encryption.
1 parent 01e17bf commit 55b56f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/saml/SamlAuthenticatorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ public void testNoAttributesReturnedWhenTheyCannotBeDecrypted() throws Exception
403403
final String xml = getSimpleResponseAsString(now);
404404

405405
// Encrypting with different cert instead of sp cert will mean that the SP cannot decrypt
406-
final Response encrypted = encryptAttributes(xml, readKeyPair("RSA_4096_updated"));
406+
final Response encrypted = encryptAttributes(xml, readKeyPair("ENCRYPTION_RSA_4096_updated"));
407407
final String encryptedString = SamlUtils.getXmlContent(encrypted, false);
408408
assertThat(encryptedString, not(equalTo(xml)));
409409

0 commit comments

Comments
 (0)