NetBSD Problem Report #49176
From www@NetBSD.org Fri Sep 5 23:00:15 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id C3EB3B87ED
for <gnats-bugs@gnats.NetBSD.org>; Fri, 5 Sep 2014 23:00:15 +0000 (UTC)
Message-Id: <20140905230011.91155B8837@mollari.NetBSD.org>
Date: Fri, 5 Sep 2014 23:00:09 +0000 (UTC)
From: jdbaker@mylinuxisp.com
Reply-To: jdbaker@mylinuxisp.com
To: gnats-bugs@NetBSD.org
Subject: certdata-20140820.txt of mozilla-rootcerts missing cert marks previous cert untrusted
X-Send-Pr-Version: www-1.0
>Number: 49176
>Category: pkg
>Synopsis: certdata-20140820.txt of mozilla-rootcerts missing cert marks previous cert untrusted
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: pkg-manager
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Sep 05 23:05:00 +0000 2014
>Closed-Date: Sat Sep 06 08:03:30 +0000 2014
>Last-Modified: Sat Sep 06 08:05:00 +0000 2014
>Originator: John D. Baker
>Release: pkgsrc-HEAD (25-Aug-2014 08:35 UTC)
>Organization:
>Environment:
NetBSD gx260a 7.99.1 NetBSD 7.99.1 (NO_DRM) #5: Sun Aug 24 20:26:20 CDT 2014 sysop@verthandi.technoskunk.fur:/d0/build/current/obj/i386/sys/arch/i386/compile/NO_DRM i386
>Description:
When running 'mozilla-rootcerts' with the "extract" or "install"
options, several certificates are later flagged "untrusted" and
removed immediately after extraction.
How the 'mozilla-rootcerts' script does this depends on maintaining
the regular structure of the "certdata*.txt" input file. Specifically:
#
# Certificate foo
#
# blah
# blah
[...]
CKA_VALUE MULTILINE_OCTAL
<octal data>
[...]
END
# Trust for Certificate foo
# blah
# blah
[...]
CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATE
[...]
#
# Certificate bar
#
[...]
The script first extracts the CKA_VALUE data, passing it to 'openssl'
to convert to PEM format and saving it in a file.
It then parses the trust data assumed to be following the certificate,
looking for something with "NOT_TRUSTED" or "UNTRUSTED" as a signal
to delete the file. It only stops parsing trust data when it sees
a line containing only a "#" (regexp /^#$/) such as found at the start
of the next Certificate.
The "certdata-20140820.txt" file contains a trust data section without
a preceeding certificate. The trust section indicates the missing
certificate is untrusted. The 'mozilla-rootcerts' script parses this
extraneous trust section as though it belonged to the preceeding certificate, marking it untrusted and removing it.
>How-To-Repeat:
Build and install "security/mozilla-rootcerts" from pkgsrc-HEAD after
25 August 2014 08:35UTC.
Build and install "net/clive".
Clean out or move aside "/etc/ssl/certs" and "/etc/openssl/certs" and
run 'mozilla-rootcerts install'
Attempt to fetch a video from YouTube with an "https://..." url using
'clive'.
Watch it fail to authenticate due to missing root certificate.
>Fix:
The following patch adds a placeholder for the missing certificate
that satisfies the requirements of the 'mozilla-rootcerts' script to
stop parsing certificate trust data.
--- certdata-20140820.txt.orig 2014-09-05 17:16:28.000000000 -0500
+++ certdata-20140820.txt 2014-09-05 17:20:01.000000000 -0500
@@ -607,6 +607,17 @@ CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_
CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR
CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE
+#
+# Certificate Placeholder for missing certificate
+#
+# Issuer: OU=Equifax Secure Certificate Authority,O=Equifax,C=US
+# Serial Number: 1407252 (0x157914)
+# Subject: CN=*.pb.com,OU=Meters,O=Pitney Bowes,L=Danbury,ST=Connecticut,C=US
+# Not Valid Before: Mon Feb 01 14:54:04 2010
+# Not Valid After : Tue Sep 30 00:00:00 2014
+# Fingerprint (MD5): 8F:46:BE:99:47:6F:93:DC:5C:01:54:50:D0:4A:BD:AC
+# Fingerprint (SHA1): 30:F1:82:CA:1A:5E:4E:4F:F3:6E:D0:E6:38:18:B8:B9:41:CB:5F:8C
+
# Distrust "Distrust a pb.com certificate that does not comply with the baseline requirements."
# Issuer: OU=Equifax Secure Certificate Authority,O=Equifax,C=US
# Serial Number: 1407252 (0x157914)
>Release-Note:
>Audit-Trail:
From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: pkg/49176: certdata-20140820.txt of mozilla-rootcerts missing
cert marks previous cert untrusted
Date: Fri, 5 Sep 2014 19:26:30 -0500 (CDT)
Looking again, there were a number of instances of consecutive
trust/distrust sections without intervening certificates, some of which
caused trusted certificates to be erroneously deleted as untrusted.
Here is a comprehensive patch that corrects all of these instances:
+--- certdata-20140820.txt.orig 2014-09-05 18:59:08.000000000 -0500
++++ certdata-20140820.txt 2014-09-05 19:13:55.000000000 -0500
+@@ -607,6 +607,17 @@ CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_
+ CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR
+ CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE
+
++#
++# Certificate Placeholder for missing certificate
++#
++# Issuer: OU=Equifax Secure Certificate Authority,O=Equifax,C=US
++# Serial Number: 1407252 (0x157914)
++# Subject: CN=*.pb.com,OU=Meters,O=Pitney Bowes,L=Danbury,ST=Connecticut,C=US
++# Not Valid Before: Mon Feb 01 14:54:04 2010
++# Not Valid After : Tue Sep 30 00:00:00 2014
++# Fingerprint (MD5): 8F:46:BE:99:47:6F:93:DC:5C:01:54:50:D0:4A:BD:AC
++# Fingerprint (SHA1): 30:F1:82:CA:1A:5E:4E:4F:F3:6E:D0:E6:38:18:B8:B9:41:CB:5F:8C
++
+ # Distrust "Distrust a pb.com certificate that does not comply with the baseline requirements."
+ # Issuer: OU=Equifax Secure Certificate Authority,O=Equifax,C=US
+ # Serial Number: 1407252 (0x157914)
+@@ -2193,6 +2204,17 @@ CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_
+ CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR
+ CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE
+
++#
++# Certificate Placeholder for missing certificate
++#
++# Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G3,OU="(c) 1999 VeriSign, Inc. - For authorized use only",OU=VeriSign Trust Network,O="VeriSign, Inc.",C=US
++# Serial Number:4c:00:36:1b:e5:08:2b:a9:aa:ce:74:0a:05:3e:fb:34
++# Subject: CN=Egypt Trust Class 3 Managed PKI Enterprise Administrator CA,OU=Terms of use at https://www.egypttrust.com/repository/rpa (c)08,OU=VeriSign Trust Network,O=Egypt Trust,C=EG
++# Not Valid Before: Sun May 18 00:00:00 2008
++# Not Valid After : Thu May 17 23:59:59 2018
++# Fingerprint (MD5): A7:91:05:96:B1:56:01:26:4E:BF:80:80:08:86:1B:4D
++# Fingerprint (SHA1): 6A:2C:5C:B0:94:D5:E0:B7:57:FB:0F:58:42:AA:C8:13:A5:80:2F:E1
++
+ # Distrust "Distrust: O=Egypt Trust, OU=VeriSign Trust Network (cert 1/3)"
+ # Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G3,OU="(c) 1999 VeriSign, Inc. - For authorized use only",OU=VeriSign Trust Network,O="VeriSign, Inc.",C=US
+ # Serial Number:4c:00:36:1b:e5:08:2b:a9:aa:ce:74:0a:05:3e:fb:34
+@@ -2230,6 +2252,16 @@ CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_
+ CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_NOT_TRUSTED
+ CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE
+
++#
++# Certificate Placeholder for missing certificate
++#
++# Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G3,OU="(c) 1999 VeriSign, Inc. - For authorized use only",OU=VeriSign Trust Network,O="VeriSign, Inc.",C=US
++# Serial Number:3e:0c:9e:87:69:aa:95:5c:ea:23:d8:45:9e:d4:5b:51
++# Subject: CN=Egypt Trust Class 3 Managed PKI Operational Administrator CA,OU=Terms of use at https://www.egypttrust.com/repository/rpa (c)08,OU=VeriSign Trust Network,O=Egypt Trust,C=EG
++# Not Valid Before: Sun May 18 00:00:00 2008
++# Not Valid After : Thu May 17 23:59:59 2018
++# Fingerprint (MD5): D0:C3:71:17:3E:39:80:C6:50:4F:04:22:DF:40:E1:34
++# Fingerprint (SHA1): 9C:65:5E:D5:FA:E3:B8:96:4D:89:72:F6:3A:63:53:59:3F:5E:B4:4E
+
+ # Distrust "Distrust: O=Egypt Trust, OU=VeriSign Trust Network (cert 2/3)"
+ # Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G3,OU="(c) 1999 VeriSign, Inc. - For authorized use only",OU=VeriSign Trust Network,O="VeriSign, Inc.",C=US
+@@ -2268,6 +2300,17 @@ CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_
+ CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_NOT_TRUSTED
+ CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE
+
++#
++# Certificate Placeholder for missing certificate
++#
++# Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G3,OU="(c) 1999 VeriSign, Inc. - For authorized use only",OU=VeriSign Trust Network,O="VeriSign, Inc.",C=US
++# Serial Number:12:bd:26:a2:ae:33:c0:7f:24:7b:6a:58:69:f2:0a:76
++# Subject: CN=Egypt Trust Class 3 Managed PKI SCO Administrator CA,OU=Terms of use at https://www.egypttrust.com/repository/rpa (c)08,OU=VeriSign Trust Network,O=Egypt Trust,C=EG
++# Not Valid Before: Sun May 18 00:00:00 2008
++# Not Valid After : Thu May 17 23:59:59 2018
++# Fingerprint (MD5): C2:13:5E:B2:67:8A:5C:F7:91:EF:8F:29:0F:9B:77:6E
++# Fingerprint (SHA1): 83:23:F1:4F:BC:9F:9B:80:B7:9D:ED:14:CD:01:57:CD:FB:08:95:D2
++
+ # Distrust "Distrust: O=Egypt Trust, OU=VeriSign Trust Network (cert 3/3)"
+ # Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G3,OU="(c) 1999 VeriSign, Inc. - For authorized use only",OU=VeriSign Trust Network,O="VeriSign, Inc.",C=US
+ # Serial Number:12:bd:26:a2:ae:33:c0:7f:24:7b:6a:58:69:f2:0a:76
+@@ -12588,6 +12631,17 @@ CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_
+ CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR
+ CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE
+
++#
++# Certificate Placeholder for missing certificate
++#
++# Issuer: CN=AC DGTPE Signature Authentification,O=DGTPE,C=FR
++# Serial Number: 204199 (0x31da7)
++# Subject: CN=AC DG Tr..sor SSL,O=DG Tr..sor,C=FR
++# Not Valid Before: Thu Jul 18 10:05:28 2013
++# Not Valid After : Fri Jul 18 10:05:28 2014
++# Fingerprint (MD5): 3A:EA:9E:FC:00:0C:E2:06:6C:E0:AC:39:C1:31:DE:C8
++# Fingerprint (SHA1): 5C:E3:39:46:5F:41:A1:E4:23:14:9F:65:54:40:95:40:4D:E6:EB:E2
++
+ # Distrust "Distrusted AC DG Tresor SSL"
+ # Issuer: CN=AC DGTPE Signature Authentification,O=DGTPE,C=FR
+ # Serial Number: 204199 (0x31da7)
+@@ -24419,6 +24473,14 @@ CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_
+ CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR
+ CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE
+
++#
++# Certificate Placeholder for missing certificate
++#
++# Issuer: E=ca@trustwave.com,CN="Trustwave Organization Issuing CA, Level 2",O="Trustwave Holdings, Inc.",L=Chicago,ST=Illinois,C=US
++# Serial Number: 1800000005 (0x6b49d205)
++# Not Before: Apr 7 15:37:15 2011 GMT
++# Not After : Apr 4 15:37:15 2021 GMT
++
+ # Explicitly Distrust "MITM subCA 1 issued by Trustwave", Bug 724929
+ # Issuer: E=ca@trustwave.com,CN="Trustwave Organization Issuing CA, Level 2",O="Trustwave Holdings, Inc.",L=Chicago,ST=Illinois,C=US
+ # Serial Number: 1800000005 (0x6b49d205)
+@@ -24450,6 +24512,14 @@ CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_
+ CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_NOT_TRUSTED
+ CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE
+
++#
++# Certificate Placeholder for missing certificate
++#
++# Issuer: E=ca@trustwave.com,CN="Trustwave Organization Issuing CA, Level 2",O="Trustwave Holdings, Inc.",L=Chicago,ST=Illinois,C=US
++# Serial Number: 1800000006 (0x6b49d206)
++# Not Before: Apr 18 21:09:30 2011 GMT
++# Not After : Apr 15 21:09:30 2021 GMT
++
+ # Explicitly Distrust "MITM subCA 2 issued by Trustwave", Bug 724929
+ # Issuer: E=ca@trustwave.com,CN="Trustwave Organization Issuing CA, Level 2",O="Trustwave Holdings, Inc.",L=Chicago,ST=Illinois,C=US
+ # Serial Number: 1800000006 (0x6b49d206)
+@@ -25753,6 +25823,17 @@ CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_
+ CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR
+ CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE
+
++#
++# Certificate Placeholder for missing certificate
++#
++# Issuer: O=T..RKTRUST Bilgi ..leti..im ve Bili..im G..venli..i Hizmetleri A...,C=TR,CN=T..RKTRUST Elektronik Sunucu Sertifikas.. Hizmetleri
++# Serial Number: 2087 (0x827)
++# Subject: CN=*.EGO.GOV.TR,OU=EGO BILGI ISLEM,O=EGO,L=ANKARA,ST=ANKARA,C=TR
++# Not Valid Before: Mon Aug 08 07:07:51 2011
++# Not Valid After : Tue Jul 06 07:07:51 2021
++# Fingerprint (MD5): F8:F5:25:FF:0C:31:CF:85:E1:0C:86:17:C1:CE:1F:8E
++# Fingerprint (SHA1): C6:9F:28:C8:25:13:9E:65:A6:46:C4:34:AC:A5:A1:D2:00:29:5D:B1
++
+ # Explicitly Distrust "TURKTRUST Mis-issued Intermediate CA 1", Bug 825022
+ # Issuer: O=T..RKTRUST Bilgi ..leti..im ve Bili..im G..venli..i Hizmetleri A...,C=TR,CN=T..RKTRUST Elektronik Sunucu Sertifikas.. Hizmetleri
+ # Serial Number: 2087 (0x827)
+@@ -25787,6 +25868,17 @@ CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_
+ CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_NOT_TRUSTED
+ CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE
+
++#
++# Certificate Placeholder for missing certificate
++#
++# Issuer: O=T..RKTRUST Bilgi ..leti..im ve Bili..im G..venli..i Hizmetleri A...,C=TR,CN=T..RKTRUST Elektronik Sunucu Sertifikas.. Hizmetleri
++# Serial Number: 2148 (0x864)
++# Subject: E=ileti@kktcmerkezbankasi.org,CN=e-islem.kktcmerkezbankasi.org,O=KKTC Merkez Bankasi,L=Lefkosa,ST=Lefkosa,C=TR
++# Not Valid Before: Mon Aug 08 07:07:51 2011
++# Not Valid After : Thu Aug 05 07:07:51 2021
++# Fingerprint (MD5): BF:C3:EC:AD:0F:42:4F:B4:B5:38:DB:35:BF:AD:84:A2
++# Fingerprint (SHA1): F9:2B:E5:26:6C:C0:5D:B2:DC:0D:C3:F2:DC:74:E0:2D:EF:D9:49:CB
++
+ # Explicitly Distrust "TURKTRUST Mis-issued Intermediate CA 2", Bug 825022
+ # Issuer: O=T..RKTRUST Bilgi ..leti..im ve Bili..im G..venli..i Hizmetleri A...,C=TR,CN=T..RKTRUST Elektronik Sunucu Sertifikas.. Hizmetleri
+ # Serial Number: 2148 (0x864)
--
|/"\ John D. Baker, KN5UKS NetBSD Darwin/MacOS X
|\ / jdbaker[snail]mylinuxisp[flyspeck]com OpenBSD FreeBSD
| X No HTML/proprietary data in email. BSD just sits there and works!
|/ \ GPGkeyID: D703 4A7E 479F 63F8 D3F4 BD99 9572 8F23 E4AD 1645
From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: pkg/49176: certdata-20140820.txt of mozilla-rootcerts missing
cert marks previous cert untrusted
Date: Fri, 5 Sep 2014 21:30:05 -0500 (CDT)
A better approach. Change the script to stop reading lines when the
key for the trust value is found, then test for untrusted status.
+--- mozilla-rootcerts.sh.orig 2014-09-05 21:09:28.000000000 -0500
++++ mozilla-rootcerts.sh 2014-09-05 21:16:51.000000000 -0500
+@@ -162,13 +162,17 @@ extract)
+ # kill untrusted certificates (not clean, but the script which comes
+ # with "curl" works the same way)
+ untrusted = 0
++ # Read lines only until we find the trust data
++ # following the certificate, then stop.
+ while (getline) {
+- if ($0 ~ /^#$/) break
+- if ($0 ~ /^CKA_TRUST_SERVER_AUTH.*CK_TRUST.*CKT_NSS_NOT_TRUSTED$/)
+- untrusted = 1
+- if ($0 ~ /^CKA_TRUST_SERVER_AUTH.*CK_TRUST.*CKT_NETSCAPE_UNTRUSTED$/)
+- untrusted = 1
++ if ($0 ~ /^CKA_TRUST_SERVER_AUTH/) break
+ }
++ # Test the result for untrusted status
++ if ($0 ~ /^CKA_TRUST_SERVER_AUTH.*CK_TRUST.*CKT_NSS_NOT_TRUSTED$/)
++ untrusted = 1
++ if ($0 ~ /^CKA_TRUST_SERVER_AUTH.*CK_TRUST.*CKT_NETSCAPE_UNTRUSTED$/)
++ untrusted = 1
++
+ if (untrusted) {
+ print filename " untrusted"
+ system("rm -f " filename)
--
|/"\ John D. Baker, KN5UKS NetBSD Darwin/MacOS X
|\ / jdbaker[snail]mylinuxisp[flyspeck]com OpenBSD FreeBSD
| X No HTML/proprietary data in email. BSD just sits there and works!
|/ \ GPGkeyID: D703 4A7E 479F 63F8 D3F4 BD99 9572 8F23 E4AD 1645
State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Sat, 06 Sep 2014 08:03:30 +0000
State-Changed-Why:
Thanks, I committed your last patch.
From: "Thomas Klausner" <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/49176 CVS commit: pkgsrc/security/mozilla-rootcerts
Date: Sat, 6 Sep 2014 08:03:00 +0000
Module Name: pkgsrc
Committed By: wiz
Date: Sat Sep 6 08:03:00 UTC 2014
Modified Files:
pkgsrc/security/mozilla-rootcerts: Makefile
pkgsrc/security/mozilla-rootcerts/files: mozilla-rootcerts.sh
Log Message:
Improve detection of untrusted certificates. From John D. Baker
in PR 49176. Bump PKGREVISION.
To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 pkgsrc/security/mozilla-rootcerts/Makefile
cvs rdiff -u -r1.5 -r1.6 \
pkgsrc/security/mozilla-rootcerts/files/mozilla-rootcerts.sh
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.