Fix data race in RAND_DRBG_generate
[openssl.git] / apps / openssl.c
index 4ab6be84b58566badd94033f8224b3ee5a504d15..a872e2c5eeec8bd8764c7e129b75e0b9ccfd3846 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the OpenSSL license (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -27,8 +27,9 @@
 #ifdef OPENSSL_SYS_VMS
 # include <unixio.h>
 #endif
-#define INCLUDE_FUNCTION_TABLE
 #include "apps.h"
+#define INCLUDE_FUNCTION_TABLE
+#include "progs.h"
 
 /* Structure to hold the number of columns to be displayed and the
  * field width used to display them.
@@ -73,7 +74,7 @@ static void calculate_columns(DISPLAY_COLUMNS *dc)
     dc->columns = (80 - 1) / dc->width;
 }
 
-static int apps_startup()
+static int apps_startup(void)
 {
 #ifdef SIGPIPE
     signal(SIGPIPE, SIG_IGN);
@@ -89,12 +90,13 @@ static int apps_startup()
     return 1;
 }
 
-static void apps_shutdown()
+static void apps_shutdown(void)
 {
     destroy_ui_method();
+    destroy_prefix_method();
 }
 
-static char *make_config_name()
+static char *make_config_name(void)
 {
     const char *t;
     size_t len;
@@ -518,7 +520,7 @@ static void list_type(FUNC_TYPE ft, int one)
 {
     FUNCTION *fp;
     int i = 0;
-    DISPLAY_COLUMNS dc;
+    DISPLAY_COLUMNS dc = {0};
 
     if (!one)
         calculate_columns(&dc);
@@ -760,6 +762,9 @@ static void list_disabled(void)
 #ifdef OPENSSL_NO_SEED
     BIO_puts(bio_out, "SEED\n");
 #endif
+#ifdef OPENSSL_NO_SM2
+    BIO_puts(bio_out, "SM2\n");
+#endif
 #ifdef OPENSSL_NO_SM3
     BIO_puts(bio_out, "SM3\n");
 #endif