Use #error in openssl/srp.h

Follow the same convention the other OPENSSL_NO_xxx header files
do, and use #error instead of making the header file be a no-op.

Reviewed-by: Matt Caswell <matt@openssl.org>
This commit is contained in:
Rich Salz 2015-05-14 15:21:36 -04:00 committed by Rich Salz
parent 2eb264a14b
commit 857048a7f3
5 changed files with 46 additions and 26 deletions

View File

@ -925,6 +925,13 @@ int s_client_main(int argc, char **argv)
srp_arg.amp = 1; srp_arg.amp = 1;
meth = TLSv1_client_method(); meth = TLSv1_client_method();
break; break;
#else
case OPT_SRPUSER:
case OPT_SRPPASS:
case OPT_SRP_STRENGTH:
case OPT_SRP_LATEUSER:
case OPT_SRP_MOREGROUPS:
break;
#endif #endif
#ifndef OPENSSL_NO_SSL3 #ifndef OPENSSL_NO_SSL3
case OPT_SSL3: case OPT_SSL3:

View File

@ -1317,6 +1317,10 @@ int s_server_main(int argc, char *argv[])
srpuserseed = opt_arg(); srpuserseed = opt_arg();
meth = TLSv1_server_method(); meth = TLSv1_server_method();
break; break;
#else
case OPT_SRPVFILE:
case OPT_SRPUSERSEED:
break;
#endif #endif
case OPT_REV: case OPT_REV:
rev = 1; rev = 1;

View File

@ -680,4 +680,10 @@ int srp_main(int argc, char **argv)
return (ret); return (ret);
} }
#else
# if PEDANTIC
static void *dummy = &dummy;
# endif
#endif #endif

View File

@ -60,7 +60,11 @@
#ifndef __SRP_H__ #ifndef __SRP_H__
# define __SRP_H__ # define __SRP_H__
# ifndef OPENSSL_NO_SRP #include <openssl/opensslconf.h>
# ifdef OPENSSL_NO_SRP
# error SRP is disabled.
# endif
# include <stdio.h> # include <stdio.h>
# include <string.h> # include <string.h>
@ -166,5 +170,4 @@ int SRP_Verify_B_mod_N(BIGNUM *B, BIGNUM *N);
} }
#endif #endif
# endif
#endif #endif

View File

@ -60,11 +60,11 @@
#include <openssl/crypto.h> #include <openssl/crypto.h>
#include <openssl/rand.h> #include <openssl/rand.h>
#include <openssl/srp.h>
#include <openssl/err.h> #include <openssl/err.h>
#include "ssl_locl.h" #include "ssl_locl.h"
#ifndef OPENSSL_NO_SRP #ifndef OPENSSL_NO_SRP
#include <openssl/srp.h>
int SSL_CTX_SRP_CTX_free(struct ssl_ctx_st *ctx) int SSL_CTX_SRP_CTX_free(struct ssl_ctx_st *ctx)
{ {