aboutsummaryrefslogtreecommitdiff
path: root/lib/nss.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-08-01 21:20:01 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-08-01 21:20:01 +0000
commit50c10aa5bf545eedfdbe561116656b6ec12654cd (patch)
treeae3de37fd3877d42ffd4c0cdcd03c4530e68a326 /lib/nss.c
parent006878686cfd3faa9eca92fc8fe60cb8f8073a59 (diff)
Patrick Monnerat and I modified libcurl so that now it *copies* all strings
passed to it with curl_easy_setopt()! Previously it has always just refered to the data, forcing the user to keep the data around until libcurl is done with it. That is now history and libcurl will instead clone the given strings and keep private copies.
Diffstat (limited to 'lib/nss.c')
-rw-r--r--lib/nss.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/nss.c b/lib/nss.c
index c99258969..e90156e15 100644
--- a/lib/nss.c
+++ b/lib/nss.c
@@ -225,8 +225,8 @@ static char * nss_get_password(PK11SlotInfo * slot, PRBool retry, void *arg)
pphrase_arg_t *parg = (pphrase_arg_t *) arg;
(void)slot; /* unused */
(void)retry; /* unused */
- if(parg->data->set.key_passwd)
- return (char *)PORT_Strdup((char *)parg->data->set.key_passwd);
+ if(parg->data->set.str[STRING_KEY_PASSWD])
+ return (char *)PORT_Strdup((char *)parg->data->set.str[STRING_KEY_PASSWD]);
else
return NULL;
}
@@ -488,10 +488,11 @@ CURLcode Curl_nss_connect(struct connectdata * conn, int sockindex)
NULL) != SECSuccess)
goto error;
- if(data->set.cert) {
+ if(data->set.str[STRING_CERT]) {
if(SSL_GetClientAuthDataHook(model,
(SSLGetClientAuthData) SelectClientCert,
- (void *)data->set.cert) != SECSuccess) {
+ (void *)data->set.str[STRING_CERT]) !=
+ SECSuccess) {
curlerr = CURLE_SSL_CERTPROBLEM;
goto error;
}