public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* Bug with bash and OpenSSL usage on Windows
@ 2024-07-26 19:40 Tim Abdiukov
  2024-07-26 19:48 ` Tim Abdiukov
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Tim Abdiukov @ 2024-07-26 19:40 UTC (permalink / raw)
  To: git

  What did you do before the bug happened? (Steps to reproduce your issue)
Tried to generate a self-signed certificate using git bash.

Using git bash, I ran
```
openssl genrsa -aes256 (private key location) 4096
```
however, openssl just hung (on Windows). Cmd can execute this command,
but bash cannot.

What did you expect to happen? (Expected behavior)

openssl to generate messages about key generation to stdout

What happened instead? (Actual behavior)

openssl just hung

What's different between what you expected and what actually happened?

openssl just hung, rendering it unusable within bash Windows

Anything else you want to add:

This is an issue specifically with Windows x64.

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.45.2.windows.1
cpu: x86_64
built from commit: 91d03cb2e4fbf6ad961ace739b8a646868cb154d
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Windows 10.0 19044
compiler info: gnuc: 14.1
libc info: no libc information available
$SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe


[Enabled Hooks]
not run from a git repository - no hooks to show

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug with bash and OpenSSL usage on Windows
  2024-07-26 19:40 Bug with bash and OpenSSL usage on Windows Tim Abdiukov
@ 2024-07-26 19:48 ` Tim Abdiukov
  2024-07-27 14:36 ` brian m. carlson
  2024-08-13 13:06 ` Johannes Schindelin
  2 siblings, 0 replies; 9+ messages in thread
From: Tim Abdiukov @ 2024-07-26 19:48 UTC (permalink / raw)
  To: git

user@(computer) MINGW64 ~
$ echo "I can start OpenSSL with no problem"
I can start OpenSSL with no problem

user@(computer) MINGW64 ~
$ openssl
help:

Standard commands
asn1parse         ca                ciphers           cmp
cms               crl               crl2pkcs7         dgst
dhparam           dsa               dsaparam          ec
ecparam           enc               engine            errstr
fipsinstall       gendsa            genpkey           genrsa
help              info              kdf               list
mac               nseq              ocsp              passwd
pkcs12            pkcs7             pkcs8             pkey
pkeyparam         pkeyutl           prime             rand
rehash            req               rsa               rsautl
s_client          s_server          s_time            sess_id
smime             speed             spkac             srp
storeutl          ts                verify            version
x509

