Skip to content

Commit

Permalink
Merge pull request #6944 from miyazakh/fix_qt_jenkins_failure
Browse files Browse the repository at this point in the history
skip DATE check if flags is set when calling AddTrustedPeer
  • Loading branch information
JacobBarthelmeh authored Nov 6, 2023
2 parents c92d258 + 49121b5 commit 8ac291b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -7235,10 +7235,10 @@ int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff,
else if (type == TRUSTED_PEER_TYPE) {
/* add trusted peer cert. der is freed within */
if (ctx != NULL)
ret = AddTrustedPeer(ctx->cm, &der, !ctx->verifyNone);
ret = AddTrustedPeer(ctx->cm, &der, verify);
else {
SSL_CM_WARNING(ssl);
ret = AddTrustedPeer(SSL_CM(ssl), &der, !ssl->options.verifyNone);
ret = AddTrustedPeer(SSL_CM(ssl), &der, verify);
}
if (ret != WOLFSSL_SUCCESS) {
WOLFSSL_MSG("Error adding trusted peer");
Expand Down Expand Up @@ -15714,19 +15714,25 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
const unsigned char* in,
long sz, int format)
{
int verify;
WOLFSSL_ENTER("wolfSSL_CTX_trust_peer_buffer");

/* sanity check on arguments */
if (sz < 0 || in == NULL || ctx == NULL) {
return BAD_FUNC_ARG;
}

verify = GET_VERIFY_SETTING_CTX(ctx);
if (WOLFSSL_LOAD_VERIFY_DEFAULT_FLAGS &
WOLFSSL_LOAD_FLAG_DATE_ERR_OKAY)
verify = VERIFY_SKIP_DATE;

if (format == WOLFSSL_FILETYPE_PEM)
return ProcessChainBuffer(ctx, in, sz, format, TRUSTED_PEER_TYPE,
NULL, GET_VERIFY_SETTING_CTX(ctx));
NULL, verify);
else
return ProcessBuffer(ctx, in, sz, format, TRUSTED_PEER_TYPE, NULL,
NULL, 0, GET_VERIFY_SETTING_CTX(ctx));
NULL, 0, verify);
}
#endif /* WOLFSSL_TRUST_PEER_CERT */

Expand Down

0 comments on commit 8ac291b

Please sign in to comment.