Fix testGenerateAndSignMetadata in FIPS mode (#54115) (#54387)

BC provider throws different error message on signature
validation failure
This commit is contained in:
Ioannis Kakavas 2020-04-01 12:04:20 +03:00 committed by GitHub
parent 5e3b6ab82b
commit 74eeecf91b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -128,7 +128,11 @@ public class SamlMetadataGeneratorTests extends IdpSamlTestCase {
//no exception thrown
SignatureException e = expectThrows(SignatureException.class,
() -> SignatureValidator.validate(signature, readCredentials("RSA", 2048)));
assertThat(e.getMessage(), containsString("Unable to evaluate key against signature"));
if (inFipsJvm()) {
assertThat(e.getMessage(), containsString("Signature cryptographic validation not successful"));
} else {
assertThat(e.getMessage(), containsString("Unable to evaluate key against signature"));
}
}
}