Skip to content

Commit 13fb548

Browse files
committed
(maint) Update test_ca
Previously, the build_cert method in Puppet::TestCa needed special logic for the Eliptical Curve class: ruby/openssl#29 This issue was resolved in OpenSSL 2.0, which was released in 2016, meaning that all versions of Ruby that Puppet supports includes Ruby/OpenSSL >= 2.0. This commit removes special logic for EC in Puppet::TestCa.
1 parent 7a7852f commit 13fb548

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

spec/lib/puppet/test_ca.rb

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,7 @@ def build_cert(name, issuer, opts = {})
135135
key = OpenSSL::PKey::RSA.new(2048)
136136
end
137137
cert = OpenSSL::X509::Certificate.new
138-
cert.public_key = if key.is_a?(OpenSSL::PKey::EC)
139-
# EC#public_key doesn't following the PKey API,
140-
# see https://github.com/ruby/openssl/issues/29
141-
point = key.public_key
142-
pubkey = OpenSSL::PKey::EC.new(point.group)
143-
pubkey.public_key = point
144-
pubkey
145-
else
146-
key.public_key
147-
end
138+
cert.public_key = key
148139
cert.subject = OpenSSL::X509::Name.new([["CN", name]])
149140
cert.issuer = issuer
150141
cert.version = 2

0 commit comments

Comments
 (0)