Message Digest commands (see the `dgst' command for more details)
blake2b512        blake2s256        md4               md5
mdc2              rmd160            sha1              sha224
sha256            sha3-224          sha3-256          sha3-384
sha3-512          sha384            sha512            sha512-224
sha512-256        shake128          shake256          sm3

Cipher commands (see the `enc' command for more details)
aes-128-cbc       aes-128-ecb       aes-192-cbc       aes-192-ecb
aes-256-cbc       aes-256-ecb       aria-128-cbc      aria-128-cfb
aria-128-cfb1     aria-128-cfb8     aria-128-ctr      aria-128-ecb
aria-128-ofb      aria-192-cbc      aria-192-cfb      aria-192-cfb1
aria-192-cfb8     aria-192-ctr      aria-192-ecb      aria-192-ofb
aria-256-cbc      aria-256-cfb      aria-256-cfb1     aria-256-cfb8
aria-256-ctr      aria-256-ecb      aria-256-ofb      base64
bf                bf-cbc            bf-cfb            bf-ecb
bf-ofb            camellia-128-cbc  camellia-128-ecb  camellia-192-cbc
camellia-192-ecb  camellia-256-cbc  camellia-256-ecb  cast
cast-cbc          cast5-cbc         cast5-cfb         cast5-ecb
cast5-ofb         des               des-cbc           des-cfb
des-ecb           des-ede           des-ede-cbc       des-ede-cfb
des-ede-ofb       des-ede3          des-ede3-cbc      des-ede3-cfb
des-ede3-ofb      des-ofb           des3              desx
idea              idea-cbc          idea-cfb          idea-ecb
idea-ofb          rc2               rc2-40-cbc        rc2-64-cbc
rc2-cbc           rc2-cfb           rc2-ecb           rc2-ofb
rc4               rc4-40            rc5               rc5-cbc
rc5-cfb           rc5-ecb           rc5-ofb           seed
seed-cbc          seed-cfb          seed-ecb          seed-ofb
sm4-cbc           sm4-cfb           sm4-ctr           sm4-ecb
sm4-ofb           zlib


user@(computer) MINGW64 ~
$ echo "However, if I run it, it just hangs"
However, if I run it, it just hangs

user@(computer) MINGW64 ~
$ openssl genrsa -aes256 -out out

On Sat, 27 Jul 2024 at 05:40, Tim Abdiukov <tabdiukov@gmail•com> wrote:
>
>   What did you do before the bug happened? (Steps to reproduce your issue)
> Tried to generate a self-signed certificate using git bash.
>
> Using git bash, I ran
> ```
> openssl genrsa -aes256 (private key location) 4096
> ```
> however, openssl just hung (on Windows). Cmd can execute this command,
> but bash cannot.
>
> What did you expect to happen? (Expected behavior)
>
> openssl to generate messages about key generation to stdout
>
> What happened instead? (Actual behavior)
>
> openssl just hung
>
> What's different between what you expected and what actually happened?
>
> openssl just hung, rendering it unusable within bash Windows
>
> Anything else you want to add:
>
> This is an issue specifically with Windows x64.
>
> Please review the rest of the bug report below.
> You can delete any lines you don't wish to share.
>
>
> [System Info]
> git version:
> git version 2.45.2.windows.1
> cpu: x86_64
> built from commit: 91d03cb2e4fbf6ad961ace739b8a646868cb154d
> sizeof-long: 4
> sizeof-size_t: 8
> shell-path: /bin/sh
> feature: fsmonitor--daemon
> uname: Windows 10.0 19044
> compiler info: gnuc: 14.1
> libc info: no libc information available
> $SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe
>
>
> [Enabled Hooks]
> not run from a git repository - no hooks to show

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug with bash and OpenSSL usage on Windows
  2024-07-26 19:40 Bug with bash and OpenSSL usage on Windows Tim Abdiukov
  2024-07-26 19:48 ` Tim Abdiukov
@ 2024-07-27 14:36 ` brian m. carlson
  2024-07-27 15:53   ` Junio C Hamano
  2024-08-13 13:06 ` Johannes Schindelin
  2 siblings, 1 reply; 9+ messages in thread
From: brian m. carlson @ 2024-07-27 14:36 UTC (permalink / raw)
  To: Tim Abdiukov; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 812 bytes --]

Hey,

On 2024-07-26 at 19:40:48, Tim Abdiukov wrote:
>   What did you do before the bug happened? (Steps to reproduce your issue)
> Tried to generate a self-signed certificate using git bash.
> 
> Using git bash, I ran
> ```
> openssl genrsa -aes256 (private key location) 4096
> ```

The Git project doesn't ship OpenSSL, or, for that matter, any binaries
at all.  All we ship is source versions of Git which various
distributors compile, sometimes with other binaries.

It looks like you're probably using Git for Windows, which _does_ ship
OpenSSL, and so you probably want to contact them using their issue
tracker[0] once you've verified that it hasn't already been reported.

[0] https://github.com/git-for-windows/git
-- 
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug with bash and OpenSSL usage on Windows
  2024-07-27 14:36 ` brian m. carlson
@ 2024-07-27 15:53   ` Junio C Hamano
  2024-07-27 15:58     ` Junio C Hamano
                       ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Junio C Hamano @ 2024-07-27 15:53 UTC (permalink / raw)
  To: brian m. carlson; +Cc: git

"brian m. carlson" <sandals@crustytoothpaste•net> writes:

> The Git project doesn't ship OpenSSL, or, for that matter, any binaries
> at all.  All we ship is source versions of Git which various
> distributors compile, sometimes with other binaries.
>
> It looks like you're probably using Git for Windows, which _does_ ship
> OpenSSL, and so you probably want to contact them using their issue
> tracker[0] once you've verified that it hasn't already been reported.
>
> [0] https://github.com/git-for-windows/git

Thanks for giving a response like the above, tirelessly every time
something similar pops out.

I've been wondering if we can somehow reduce the occurrence of such
an issue in the first place.  Elaborating a bit more in the
"Reporting bugs" section of the documentation landing page is
probably the 0-th step, and if people agree that it is going in the
right direction, perhaps we would extend it to include something
similar to the top of the "git bugreport" template, by futzing with
the implementation of builtin/bugreport.c:get_bug_template(), and we
can even encourage customizing it by distribution.

Comments?

Thanks.


 Documentation/git.txt | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git c/Documentation/git.txt w/Documentation/git.txt
index 4489e2297a..495467ac1e 100644
--- c/Documentation/git.txt
+++ w/Documentation/git.txt
@@ -1149,14 +1149,31 @@ the authors for specific parts of the project.
 Reporting Bugs
 --------------
 
+First, thanks for noticing that there may be a problem in Git, and
+be willing to share it to help the larger user base.
+
+Issues which are security relevant should be disclosed privately to
+the Git Security mailing list <git-security@googlegroups•com> and
+not on any other public mailing list.
+
 Report bugs to the Git mailing list <git@vger•kernel.org> where the
 development and maintenance is primarily done.  You do not have to be
 subscribed to the list to send a message there.  See the list archive
 at https://lore.kernel.org/git for previous bug reports and other
 discussions.
 
-Issues which are security relevant should be disclosed privately to
-the Git Security mailing list <git-security@googlegroups•com>.
+The Git project does not distribute anything but the source code to
+Git.  Folks like Debian, Ubuntu, and Git for Windows project make
+binary package to install, and may include software other than Git
+(e.g. OpenSSL and Bash) in their packages.  Please report bugs in
+components *other* *than* *Git* *itself* in such a package to the
+respective packagers, not to the Git mailing list.  How to report
+bugs in some sample binary packages are found here:
+
+ Git for Windoes: https://github.com/git-for-windows/git
+ Ubuntu: https://help.ubuntu.com/stable/ubuntu-help/report-ubuntu-bug.html.en
+ Debian: https://www.debian.org/Bugs/Reporting 
+
 
 SEE ALSO
 --------

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: Bug with bash and OpenSSL usage on Windows
  2024-07-27 15:53   ` Junio C Hamano
@ 2024-07-27 15:58     ` Junio C Hamano
  2024-07-27 16:05     ` Eric Sunshine
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Junio C Hamano @ 2024-07-27 15:58 UTC (permalink / raw)
  To: git; +Cc: brian m. carlson

Junio C Hamano <gitster@pobox•com> writes:

> I've been wondering if we can somehow reduce the occurrence of such
> an issue in the first place.  Elaborating a bit more in the
> "Reporting bugs" section of the documentation landing page is
> probably the 0-th step, ...
> ...
> +respective packagers, not to the Git mailing list.  How to report
> +bugs in some sample binary packages are found here:
> +
> + Git for Windoes: https://github.com/git-for-windows/git
> + Ubuntu: https://help.ubuntu.com/stable/ubuntu-help/report-ubuntu-bug.html.en
> + Debian: https://www.debian.org/Bugs/Reporting 

I forgot to mention that this weather-balloon patch was primarily to
show the shape of the documentation updates, and corrections to use
more appropriate URLs or additions for other binary distributors are
of course welcome.

Thanks.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug with bash and OpenSSL usage on Windows
  2024-07-27 15:53   ` Junio C Hamano
  2024-07-27 15:58     ` Junio C Hamano
@ 2024-07-27 16:05     ` Eric Sunshine
  2024-07-27 21:20     ` brian m. carlson
  2024-07-27 22:01     ` Jeff King
  3 siblings, 0 replies; 9+ messages in thread
From: Eric Sunshine @ 2024-07-27 16:05 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: brian m. carlson, git

On Sat, Jul 27, 2024 at 11:53 AM Junio C Hamano <gitster@pobox•com> wrote:
> I've been wondering if we can somehow reduce the occurrence of such
> an issue in the first place.  Elaborating a bit more in the
> "Reporting bugs" section of the documentation landing page is
> probably the 0-th step, and if people agree that it is going in the
> right direction, perhaps we would extend it to include something
> similar to the top of the "git bugreport" template, by futzing with
> the implementation of builtin/bugreport.c:get_bug_template(), and we
> can even encourage customizing it by distribution.
>
> Comments?
>
> + Git for Windoes: https://github.com/git-for-windows/git
> + Ubuntu: https://help.ubuntu.com/stable/ubuntu-help/report-ubuntu-bug.html.en
> + Debian: https://www.debian.org/Bugs/Reporting

In case this ever gets turned into a real patch...

 s/Windoes/Windows/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug with bash and OpenSSL usage on Windows
  2024-07-27 15:53   ` Junio C Hamano
  2024-07-27 15:58     ` Junio C Hamano
  2024-07-27 16:05     ` Eric Sunshine
@ 2024-07-27 21:20     ` brian m. carlson
  2024-07-27 22:01     ` Jeff King
  3 siblings, 0 replies; 9+ messages in thread
From: brian m. carlson @ 2024-07-27 21:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 2004 bytes --]

On 2024-07-27 at 15:53:06, Junio C Hamano wrote:
> "brian m. carlson" <sandals@crustytoothpaste•net> writes:
> 
> > The Git project doesn't ship OpenSSL, or, for that matter, any binaries
> > at all.  All we ship is source versions of Git which various
> > distributors compile, sometimes with other binaries.
> >
> > It looks like you're probably using Git for Windows, which _does_ ship
> > OpenSSL, and so you probably want to contact them using their issue
> > tracker[0] once you've verified that it hasn't already been reported.
> >
> > [0] https://github.com/git-for-windows/git
> 
> Thanks for giving a response like the above, tirelessly every time
> something similar pops out.
> 
> I've been wondering if we can somehow reduce the occurrence of such
> an issue in the first place.  Elaborating a bit more in the
> "Reporting bugs" section of the documentation landing page is
> probably the 0-th step, and if people agree that it is going in the
> right direction, perhaps we would extend it to include something
> similar to the top of the "git bugreport" template, by futzing with
> the implementation of builtin/bugreport.c:get_bug_template(), and we
> can even encourage customizing it by distribution.
> 
> Comments?

I think something like that would be valuable.  We of course want to
hear about useful bug reports, but there's nothing we can do in this
case and it would be very helpful both for us and the reporter if it
went to the right place at first (even if that were the case even just a
slightly higher percentage of the time).

It might be helpful to maybe add a note that the reporter should search
for a similar issue first before reporting it.  I feel like Dscho, as
well as the Debian and Ubuntu maintainers, will appreciate that, and I
know for Ubuntu at least the issue tracker actually keeps track of the
issues affecting the most people to help prioritize fixes.
-- 
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug with bash and OpenSSL usage on Windows
  2024-07-27 15:53   ` Junio C Hamano
                       ` (2 preceding siblings ...)
  2024-07-27 21:20     ` brian m. carlson
@ 2024-07-27 22:01     ` Jeff King
  3 siblings, 0 replies; 9+ messages in thread
From: Jeff King @ 2024-07-27 22:01 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: brian m. carlson, git

On Sat, Jul 27, 2024 at 08:53:06AM -0700, Junio C Hamano wrote:

> I've been wondering if we can somehow reduce the occurrence of such
> an issue in the first place.  Elaborating a bit more in the
> "Reporting bugs" section of the documentation landing page is
> probably the 0-th step, and if people agree that it is going in the
> right direction, perhaps we would extend it to include something
> similar to the top of the "git bugreport" template, by futzing with
> the implementation of builtin/bugreport.c:get_bug_template(), and we
> can even encourage customizing it by distribution.

People might also get here from:

  https://git-scm.com/community

That page does mention the Git for Windows tracker, but it could perhaps
be more explicit that "bundled" components are specific to Git for
Windows. I don't really touch that site anymore, but I'm sure a pull
request at:

  https://github.com/git/git-scm.com

would be welcome.

-Peff

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Bug with bash and OpenSSL usage on Windows
  2024-07-26 19:40 Bug with bash and OpenSSL usage on Windows Tim Abdiukov
  2024-07-26 19:48 ` Tim Abdiukov
  2024-07-27 14:36 ` brian m. carlson
@ 2024-08-13 13:06 ` Johannes Schindelin
  2 siblings, 0 replies; 9+ messages in thread
From: Johannes Schindelin @ 2024-08-13 13:06 UTC (permalink / raw)
  To: Tim Abdiukov; +Cc: git

Hi Tim,

I suspect that you also reported this issue at
https://github.com/git-for-windows/git/issues/5079. For the benefit of
readers of this list, here is the explanation:

`openssl.exe` is a pure Win32 program, while Git Bash uses a friendly fork
of the Cygwin POSIX emulation layer. The latter, therefore, uses emulated
pseudo terminals, but Win32 programs only use Win32 Consoles.

For the moment, therefore, programs like `openssl.exe` that want to
interact with the user via such a Win32 Console have to be called via the
`winpty` helper that acts as a translator between Win32 Consoles and
emulated Unix pseudo terminals.

Modern Windows versions support a concept called "pseudo consoles" that
are similar to Unix pseudo terminals, similar enough that there is an
option to use them, which would avoid the need for that `winpty` helper.

In the near future, the Git for Windows project will switch the default to
use those pseudo consoles by default (where available, that is).

Ciao,
Johannes

On Sat, 27 Jul 2024, Tim Abdiukov wrote:

>   What did you do before the bug happened? (Steps to reproduce your issue)
> Tried to generate a self-signed certificate using git bash.
>
> Using git bash, I ran
> ```
> openssl genrsa -aes256 (private key location) 4096
> ```
> however, openssl just hung (on Windows). Cmd can execute this command,
> but bash cannot.
>
> What did you expect to happen? (Expected behavior)
>
> openssl to generate messages about key generation to stdout
>
> What happened instead? (Actual behavior)
>
> openssl just hung
>
> What's different between what you expected and what actually happened?
>
> openssl just hung, rendering it unusable within bash Windows
>
> Anything else you want to add:
>
> This is an issue specifically with Windows x64.
>
> Please review the rest of the bug report below.
> You can delete any lines you don't wish to share.
>
>
> [System Info]
> git version:
> git version 2.45.2.windows.1
> cpu: x86_64
> built from commit: 91d03cb2e4fbf6ad961ace739b8a646868cb154d
> sizeof-long: 4
> sizeof-size_t: 8
> shell-path: /bin/sh
> feature: fsmonitor--daemon
> uname: Windows 10.0 19044
> compiler info: gnuc: 14.1
> libc info: no libc information available
> $SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe
>
>
> [Enabled Hooks]
> not run from a git repository - no hooks to show
>
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-08-13 13:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-26 19:40 Bug with bash and OpenSSL usage on Windows Tim Abdiukov
2024-07-26 19:48 ` Tim Abdiukov
2024-07-27 14:36 ` brian m. carlson
2024-07-27 15:53   ` Junio C Hamano
2024-07-27 15:58     ` Junio C Hamano
2024-07-27 16:05     ` Eric Sunshine
2024-07-27 21:20     ` brian m. carlson
2024-07-27 22:01     ` Jeff King
2024-08-13 13:06 ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox