summaryrefslogtreecommitdiff
path: root/lib/vtls/cyassl.c
diff options
context:
space:
mode:
authorThomas Glanzmann <thomas@glanzmann.de>2016-11-25 10:47:25 +0100
committerDaniel Stenberg <daniel@haxx.se>2016-11-25 10:49:38 +0100
commit4f8b17743d7c55a0bfb48463238c88564875ae47 (patch)
treeea77a17d0cc904146e5bd17909c5c4dfbe1002ea /lib/vtls/cyassl.c
parent1232dbb8bd49b5502834ae9dd9f7ab1cb7a88b7b (diff)
downloadcurl-4f8b17743d7c55a0bfb48463238c88564875ae47.tar.gz
HTTPS Proxy: Implement CURLOPT_PROXY_PINNEDPUBLICKEY
Diffstat (limited to 'lib/vtls/cyassl.c')
-rw-r--r--lib/vtls/cyassl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/vtls/cyassl.c b/lib/vtls/cyassl.c
index 5570760d4..db5ce2756 100644
--- a/lib/vtls/cyassl.c
+++ b/lib/vtls/cyassl.c
@@ -424,6 +424,10 @@ cyassl_connect_step2(struct connectdata *conn,
conn->host.name;
const char * const dispname = SSL_IS_PROXY() ?
conn->http_proxy.host.dispname : conn->host.dispname;
+ const char * const pinnedpubkey = SSL_IS_PROXY() ?
+ data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY] :
+ data->set.str[STRING_SSL_PINNEDPUBLICKEY_ORIG];
+ conn->http_proxy.host.dispname : conn->host.dispname;
conn->recv[sockindex] = cyassl_recv;
conn->send[sockindex] = cyassl_send;
@@ -497,7 +501,7 @@ cyassl_connect_step2(struct connectdata *conn,
}
}
- if(data->set.str[STRING_SSL_PINNEDPUBLICKEY]) {
+ if(pinnedpubkey) {
#ifdef KEEP_PEER_CERT
X509 *x509;
const char *x509_der;
@@ -529,7 +533,7 @@ cyassl_connect_step2(struct connectdata *conn,
}
result = Curl_pin_peer_pubkey(data,
- data->set.str[STRING_SSL_PINNEDPUBLICKEY],
+ pinnedpubkey,
(const unsigned char *)pubkey->header,
(size_t)(pubkey->end - pubkey->header));
if(result) {