apps/verify.c: Change an old comment to clarify what the callback does#7922
apps/verify.c: Change an old comment to clarify what the callback does#7922levitte wants to merge 7 commits intoopenssl:masterfrom
Conversation
|
The errors to be ignored that I removed in |
|
I'd remove the ok=1 from cb. but when the callback removed X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT we get the return code right: |
|
PS: maybe a test case for X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT is missing? |
|
Maybe the callback should be made to print a warning line instead of an error line if it decides to ignore (i.e. override) the error. So in case of a self-signed certificate, it would output this: instead of this: |
0641cec to
b52a582
Compare
|
And why is it necessary to change the result of the openssl verify command? That looks perfectly okay to me. |
|
I don't understand what you're trying to say. Basically, I'm preserving a behaviour that's been around since the beginning of time. |
|
I am now a bit confused. but 1.0.2-stable does something different: This looks like a bug in 1.0.2, FWIW. Do you want to change the behavior of 1.1.1 with this PR? |
|
The behaviour in 1.1.1 (and 1.1.0) is faulty, it's because of the change in That change basically invalidates any |
|
This is what the documentation says about verify: So first, a self-signed certificate that is not in the trust store, is an untrusted one, But most importantly there are obviously no test cases for |
|
I had to think a bit before catching on to your idea... what you're saying is that the Yeahok, I can accept that. That basically invalidates this PR entirely. |
|
This comment might need a slight edit, though... I find it confusing Lines 295 to 298 in 807989d |
X509_verify_cert() returns 1 if the certificate validated ok. However, the verify command would then check if there was any error that got ignored by the verify callback (in this file, that's cb()), and does in essence say that these errors shouldn't have been ignored. We now change to trust the return value from X509_verify_cert(), and ignore less errors in cb() instead.
This removes the remainder of the exceptions in cb(). Since this is effectively what we have done since 1.1.0 anyway... I'm still making self signed certificates an exception, though, for test/certs/ee-ed25519.pem
This makes changes ignored errors to be shown as warnings.
This reverts commit b52a58265f8c9588ccbf772056b771d00e3be68c.
This reverts commit d95beb0bcacbc21d7e6bdf2de8e8482610faefa9.
This reverts commit fe0b1087fee0022795a2f9492c35bf5452d4daf4.
b52a582 to
aa66ad0
Compare
|
Yes, and of course test cases are missing all over... |
|
So, I've added some revert commits to clear everything, and an additional commit that fixes the comment to actually say what the callback does. As for tests, I'd rather do that in a separate |
bernd-edlinger
left a comment
There was a problem hiding this comment.
Okay with separate commit. Thanks!
Reviewed-by: Bernd Edlinger <[email protected]> (Merged from #7922) (cherry picked from commit 9b10986)
Reviewed-by: Bernd Edlinger <[email protected]> (Merged from #7922)
X509_verify_cert() returns 1 if the certificate validated ok.However, the verify command would then check if there was any error
that got ignored by the verify callback (in this file, that's cb()),
and does in essence say that these errors shouldn't have been ignored.
We now change to trust the return value from X509_verify_cert(), andignore less errors in cb() instead.