{"thread":{"id":"61853","subject":"Bug with bash and OpenSSL usage on Windows","startedAt":"2024-07-26T19:41:01Z","lastAt":"2024-08-13T13:06:40Z","messageCount":9,"participants":["Tim Abdiukov","brian m. carlson","Junio C Hamano","Eric Sunshine","Jeff King","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"499467","messageId":"CAD+08a87xxVRxO1eiWiam-7xvq=AyKUB-MzqG-r=rM_SYbquBQ@mail.gmail.com","threadId":"61853","inReplyTo":null,"subject":"Bug with bash and OpenSSL usage on Windows","fromName":"Tim Abdiukov","fromEmail":"tabdiukov@gmail.com","sentAt":"2024-07-26T19:40:48Z","receivedAt":"2024-07-26T19:41:01Z","isPatch":false,"sender":{"key":"tabdiukov@gmail.com","avatar":null},"body":"  What did you do before the bug happened? (Steps to reproduce your issue)\nTried to generate a self-signed certificate using git bash.\n\nUsing git bash, I ran\n```\nopenssl genrsa -aes256 (private key location) 4096\n```\nhowever, openssl just hung (on Windows). Cmd can execute this command,\nbut bash cannot.\n\nWhat did you expect to happen? (Expected behavior)\n\nopenssl to generate messages about key generation to stdout\n\nWhat happened instead? (Actual behavior)\n\nopenssl just hung\n\nWhat's different between what you expected and what actually happened?\n\nopenssl just hung, rendering it unusable within bash Windows\n\nAnything else you want to add:\n\nThis is an issue specifically with Windows x64.\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.45.2.windows.1\ncpu: x86_64\nbuilt from commit: 91d03cb2e4fbf6ad961ace739b8a646868cb154d\nsizeof-long: 4\nsizeof-size_t: 8\nshell-path: /bin/sh\nfeature: fsmonitor--daemon\nuname: Windows 10.0 19044\ncompiler info: gnuc: 14.1\nlibc info: no libc information available\n$SHELL (typically, interactive shell): C:\\Program Files\\Git\\usr\\bin\\bash.exe\n\n\n[Enabled Hooks]\nnot run from a git repository - no hooks to show\n"},{"id":"499469","messageId":"CAD+08a-+uME7SgmpV_NJ5qmmtxpGeKPYV4wig5w4=gX+GMB7nA@mail.gmail.com","threadId":"61853","inReplyTo":"CAD+08a87xxVRxO1eiWiam-7xvq=AyKUB-MzqG-r=rM_SYbquBQ@mail.gmail.com","subject":"Re: Bug with bash and OpenSSL usage on Windows","fromName":"Tim Abdiukov","fromEmail":"tabdiukov@gmail.com","sentAt":"2024-07-26T19:48:55Z","receivedAt":"2024-07-26T19:49:07Z","isPatch":false,"sender":{"key":"tabdiukov@gmail.com","avatar":null},"body":"user@(computer) MINGW64 ~\n$ echo \"I can start OpenSSL with no problem\"\nI can start OpenSSL with no problem\n\nuser@(computer) MINGW64 ~\n$ openssl\nhelp:\n\nStandard commands\nasn1parse         ca                ciphers           cmp\ncms               crl               crl2pkcs7         dgst\ndhparam           dsa               dsaparam          ec\necparam           enc               engine            errstr\nfipsinstall       gendsa            genpkey           genrsa\nhelp              info              kdf               list\nmac               nseq              ocsp              passwd\npkcs12            pkcs7             pkcs8             pkey\npkeyparam         pkeyutl           prime             rand\nrehash            req               rsa               rsautl\ns_client          s_server          s_time            sess_id\nsmime             speed             spkac             srp\nstoreutl          ts                verify            version\nx509\n\nMessage Digest commands (see the `dgst' command for more details)\nblake2b512        blake2s256        md4               md5\nmdc2              rmd160            sha1              sha224\nsha256            sha3-224          sha3-256          sha3-384\nsha3-512          sha384            sha512            sha512-224\nsha512-256        shake128          shake256          sm3\n\nCipher commands (see the `enc' command for more details)\naes-128-cbc       aes-128-ecb       aes-192-cbc       aes-192-ecb\naes-256-cbc       aes-256-ecb       aria-128-cbc      aria-128-cfb\naria-128-cfb1     aria-128-cfb8     aria-128-ctr      aria-128-ecb\naria-128-ofb      aria-192-cbc      aria-192-cfb      aria-192-cfb1\naria-192-cfb8     aria-192-ctr      aria-192-ecb      aria-192-ofb\naria-256-cbc      aria-256-cfb      aria-256-cfb1     aria-256-cfb8\naria-256-ctr      aria-256-ecb      aria-256-ofb      base64\nbf                bf-cbc            bf-cfb            bf-ecb\nbf-ofb            camellia-128-cbc  camellia-128-ecb  camellia-192-cbc\ncamellia-192-ecb  camellia-256-cbc  camellia-256-ecb  cast\ncast-cbc          cast5-cbc         cast5-cfb         cast5-ecb\ncast5-ofb         des               des-cbc           des-cfb\ndes-ecb           des-ede           des-ede-cbc       des-ede-cfb\ndes-ede-ofb       des-ede3          des-ede3-cbc      des-ede3-cfb\ndes-ede3-ofb      des-ofb           des3              desx\nidea              idea-cbc          idea-cfb          idea-ecb\nidea-ofb          rc2               rc2-40-cbc        rc2-64-cbc\nrc2-cbc           rc2-cfb           rc2-ecb           rc2-ofb\nrc4               rc4-40            rc5               rc5-cbc\nrc5-cfb           rc5-ecb           rc5-ofb           seed\nseed-cbc          seed-cfb          seed-ecb          seed-ofb\nsm4-cbc           sm4-cfb           sm4-ctr           sm4-ecb\nsm4-ofb           zlib\n\n\nuser@(computer) MINGW64 ~\n$ echo \"However, if I run it, it just hangs\"\nHowever, if I run it, it just hangs\n\nuser@(computer) MINGW64 ~\n$ openssl genrsa -aes256 -out out\n\nOn Sat, 27 Jul 2024 at 05:40, Tim Abdiukov <tabdiukov@gmail.com> wrote:\n>\n>   What did you do before the bug happened? (Steps to reproduce your issue)\n> Tried to generate a self-signed certificate using git bash.\n>\n> Using git bash, I ran\n> ```\n> openssl genrsa -aes256 (private key location) 4096\n> ```\n> however, openssl just hung (on Windows). Cmd can execute this command,\n> but bash cannot.\n>\n> What did you expect to happen? (Expected behavior)\n>\n> openssl to generate messages about key generation to stdout\n>\n> What happened instead? (Actual behavior)\n>\n> openssl just hung\n>\n> What's different between what you expected and what actually happened?\n>\n> openssl just hung, rendering it unusable within bash Windows\n>\n> Anything else you want to add:\n>\n> This is an issue specifically with Windows x64.\n>\n> Please review the rest of the bug report below.\n> You can delete any lines you don't wish to share.\n>\n>\n> [System Info]\n> git version:\n> git version 2.45.2.windows.1\n> cpu: x86_64\n> built from commit: 91d03cb2e4fbf6ad961ace739b8a646868cb154d\n> sizeof-long: 4\n> sizeof-size_t: 8\n> shell-path: /bin/sh\n> feature: fsmonitor--daemon\n> uname: Windows 10.0 19044\n> compiler info: gnuc: 14.1\n> libc info: no libc information available\n> $SHELL (typically, interactive shell): C:\\Program Files\\Git\\usr\\bin\\bash.exe\n>\n>\n> [Enabled Hooks]\n> not run from a git repository - no hooks to show\n"},{"id":"499484","messageId":"ZqUF0ANz9qX-wWEN@tapette.crustytoothpaste.net","threadId":"61853","inReplyTo":"CAD+08a87xxVRxO1eiWiam-7xvq=AyKUB-MzqG-r=rM_SYbquBQ@mail.gmail.com","subject":"Re: Bug with bash and OpenSSL usage on Windows","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2024-07-27T14:36:00Z","receivedAt":"2024-07-27T14:36:08Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"Hey,\n\nOn 2024-07-26 at 19:40:48, Tim Abdiukov wrote:\n>   What did you do before the bug happened? (Steps to reproduce your issue)\n> Tried to generate a self-signed certificate using git bash.\n> \n> Using git bash, I ran\n> ```\n> openssl genrsa -aes256 (private key location) 4096\n> ```\n\nThe Git project doesn't ship OpenSSL, or, for that matter, any binaries\nat all.  All we ship is source versions of Git which various\ndistributors compile, sometimes with other binaries.\n\nIt looks like you're probably using Git for Windows, which _does_ ship\nOpenSSL, and so you probably want to contact them using their issue\ntracker[0] once you've verified that it hasn't already been reported.\n\n[0] https://github.com/git-for-windows/git\n-- \nbrian m. carlson (they/them or he/him)\nToronto, Ontario, CA\n"},{"id":"499485","messageId":"xmqqttgasufx.fsf@gitster.g","threadId":"61853","inReplyTo":"ZqUF0ANz9qX-wWEN@tapette.crustytoothpaste.net","subject":"Re: Bug with bash and OpenSSL usage on Windows","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-07-27T15:53:06Z","receivedAt":"2024-07-27T15:53:15Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n\n> The Git project doesn't ship OpenSSL, or, for that matter, any binaries\n> at all.  All we ship is source versions of Git which various\n> distributors compile, sometimes with other binaries.\n>\n> It looks like you're probably using Git for Windows, which _does_ ship\n> OpenSSL, and so you probably want to contact them using their issue\n> tracker[0] once you've verified that it hasn't already been reported.\n>\n> [0] https://github.com/git-for-windows/git\n\nThanks for giving a response like the above, tirelessly every time\nsomething similar pops out.\n\nI've been wondering if we can somehow reduce the occurrence of such\nan issue in the first place.  Elaborating a bit more in the\n\"Reporting bugs\" section of the documentation landing page is\nprobably the 0-th step, and if people agree that it is going in the\nright direction, perhaps we would extend it to include something\nsimilar to the top of the \"git bugreport\" template, by futzing with\nthe implementation of builtin/bugreport.c:get_bug_template(), and we\ncan even encourage customizing it by distribution.\n\nComments?\n\nThanks.\n\n\n Documentation/git.txt | 21 +++++++++++++++++++--\n 1 file changed, 19 insertions(+), 2 deletions(-)\n\ndiff --git c/Documentation/git.txt w/Documentation/git.txt\nindex 4489e2297a..495467ac1e 100644\n--- c/Documentation/git.txt\n+++ w/Documentation/git.txt\n@@ -1149,14 +1149,31 @@ the authors for specific parts of the project.\n Reporting Bugs\n --------------\n \n+First, thanks for noticing that there may be a problem in Git, and\n+be willing to share it to help the larger user base.\n+\n+Issues which are security relevant should be disclosed privately to\n+the Git Security mailing list <git-security@googlegroups.com> and\n+not on any other public mailing list.\n+\n Report bugs to the Git mailing list <git@vger.kernel.org> where the\n development and maintenance is primarily done.  You do not have to be\n subscribed to the list to send a message there.  See the list archive\n at https://lore.kernel.org/git for previous bug reports and other\n discussions.\n \n-Issues which are security relevant should be disclosed privately to\n-the Git Security mailing list <git-security@googlegroups.com>.\n+The Git project does not distribute anything but the source code to\n+Git.  Folks like Debian, Ubuntu, and Git for Windows project make\n+binary package to install, and may include software other than Git\n+(e.g. OpenSSL and Bash) in their packages.  Please report bugs in\n+components *other* *than* *Git* *itself* in such a package to the\n+respective packagers, not to the Git mailing list.  How to report\n+bugs in some sample binary packages are found here:\n+\n+ Git for Windoes: https://github.com/git-for-windows/git\n+ Ubuntu: https://help.ubuntu.com/stable/ubuntu-help/report-ubuntu-bug.html.en\n+ Debian: https://www.debian.org/Bugs/Reporting \n+\n \n SEE ALSO\n --------\n"},{"id":"499486","messageId":"xmqqplqysu7o.fsf@gitster.g","threadId":"61853","inReplyTo":"xmqqttgasufx.fsf@gitster.g","subject":"Re: Bug with bash and OpenSSL usage on Windows","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-07-27T15:58:03Z","receivedAt":"2024-07-27T15:58:06Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> I've been wondering if we can somehow reduce the occurrence of such\n> an issue in the first place.  Elaborating a bit more in the\n> \"Reporting bugs\" section of the documentation landing page is\n> probably the 0-th step, ...\n> ...\n> +respective packagers, not to the Git mailing list.  How to report\n> +bugs in some sample binary packages are found here:\n> +\n> + Git for Windoes: https://github.com/git-for-windows/git\n> + Ubuntu: https://help.ubuntu.com/stable/ubuntu-help/report-ubuntu-bug.html.en\n> + Debian: https://www.debian.org/Bugs/Reporting \n\nI forgot to mention that this weather-balloon patch was primarily to\nshow the shape of the documentation updates, and corrections to use\nmore appropriate URLs or additions for other binary distributors are\nof course welcome.\n\nThanks.\n"},{"id":"499487","messageId":"CAPig+cSRuEtd0OX+RmepdHzC33SLvmzmkQTmpbqr4_rpUzXUAA@mail.gmail.com","threadId":"61853","inReplyTo":"xmqqttgasufx.fsf@gitster.g","subject":"Re: Bug with bash and OpenSSL usage on Windows","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2024-07-27T16:05:00Z","receivedAt":"2024-07-27T16:05:15Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sat, Jul 27, 2024 at 11:53 AM Junio C Hamano <gitster@pobox.com> wrote:\n> I've been wondering if we can somehow reduce the occurrence of such\n> an issue in the first place.  Elaborating a bit more in the\n> \"Reporting bugs\" section of the documentation landing page is\n> probably the 0-th step, and if people agree that it is going in the\n> right direction, perhaps we would extend it to include something\n> similar to the top of the \"git bugreport\" template, by futzing with\n> the implementation of builtin/bugreport.c:get_bug_template(), and we\n> can even encourage customizing it by distribution.\n>\n> Comments?\n>\n> + Git for Windoes: https://github.com/git-for-windows/git\n> + Ubuntu: https://help.ubuntu.com/stable/ubuntu-help/report-ubuntu-bug.html.en\n> + Debian: https://www.debian.org/Bugs/Reporting\n\nIn case this ever gets turned into a real patch...\n\n s/Windoes/Windows/\n"},{"id":"499490","messageId":"ZqVkiaD6L_zdfTJV@tapette.crustytoothpaste.net","threadId":"61853","inReplyTo":"xmqqttgasufx.fsf@gitster.g","subject":"Re: Bug with bash and OpenSSL usage on Windows","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2024-07-27T21:20:09Z","receivedAt":"2024-07-27T21:20:12Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2024-07-27 at 15:53:06, Junio C Hamano wrote:\n> \"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n> \n> > The Git project doesn't ship OpenSSL, or, for that matter, any binaries\n> > at all.  All we ship is source versions of Git which various\n> > distributors compile, sometimes with other binaries.\n> >\n> > It looks like you're probably using Git for Windows, which _does_ ship\n> > OpenSSL, and so you probably want to contact them using their issue\n> > tracker[0] once you've verified that it hasn't already been reported.\n> >\n> > [0] https://github.com/git-for-windows/git\n> \n> Thanks for giving a response like the above, tirelessly every time\n> something similar pops out.\n> \n> I've been wondering if we can somehow reduce the occurrence of such\n> an issue in the first place.  Elaborating a bit more in the\n> \"Reporting bugs\" section of the documentation landing page is\n> probably the 0-th step, and if people agree that it is going in the\n> right direction, perhaps we would extend it to include something\n> similar to the top of the \"git bugreport\" template, by futzing with\n> the implementation of builtin/bugreport.c:get_bug_template(), and we\n> can even encourage customizing it by distribution.\n> \n> Comments?\n\nI think something like that would be valuable.  We of course want to\nhear about useful bug reports, but there's nothing we can do in this\ncase and it would be very helpful both for us and the reporter if it\nwent to the right place at first (even if that were the case even just a\nslightly higher percentage of the time).\n\nIt might be helpful to maybe add a note that the reporter should search\nfor a similar issue first before reporting it.  I feel like Dscho, as\nwell as the Debian and Ubuntu maintainers, will appreciate that, and I\nknow for Ubuntu at least the issue tracker actually keeps track of the\nissues affecting the most people to help prioritize fixes.\n-- \nbrian m. carlson (they/them or he/him)\nToronto, Ontario, CA\n"},{"id":"499492","messageId":"20240727220137.GB1263246@coredump.intra.peff.net","threadId":"61853","inReplyTo":"xmqqttgasufx.fsf@gitster.g","subject":"Re: Bug with bash and OpenSSL usage on Windows","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2024-07-27T22:01:37Z","receivedAt":"2024-07-27T22:01:39Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Jul 27, 2024 at 08:53:06AM -0700, Junio C Hamano wrote:\n\n> I've been wondering if we can somehow reduce the occurrence of such\n> an issue in the first place.  Elaborating a bit more in the\n> \"Reporting bugs\" section of the documentation landing page is\n> probably the 0-th step, and if people agree that it is going in the\n> right direction, perhaps we would extend it to include something\n> similar to the top of the \"git bugreport\" template, by futzing with\n> the implementation of builtin/bugreport.c:get_bug_template(), and we\n> can even encourage customizing it by distribution.\n\nPeople might also get here from:\n\n  https://git-scm.com/community\n\nThat page does mention the Git for Windows tracker, but it could perhaps\nbe more explicit that \"bundled\" components are specific to Git for\nWindows. I don't really touch that site anymore, but I'm sure a pull\nrequest at:\n\n  https://github.com/git/git-scm.com\n\nwould be welcome.\n\n-Peff\n"},{"id":"500777","messageId":"074d1fb3-e2ef-6365-73cd-b63672b4842e@gmx.de","threadId":"61853","inReplyTo":"CAD+08a87xxVRxO1eiWiam-7xvq=AyKUB-MzqG-r=rM_SYbquBQ@mail.gmail.com","subject":"Re: Bug with bash and OpenSSL usage on Windows","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2024-08-13T13:06:37Z","receivedAt":"2024-08-13T13:06:40Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Tim,\n\nI suspect that you also reported this issue at\nhttps://github.com/git-for-windows/git/issues/5079. For the benefit of\nreaders of this list, here is the explanation:\n\n`openssl.exe` is a pure Win32 program, while Git Bash uses a friendly fork\nof the Cygwin POSIX emulation layer. The latter, therefore, uses emulated\npseudo terminals, but Win32 programs only use Win32 Consoles.\n\nFor the moment, therefore, programs like `openssl.exe` that want to\ninteract with the user via such a Win32 Console have to be called via the\n`winpty` helper that acts as a translator between Win32 Consoles and\nemulated Unix pseudo terminals.\n\nModern Windows versions support a concept called \"pseudo consoles\" that\nare similar to Unix pseudo terminals, similar enough that there is an\noption to use them, which would avoid the need for that `winpty` helper.\n\nIn the near future, the Git for Windows project will switch the default to\nuse those pseudo consoles by default (where available, that is).\n\nCiao,\nJohannes\n\nOn Sat, 27 Jul 2024, Tim Abdiukov wrote:\n\n>   What did you do before the bug happened? (Steps to reproduce your issue)\n> Tried to generate a self-signed certificate using git bash.\n>\n> Using git bash, I ran\n> ```\n> openssl genrsa -aes256 (private key location) 4096\n> ```\n> however, openssl just hung (on Windows). Cmd can execute this command,\n> but bash cannot.\n>\n> What did you expect to happen? (Expected behavior)\n>\n> openssl to generate messages about key generation to stdout\n>\n> What happened instead? (Actual behavior)\n>\n> openssl just hung\n>\n> What's different between what you expected and what actually happened?\n>\n> openssl just hung, rendering it unusable within bash Windows\n>\n> Anything else you want to add:\n>\n> This is an issue specifically with Windows x64.\n>\n> Please review the rest of the bug report below.\n> You can delete any lines you don't wish to share.\n>\n>\n> [System Info]\n> git version:\n> git version 2.45.2.windows.1\n> cpu: x86_64\n> built from commit: 91d03cb2e4fbf6ad961ace739b8a646868cb154d\n> sizeof-long: 4\n> sizeof-size_t: 8\n> shell-path: /bin/sh\n> feature: fsmonitor--daemon\n> uname: Windows 10.0 19044\n> compiler info: gnuc: 14.1\n> libc info: no libc information available\n> $SHELL (typically, interactive shell): C:\\Program Files\\Git\\usr\\bin\\bash.exe\n>\n>\n> [Enabled Hooks]\n> not run from a git repository - no hooks to show\n>\n>\n"}]}