pki-bot / pki-issues-final

0 stars 0 forks source link

Not able to setup CA with ECC #2436

Closed pki-bot closed 4 years ago

pki-bot commented 4 years ago

This issue was migrated from Pagure Issue #2887. Originally filed by mharmsen (@mharmsen) on 2018-01-09 18:57:32:


Steps to Reproduce:

1. Setup directory server.
2. Install ca subsystem with ECC.

Actual results:

# pkispawn -s CA -f ecc_ca.cfg 
Log file: /var/log/pki/pki-ca-spawn.20171218005026.log
Loading deployment configuration from ecc_ca.cfg.
Installing CA into /var/lib/pki/ECC_RootCA.
pkispawn    : ERROR    ....... subprocess.CalledProcessError:  Command '['certutil', '-R', '-d', '/opt/ECC_RootCA/ca/alias', '-s', u'cn=PKI Administrator,e=caadmin@idm.lab.eng.rdu.redhat.com,ou=ECC_RootCA,o=example.com Security Domain', '-k', 'ec', '-q', '2048', '-z', '/opt/ECC_RootCA/ca/alias/noise', '-f', '/opt/ECC_RootCA/ca/password.conf', '-o', '/opt/ECC_RootCA/ca/alias/admin_pkcs10.bin']' returned non-zero exit status 255!

Installation failed: Command '['certutil', '-R', '-d', '/opt/ECC_RootCA/ca/alias', '-s', u'cn=PKI Administrator,e=caadmin@example.com,ou=ECC_RootCA,o=example.com Security Domain', '-k', 'ec', '-q', '2048', '-z', '/opt/ECC_RootCA/ca/alias/noise', '-f', '/opt/ECC_RootCA/ca/password.conf', '-o', '/opt/ECC_RootCA/ca/alias/admin_pkcs10.bin']' returned non-zero exit status 255

Expected results:

Installation should be successful.

Additional info:

While we specifying the key type as 'ecc' then it should be expected to take a nistp* algorithms, instead, it is taking '2048' as a length.

I faced this issue because of the `pki_admin_keysize` and `pki_admin_key_size` parameter. In the config file, if you specify `pki_admin_key_size` instead of `pki_admin_keysize` it will fail, but it will work with `pki_admin_keysize` with ECC.

In the pki deployer code[1], it is clearly mentioned that if the key size for ECC is not specified then it should take the default 'nistp256' size. If you do not specify the key size for ECC then it takes 2048 as a key size.

[1] https://github.com/dogtagpki/pki/blob/master/base/server/python/pki/server/deployment/pkihelper.py#L2599
pki-bot commented 4 years ago

Comment from mharmsen (@mharmsen) at 2018-01-09 18:58:02

Metadata Update from @mharmsen:

pki-bot commented 4 years ago

Comment from mharmsen (@mharmsen) at 2018-01-19 11:27:34

commit 96a3bb4dddb3d18af5ddc917e02c437175dcfee7 Author: Matthew Harmsen mharmsen@redhat.com Date: Thu Jan 18 15:53:27 2018 -0700

Fixed setup of ECC CA

Restored ECC functionality that was lost during
'Refactoring SSL server cert creation'
(https://pagure.io/dogtagpki/issue/2786).

Additionally, to avoid confusion, deprecated
'pki_admin_keysize' and use 'pki_admin_key_size'
to make parameters consistent across different
certificate key types.

Fixes:  https://pagure.io/dogtagpki/issue/2887
Change-Id: I1206b37a00b7da5e30fef5b2d12fb266e2779cfb
pki-bot commented 4 years ago

Comment from mharmsen (@mharmsen) at 2018-01-19 11:27:37

Metadata Update from @mharmsen:

pki-bot commented 4 years ago

Comment from mharmsen (@mharmsen) at 2018-01-23 21:51:01

Metadata Update from @mharmsen: