Remove call to ERR_clear_error() in CRYPTOKI_checkerr macro #590
+0
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The call to
ERR_clear_error()in theCRYPTOKI_checkerrmacro has been removed. Its presence was unintentionally discarding important error information in multi-step object fetching scenarios within thePKCS#11provider.When
expected_typeis not specified, the store implementation attempts to load a private key, then a public key, and finally a certificate. If the first attempt (e.g., loading a private key) fails due to an incorrect PIN, the corresponding error (such asCKR_PIN_INCORRECT) is pushed onto the OpenSSL error queue. Subsequent attempts clear this queue viaERR_clear_error(), effectively masking the root cause.Preserving the error queue allows higher-level code to accurately report the original failure reason and improving diagnostics.