[gnutls-devel] GnuTLS | p11tool does not distinguish key objects with the same label (#1467)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Thu Mar 2 14:07:03 CET 2023



Daiki Ueno created an issue: https://gitlab.com/gnutls/gnutls/-/issues/1467



If there are multiple key objects with same label in a token, `p11tool --list-all` prints information of one of them, repeatedly:

```console
$ mkdir t
$ cd t
$ echo 'directories.tokendir = .' > softhsm2.conf
$ export SOFTHSM2_CONF=softhsm2.conf
$ softhsm2-util --init-token --slot 0 --so-pin 1234 --pin 123456 --label Token1
$ pkcs11-tool --module /usr/lib64/pkcs11/libsofthsm2.so --keypairgen --token-label Token1 --pin 123456 -v --key-type rsa:1024
$ pkcs11-tool --module /usr/lib64/pkcs11/libsofthsm2.so --keypairgen --token-label Token1 --pin 123456 -v --key-type EC:prime256v1
$ pkcs11-tool --module /usr/lib64/pkcs11/libsofthsm2.so --keypairgen --token-label Token1 --label OpenDNSSEC1 --pin 123456 -v --key-type rsa:1024
$ pkcs11-tool --module /usr/lib64/pkcs11/libsofthsm2.so --keypairgen --token-label Token1 --label OpenDNSSEC1 --pin 123456 -v --key-type EC:prime256v1
$ p11tool --list-all pkcs11:model=SoftHSM%20v2
Object 0:
	URL: pkcs11:model=SoftHSM%20v2;manufacturer=SoftHSM%20project;serial=87b4e2263f5f82a4;token=Token1;object=OpenDNSSEC1;type=public
	Type: Public key (EC/ECDSA-SECP256R1)
	Label: OpenDNSSEC1
	Flags: CKA_WRAP/UNWRAP; 
	ID: 

Object 1:
	URL: pkcs11:model=SoftHSM%20v2;manufacturer=SoftHSM%20project;serial=87b4e2263f5f82a4;token=Token1;type=public
	Type: Public key
	Label: 
	Flags: CKA_WRAP/UNWRAP; 
	ID: 

Object 2:
	URL: pkcs11:model=SoftHSM%20v2;manufacturer=SoftHSM%20project;serial=87b4e2263f5f82a4;token=Token1;type=public
	Type: Public key
	Label: 
	Flags: CKA_WRAP/UNWRAP; 
	ID: 

Object 3:
	URL: pkcs11:model=SoftHSM%20v2;manufacturer=SoftHSM%20project;serial=87b4e2263f5f82a4;token=Token1;object=OpenDNSSEC1;type=public
	Type: Public key (EC/ECDSA-SECP256R1)
	Label: OpenDNSSEC1
	Flags: CKA_WRAP/UNWRAP; 
	ID: 

```

Originally reported by @mhavrila.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/issues/1467
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20230302/87022435/attachment.html>


More information about the Gnutls-devel mailing list