p11-glue / p11-kit

Provides a way to load and enumerate PKCS#11 modules.
https://p11-glue.github.io/p11-glue/p11-kit.html
Other
151 stars 95 forks source link

Confusing error message when storing certificate already present in trust store #397

Open ueno opened 3 years ago

ueno commented 3 years ago

When the trust paths are configured as below:

$ pkg-config --variable p11_trust_paths p11-kit-1
/etc/pki/ca-trust/source:/usr/share/pki/ca-trust-source

calling trust anchor after manually copying the certificate in either of the above directory prints a confusing error:

$ trust anchor /etc/pki/ca-trust/source/anchors/ca.crt
p11-kit: couldn't create object: The field is read-only
p11-kit: 1 error while processing

The trust anchor command should check the argument a little earlier before proceeding to overwrite.

Originally reported by Lukas Hanusovsky in: https://bugzilla.redhat.com/show_bug.cgi?id=2024927

thorian93 commented 4 months ago

It is 2024, and I still wasted a solid 15 minutes to understand my error. This error message could be way better!