Skip to content

Commit 342042f

Browse files
committed
DSA+SHA1 is actually a supported algorithm
1 parent e701a4f commit 342042f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/main/java/org/jruby/ext/openssl/PKey.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -414,14 +414,12 @@ static void supportedSignatureAlgorithm(final Ruby runtime, final RubyClass erro
414414
final String keyAlg = key.getAlgorithm();
415415
final String digAlg = digest.getShortAlgorithm();
416416
if ( ( "DSA".equalsIgnoreCase(keyAlg) && "MD5".equalsIgnoreCase(digAlg)) ||
417-
( "RSA".equalsIgnoreCase(keyAlg) && "DSS1".equals( digest.name().toString() ) ) ||
418-
( "DSA".equalsIgnoreCase(keyAlg) && "SHA1".equals( digest.name().toString() ) ) ) {
419-
throw Utils.newError(runtime, errorClass, "unsupported key / digest algorithm ( "+ key +" / "+ digAlg +" )");
417+
( "RSA".equalsIgnoreCase(keyAlg) && "DSS1".equals( digest.name().toString() ) ) ) {
418+
throw Utils.newError(runtime, errorClass, "unsupported key / digest algorithm ( "+ keyAlg +" / "+ digAlg +" )");
420419
}
421420
}
422421

423-
static void supportedSignatureAlgorithm(final Ruby runtime,
424-
final PKey key, final Digest digest) {
422+
static void supportedSignatureAlgorithm(final Ruby runtime, final PKey key, final Digest digest) {
425423
supportedSignatureAlgorithm(runtime, _OpenSSLError(runtime), key, digest);
426424
}
427425

0 commit comments

Comments
 (0)