bn/asm/rsaz-avx2.pl: fix digit correction bug in rsaz_1024_mul_avx2.
[openssl.git] / crypto / conf / conf_lib.c
index 1b902e20777daed0afe1a7138f0439c9beaed391..c72511ba67eae8abe37e68d2cb1706f9b64a75a0 100644 (file)
@@ -7,9 +7,10 @@
  * https://www.openssl.org/source/license.html
  */
 
+#include "e_os.h"
 #include <stdio.h>
 #include <string.h>
-#include <internal/conf.h>
+#include "internal/conf.h"
 #include <openssl/crypto.h>
 #include <openssl/err.h>
 #include <openssl/conf.h>
@@ -185,7 +186,7 @@ CONF *NCONF_new(CONF_METHOD *meth)
     ret = meth->create(meth);
     if (ret == NULL) {
         CONFerr(CONF_F_NCONF_NEW, ERR_R_MALLOC_FAILURE);
-        return (NULL);
+        return NULL;
     }
 
     return ret;
@@ -339,16 +340,26 @@ OPENSSL_INIT_SETTINGS *OPENSSL_INIT_new(void)
 
 
 #ifndef OPENSSL_NO_STDIO
-void OPENSSL_INIT_set_config_filename(OPENSSL_INIT_SETTINGS *settings,
-                                      const char *config_file)
+int OPENSSL_INIT_set_config_appname(OPENSSL_INIT_SETTINGS *settings,
+                                    const char *appname)
 {
-    free(settings->config_name);
-    settings->config_name = config_file == NULL ? NULL : strdup(config_file);
+    char *newappname = NULL;
+
+    if (appname != NULL) {
+        newappname = strdup(appname);
+        if (newappname == NULL)
+            return 0;
+    }
+
+    free(settings->appname);
+    settings->appname = newappname;
+
+    return 1;
 }
 #endif
 
 void OPENSSL_INIT_free(OPENSSL_INIT_SETTINGS *settings)
 {
-    free(settings->config_name);
+    free(settings->appname);
     free(settings);
 }