Jira (PUP-4467) Netscape comment extension uses wrong encoding

2 views
Skip to first unread message

Jeremy Barlow (JIRA)

unread,
Apr 27, 2015, 8:35:54 PM4/27/15
to puppe...@googlegroups.com
Jeremy Barlow created an issue
 
Puppet / Bug PUP-4467
Netscape comment extension uses wrong encoding
Issue Type: Bug Bug
Affects Versions: PUP 4.0.0
Assignee: Unassigned
Created: 2015/04/27 5:35 PM
Priority: Normal Normal
Reporter: Jeremy Barlow

The value for a Netscape Comment certificate extension is supposed to be an ASN.1 OctetString which wraps an IA5String. Originally, I believe this was documented here, but this link no longer appears to be active:

http://wp.netscape.com/eng/security/cert-exts.html

References to this needing to be an IA5String, however, appear in some other places:

Prior to Puppet 4, the Ruby Puppet CA would generate the Netscape Comment extension value as a raw OctetString, not wrapping a String of another type. This was incorrect. Per the work done in

PUP-3560 , however, the Ruby Puppet CA would generate the extension value as an OctetString wrapping a UTF8String. Different, but also incorrect. Note that the Puppet Server CA - both versions 1.x and 2.x - correctly generate the Netscape Comment extension value as an OctetString wrapping an IA5String.

-

Steps to reproduce:

1) Install puppet-agent 1.x.
2) Run export RUBYLIB=/opt/puppetlabs/puppet/lib/ruby/vendor_ruby.
3) Run export PATH=/opt/puppetlabs/puppet/bin:$PATH.
4) Run puppet master --no-daemonize --debug --trace --verbose --confdir=/etc/puppetlabs/puppet --vardir=/opt/puppetlabs/puppet/cache.
5) After the WEBrick Puppet master has started, an /etc/puppetlabs/puppet/ssl/certs/[myhost].pem file should exist. On that file, run openssl asn1parse -in [myhost].pem.

The output from the command could include:

702:d=5  hl=2 l=   9 prim: OBJECT            :Netscape Comment
713:d=5  hl=2 l=  42 prim: OCTET STRING      [HEX DUMP]:0C2850757070657420527562792F4F70656E53534C20496E7465726E616C204365727469666963617465

Not that the "0C" at the beginning of the OCTET STRING in this case indicates that the value is encoded as a UTF8String whereas the value should start with "16", hex value for IA5String. See http://www.obj-sys.com/asn1tutorial/node124.html for a list of ASN.1 universal tag numbers.

Since the Netscape Comment extension has been deprecated - https://www.openssl.org/docs/apps/x509v3_config.html#Netscape-String-extensions, this problem only affects the Ruby Puppet CA and not the Puppet Server CA, and the Ruby Puppet CA is intended to be deprecated in the not too distant future, resolution of this problem is probably not critical.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.3.15#6346-sha1:dbc023d)
Atlassian logo

Moses Mendoza (JIRA)

unread,
May 17, 2017, 1:47:03 PM5/17/17
to puppe...@googlegroups.com
Moses Mendoza commented on Bug PUP-4467
 
Re: Netscape comment extension uses wrong encoding

Thank you for filing this issue. We agree it is likely an improvement, but due to other issues demanding precedence, we don’t anticipate being able to address this any time soon. If you are interested in submitting a patch to the repository for this project at https://github.com/puppetlabs, please open a pull request and re-open this ticket. Pending that, we are closing this as “Won’t Fix.” We may revisit it at a later time, and if so will re-open this ticket.

This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Moses Mendoza (JIRA)

unread,
May 18, 2017, 1:45:32 PM5/18/17
to puppe...@googlegroups.com

Maggie Dreyer (Jira)

unread,
Aug 3, 2020, 2:23:04 PM8/3/20
to puppe...@googlegroups.com
Maggie Dreyer commented on Bug PUP-4467
 
Re: Netscape comment extension uses wrong encoding

For posterity, this caused further issues with version 1.64 of Bouncy Castle, when they added a new error check that was tripped by the fact that we did not wrap our Netscape comments in another string. We had to start catching a more generic error to account for it, see https://github.com/puppetlabs/jvm-ssl-utils/pull/96.

At some point, it would be great to say we no longer support certs signed by the Ruby CA, which would allow to remove this special handling.

This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages