The pki command is not working with PKCS12 files when the operating system is in FIPS mode. For example if you execute the command "pki pkcs12-cert-find --pkcs12-file --pkcs12-password " replacing with an actual p12 file and the actual password it works on a system with FIPS disabled but using the exact same p12 file on a system with FIPS enabled it fails with the error "Exception: Invalid PKCS #12 password: A TokenException occurred". It does not seem to matter if the password to the p12 file is a strong FIPS compliant password or not.
This is a problem because migration instructions require using the pki command to modify trust attributes on the p12 file, http://pki.fedoraproject.org/wiki/Migrating_a_CA_using_existing_CA_mechanism .
How reproducible:
Every time with FIPS mode
Steps to Reproduce:
pki pkcs12-cert-find --pkcs12-file <p12-file> --pkcs12-password <password>
Actual results:
Fails with error" "Exception: Invalid PKCS #12 password: A TokenException occurred"
Expected results:
No error
Metadata Update from @aheverle@redhat.com: - Issue set to the milestone: 0.0 NEEDS_TRIAGE
Endi Sukma Dewata 2017-02-22 22:28:05 EST wrote:
The pki pkcs12 actually works in FIPS mode, but apparently it requires an NSS database to work properly. So create a new NSS database (or use an existing one):
$ pki -c <NSS password> client-init
Then use the NSS password in all pki pkcs12 commands:
$ pki -c <NSS password> pkcs12-cert-find --pkcs12-file <p12-file> --pkcs12-password <password>
I've updated the wiki pages to include this information:
* http://pki.fedoraproject.org/wiki/Migrating_a_CA_using_existing_CA_mechanism#Run_pkispawn_on_the_new_CA * http://pki.fedoraproject.org/wiki/PKI_PKCS12_CLI#Overview
Metadata Update from @mharmsen: - Custom field feature adjusted to '' - Custom field proposedmilestone adjusted to '' - Custom field proposedpriority adjusted to '' - Custom field reviewer adjusted to '' - Custom field version adjusted to '' - Issue close_status updated to: worksforme - Issue set to the milestone: 10.4 (was: 0.0 NEEDS_TRIAGE) - Issue status updated to: Closed (was: Open)
Just a note, since PKI 10.4.1 the CLI will automatically create a default NSS database without a password, so the pki pkcs12 commands should work without NSS password and it's not necessary to run pki client-init first.
Metadata Update from @mharmsen: - Issue set to the milestone: 10.4.2 (was: 10.4)
Dogtag PKI is moving from Pagure issues to GitHub issues. This means that existing or new issues will be reported and tracked through Dogtag PKI's GitHub Issue tracker.
This issue has been cloned to GitHub and is available here: https://github.com/dogtagpki/pki/issues/2710
If you want to receive further updates on the issue, please navigate to the GitHub issue and click on Subscribe button.
Subscribe
Thank you for understanding, and we apologize for any inconvenience.