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

OpenSSL::PKey::RSA missing #public_to_der #298

Closed
segiddins opened this issue Apr 30, 2024 · 7 comments
Closed

OpenSSL::PKey::RSA missing #public_to_der #298

segiddins opened this issue Apr 30, 2024 · 7 comments

Comments

@segiddins
Copy link

#!/usr/bin/env ruby

require 'rubygems'
require 'openssl'

b64 = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2G2Y+2tabdTV5BcGiBIx0a9fAFwrkBbmLSGtks4L3qX6yYY0zufBnhC8Ur/iy55GhWP/9A/bY2LhC30M9+RYtw=="

key = OpenSSL::PKey.read(b64.unpack1("m"))

pp OpenSSL::Digest::SHA256.hexdigest(key.public_to_der)

passes on MRI, fails on jruby (JRuby-OpenSSL 0.14.5):

NoMethodError: undefined method `public_to_der' for #<OpenSSL::PKey::RSA:0x5a1c7619>
  <main> at Untitled 2.rb:10
@segiddins
Copy link
Author

So is OpenSSL::PKey::EC

@headius
Copy link
Member

headius commented Dec 10, 2024

High priority here. @kares If you can get to this soon it would be great, but otherwise I will try to do it during my holiday hacking this month.

@kares
Copy link
Member

kares commented Dec 12, 2024

High priority, in terms of what?
The report seem quite old and there's not much new context since.

@headius
Copy link
Member

headius commented Dec 12, 2024

@kares This is needed by the new secure gem publisher that @segiddins is working on, and has already led to one JRuby gem not getting published correctly. @segiddins is trying to work around it in sigstore/sigstore-ruby#192.

@kares
Copy link
Member

kares commented Dec 13, 2024

Thanks, I somehow missed the issues linked to this bug.
I will try adding the to_der variants, should be fairly easy...

@kares
Copy link
Member

kares commented Dec 13, 2024

pushed 7dbac3c and d692376 what's left is PKey::EC

@kares
Copy link
Member

kares commented Jan 9, 2025

final part (PKey::EC) at 6a6ce2e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants