From: Mark Lodato <hidden> Date: 2016-06-15 22:46:52
If an SSL client certificate is enabled (via http.sslcert or
GIT_SSL_CERT), prompt for the certificate password rather than
defaulting to OpenSSL's password prompt. This causes the prompt to only
appear once each run. Previously, OpenSSL prompted the user *many*
times, causing git to be unusable over HTTPS with client-side
certificates.
Note that the password is stored in memory in the clear while the
program is running. This may be a security problem if git crashes and
core dumps.
The user is always prompted, even if the certificate is not encrypted.
This should be fine; unencrypted certificates are rare and a security
risk anyway.
Signed-off-by: Mark Lodato <redacted>
---
See http://osdir.com/ml/git/2009-02/msg03402.html for a discussion of
this topic and an example showing how horrible the current password
prompts are.
The next patch adds an option to disable this feature. I split it into
two commits in case the configuration option is not wanted.
I did not create any tests because the existing http.sslcert option has
no tests to begin with.
I would really like to use git over HTTPS with client certs, but the
current situation is just unusable. So, I'm hoping this gets included
in git.git at some point. I would be happy to hear any comments people
have about this patch series. Thanks!
http.c | 40 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 39 insertions(+), 1 deletions(-)
From: Mark Lodato <hidden> Date: 2016-06-15 22:46:52
Add a configuration option, http.sslCertNoPass, and associated
environment variable, GIT_SSL_CERT_NO_PASS, to allow disabling of the
SSL client certificate password prompt from within git. If this option
is set to true, or if the environment variable exists, git falls back to
OpenSSL's prompts (as in earlier versions of git).
This option is useful in (at least) two cases:
1. The certificate is not encrypted and the user does not want to be
prompted needlessly.
2. The user does not wish to leave the password in the clear in git's
(and libcurl's) memory, in case the program crashes and core dumps.
The environment variable may only be used to disable, not to re-enable,
git's password prompt. This behavior mimics GIT_NO_VERIFY; the mere
existence of the variable is all that is checked.
Signed-off-by: Mark Lodato <redacted>
---
Documentation/config.txt | 9 +++++++++
http.c | 9 ++++++++-
2 files changed, 17 insertions(+), 1 deletions(-)
@@ -1038,6 +1038,15 @@ http.sslKey:: over HTTPS. Can be overridden by the 'GIT_SSL_KEY' environment variable.+http.sslCertNoPass::+ Disable git's password prompt for the SSL certificate. OpenSSL+ will still prompt the user, possibly many times, if the+ certificate or private key is encrypted. Useful if the+ certificate is not encrypted (to disable the password prompt) or+ if you do not wish to store the certificate password in git's+ memory. Can be overridden by the 'GIT_SSL_CERT_NO_PASS'+ environment variable.+ http.sslCAInfo:: File containing the certificates to verify the peer with when fetching or pushing over HTTPS. Can be overridden by the
From: Mark Lodato <hidden> Date: 2016-06-15 22:46:54
Any thoughts on this? I would love to see this in git 1.6.4, and I
don't think it affects people who do not use certificates.
~ Mark
On Wed, May 27, 2009 at 11:16 PM, Mark Lodato[off-list ref] wrote:
quoted hunk
If an SSL client certificate is enabled (via http.sslcert or
GIT_SSL_CERT), prompt for the certificate password rather than
defaulting to OpenSSL's password prompt. This causes the prompt to only
appear once each run. Previously, OpenSSL prompted the user *many*
times, causing git to be unusable over HTTPS with client-side
certificates.
Note that the password is stored in memory in the clear while the
program is running. This may be a security problem if git crashes and
core dumps.
The user is always prompted, even if the certificate is not encrypted.
This should be fine; unencrypted certificates are rare and a security
risk anyway.
Signed-off-by: Mark Lodato <redacted>
---
See http://osdir.com/ml/git/2009-02/msg03402.html for a discussion of
this topic and an example showing how horrible the current password
prompts are.
The next patch adds an option to disable this feature. I split it into
two commits in case the configuration option is not wanted.
I did not create any tests because the existing http.sslcert option has
no tests to begin with.
I would really like to use git over HTTPS with client certs, but the
current situation is just unusable. So, I'm hoping this gets included
in git.git at some point. I would be happy to hear any comments people
have about this patch series. Thanks!
http.c | 40 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 39 insertions(+), 1 deletions(-)
How it works if git is run from IDEs (no tty will be available)?
Is there a way to redefine the way the password is got?
What about scripting scenarios where passwordless certificates are
likely to be used?
Regards,
Constantine
On Fri, Jun 5, 2009 at 6:44 AM, Mark Lodato [off-list ref] wrote:
Any thoughts on this? I would love to see this in git 1.6.4, and I
don't think it affects people who do not use certificates.
~ Mark
On Wed, May 27, 2009 at 11:16 PM, Mark Lodato[off-list ref] wrote:
quoted
If an SSL client certificate is enabled (via http.sslcert or
GIT_SSL_CERT), prompt for the certificate password rather than
defaulting to OpenSSL's password prompt. This causes the prompt to only
appear once each run. Previously, OpenSSL prompted the user *many*
times, causing git to be unusable over HTTPS with client-side
certificates.
Note that the password is stored in memory in the clear while the
program is running. This may be a security problem if git crashes and
core dumps.
The user is always prompted, even if the certificate is not encrypted.
This should be fine; unencrypted certificates are rare and a security
risk anyway.
Signed-off-by: Mark Lodato <redacted>
---
See http://osdir.com/ml/git/2009-02/msg03402.html for a discussion of
this topic and an example showing how horrible the current password
prompts are.
The next patch adds an option to disable this feature. I split it into
two commits in case the configuration option is not wanted.
I did not create any tests because the existing http.sslcert option has
no tests to begin with.
I would really like to use git over HTTPS with client certs, but the
current situation is just unusable. So, I'm hoping this gets included
in git.git at some point. I would be happy to hear any comments people
have about this patch series. Thanks!
http.c | 40 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 39 insertions(+), 1 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Mark Lodato <hidden> Date: 2016-06-15 22:46:55
On Fri, Jun 5, 2009 at 4:20 AM, Constantine
Plotnikov[off-list ref] wrote:
How it works if git is run from IDEs (no tty will be available)?
Then this will be no worse than the current situation, which also uses
standard input to prompt for the password. Note that a TTY is also
required if an HTTP password is requested.
Is there a way to redefine the way the password is got?
No. This may be nice, but it would be much more complicated to implement.
What about scripting scenarios where passwordless certificates are
likely to be used?
If you wish to use a client certificate without a password, then you
need the second patch in this series, which adds an option to disable
the password prompt.
Thanks for your input,
Mark
From: Mark Lodato <hidden> Date: 2016-06-15 22:46:56
Any other thoughts, one way or the other? Adding proper SSL/PKI
support would really help git adoption in the corporate world. I am
willing to make any changes necessary to get this into git.git.
~ Mark
On Wed, May 27, 2009 at 11:16 PM, Mark Lodato[off-list ref] wrote:
quoted hunk
If an SSL client certificate is enabled (via http.sslcert or
GIT_SSL_CERT), prompt for the certificate password rather than
defaulting to OpenSSL's password prompt. This causes the prompt to only
appear once each run. Previously, OpenSSL prompted the user *many*
times, causing git to be unusable over HTTPS with client-side
certificates.
Note that the password is stored in memory in the clear while the
program is running. This may be a security problem if git crashes and
core dumps.
The user is always prompted, even if the certificate is not encrypted.
This should be fine; unencrypted certificates are rare and a security
risk anyway.
Signed-off-by: Mark Lodato <redacted>
---
See http://osdir.com/ml/git/2009-02/msg03402.html for a discussion of
this topic and an example showing how horrible the current password
prompts are.
The next patch adds an option to disable this feature. I split it into
two commits in case the configuration option is not wanted.
I did not create any tests because the existing http.sslcert option has
no tests to begin with.
I would really like to use git over HTTPS with client certs, but the
current situation is just unusable. So, I'm hoping this gets included
in git.git at some point. I would be happy to hear any comments people
have about this patch series. Thanks!
http.c | 40 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 39 insertions(+), 1 deletions(-)
Any other thoughts, one way or the other? Adding proper SSL/PKI
support would really help git adoption in the corporate world. I am
willing to make any changes necessary to get this into git.git.
Somebody mentioned that your patch forces people to type password even when the certificate isn't encrypted. How was this issue addressed?
It would be ideal if you can inspect the certificate and decide if you need to ask for decrypting password before using it (and otherwise you don't ask). If you can't do that, probably you can introduce a config var that says "this certificate is encrypted", and bypass your new code if that config var isn't set.
That way, people who are used to the old behavior don't have to change anything in their set-up.
If people didn't have to type password at all, and after your patch if they are forced to do something else to keep the old set-up working, that isn't nice.
--
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
From: Daniel Stenberg <hidden> Date: 2016-06-15 22:46:56
On Fri, 12 Jun 2009, Nanako Shiraishi wrote:
It would be ideal if you can inspect the certificate and decide if you need
to ask for decrypting password before using it (and otherwise you don't
ask). If you can't do that, probably you can introduce a config var that
says "this certificate is encrypted", and bypass your new code if that
config var isn't set.
Is this really a common setup? Using an unencrypted private key sounds like a
really bad security situation to me. The certificate is never encrupted, the
passphrase is for the key.
And for the libcurl not supporting this, I figure it _could_ be done by simply
letting libcurl prope the remote and see if it can access it without a
passphrase as that would then imply that isn't necessary.
I'm not familiar enough with the code and architecture to deem how suitable
such an action would be.
--
/ daniel.haxx.se
On Fri, Jun 12, 2009 at 11:56 AM, Daniel Stenberg[off-list ref] wrote:
On Fri, 12 Jun 2009, Nanako Shiraishi wrote:
quoted
It would be ideal if you can inspect the certificate and decide if you
need to ask for decrypting password before using it (and otherwise you don't
ask). If you can't do that, probably you can introduce a config var that
says "this certificate is encrypted", and bypass your new code if that
config var isn't set.
Is this really a common setup? Using an unencrypted private key sounds like
a really bad security situation to me. The certificate is never encrupted,
the passphrase is for the key.
For SSH using unencrypted private key is very common for scripting and
cron jobs. For HTTPS situation looks like being worse since there is
no analog of ssh-agent that covers at least some of scripting
scenarios. Do we want to disable scripting for HTTPS?
Constantine
From: Jakub Narebski <hidden> Date: 2016-06-15 22:46:56
Constantine Plotnikov [off-list ref] writes:
On Fri, Jun 12, 2009 at 11:56 AM, Daniel Stenberg[off-list ref] wrote:
quoted
On Fri, 12 Jun 2009, Nanako Shiraishi wrote:
quoted
It would be ideal if you can inspect the certificate and decide if you
need to ask for decrypting password before using it (and otherwise you don't
ask). If you can't do that, probably you can introduce a config var that
says "this certificate is encrypted", and bypass your new code if that
config var isn't set.
Is this really a common setup? Using an unencrypted private key sounds like
a really bad security situation to me. The certificate is never encrupted,
the passphrase is for the key.
For SSH using unencrypted private key is very common for scripting and
cron jobs. For HTTPS situation looks like being worse since there is
no analog of ssh-agent that covers at least some of scripting
scenarios. Do we want to disable scripting for HTTPS?
Actually you can use _encrypted_ private keys together with ssh-agent
and for example keychain helper for scripting. You have to provide
password to all listed private keys only once at login. I wonder if
something like this would be possible for HTTP certificates...
--
Jakub Narebski
Poland
ShadeHawk on #git
For SSH using unencrypted private key is very common for scripting and
cron jobs. For HTTPS situation looks like being worse since there is
no analog of ssh-agent that covers at least some of scripting
scenarios. Do we want to disable scripting for HTTPS?
Actually you can use _encrypted_ private keys together with ssh-agent
and for example keychain helper for scripting. You have to provide
password to all listed private keys only once at login. I wonder if
something like this would be possible for HTTP certificates...
I wonder if it might be possible using a PKCS#11 interface?
e.g. there are various "software" PKCS#11 implementations
(<http://trac.opendnssec.org/wiki/SoftHSM> springs to mind).
If you store your keys in the PKCS#11 store, and unlock them prior to
calling git, then the OpenSSL library might be able to access them
without a passphrase. Locking the PKCS#11 store would then secure the keys.
A little cumbersome, but possibly workable.
Rogan
From: Mark Lodato <hidden> Date: 2016-06-15 22:46:56
On Fri, Jun 12, 2009 at 12:50 PM, Jakub Narebski[off-list ref] wrote:
Constantine Plotnikov [off-list ref] writes:
quoted
On Fri, Jun 12, 2009 at 11:56 AM, Daniel Stenberg[off-list ref] wrote:
quoted
On Fri, 12 Jun 2009, Nanako Shiraishi wrote:
quoted
It would be ideal if you can inspect the certificate and decide if you
need to ask for decrypting password before using it (and otherwise you don't
ask). If you can't do that, probably you can introduce a config var that
says "this certificate is encrypted", and bypass your new code if that
config var isn't set.
Is this really a common setup? Using an unencrypted private key sounds like
a really bad security situation to me. The certificate is never encrupted,
the passphrase is for the key.
For SSH using unencrypted private key is very common for scripting and
cron jobs. For HTTPS situation looks like being worse since there is
no analog of ssh-agent that covers at least some of scripting
scenarios. Do we want to disable scripting for HTTPS?
Actually you can use _encrypted_ private keys together with ssh-agent
and for example keychain helper for scripting. You have to provide
password to all listed private keys only once at login. I wonder if
something like this would be possible for HTTP certificates...
I would love something like this - it would be useful for SVN as well.
From: Mark Lodato <hidden> Date: 2016-06-15 22:46:56
On Fri, Jun 12, 2009 at 3:56 AM, Daniel Stenberg[off-list ref] wrote:
On Fri, 12 Jun 2009, Nanako Shiraishi wrote:
quoted
It would be ideal if you can inspect the certificate and decide if you
need to ask for decrypting password before using it (and otherwise you don't
ask). If you can't do that, probably you can introduce a config var that
says "this certificate is encrypted", and bypass your new code if that
config var isn't set.
Is this really a common setup? Using an unencrypted private key sounds like
a really bad security situation to me. The certificate is never encrupted,
the passphrase is for the key.
And for the libcurl not supporting this, I figure it _could_ be done by
simply letting libcurl prope the remote and see if it can access it without
a passphrase as that would then imply that isn't necessary.
I'm not familiar enough with the code and architecture to deem how suitable
such an action would be.
I don't think it is possible to check to see if it is encrypted from
within git (without calling OpenSSL directly.) To implement this in
libcurl, a possible solution is to always set
SSL_CTX_set_default_passwd_cb(), and have the callback function prompt
the user on the first call if CURLOPT_KEYPASSWD is not set. If there
is interest, I could try this out and, if it works, submit a patch for
libcurl.
The upside of doing the prompting in git is that it works with old
libcurl versions... but I'm not sure this is a big deal. Having it in
libcurl is probably better.
On Thu, Jun 11, 2009 at 7:42 PM, Nanako Shiraishi[off-list ref] wrote:
Somebody mentioned that your patch forces people to type password
even when the certificate isn't encrypted. How was this issue addressed?
<snip...> If you can't do that, probably you can introduce a config var that says
"this certificate is encrypted", and bypass your new code if that config var isn't set.
Patch 2/2 gives the user a way to disable this new password prompt. I
imagine it is a more common for the certificate to be encrypted than
not, so I believe the default should be to prompt.
Mark