threads / patch / 32433

patchRe: [PATCH] http.c: Avoid username prompt for certifcate credentials

Subject: Re: [PATCH] http.c: Avoid username prompt for certifcate credentials

## tl;dr

3 messages between Dec 21, 2012 and Dec 21, 2012. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

Rene Bredlau· Dec 21, 2012, 16:31 UTC · lore

[PATCH] http.c: Avoid username prompt for certifcate credentials

If sslCertPasswordProtected is set to true do not ask for username to decrypt rsa key. This question is pointless, the key is only protected by a password. Internaly the username is simply set to "".
Signed-off-by: Rene Bredlau <git@unrelated.de>
---
 http.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Show changes to http.c +1 −0
diff --git a/http.c b/http.c
index 0a8abf3..44f3525 100644
--- a/http.c
+++ b/http.c
@@ -236,6 +236,7 @@ static int has_cert_password(void)
 		return 0;
 	if (!cert_auth.password) {
 		cert_auth.protocol = xstrdup("cert");
+		cert_auth.username = xstrdup("");
 		cert_auth.path = xstrdup(ssl_cert);
 		credential_fill(&cert_auth);
 	}
-- 
1.7.9
Jeff King· Dec 21, 2012, 17:09 UTC · re: Rene Bredlau · lore
On Fri, Dec 21, 2012 at 05:31:19PM +0100, Rene Bredlau wrote:
> If sslCertPasswordProtected is set to true do not ask for username to
> decrypt rsa key. This question is pointless, the key is only protected
> by a password. Internaly the username is simply set to "".

Yeah, that makes sense. I suspect the cert-unlocking code paths for credential helpers are not that well used (and I do not think we have any test coverage for them at all), so I am not too surprised that this went unreported for a long time.

Thanks.
> Signed-off-by: Rene Bredlau <git@unrelated.de>
Acked-by: Jeff King <peff@peff.net>
-Peff

← back to recent threads