[openssl-commits] [openssl] master update
Rich Salz
rsalz at openssl.org
Fri May 15 12:16:35 UTC 2015
The branch master has been updated
via 857048a7f339913fc4e510ddf033878850c655cd (commit)
from 2eb264a14b93b277269b1f3311925d550d5de580 (commit)
- Log -----------------------------------------------------------------
commit 857048a7f339913fc4e510ddf033878850c655cd
Author: Rich Salz <rsalz at akamai.com>
Date: Thu May 14 15:21:36 2015 -0400
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 at openssl.org>
-----------------------------------------------------------------------
Summary of changes:
apps/s_client.c | 7 +++++++
apps/s_server.c | 4 ++++
apps/srp.c | 6 ++++++
include/openssl/srp.h | 57 +++++++++++++++++++++++++++------------------------
ssl/tls_srp.c | 2 +-
5 files changed, 48 insertions(+), 28 deletions(-)
diff --git a/apps/s_client.c b/apps/s_client.c
index 8d78dc7..ba411f2 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -925,6 +925,13 @@ int s_client_main(int argc, char **argv)
srp_arg.amp = 1;
meth = TLSv1_client_method();
break;
+#else
+ case OPT_SRPUSER:
+ case OPT_SRPPASS:
+ case OPT_SRP_STRENGTH:
+ case OPT_SRP_LATEUSER:
+ case OPT_SRP_MOREGROUPS:
+ break;
#endif
#ifndef OPENSSL_NO_SSL3
case OPT_SSL3:
diff --git a/apps/s_server.c b/apps/s_server.c
index c54caa6..2ef902a 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -1317,6 +1317,10 @@ int s_server_main(int argc, char *argv[])
srpuserseed = opt_arg();
meth = TLSv1_server_method();
break;
+#else
+ case OPT_SRPVFILE:
+ case OPT_SRPUSERSEED:
+ break;
#endif
case OPT_REV:
rev = 1;
diff --git a/apps/srp.c b/apps/srp.c
index ec875cb..6c50a6e 100644
--- a/apps/srp.c
+++ b/apps/srp.c
@@ -680,4 +680,10 @@ int srp_main(int argc, char **argv)
return (ret);
}
+#else
+
+# if PEDANTIC
+static void *dummy = &dummy;
+# endif
+
#endif
diff --git a/include/openssl/srp.h b/include/openssl/srp.h
index de6631d..3411fe5 100644
--- a/include/openssl/srp.h
+++ b/include/openssl/srp.h
@@ -60,18 +60,22 @@
#ifndef __SRP_H__
# define __SRP_H__
-# ifndef OPENSSL_NO_SRP
+#include <openssl/opensslconf.h>
-# include <stdio.h>
-# include <string.h>
+# ifdef OPENSSL_NO_SRP
+# error SRP is disabled.
+# endif
+
+# include <stdio.h>
+# include <string.h>
#ifdef __cplusplus
extern "C" {
#endif
-# include <openssl/safestack.h>
-# include <openssl/bn.h>
-# include <openssl/crypto.h>
+# include <openssl/safestack.h>
+# include <openssl/bn.h>
+# include <openssl/crypto.h>
typedef struct SRP_gN_cache_st {
char *b64_bn;
@@ -122,25 +126,25 @@ int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
BIGNUM **verifier, const BIGNUM *N,
const BIGNUM *g);
-# define SRP_NO_ERROR 0
-# define SRP_ERR_VBASE_INCOMPLETE_FILE 1
-# define SRP_ERR_VBASE_BN_LIB 2
-# define SRP_ERR_OPEN_FILE 3
-# define SRP_ERR_MEMORY 4
-
-# define DB_srptype 0
-# define DB_srpverifier 1
-# define DB_srpsalt 2
-# define DB_srpid 3
-# define DB_srpgN 4
-# define DB_srpinfo 5
-# undef DB_NUMBER
-# define DB_NUMBER 6
-
-# define DB_SRP_INDEX 'I'
-# define DB_SRP_VALID 'V'
-# define DB_SRP_REVOKED 'R'
-# define DB_SRP_MODIF 'v'
+# define SRP_NO_ERROR 0
+# define SRP_ERR_VBASE_INCOMPLETE_FILE 1
+# define SRP_ERR_VBASE_BN_LIB 2
+# define SRP_ERR_OPEN_FILE 3
+# define SRP_ERR_MEMORY 4
+
+# define DB_srptype 0
+# define DB_srpverifier 1
+# define DB_srpsalt 2
+# define DB_srpid 3
+# define DB_srpgN 4
+# define DB_srpinfo 5
+# undef DB_NUMBER
+# define DB_NUMBER 6
+
+# define DB_SRP_INDEX 'I'
+# define DB_SRP_VALID 'V'
+# define DB_SRP_REVOKED 'R'
+# define DB_SRP_MODIF 'v'
/* see srp.c */
char *SRP_check_known_gN_param(BIGNUM *g, BIGNUM *N);
@@ -160,11 +164,10 @@ BIGNUM *SRP_Calc_client_key(BIGNUM *N, BIGNUM *B, BIGNUM *g, BIGNUM *x,
BIGNUM *a, BIGNUM *u);
int SRP_Verify_B_mod_N(BIGNUM *B, BIGNUM *N);
-# define SRP_MINIMAL_N 1024
+# define SRP_MINIMAL_N 1024
#ifdef __cplusplus
}
#endif
-# endif
#endif
diff --git a/ssl/tls_srp.c b/ssl/tls_srp.c
index 7d4fd1d..6bd7845 100644
--- a/ssl/tls_srp.c
+++ b/ssl/tls_srp.c
@@ -60,11 +60,11 @@
#include <openssl/crypto.h>
#include <openssl/rand.h>
-#include <openssl/srp.h>
#include <openssl/err.h>
#include "ssl_locl.h"
#ifndef OPENSSL_NO_SRP
+#include <openssl/srp.h>
int SSL_CTX_SRP_CTX_free(struct ssl_ctx_st *ctx)
{
More information about the openssl-commits
mailing list