Bug 1314378

Summary: gnome-keyring sets incorrect label (and ID) on certificates
Product: [Fedora] Fedora Reporter: David Woodhouse <dwmw2>
Component: gnome-keyringAssignee: Matthias Clasen <mclasen>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: debarshir, mclasen, nmavrogi, stefw, tmraz, walters
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-20 19:13:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Woodhouse 2016-03-03 13:24:34 UTC
p11tool --load-certificate ~/.fedora.cert  --write 'pkcs11:token=Gnome2%20Key%20Storage'  --login
warning: The object's label was not specified.
Label: FedoraCert
[dwoodhou@i7 ~]$ p11tool --list-all-certs  'pkcs11:token=Gnome2%20Key%20Storage;object=FedoraCert'  --login
No matching objects found


Hm. It got added with the wrong label, taken from the certificate's Subject field.

In fact the ID doesn't match the X509v3 Subject Key Identifier *either*, wasn't it supposed to? Didn't we fix that once already?

$ openssl x509 -in ~/.fedora.cert -noout -text | grep -A1 Subject\ Key\ Iden
            X509v3 Subject Key Identifier: 
                75:3B:F3:AA:E3:03:D7:F4:42:73:BB:34:54:58:A8:AD:EB:6E:37:BB

But what got imported was:

Object 0:
	URL: pkcs11:model=1.0;manufacturer=Gnome%20Keyring;serial=1%3aUSER%3aDEFAULT;token=Gnome2%20Key%20Storage;id=%bf%5f%fc%40%4e%4a%a4%14%05%35%f0%4a%ab%11%19%68%ac%3d%d7%e3;object=dwmw2;type=cert
	Type: X.509 Certificate
	Label: dwmw2
	ID: bf:5f:fc:40:4e:4a:a4:14:05:35:f0:4a:ab:11:19:68:ac:3d:d7:e3

Comment 1 Nikos Mavrogiannopoulos 2016-03-03 13:50:38 UTC
Cannot reproduce with softhsm. Are you sure that this is an issue on p11tool and not the gnome key storage?

Comment 2 David Woodhouse 2016-03-07 11:42:51 UTC
Hm, maybe. And in fact now you come to mention it, ISTR fixing precisely such an issue with CKA_ID generation in gnome-keyring. Perhaps it regressed...

Comment 3 David Woodhouse 2016-03-07 11:45:30 UTC
12: C_CreateObject
2016-03-07 11:43:59.635
[in] hSession = 0x518
[in] pTemplate[9]: 
    CKA_CLASS             CKO_CERTIFICATE      
    CKA_ID                00007ffc0beb2ae0 / 20
    00000000  75 3B F3 AA E3 03 D7 F4 42 73 BB 34 54 58 A8 AD  u;......Bs.4TX..
    00000010  EB 6E 37 BB                                      .n7.            
    CKA_VALUE             0000557df7fb46f0 / 1841
    00000000  30 82 07 2D 30 82 03 21 A0 03 02 01 02 02 03 00  0..-0..!........
...
    00000720  5B 01 50 0B 38 C3 E7 F3 13 FA FE 2A B6 4D A0 36  [.P.8......*.M.6
    00000730  A8                                               .               
    CKA_TOKEN             True
    CKA_CERTIFICATE_TYPE  CKC_X_509
    CKA_SUBJECT           0000557df7fb9685 / 145
    00000000  30 81 8E 31 0B 30 09 06 03 55 04 06 13 02 55 53  0..1.0...U....US
...
    00000090  67                                               g               
    DN: C=US, ST=North Carolina, O=Fedora Project, OU=Fedora User Cert, CN=dwmw2/emailAddress=dwmw2
    CKA_ISSUER            0000557df7fb95b1 / 180
    00000000  30 81 B1 31 0B 30 09 06 03 55 04 06 13 02 55 53  0..1.0...U....US
...
    000000B0  2E 6F 72 67                                      .org            
    DN: C=US, ST=North Carolina, L=Raleigh, O=Fedora Project, OU=Fedora Project CA, CN=Fedora Project CA/emailAddress=admin
    CKA_SERIAL_NUMBER     00007ffc0beb2b00 / 3
    00000000  00 8B B2                                         ...             
    CKA_LABEL             0000557df7cffd20 / 10
    4665646F 72614365 7274
     F e d o  r a C e  r t
[out] *phObject = 0x2a72
Returned:  0 CKR_OK

Comment 4 Fedora End Of Life 2016-11-24 15:54:24 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Fedora End Of Life 2016-12-20 19:13:08 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.