summaryrefslogtreecommitdiff
path: root/lib/easy.c
diff options
context:
space:
mode:
authorGilles Vollant <info@winimage.com>2020-05-15 10:47:46 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-05-15 13:03:59 +0200
commitcac5374298b3e79405bbdabe38941227c73a4c96 (patch)
treeb3548eba0d3ea4538765897a7ef01154805788e5 /lib/easy.c
parent8df455479f8801bbebad8839fc96abbffa711603 (diff)
downloadcurl-cac5374298b3e79405bbdabe38941227c73a4c96.tar.gz
setopt: support certificate options in memory with struct curl_blob
This change introduces a generic way to provide binary data in setopt options, called BLOBs. This change introduces these new setopts: CURLOPT_ISSUERCERT_BLOB, CURLOPT_PROXY_SSLCERT_BLOB, CURLOPT_PROXY_SSLKEY_BLOB, CURLOPT_SSLCERT_BLOB and CURLOPT_SSLKEY_BLOB. Reviewed-by: Daniel Stenberg Closes #5357
Diffstat (limited to 'lib/easy.c')
-rw-r--r--lib/easy.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/easy.c b/lib/easy.c
index 988ff613c..1deedb265 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -764,6 +764,7 @@ static CURLcode dupset(struct Curl_easy *dst, struct Curl_easy *src)
{
CURLcode result = CURLE_OK;
enum dupstring i;
+ enum dupblob j;
/* Copy src->set into dst->set first, then deal with the strings
afterwards */
@@ -780,6 +781,16 @@ static CURLcode dupset(struct Curl_easy *dst, struct Curl_easy *src)
return result;
}
+ /* clear all blob pointers first */
+ memset(dst->set.blobs, 0, BLOB_LAST * sizeof(struct curl_blob *));
+ /* duplicate all blobs */
+ for(j = (enum dupblob)0; j < BLOB_LAST; j++) {
+ result = Curl_setblobopt(&dst->set.blobs[j], src->set.blobs[j]);
+ /* Curl_setstropt return CURLE_BAD_FUNCTION_ARGUMENT with blob */
+ if(result)
+ return result;
+ }
+
/* duplicate memory areas pointed to */
i = STRING_COPYPOSTFIELDS;
if(src->set.postfieldsize && src->set.str[i]) {