From 2f1f86d5f2b21f286592ad05e75bdc6ee065b01b Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Fri, 28 Jul 2017 11:42:21 +0900 Subject: [PATCH] VerifyCallback with any reason --- src/internal.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/internal.c b/src/internal.c index d092c3eff..416254ec7 100644 --- a/src/internal.c +++ b/src/internal.c @@ -8939,9 +8939,8 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx, } #endif if (ret != 0) { + int why = bad_certificate; if (!ssl->options.verifyNone) { - int why = bad_certificate; - if (ret == ASN_AFTER_DATE_E || ret == ASN_BEFORE_DATE_E) { why = certificate_expired; } @@ -8984,11 +8983,12 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx, } #endif /* SESSION_CERTS */ } - if (ret != 0) { - SendAlert(ssl, alert_fatal, why); /* try to send */ - ssl->options.isClosed = 1; - } } + if (ret != 0) { + SendAlert(ssl, alert_fatal, why); /* try to send */ + ssl->options.isClosed = 1; + } + ssl->error = ret; } #ifdef WOLFSSL_ALWAYS_VERIFY_CB