gurde SSL_get_peer_cert_chain->count check by macro option

This commit is contained in:
Takashi Kojo
2017-11-25 06:25:15 +09:00
parent eb85accea9
commit 8f31d36bcd

View File

@ -162,7 +162,7 @@
#include <wolfssl/wolfcrypt/srp.h> #include <wolfssl/wolfcrypt/srp.h>
#endif #endif
#if defined(SESSION_CERTS) #if defined(SESSION_CERTS) && defined(TEST_PEER_CERT_CHAIN)
#include "wolfssl/internal.h" /* for testing SSL_get_peer_cert_chain */ #include "wolfssl/internal.h" /* for testing SSL_get_peer_cert_chain */
#endif #endif
@ -10380,7 +10380,7 @@ static int msgCb(SSL_CTX *ctx, SSL *ssl)
(void) ctx; (void) ctx;
(void) ssl; (void) ssl;
printf("\n===== msgcb called ====\n"); printf("\n===== msgcb called ====\n");
#if defined(SESSION_CERTS) #if defined(SESSION_CERTS) && defined(TEST_PEER_CERT_CHAIN)
AssertTrue(SSL_get_peer_cert_chain(ssl) != NULL); AssertTrue(SSL_get_peer_cert_chain(ssl) != NULL);
AssertIntEQ(((WOLFSSL_X509_CHAIN *)SSL_get_peer_cert_chain(ssl))->count, 1); AssertIntEQ(((WOLFSSL_X509_CHAIN *)SSL_get_peer_cert_chain(ssl))->count, 1);
#endif #endif