From 3b44e5e32c357272d864a6846d3328fbef13cc13 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Fri, 26 May 2017 15:03:37 +0200 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/13241 Reviewed-By: Ben Noordhuis Reviewed-By: Refael Ackermann Reviewed-By: Colin Ihrig --- src/node_crypto.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index acae4d3fb0fdf5..10939f043bae8f 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -2867,14 +2867,14 @@ inline int VerifyCallback(int preverify_ok, X509_STORE_CTX* ctx) { // Failure on verification of the cert is handled in // Connection::VerifyError. if (preverify_ok == 0 || X509_STORE_CTX_get_error(ctx) != X509_V_OK) - return 1; + return CHECK_OK; // Server does not need to check the whitelist. SSL* ssl = static_cast( X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx())); if (SSL_is_server(ssl)) - return 1; + return CHECK_OK; // Client needs to check if the server cert is listed in the // whitelist when it is issued by the specific rootCAs.