public OCSP functions are available, just return errors when OCSP not compiled in

This commit is contained in:
John Safranek 2012-05-24 14:12:28 -07:00
parent f2110487b6
commit e8e575fd58

View File

@ -7695,25 +7695,34 @@ const byte* CyaSSL_get_sessionID(const CYASSL_SESSION* session)
#endif /* SESSION_CERTS */ #endif /* SESSION_CERTS */
#ifdef HAVE_OCSP
long CyaSSL_CTX_OCSP_set_options(CYASSL_CTX* ctx, long options) long CyaSSL_CTX_OCSP_set_options(CYASSL_CTX* ctx, long options)
{ {
CYASSL_ENTER("CyaSSL_CTX_OCSP_set_options"); CYASSL_ENTER("CyaSSL_CTX_OCSP_set_options");
#ifdef HAVE_OCSP
if (ctx != NULL) { if (ctx != NULL) {
ctx->ocsp.enabled = (options & CYASSL_OCSP_ENABLE) != 0; ctx->ocsp.enabled = (options & CYASSL_OCSP_ENABLE) != 0;
ctx->ocsp.useOverrideUrl = (options & CYASSL_OCSP_URL_OVERRIDE) != 0; ctx->ocsp.useOverrideUrl = (options & CYASSL_OCSP_URL_OVERRIDE) != 0;
return 1; return 1;
} }
return 0; return 0;
#else
(void*)ctx;
(void*)options;
return NOT_COMPILED_IN;
#endif
} }
int CyaSSL_CTX_OCSP_set_override_url(CYASSL_CTX* ctx, const char* url) int CyaSSL_CTX_OCSP_set_override_url(CYASSL_CTX* ctx, const char* url)
{ {
CYASSL_ENTER("CyaSSL_CTX_OCSP_set_override_url"); CYASSL_ENTER("CyaSSL_CTX_OCSP_set_override_url");
#ifdef HAVE_OCSP
return CyaSSL_OCSP_set_override_url(&ctx->ocsp, url); return CyaSSL_OCSP_set_override_url(&ctx->ocsp, url);
#else
(void*)ctx;
(void*)url;
return NOT_COMPILED_IN;
#endif
} }
#endif