diff options
author | Kamil Dudka <kdudka@redhat.com> | 2013-10-18 15:37:18 +0200 |
---|---|---|
committer | Kamil Dudka <kdudka@redhat.com> | 2013-10-18 15:37:18 +0200 |
commit | 86c64f3daf0079e96f4694b10fe1bc53944110fc (patch) | |
tree | 552bef57cc387d5fef50d5f38633b5c41d3db8af /lib | |
parent | 65e556d0ce1d788ce5649145b44cad836114dca8 (diff) |
curl_sasl: initialize NSS before using crypto
Diffstat (limited to 'lib')
-rw-r--r-- | lib/curl_sasl.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index b3ffc6615..9a0bc0fa8 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -40,6 +40,10 @@ #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, |