git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH +warn] Implement https public key pinning

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 17, 2016, 21:05 UTC
Message-ID
<xmqqlh6jhwu0.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160215140422.GA1747@mitoraj.siccegge.de>
Christoph Egger <christoph@christoph-egger.org> writes:
Show 9 quoted lines
> Add the http.pinnedpubkey configuration option for public key
> pinning. It allows any string supported by libcurl --
> base64(sha256(pubkey)) or filename of the full public key.
>
> If cURL does not support pinning (is too old) output a warning to the
> user.
>
> Signed-off-by: Christoph Egger <christoph@christoph-egger.org>
> ---

I needed this fix to unbreak it for those with older versions of cURL.

 http.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/http.c b/http.c
index a6b8076..3475040 100644
--- a/http.c
+++ b/http.c
@@ -219,13 +219,6 @@ static int http_options(const char *var, const char *value, void *cb)
 	if (!strcmp("http.sslcapath", var))
 		return git_config_pathname(&ssl_capath, var, value);
 #endif
-	if (!strcmp("http.pinnedpubkey", var))
-#if LIBCURL_VERSION_NUM >= 0x072c00
-		return git_config_pathname(&ssl_pinnedkey, var, value);
-#else
-		warning(_("Public key pinning not supported with cURL < 7.44.0"));
-		return 0;
-#endif
 	if (!strcmp("http.sslcainfo", var))
 		return git_config_pathname(&ssl_cainfo, var, value);
 	if (!strcmp("http.sslcertpasswordprotected", var)) {
@@ -283,6 +276,14 @@ static int http_options(const char *var, const char *value, void *cb)
 	if (!strcmp("http.useragent", var))
 		return git_config_string(&user_agent, var, value);
 
+	if (!strcmp("http.pinnedpubkey", var)) {
+#if LIBCURL_VERSION_NUM >= 0x072c00
+		return git_config_pathname(&ssl_pinnedkey, var, value);
+#else
+		warning(_("Public key pinning not supported with cURL < 7.44.0"));
+		return 0;
+#endif
+	}
 	/* Fall back on the default ones */
 	return git_default_config(var, value, cb);
 }
Previous: Junio C HamanoNext: Christoph Egger
Message 15 of 16 in “Implement https public key pinning”
  1. Implement https public key pinningChristoph Egger, Feb 11, 2016
  2. Daniel StenbergFeb 11, 2016
  3. Christoph EggerFeb 12, 2016
  4. Implement https public key pinningChristoph Egger, Feb 12, 2016
  5. Thomas GummererFeb 12, 2016
  6. Jeff KingFeb 12, 2016
  7. Christoph EggerFeb 15, 2016
  8. Implement https public key pinningChristoph Egger, Feb 15, 2016
  9. Junio C HamanoFeb 15, 2016
  10. Jeff KingFeb 16, 2016
  11. Junio C HamanoFeb 16, 2016
  12. Jeff KingFeb 16, 2016
  13. Implement https public key pinningChristoph Egger, Feb 16, 2016
  14. Junio C HamanoFeb 16, 2016
  15. Junio C HamanoFeb 17, 2016
  16. Christoph EggerFeb 22, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.