]> granicus.if.org Git - curl/commitdiff
openssl: Fix algorithm init
authorMichael Kalinin <kalinin@company.dnevnik.ru>
Tue, 22 Sep 2015 06:49:54 +0000 (02:49 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Tue, 29 Sep 2015 02:47:25 +0000 (22:47 -0400)
- Change algorithm init to happen after OpenSSL config load.

Additional algorithms may be available due to the user's config so we
initialize the algorithms after the user's config is loaded.

Bug: https://github.com/bagder/curl/issues/447
Reported-by: Denis Feklushkin
lib/vtls/openssl.c

index 998ab2bacd67a5a6749c8d2929b7656757a4f6e6..1bb99671d3ecc363b6b4ef4f8baee71cdc3730b9 100644 (file)
@@ -702,16 +702,6 @@ int Curl_ossl_init(void)
   ENGINE_load_builtin_engines();
 #endif
 
-  /* Lets get nice error messages */
-  SSL_load_error_strings();
-
-  /* Init the global ciphers and digests */
-  if(!SSLeay_add_ssl_algorithms())
-    return 0;
-
-  OpenSSL_add_all_algorithms();
-
-
   /* OPENSSL_config(NULL); is "strongly recommended" to use but unfortunately
      that function makes an exit() call on wrongly formatted config files
      which makes it hard to use in some situations. OPENSSL_config() itself
@@ -728,6 +718,15 @@ int Curl_ossl_init(void)
                          CONF_MFLAGS_DEFAULT_SECTION|
                          CONF_MFLAGS_IGNORE_MISSING_FILE);
 
+  /* Lets get nice error messages */
+  SSL_load_error_strings();
+
+  /* Init the global ciphers and digests */
+  if(!SSLeay_add_ssl_algorithms())
+    return 0;
+
+  OpenSSL_add_all_algorithms();
+
   return 1;
 }