Fix various OPENSSL_NO_* options
authorMatt Caswell <matt@openssl.org>
Fri, 15 May 2015 08:42:08 +0000 (09:42 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 22 May 2015 08:38:37 +0000 (09:38 +0100)
This fixes compilation with various OPENSSL_NO_* options that got broken
during the big apps cleanup.

Reviewed-by: Rich Salz <rsalz@openssl.org>
apps/s_client.c
apps/s_server.c
apps/srp.c

index 339e4517db4357947cf1ffeafa48caf96c81f4bb..9717ad131c6239c0ab51b661e6fcc20b54db0fdc 100644 (file)
@@ -721,6 +721,20 @@ int s_client_main(int argc, char **argv)
 #endif
 #ifdef OPENSSL_NO_SSL_TRACE
         case OPT_TRACE:
+#endif
+#ifdef OPENSSL_NO_PSK
+        case OPT_PSK_IDENTITY:
+        case OPT_PSK:
+#endif
+#ifdef OPENSSL_NO_SSL3
+        case OPT_SSL3:
+#endif
+#ifdef OPENSSL_NO_DTLS1
+        case OPT_DTLS:
+        case OPT_DTLS1:
+        case OPT_DTLS1_2:
+        case OPT_TIMEOUT:
+        case OPT_MTU:
 #endif
         case OPT_EOF:
         case OPT_ERR:
index e46376db4ce47716f036d8899682a15e39dcd16c..5500ceadbc2f91469ebd938ccac04a80e55dd980 100644 (file)
@@ -997,7 +997,10 @@ int s_server_main(int argc, char *argv[])
     char *CApath = NULL, *CAfile = NULL, *chCApath = NULL, *chCAfile = NULL;
     char *dhfile = NULL, *dpassarg = NULL, *dpass = NULL, *inrand = NULL;
     char *passarg = NULL, *pass = NULL, *vfyCApath = NULL, *vfyCAfile = NULL;
-    char *crl_file = NULL, *prog, *p;
+    char *crl_file = NULL, *prog;
+#ifndef OPENSSL_NO_PSK
+    char *p;
+#endif
     const char *unix_path = NULL;
 #ifndef NO_SYS_UN_H
     int unlink_unix_path = 0;
@@ -1046,6 +1049,18 @@ int s_server_main(int argc, char *argv[])
     prog = opt_init(argc, argv, s_server_options);
     while ((o = opt_next()) != OPT_EOF) {
         switch (o) {
+#ifdef OPENSSL_NO_PSK
+        case OPT_PSK_HINT:
+        case OPT_PSK:
+#endif
+#ifdef OPENSSL_NO_DTLS1
+        case OPT_DTLS:
+        case OPT_DTLS1:
+        case OPT_DTLS1_2:
+        case OPT_TIMEOUT:
+        case OPT_MTU:
+        case OPT_CHAIN:
+#endif
         case OPT_EOF:
         case OPT_ERR:
  opthelp:
index 6c50a6e6d7c00887c0f5353049597fc6db9169ae..161f2b89ef9508ace5f94701d3e0a16e54b2bb3c 100644 (file)
 #include <openssl/opensslconf.h>
 
 #ifndef OPENSSL_NO_SRP
-# include <stdio.h>
-# include <stdlib.h>
-# include <string.h>
-# include <openssl/conf.h>
-# include <openssl/bio.h>
-# include <openssl/err.h>
-# include <openssl/txt_db.h>
-# include <openssl/buffer.h>
-# include <openssl/srp.h>
-
-# include "apps.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <openssl/conf.h>
+#include <openssl/bio.h>
+#include <openssl/err.h>
+#include <openssl/txt_db.h>
+#include <openssl/buffer.h>
+#include <openssl/srp.h>
+#include "apps.h"
 
 # define BASE_SECTION    "srp"
 # define CONFIG_FILE "openssl.cnf"