]> granicus.if.org Git - curl/commitdiff
curl_sasl: initialize NSS before using crypto
authorKamil Dudka <kdudka@redhat.com>
Fri, 18 Oct 2013 13:37:18 +0000 (15:37 +0200)
committerKamil Dudka <kdudka@redhat.com>
Fri, 18 Oct 2013 13:37:18 +0000 (15:37 +0200)
RELEASE-NOTES
lib/curl_sasl.c

index c884bba667b706575a716fca5d7a2dce0bfd5bb2..157b148afe541c9b13302b924507d01d77c328a7 100644 (file)
@@ -13,7 +13,7 @@ This release includes the following changes:
 
 This release includes the following bugfixes:
 
- o 
+ o nss: missing initialization in NTLM code causing test 906 to fail
 
 This release includes the following known bugs:
 
@@ -28,4 +28,4 @@ advice from friends like these:
 
 References to bug reports and discussions on issues:
 
\ No newline at end of file
index b3ffc66156ddaa14901917807937ff58213c35bd..9a0bc0fa83c53a3ce10555401fe2f3a5a309b885 100644 (file)
 #include "warnless.h"
 #include "curl_memory.h"
 
+#ifdef USE_NSS
+#include "nssg.h" /* for Curl_nss_force_init() */
+#endif
+
 #define _MPRINTF_REPLACE /* use our functions only */
 #include <curl/mprintf.h>
 
@@ -468,7 +472,14 @@ CURLcode Curl_sasl_create_ntlm_type3_message(struct SessionHandle *data,
                                              struct ntlmdata *ntlm,
                                              char **outptr, size_t *outlen)
 {
-  CURLcode result = Curl_ntlm_decode_type2_message(data, header, ntlm);
+  CURLcode result;
+#ifdef USE_NSS
+  /* make sure the crypto backend is initialized */
+  result = Curl_nss_force_init(data);
+  if(result)
+    return result;
+#endif
+  result = Curl_ntlm_decode_type2_message(data, header, ntlm);
 
   if(!result)
     result = Curl_ntlm_create_type3_message(data, userp, passwdp, ntlm,