Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requiring 'digest/ripemd160' on JRuby 1.7.8 gives RMD160 not supported without BouncyCastle error #1259

Closed
michaelgpearce opened this issue Nov 24, 2013 · 2 comments

Comments

@michaelgpearce
Copy link

With the BouncyCastle Gem installed 'digest/ripemd160' does not load properly. 'digest/sha2' can be required and works fine. If i require 'openssl', i can then use OpenSSL::Digest::RIPEMD160, which also works correctly.

This example shows Digest::SHA256 and OpenSSL::Digest::RIPEMD160 working properly, along with the error generated by requiring 'digest/rmd160'.

~/myprojects/test $ jruby --version
jruby 1.7.8 (1.9.3p392) 2013-11-14 0ce429e on Java HotSpot(TM) 64-Bit Server VM 1.6.0_65-b14-462-11M4609 [darwin-x86_64]
~/myprojects/test $ bundle show bouncy-castle-java
/Users/test/.rvm/gems/jruby-1.7.8@global/gems/bouncy-castle-java-1.5.0147
~/myprojects/test $ irb
irb(main):001:0> require 'digest/sha2'
=> true
irb(main):002:0> Digest::SHA256.new {|d| d << 'foo'}.to_s
=> "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
irb(main):003:0> require 'digest/rmd160'
LoadError: RMD160 not supported without BouncyCastle
    from org/jruby/RubyKernel.java:1084:in `require'
    from /Users/test/.rvm/rubies/jruby-1.7.8/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55:in `require'
    from (irb):3:in `evaluate'
    from org/jruby/RubyKernel.java:1123:in `eval'
    from org/jruby/RubyKernel.java:1519:in `loop'
    from org/jruby/RubyKernel.java:1284:in `catch'
    from org/jruby/RubyKernel.java:1284:in `catch'
    from /Users/test/.rvm/rubies/jruby-1.7.8/bin/irb:13:in `(root)'
irb(main):004:0> 
irb(main):005:0> require 'openssl'
=> true
irb(main):006:0> OpenSSL::Digest::RIPEMD160.new {|d| d << 'foo'}.to_s
=> "9c1185a5c5e9fc54612808977ee8f548b2258d31"
@dirtyfilthy
Copy link

I also have exactly the same issue under jruby-1.7.10

@kares
Copy link
Member

kares commented Jan 10, 2016

no longer relevant in recent jruby-openssl as BC is always bundled

@kares kares closed this as completed Jan 10, 2016
@kares kares added this to the Invalid or Duplicate milestone Jan 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants