Skip to content

Commit

Permalink
CRYPTO-178: isNativeCodeEnabled should not throw
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbASF committed Nov 20, 2023
1 parent 514a0e3 commit 5252a31
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
1 change: 1 addition & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
<body>
<release version="1.2.1" date="202X-MM-DD" description="Minor release (Java 8, OpenSSL 1.1.1)">
<!-- FIX -->
<action issue="CRYPTO-178" type="fix" dev="sebb">OpenSslCryptoRandom.isNativeCodeEnabled() throws if library cannot be loaded</action>
<action issue="CRYPTO-173" type="fix" dev="sebb">docker build does not work on macOS M1</action>
<action issue="CRYPTO-167" type="fix" dev="sebb">cannot use THROW to report missing env</action>
<action issue="CRYPTO-171" type="fix" dev="sebb">openssl(2) not supported since Sierra on macOS M1</action>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ final class OpenSslCryptoRandom implements CryptoRandom {
}
nativeEnabled = opensslLoaded;
initException = except;
//
// Check that nextRandBytes works (is this really needed?)
try {
checkNative();
} catch (final GeneralSecurityException e) {
throw new IllegalStateException(e);
}
if (!OpenSslCryptoRandomNative.nextRandBytes(new byte[1])) {
throw new IllegalStateException("Check of nextRandBytes failed");
}
}

private static void checkNative() throws GeneralSecurityException {
Expand Down

0 comments on commit 5252a31

Please sign in to comment.