]> granicus.if.org Git - curl/commitdiff
ntlm: Moved NSS initialisation to base decode function
authorSteve Holme <steve_holme@hotmail.com>
Sun, 23 Nov 2014 15:58:24 +0000 (15:58 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Sun, 23 Nov 2014 16:07:59 +0000 (16:07 +0000)
lib/curl_ntlm_msgs.c
lib/curl_sasl.c

index d0672af360a7e9c7db3ddbc10bcf66d17aa28035..2632319305bf8a1a2ba2db65b4164c896a7ca989 100644 (file)
 
 #include "vtls/vtls.h"
 
+#ifdef USE_NSS
+#include "vtls/nssg.h" /* for Curl_nss_force_init() */
+#endif
+
 #define BUILDING_CURL_NTLM_MSGS_C
 #include "curl_ntlm_msgs.h"
 #include "curl_sasl.h"
@@ -271,7 +275,12 @@ CURLcode Curl_ntlm_decode_type2_message(struct SessionHandle *data,
   unsigned char *type2 = NULL;
   size_t type2_len = 0;
 
-#if defined(CURL_DISABLE_VERBOSE_STRINGS)
+#if defined(USE_NSS)
+  /* Make sure the crypto backend is initialized */
+  result = Curl_nss_force_init(data);
+  if(result)
+    return result;
+#elif defined(CURL_DISABLE_VERBOSE_STRINGS)
   (void)data;
 #endif
 
index 47766a705a369ac7913fe4a9abbbd49fbf63e596..bfae4b386239e21197ea7d7811d703761bd9d18f 100644 (file)
 #include "rawstr.h"
 #include "non-ascii.h" /* included for Curl_convert_... prototypes */
 
-#ifdef USE_NSS
-#include "vtls/nssg.h" /* for Curl_nss_force_init() */
-#endif
-
 #define _MPRINTF_REPLACE /* use our functions only */
 #include <curl/mprintf.h>
 
@@ -1139,15 +1135,6 @@ CURLcode Curl_sasl_decode_ntlm_type2_message(struct SessionHandle *data,
                                              const char *type2msg,
                                              struct ntlmdata *ntlm)
 {
-#ifdef USE_NSS
-  CURLcode result;
-
-  /* make sure the crypto backend is initialized */
-  result = Curl_nss_force_init(data);
-  if(result)
-    return result;
-#endif
-
   return Curl_ntlm_decode_type2_message(data, type2msg, ntlm);
 }