From 8f8c11d83f39197e373ae6cc75782f5cfc4467d7 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 4 Jan 2017 09:16:07 +0100 Subject: [PATCH] Don't build OCSP stuff when OCSP is disabled Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/2173) --- ssl/statem/extensions.c | 4 ++++ test/sslapitest.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/ssl/statem/extensions.c b/ssl/statem/extensions.c index 2bb09c9507..8ccb76f09b 100644 --- a/ssl/statem/extensions.c +++ b/ssl/statem/extensions.c @@ -20,9 +20,11 @@ static int final_ec_pt_formats(SSL *s, unsigned int context, int sent, int *al); #endif static int init_session_ticket(SSL *s, unsigned int context); +#ifndef OPENSSL_NO_OCSP static int init_status_request(SSL *s, unsigned int context); static int final_status_request(SSL *s, unsigned int context, int sent, int *al); +#endif #ifndef OPENSSL_NO_NEXTPROTONEG static int init_npn(SSL *s, unsigned int context); #endif @@ -777,6 +779,7 @@ static int init_session_ticket(SSL *s, unsigned int context) return 1; } +#ifndef OPENSSL_NO_OCSP static int init_status_request(SSL *s, unsigned int context) { if (s->server) @@ -801,6 +804,7 @@ static int final_status_request(SSL *s, unsigned int context, int sent, return 1; } +#endif #ifndef OPENSSL_NO_NEXTPROTONEG static int init_npn(SSL *s, unsigned int context) diff --git a/test/sslapitest.c b/test/sslapitest.c index d20aec8ebb..9e3326d2e8 100644 --- a/test/sslapitest.c +++ b/test/sslapitest.c @@ -23,12 +23,14 @@ static char *cert = NULL; static char *privkey = NULL; +#ifndef OPENSSL_NO_OCSP static const unsigned char orespder[] = "Dummy OCSP Response"; static int ocsp_server_called = 0; static int ocsp_client_called = 0; static int cdummyarg = 1; static X509 *ocspcert = NULL; +#endif #define NUM_EXTRA_CERTS 40 @@ -145,6 +147,7 @@ static int test_large_message_dtls(void) } #endif +#ifndef OPENSSL_NO_OCSP static int ocsp_server_cb(SSL *s, void *arg) { int *argi = (int *)arg; @@ -378,6 +381,7 @@ static int test_tlsext_status_type(void) return testresult; } +#endif typedef struct ssl_session_test_fixture { const char *test_case_name; @@ -1022,7 +1026,9 @@ int test_main(int argc, char *argv[]) #ifndef OPENSSL_NO_DTLS ADD_TEST(test_large_message_dtls); #endif +#ifndef OPENSSL_NO_OCSP ADD_TEST(test_tlsext_status_type); +#endif ADD_TEST(test_session_with_only_int_cache); ADD_TEST(test_session_with_only_ext_cache); ADD_TEST(test_session_with_both_cache); -- 2.25.1