diff options
author | Michael Shuler <michael@pbandjelly.org> | 2014-02-23 17:39:56 -0600 |
---|---|---|
committer | Michael Shuler <michael@pbandjelly.org> | 2014-02-23 17:39:56 -0600 |
commit | 813fc23d8ab0ff02f4612a6e647ec8b4d9a955d6 (patch) | |
tree | 2b8ecd6fe1317ca409464226002cac85a7a9b856 | |
parent | 490b8b38b4b76edf879cc38ffe98011fb5f8a1c1 (diff) | |
download | ca-certificates-813fc23d8ab0ff02f4612a6e647ec8b4d9a955d6.tar.gz |
Fix certdata2pem.py for multiple CAs using the same CKA_LABEL
-rw-r--r-- | debian/changelog | 4 | ||||
-rw-r--r-- | mozilla/certdata2pem.py | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog index a6f7361..299f676 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ -ca-certificates (20140223) UNRELEASED; urgency=medium +ca-certificates (20140223) unstable; urgency=medium * No longer ship cacert.org certificates. Closes: #718434, LP: #1258286 + * Fix certdata2pem.py for multiple CAs using the same CKA_LABEL. Thanks + to Marc Deslauriers for the patch. Closes: #683403 * Update mozilla/certdata.txt to version 1.97. Certificates added (+) and removed (-): + "ACCVRAIZ1" diff --git a/mozilla/certdata2pem.py b/mozilla/certdata2pem.py index 5cc8f4c..0482894 100644 --- a/mozilla/certdata2pem.py +++ b/mozilla/certdata2pem.py @@ -116,12 +116,16 @@ for obj in objects: if obj['CKA_CLASS'] == 'CKO_CERTIFICATE': if not obj['CKA_LABEL'] in trust or not trust[obj['CKA_LABEL']]: continue - fname = obj['CKA_LABEL'][1:-1].replace('/', '_')\ + bname = obj['CKA_LABEL'][1:-1].replace('/', '_')\ .replace(' ', '_')\ .replace('(', '=')\ .replace(')', '=')\ - .replace(',', '_') + '.crt' - fname = fname.decode('string_escape') + .replace(',', '_') + bname = bname.decode('string_escape') + fname = bname + '.crt' + if os.path.exists(fname): + print "Found duplicate certificate name %s, renaming." % bname + fname = bname + '_2.crt' f = open(fname, 'w') f.write("-----BEGIN CERTIFICATE-----\n") f.write("\n".join(textwrap.wrap(base64.b64encode(obj['CKA_VALUE']), 64))) |