Bug 1074208
| Summary: | JSS certificate validation does not pass up exact error from NSS | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Christina Fu <cfu> | ||||||||
| Component: | jss | Assignee: | Christina Fu <cfu> | ||||||||
| Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||
| Severity: | unspecified | Docs Contact: | |||||||||
| Priority: | unspecified | ||||||||||
| Version: | 24 | CC: | cfu, edewata, emaldona, jdennis, kwright, mharmsen, nkinder, rmeggins | ||||||||
| Target Milestone: | --- | Keywords: | Reopened | ||||||||
| Target Release: | --- | ||||||||||
| Hardware: | Unspecified | ||||||||||
| OS: | Unspecified | ||||||||||
| Whiteboard: | |||||||||||
| Fixed In Version: | jss-4.2.6-40.fc24 | Doc Type: | Bug Fix | ||||||||
| Doc Text: | Story Points: | --- | |||||||||
| Clone Of: | |||||||||||
| : | 1289335 (view as bug list) | Environment: | |||||||||
| Last Closed: | 2017-08-08 11:45:33 UTC | Type: | Bug | ||||||||
| Regression: | --- | Mount Type: | --- | ||||||||
| Documentation: | --- | CRM: | |||||||||
| Verified Versions: | Category: | --- | |||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||
| Embargoed: | |||||||||||
| Bug Depends On: | |||||||||||
| Bug Blocks: | 1289335, 1289338 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Christina Fu
2014-03-08 22:39:07 UTC
FWIW the NSS error codes, especially with cert validation, are often worthless in helping to diagnose a problem. In some cases the error codes are genuinely misleading. My suggestion is to use the log info returned from CERT_VerifyCertificate or CERT_VerifyCertificateNow, the log info provides information on each aspect of the cert validation that failed. The log info also leaves something to be desired but it's way better than just the error return. This message is a reminder that Fedora 20 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 20. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '20'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 20 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed. Created attachment 1103739 [details]
jss-Added-verifyCertificate-method.patch
(In reply to Endi Sukma Dewata from comment #5) > Created attachment 1103739 [details] > jss-Added-verifyCertificate-method.patch Two comments for now before I continue: 1. Could you explain how the following gives us more info to the error than before? JSS_throwMsgPrErr(env, JSS_EXCEPTION, "Invalid certificate"); I thought you were going to use PR_GetErrorText() from the example I pointed out in pkcs11/PK11KeyPairGenerator.c. I have not tried it myself, but did you try it and did it not give you more error info? 2. It seems you changed the name of the method name Java_org_mozilla_jss_CryptoManager_verifyCertificateNowNative to Java_org_mozilla_jss_CryptoManager_verifyCertificate as we have gone over regarding "minimal changes", could you please refrain from making such change at this time? Created attachment 1103974 [details] jss-Added-verifyCertificate-method2.patch > 1. Could you explain how the following gives us more info to the error than > before? > JSS_throwMsgPrErr(env, JSS_EXCEPTION, "Invalid certificate"); As discussed on IRC, the command will throw a JSSException containing the NSS error code and message, for example: org.mozilla.jss.JSSException: Invalid certificate: (-8101) Certificate type not approved for application. At least this is better than a simple boolean value returned by isCertValid(). > 2. It seems you changed the name of the method name > Java_org_mozilla_jss_CryptoManager_verifyCertificateNowNative > to > Java_org_mozilla_jss_CryptoManager_verifyCertificate > as we have gone over regarding "minimal changes", could you please refrain > from making such change at this time? As discussed on IRC, the change should not affect applications using JSS since the native method was originally private. And as a new public method, the "verifyCertificate" would be more user-friendly than "verifyCertificateNowNative". However, the current patch apparently would change the behavior of both isCertValid() methods since they both call the C method verifyCertificateNow(). To limit the changes to the isCertValid() method that returns boolean, the new patch copies the C code from verifyCertificateNow() into the verifyCertificateNowNative() and only adds the exceptions there. Created attachment 1104028 [details]
jss-Added-verifyCertificate-method.patch
Added null checking in verifyCertificate().
Comment on attachment 1104028 [details]
jss-Added-verifyCertificate-method.patch
Overall it looks good provided tested to work.
As discussed over IRC, the isCertValid()'s were a bit convoluted to start with, and we will provide a better consolidated solution when we do the upstream merge and refactor.
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle. Changing version to '24'. More information and reason for this action is here: https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions jss-4.2.6-39.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-d3c8f022c5 jss-4.2.6-40.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-c036afbe30 jss-4.2.6-40.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-c036afbe30 jss-4.2.6-40.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report. PKI was modified to utilize the new JSS functionality in the following commit: * 2c73f1c2721021755d5753f07fa059a018ae9d7f This message is a reminder that Fedora 24 is nearing its end of life. Approximately 2 (two) weeks from now Fedora will stop maintaining and issuing updates for Fedora 24. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '24'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 24 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed. |