Project

General

Profile

« Previous | Next » 

Revision 94ee88b3

Added by Vít Ondruch over 3 years ago

[rubygems/rubygems] Provide distinguished name which will be correctly parsed.

It seems that since ruby openssl 2.1.0 [1], the distinguished name
submitted to OpenSSL::X509::Name.parse is not correctly parsed if it
does not contain the first slash:

$ ruby -v
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux]

$ gem list | grep openssl
openssl (default: 2.2.0)

$ irb -r openssl
irb(main):001:0> OpenSSL::X509::Name.parse("CN=nobody/DC=example").to_s(OpenSSL::X509::Name::ONELINE)
=> "CN = nobody/DC=example"
irb(main):002:0> OpenSSL::X509::Name.parse("/CN=nobody/DC=example").to_s(OpenSSL::X509::Name::ONELINE)
=> "CN = nobody, DC = example"

Instead, use OpenSSL::X509::Name.new directly as suggested by upstream
maintainer.

https://github.com/rubygems/rubygems/commit/09ca0c2dae

Co-authored-by: Kazuki Yamaguchi