Skip to content

Commit 9459161

Browse files
danbevjasnell
authored andcommitted
crypto: return CHECK_OK in VerifyCallback
VerifyCallback returns 1 in two locations but CHECK_CERT_REVOKED in a third return statment. This commit suggests that CHECK_OK is used instead of 1. CHECK_OK is also used as the return value in CheckWhitelistedServerCert so it seems to be consitent change to make. PR-URL: #13241 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent ea6941f commit 9459161

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node_crypto.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -2881,14 +2881,14 @@ inline int VerifyCallback(int preverify_ok, X509_STORE_CTX* ctx) {
28812881
// Failure on verification of the cert is handled in
28822882
// Connection::VerifyError.
28832883
if (preverify_ok == 0 || X509_STORE_CTX_get_error(ctx) != X509_V_OK)
2884-
return 1;
2884+
return CHECK_OK;
28852885

28862886
// Server does not need to check the whitelist.
28872887
SSL* ssl = static_cast<SSL*>(
28882888
X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx()));
28892889

28902890
if (SSL_is_server(ssl))
2891-
return 1;
2891+
return CHECK_OK;
28922892

28932893
// Client needs to check if the server cert is listed in the
28942894
// whitelist when it is issued by the specific rootCAs.

0 commit comments

Comments
 (0)