Skip to content

Commit 61234be

Browse files
authored
Merge pull request #9070 from joshcooper/missing_crlid_11849
(PUP-11849) Always print the CRL authorityKeyIdentifier
2 parents 440ea41 + 4f8d25a commit 61234be

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

lib/puppet/ssl/ssl_provider.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def print(ssl_context, alg = 'SHA256')
225225
ssl_context.crls.each do |crl|
226226
oid_values = Hash[crl.extensions.map { |ext| [ext.oid, ext.value] }]
227227
crlNumber = oid_values['crlNumber'] || 'unknown'
228-
authKeyId = (oid_values['authorityKeyIdentifier'] || 'unknown').chomp!
228+
authKeyId = (oid_values['authorityKeyIdentifier'] || 'unknown').chomp
229229
Puppet.debug("Using CRL '#{crl.issuer.to_utf8}' authorityKeyIdentifier '#{authKeyId}' crlNumber '#{crlNumber }'")
230230
end
231231
end

spec/unit/ssl/ssl_provider_spec.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,4 +634,24 @@
634634
"The CSR for host 'CN=signed' does not match the public key")
635635
end
636636
end
637+
638+
context 'printing' do
639+
let(:client_cert) { cert_fixture('signed.pem') }
640+
let(:private_key) { key_fixture('signed-key.pem') }
641+
let(:config) { { cacerts: global_cacerts, crls: global_crls, client_cert: client_cert, private_key: private_key } }
642+
643+
it 'prints in debug' do
644+
Puppet[:log_level] = 'debug'
645+
646+
ctx = subject.create_context(**config)
647+
subject.print(ctx)
648+
expect(@logs.map(&:message)).to include(
649+
/Verified CA certificate 'CN=Test CA' fingerprint/,
650+
/Verified CA certificate 'CN=Test CA Subauthority' fingerprint/,
651+
/Verified client certificate 'CN=signed' fingerprint/,
652+
/Using CRL 'CN=Test CA' authorityKeyIdentifier '(keyid:)?[A-Z0-9:]{59}' crlNumber '0'/,
653+
/Using CRL 'CN=Test CA Subauthority' authorityKeyIdentifier '(keyid:)?[A-Z0-9:]{59}' crlNumber '0'/
654+
)
655+
end
656+
end
637657
end

0 commit comments

Comments
 (0)