curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Getting CURLE_OK with wrong pinned public key after using the correct.

From: Sebastian Haglund via curl-library <curl-library_at_cool.haxx.se>
Date: Fri, 13 Sep 2019 20:19:12 +0200

On Fri, 13 Sep 2019 at 16:41, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Fri, 13 Sep 2019, Daniel Stenberg via curl-library wrote:
>
> > I'll write up a PR for this and get back.
>
> Done. Can you try this and see if it fixes the behavior for you?
>
> https://github.com/curl/curl/pull/4347
>
>
That was quick, unfortunately still the same behavior.
I did some debugging and found that pinned_key is null in both data and
needle.
This patch fixed it for me

--- a/lib/vtls/vtls.c
+++ b/lib/vtls/vtls.c
@@ -122,6 +122,7 @@ Curl_clone_primary_ssl_config(struct ssl_primary_config
*source,
  CLONE_STRING(egdsocket);
  CLONE_STRING(cipher_list);
  CLONE_STRING(cipher_list13);
+ CLONE_STRING(pinned_key);

  return TRUE;
}
@@ -135,6 +136,7 @@ void Curl_free_primary_ssl_config(struct
ssl_primary_config* sslc)
  Curl_safefree(sslc->egdsocket);
  Curl_safefree(sslc->cipher_list);
  Curl_safefree(sslc->cipher_list13);
+ Curl_safefree(sslc->pinned_key);
}

Regards,
Sebastian

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-09-13