Skip to content

Commit 8d9dc3d

Browse files
committed
skip DATE if flags is set when calling AddTrustedPeer
1 parent c23559a commit 8d9dc3d

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

src/ssl.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7230,10 +7230,10 @@ int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff,
72307230
else if (type == TRUSTED_PEER_TYPE) {
72317231
/* add trusted peer cert. der is freed within */
72327232
if (ctx != NULL)
7233-
ret = AddTrustedPeer(ctx->cm, &der, !ctx->verifyNone);
7233+
ret = AddTrustedPeer(ctx->cm, &der, verify);
72347234
else {
72357235
SSL_CM_WARNING(ssl);
7236-
ret = AddTrustedPeer(SSL_CM(ssl), &der, !ssl->options.verifyNone);
7236+
ret = AddTrustedPeer(SSL_CM(ssl), &der, verify);
72377237
}
72387238
if (ret != WOLFSSL_SUCCESS) {
72397239
WOLFSSL_MSG("Error adding trusted peer");
@@ -15640,13 +15640,19 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
1564015640
if (sz < 0 || in == NULL || ctx == NULL) {
1564115641
return BAD_FUNC_ARG;
1564215642
}
15643+
int verify;
15644+
15645+
verify = GET_VERIFY_SETTING_CTX(ctx);
15646+
if (WOLFSSL_LOAD_VERIFY_DEFAULT_FLAGS &
15647+
WOLFSSL_LOAD_FLAG_DATE_ERR_OKAY)
15648+
verify = VERIFY_SKIP_DATE;
1564315649

1564415650
if (format == WOLFSSL_FILETYPE_PEM)
1564515651
return ProcessChainBuffer(ctx, in, sz, format, TRUSTED_PEER_TYPE,
15646-
NULL, GET_VERIFY_SETTING_CTX(ctx));
15652+
NULL, verify);
1564715653
else
1564815654
return ProcessBuffer(ctx, in, sz, format, TRUSTED_PEER_TYPE, NULL,
15649-
NULL, 0, GET_VERIFY_SETTING_CTX(ctx));
15655+
NULL, 0, verify);
1565015656
}
1565115657
#endif /* WOLFSSL_TRUST_PEER_CERT */
1565215658

0 commit comments

Comments
 (0)