Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby-OSSL 0.7.1
-
Fix Version/s: JRuby-OSSL 0.7.2
-
Component/s: OpenSSL
-
Labels:None
-
Environment:any
-
Number of attachments :
Description
HMAC.new(msg, "SHA1") raises an exception. Should work as well as HMAC.new(msg, Digest::SHA1.new).
% jruby -ropenssl -e 'OpenSSL::HMAC.new("hello", "SHA1")'
HMAC.java:111:in `initialize': java.lang.ClassCastException: org.jruby.RubyString cannot be cast to org.jruby.ext.openssl.Digest
from org/jruby/ext/openssl/HMAC$i_method_2_0$RUBYINVOKER$initialize.gen:65535:in `call'
from JavaMethod.java:781:in `call'
from CachingCallSite.java:339:in `cacheAndCall'
from CachingCallSite.java:197:in `callBlock'
from CachingCallSite.java:202:in `call'
from RubyClass.java:815:in `call'
from DynamicMethod.java:194:in `call'
from CachingCallSite.java:329:in `cacheAndCall'
from CachingCallSite.java:188:in `call'
from -e:1:in `__file__'
from -e:-1:in `load'
from Ruby.java:685:in `runScript'
from Ruby.java:568:in `runNormally'
from Ruby.java:414:in `runFromMain'
from Main.java:286:in `run'
from Main.java:128:in `run'
from Main.java:97:in `main'
Issue Links
- is duplicated by
-
JRUBY-5872
OpenSSL::HMAC.digest does not accept plain string Digest identifier as other rubies
-
Fixed at 6a6cc3f303ca057c7f4b.
JRUBY-5024: let HMAC.new accept a String as a digest name.HMAC.new(msg, "SHA1") works as same as HMAC.new(msg, SHA1.new) like
CRuby.