New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cert checks in ipa-server-certinstall #50
Conversation
|
|
||
| # import all the CA certs from nssdb into the temp db | ||
| for nickname, flags in nssdb.list_certs(): | ||
| if 'C' in flags: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CA certs don't have to have the C flag set. The proper check is if 'u' not in flags:.
|
NACK, see my inline comments above. |
b68d1a1
to
087c96f
Compare
| pkcs12_pin) | ||
| for nickname, flags in tempnssdb.list_certs(): | ||
| if 'u' not in flags: | ||
| tempnssdb.delete_cert(nickname) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are multiple certs with the same nickname, delete_cert will only delete one of them. To delete them all, you have to:
while tempnssdb.has_nickname(nickname):
tempnssdb.delete_cert(nickname)|
More comments inline. |
64d335e
to
835eb95
Compare
|
Bump for review |
|
Functional ACK, but please don't use newlines in exception messages. If you want the original error on a separate line, you can use the logger to log it, but I think it would be preferable to use this format: |
When ipa-server-certinstall is called to install a new server certificate, the prerequisite is that the certificate issuer must be already known by IPA. This fix adds new checks to make sure that the tool exits before modifying the target NSS database if it is not the case. The fix consists in creating a temp NSS database with the CA certs from the target NSS database + the new server cert and checking the new server cert validity. https://fedorahosted.org/freeipa/ticket/6263
835eb95
to
b4d5a74
Compare
|
Fixed upstream |
When ipa-server-certinstall is called to install a new server certificate,
the prerequisite is that the certificate issuer must be already known by IPA.
This fix adds new checks to make sure that the tool exits before
modifying the target NSS database if it is not the case.
The fix consists in creating a temp NSS database with the CA certs from the
target NSS database + the new server cert and checking the new server cert
validity.
https://fedorahosted.org/freeipa/ticket/6263