Repository navigation
Conversation
173f78e to
9ed04b9
Compare
paulidale
left a comment
There was a problem hiding this comment.
One wording suggestion
|
Wow, this was quick! How about the idea I mentioned in the description of this PR, namely letting |
|
Calling the callback function is a good suggestion. |
|
It would be wrong to overwhelm the application with callback calls if there is another possible candidate. It would be also wrong to allow application to ignore an issue that will lead inevitably to another failure in the chain verification code anyway. So I am not so sure about the call to verify_cb() instead of returning 0 straight away. |
|
Yeah, I'm not sure myself about the potential call to Therefore I suggest that I merge this PR now "as is" and setting up a small follow-up PR for handling this separately - ok? |
|
Please fix the issue before merging and avoid a behavior change. |
|
@richsalz, which issue do you mean? |
|
I mean: decide whether or not to do the additional callback. |
As mentioned, I suggest deferring this topic to a separate PR. |
|
We're going in circles. Yes, I know you suggested deferring the callback issue. I am suggesting resolve it now, as part of this PR, rather than changing behavior. |
|
I'm open to either path forwards. |
|
The callback must be called only when the chain building process is coming to a dead end. It should not ever be called for any intermediate failures that can be overcome by considering further certificates in the untrusted or trusted set. |
Reviewed-by: Paul Dale <[email protected]> (Merged from #14094)
|
Merged in the approved version, without an extra call to |
|
I would really like to have seen tests for this. |
|
It would be possible to set up test cases for error output, but it's a bit ugly to do and brittle. |
…error reporting The problem of producing to-the-point diagnostics will be fixed in a follow-up PR. Fixes openssl#18691
…error reporting The problem of producing to-the-point diagnostics will be fixed in a follow-up PR. Fixes openssl#18691
…eporting The problem of producing to-the-point diagnostics will be fixed in a follow-up PR. Fixes #18691 Reviewed-by: Viktor Dukhovni <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: David von Oheimb <[email protected]> (Merged from #18758) (cherry picked from commit 1f00dc4)
…eporting The problem of producing to-the-point diagnostics will be fixed in a follow-up PR. Fixes #18691 Reviewed-by: Viktor Dukhovni <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: David von Oheimb <[email protected]> (Merged from #18758)
…error reporting The problem of producing to-the-point diagnostics will be fixed in a follow-up PR. Fixes openssl#18691
…error reporting The problem of producing to-the-point diagnostics will be fixed in a follow-up PR. Fixes openssl#18691 Reviewed-by: Viktor Dukhovni <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: David von Oheimb <[email protected]> (Merged from openssl#18758)
So far, when something goes wrong during the chain building phase of certificate verification,
the error code pretty often is "
unable to get local issuer certificate" or the like.Often this does not tell much about the real problem and may be even misleading.
Here is a simple example.
yields
because
check_issued()throws away all error codes.This PR makes
check_issued()record any 'real' error code (i.e., everything except forX509_V_ERR_SUBJECT_ISSUER_MISMATCH, which just means that the current certxis clearly not issued by the candidateissuer) inctx->error.At this point it could make sense to even call
verify_cb_cert(ctx, x, ctx->error_depth, err)-what do you think?
Care is taken such that for backward compatibility any previous
ctx->errorcontents are restored in case of successful chain building.After these changes, the above verification yields much better diagnostics:
On this occasion also various coding style and documentation style nits are fixed.[x] documentation is added or updated