forked from wolfSSL/wolfssl
additional fix for set verify depth to be compliant with openssl limit
This commit is contained in:
@ -12397,7 +12397,8 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
|
||||
}
|
||||
|
||||
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
|
||||
if (args->untrustedDepth > ssl->options.verifyDepth) {
|
||||
/* limit compliant with OpenSSL verify Depth + 1 */
|
||||
if (args->untrustedDepth > (ssl->options.verifyDepth + 1)) {
|
||||
ssl->peerVerifyRet = X509_V_ERR_CERT_CHAIN_TOO_LONG;
|
||||
ret = MAX_CHAIN_ERROR;
|
||||
}
|
||||
|
@ -4595,8 +4595,8 @@ static void test_wolfSSL_CTX_verifyDepth_ServerClient(void)
|
||||
client_args.argc = -1;
|
||||
test_client_verifyDepth(&client_args);
|
||||
join_thread(serverThread);
|
||||
AssertIntEQ(client_args.return_code, TEST_FAIL);
|
||||
AssertIntEQ(server_args.return_code, TEST_FAIL);
|
||||
AssertIntEQ(client_args.return_code, TEST_SUCCESS);
|
||||
AssertIntEQ(server_args.return_code, TEST_SUCCESS);
|
||||
}
|
||||
|
||||
FreeTcpReady(&ready);
|
||||
|
Reference in New Issue
Block a user