[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 101/153: vtls: reinstantiate engine on duplicated h
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 101/153: vtls: reinstantiate engine on duplicated handles |
Date: |
Tue, 11 Sep 2018 12:52:52 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 4939f3652473c1519d2b604068efb87ef7531874
Author: Laurent Bonnans <address@hidden>
AuthorDate: Fri Aug 17 17:39:01 2018 +0200
vtls: reinstantiate engine on duplicated handles
Handles created with curl_easy_duphandle do not use the SSL engine set
up in the original handle. This fixes the issue by storing the engine
name in the internal url state and setting the engine from its name
inside curl_easy_duphandle.
Reported-by: Anton Gerasimov
Signed-of-by: Laurent Bonnans
Fixes #2829
Closes #2833
---
lib/easy.c | 7 +++++++
lib/setopt.c | 9 +++++++--
lib/urldata.h | 1 +
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/lib/easy.c b/lib/easy.c
index 5af90e326..027d0bef3 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -958,6 +958,13 @@ struct Curl_easy *curl_easy_duphandle(struct Curl_easy
*data)
outcurl->change.referer_alloc = TRUE;
}
+ /* Reinitialize an SSL engine for the new handle
+ * note: the engine name has already been copied by dupset */
+ if(outcurl->set.str[STRING_SSL_ENGINE]) {
+ if(Curl_ssl_set_engine(outcurl, outcurl->set.str[STRING_SSL_ENGINE]))
+ goto fail;
+ }
+
/* Clone the resolver handle, if present, for the new handle */
if(Curl_resolver_duphandle(&outcurl->state.resolver,
data->state.resolver))
diff --git a/lib/setopt.c b/lib/setopt.c
index 5ecf5b97f..5c5f4b381 100644
--- a/lib/setopt.c
+++ b/lib/setopt.c
@@ -1603,14 +1603,19 @@ CURLcode Curl_vsetopt(struct Curl_easy *data,
CURLoption option,
* String that holds the SSL crypto engine.
*/
argptr = va_arg(param, char *);
- if(argptr && argptr[0])
- result = Curl_ssl_set_engine(data, argptr);
+ if(argptr && argptr[0]) {
+ result = Curl_setstropt(&data->set.str[STRING_SSL_ENGINE], argptr);
+ if(!result) {
+ result = Curl_ssl_set_engine(data, argptr);
+ }
+ }
break;
case CURLOPT_SSLENGINE_DEFAULT:
/*
* flag to set engine as default.
*/
+ Curl_setstropt(&data->set.str[STRING_SSL_ENGINE], NULL);
result = Curl_ssl_set_engine_default(data);
break;
case CURLOPT_CRLF:
diff --git a/lib/urldata.h b/lib/urldata.h
index 2a0540fa9..6119136d4 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -1404,6 +1404,7 @@ enum dupstring {
STRING_SSL_CRLFILE_PROXY, /* crl file to check certificate */
STRING_SSL_ISSUERCERT_ORIG, /* issuer cert file to check certificate */
STRING_SSL_ISSUERCERT_PROXY, /* issuer cert file to check certificate */
+ STRING_SSL_ENGINE, /* name of ssl engine */
STRING_USERNAME, /* <username>, if used */
STRING_PASSWORD, /* <password>, if used */
STRING_OPTIONS, /* <options>, if used */
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 93/153: CMake: CMake config files are defining CURL_STATICLIB for static builds, (continued)
- [GNUnet-SVN] [gnurl] 93/153: CMake: CMake config files are defining CURL_STATICLIB for static builds, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 97/153: curl: warn the user if a given file name looks like an option, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 102/153: upload: allocate upload buffer on-demand, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 105/153: docs/SECURITY-PROCESS: now we name the files after the CVE id, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 104/153: RELEASE-NOTES: synced, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 103/153: upload: change default UPLOAD_BUFSIZE to 64KB, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 96/153: http2: check nghttp2_session_set_stream_user_data return code, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 71/153: test1531: Add timeout, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 51/153: smb: don't mark it done in smb_do, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 91/153: ssh-libssh: fix infinite connect loop on invalid private key, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 101/153: vtls: reinstantiate engine on duplicated handles,
gnunet <=
- [GNUnet-SVN] [gnurl] 95/153: travis: revert back to gcc-7 for coverage builds, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 86/153: docs: add disallow-username-in-url.d and haproxy-protocol.d on the list, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 98/153: urldata: remove unused pipe_broke struct field, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 92/153: TODO: host name sections in config files, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 110/153: Remove unused definitions, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 68/153: http_proxy: Remove unused macro SELECT_TIMEOUT, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 90/153: ssh-libssh: reduce excessive verbose output about pubkey auth, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 94/153: RELEASE-NOTES: synced, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 87/153: http: fix for tiny "HTTP/0.9" response, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 88/153: travis: update to GCC 8, gnunet, 2018/09/11