{"thread":{"id":"56940","subject":"Ambiguous verification response when ssh-based signatures","startedAt":"2021-11-19T02:47:14Z","lastAt":"2021-11-19T18:26:37Z","messageCount":5,"participants":["Thor Andreas Rognan","Fabian Stelzer"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"441684","messageId":"CAMn8hCcFLR-YyLaawtbtjpVUKd45Z4C6t1kWj+-WBZVNtNgozw@mail.gmail.com","threadId":"56940","inReplyTo":null,"subject":"Ambiguous verification response when ssh-based signatures","fromName":"Thor Andreas Rognan","fromEmail":"thor.rognan@gmail.com","sentAt":"2021-11-19T02:46:57Z","receivedAt":"2021-11-19T02:47:14Z","isPatch":false,"sender":{"key":"thor.rognan@gmail.com","avatar":null},"body":"Thank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\n\n$ ssh-keygen -t ed25519 -C \"me@example.com\"\n$ mkdir -pv ~/tmp/example && cd ~/tmp/example && git init\n$ git config commit.gpgsign true\n$ git config gpg.format ssh\n$ git config user.signingkey \"$(cat ~/.ssh/id_ed25519.pub)\"\n$ mkdir -p ~/.config/git/ && touch ~/.config/git/allowed_signers\\\n && chmod 0600 ~/.config/git/allowed_signers\n$ cat ~/.ssh/id_ed25519.pub | awk '{print email \" \" $0}' email=$(git\nconfig user.email)\\\n >> ~/.config/git/allowed_signers\n$ git config gpg.ssh.allowedSignersFile \"$HOME/.config/git/allowed_signers\"\n$ git commit --allow-empty -m \"Initial commit\"\n$ git verify-commit HEAD\n\nWhat did you expect to happen? (Expected behavior)\n\nA verified signature without any error message.\n\nWhat happened instead? (Actual behavior)\n\n$ git verify-commit HEAD\nGood \"git\" signature with ED25519 key SHA256:...\nToo few arguments for sign/verify: missing namespace\n$ git log --show-signature\ncommit 4697b474dd5ec0de14870d5b0eba5f579b852bbd (HEAD -> main)\nGood \"git\" signature with ED25519 key SHA256:...\nToo few arguments for sign/verify: missing namespace^M\n\nWhat's different between what you expected and what actually happened?\n\nAmbiguous signature verification message.\n\nAnything else you want to add:\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.34.0\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Darwin 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21\nPDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64\ncompiler info: clang: 13.0.0 (clang-1300.0.29.3)\nlibc info: no libc information available\n$SHELL (typically, interactive shell): /usr/local/bin/bash\n\n\n[Enabled Hooks]\n"},{"id":"441706","messageId":"20211119090037.m4zfzovaitfj35l3@fs","threadId":"56940","inReplyTo":"CAMn8hCcFLR-YyLaawtbtjpVUKd45Z4C6t1kWj+-WBZVNtNgozw@mail.gmail.com","subject":"Re: Ambiguous verification response when ssh-based signatures","fromName":"Fabian Stelzer","fromEmail":"fs@gigacodes.de","sentAt":"2021-11-19T09:00:37Z","receivedAt":"2021-11-19T09:00:43Z","isPatch":false,"sender":{"key":"fs@gigacodes.de","avatar":"https://avatars.githubusercontent.com/u/564858?v=4"},"body":"On 19.11.2021 03:46, Thor Andreas Rognan wrote:\n>Thank you for filling out a Git bug report!\n>Please answer the following questions to help us understand your issue.\n>\n>What did you do before the bug happened? (Steps to reproduce your issue)\n>\n>$ ssh-keygen -t ed25519 -C \"me@example.com\"\n>$ mkdir -pv ~/tmp/example && cd ~/tmp/example && git init\n>$ git config commit.gpgsign true\n>$ git config gpg.format ssh\n>$ git config user.signingkey \"$(cat ~/.ssh/id_ed25519.pub)\"\n>$ mkdir -p ~/.config/git/ && touch ~/.config/git/allowed_signers\\\n> && chmod 0600 ~/.config/git/allowed_signers\n>$ cat ~/.ssh/id_ed25519.pub | awk '{print email \" \" $0}' email=$(git\n>config user.email)\\\n> >> ~/.config/git/allowed_signers\n>$ git config gpg.ssh.allowedSignersFile \"$HOME/.config/git/allowed_signers\"\n>$ git commit --allow-empty -m \"Initial commit\"\n>$ git verify-commit HEAD\n>\n>What did you expect to happen? (Expected behavior)\n>\n>A verified signature without any error message.\n>\n>What happened instead? (Actual behavior)\n>\n>$ git verify-commit HEAD\n>Good \"git\" signature with ED25519 key SHA256:...\n>Too few arguments for sign/verify: missing namespace\n>$ git log --show-signature\n>commit 4697b474dd5ec0de14870d5b0eba5f579b852bbd (HEAD -> main)\n>Good \"git\" signature with ED25519 key SHA256:...\n>Too few arguments for sign/verify: missing namespace^M\n>\n>What's different between what you expected and what actually happened?\n>\n>Ambiguous signature verification message.\n>\n>Anything else you want to add:\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.34.0\n>cpu: x86_64\n>no commit associated with this build\n>sizeof-long: 8\n>sizeof-size_t: 8\n>shell-path: /bin/sh\n>uname: Darwin 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21\n>PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64\n>compiler info: clang: 13.0.0 (clang-1300.0.29.3)\n>libc info: no libc information available\n>$SHELL (typically, interactive shell): /usr/local/bin/bash\n>\n>\n>[Enabled Hooks]\n\nHi Thor,\nthanks for your report. I'm curious why verify complains about a missing\nnamespace. This parameter is basically hard coded to every command :/\nWhat version of openssh are you using (ssh -V)?\nAlso, could you run the sign & the verify with a `GIT_TRACE=1`?\nThis way we can see what the actual keygen commands are that are\nexecuted.\n\nThanks,\nFabian\n"},{"id":"441711","messageId":"CAMn8hCf1ypU4Bwt8bDgai86QFTdORPyaHiE7W+=tx_rKbchz4w@mail.gmail.com","threadId":"56940","inReplyTo":"20211119090037.m4zfzovaitfj35l3@fs","subject":"Re: Ambiguous verification response when ssh-based signatures","fromName":"Thor Andreas Rognan","fromEmail":"thor.rognan@gmail.com","sentAt":"2021-11-19T10:26:44Z","receivedAt":"2021-11-19T10:27:03Z","isPatch":false,"sender":{"key":"thor.rognan@gmail.com","avatar":null},"body":"Hi Fabian,\n\nThank you for your quick response! Commands and output below:\n\n$ ssh -V\nOpenSSH_8.1p1, LibreSSL 2.7.3\n\n$ GIT_TRACE=1 git commit -m \"Trace keygen commands with GIT_TRACE\"\n11:13:49.771601 git.c:455               trace: built-in: git commit -m\n'Trace keygen commands with GIT_TRACE'\n11:13:49.776095 run-command.c:668       trace: run_command: ssh-keygen\n-Y sign -n git -f\n/var/folders/jj/sfgpggbj5b13gvljxf977zq80000gn/T//.git_signing_key_tmp1FkZ52\n/var/folders/jj/sfgpggbj5b13gvljxf977zq80000gn/T//.git_signing_buffer_tmpBweN52\n11:13:49.814072 run-command.c:668       trace: run_command: git\nmaintenance run --auto --no-quiet\n11:13:49.819952 git.c:455               trace: built-in: git\nmaintenance run --auto --no-quiet\n[main 633e567] Trace keygen commands with GIT_TRACE\n 1 file changed, 59 insertions(+)\n create mode 100644 git-bugreport-2021-11-19-0311.txt\n\n$ GIT_TRACE=1 git verify-commit HEAD\n11:14:40.274423 git.c:455               trace: built-in: git verify-commit HEAD\n11:14:40.277417 run-command.c:668       trace: run_command: ssh-keygen\n-Y find-principals -f ~/.config/git/allowed_signers -s\n/var/folders/jj/sfgpggbj5b13gvljxf977zq80000gn/T//.git_vtag_tmpEI3SAu\n11:14:40.284075 run-command.c:668       trace: run_command: ssh-keygen\n-Y check-novalidate -n git -s\n/var/folders/jj/sfgpggbj5b13gvljxf977zq80000gn/T//.git_vtag_tmpEI3SAu\nGood \"git\" signature with ED25519 key\nSHA256:x3FRAl3XR188M9KR3UE+TuG3jkZzPQMjfBo+ddbM0dk\nToo few arguments for sign/verify: missing namespace\n\nBest regards,\nThor\n\nOn Fri, 19 Nov 2021 at 10:00, Fabian Stelzer <fs@gigacodes.de> wrote:\n>\n> On 19.11.2021 03:46, Thor Andreas Rognan wrote:\n> >Thank you for filling out a Git bug report!\n> >Please answer the following questions to help us understand your issue.\n> >\n> >What did you do before the bug happened? (Steps to reproduce your issue)\n> >\n> >$ ssh-keygen -t ed25519 -C \"me@example.com\"\n> >$ mkdir -pv ~/tmp/example && cd ~/tmp/example && git init\n> >$ git config commit.gpgsign true\n> >$ git config gpg.format ssh\n> >$ git config user.signingkey \"$(cat ~/.ssh/id_ed25519.pub)\"\n> >$ mkdir -p ~/.config/git/ && touch ~/.config/git/allowed_signers\\\n> > && chmod 0600 ~/.config/git/allowed_signers\n> >$ cat ~/.ssh/id_ed25519.pub | awk '{print email \" \" $0}' email=$(git\n> >config user.email)\\\n> > >> ~/.config/git/allowed_signers\n> >$ git config gpg.ssh.allowedSignersFile \"$HOME/.config/git/allowed_signers\"\n> >$ git commit --allow-empty -m \"Initial commit\"\n> >$ git verify-commit HEAD\n> >\n> >What did you expect to happen? (Expected behavior)\n> >\n> >A verified signature without any error message.\n> >\n> >What happened instead? (Actual behavior)\n> >\n> >$ git verify-commit HEAD\n> >Good \"git\" signature with ED25519 key SHA256:...\n> >Too few arguments for sign/verify: missing namespace\n> >$ git log --show-signature\n> >commit 4697b474dd5ec0de14870d5b0eba5f579b852bbd (HEAD -> main)\n> >Good \"git\" signature with ED25519 key SHA256:...\n> >Too few arguments for sign/verify: missing namespace^M\n> >\n> >What's different between what you expected and what actually happened?\n> >\n> >Ambiguous signature verification message.\n> >\n> >Anything else you want to add:\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.34.0\n> >cpu: x86_64\n> >no commit associated with this build\n> >sizeof-long: 8\n> >sizeof-size_t: 8\n> >shell-path: /bin/sh\n> >uname: Darwin 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21\n> >PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64\n> >compiler info: clang: 13.0.0 (clang-1300.0.29.3)\n> >libc info: no libc information available\n> >$SHELL (typically, interactive shell): /usr/local/bin/bash\n> >\n> >\n> >[Enabled Hooks]\n>\n> Hi Thor,\n> thanks for your report. I'm curious why verify complains about a missing\n> namespace. This parameter is basically hard coded to every command :/\n> What version of openssh are you using (ssh -V)?\n> Also, could you run the sign & the verify with a `GIT_TRACE=1`?\n> This way we can see what the actual keygen commands are that are\n> executed.\n>\n> Thanks,\n> Fabian\n"},{"id":"441714","messageId":"20211119110722.noxoecfk5zk5hssv@fs","threadId":"56940","inReplyTo":"CAMn8hCf1ypU4Bwt8bDgai86QFTdORPyaHiE7W+=tx_rKbchz4w@mail.gmail.com","subject":"Re: Ambiguous verification response when ssh-based signatures","fromName":"Fabian Stelzer","fromEmail":"fs@gigacodes.de","sentAt":"2021-11-19T11:07:22Z","receivedAt":"2021-11-19T11:07:27Z","isPatch":false,"sender":{"key":"fs@gigacodes.de","avatar":"https://avatars.githubusercontent.com/u/564858?v=4"},"body":"On 19.11.2021 11:26, Thor Andreas Rognan wrote:\n>Hi Fabian,\n>\n>Thank you for your quick response! Commands and output below:\n>\n>$ ssh -V\n>OpenSSH_8.1p1, LibreSSL 2.7.3\n>\n>$ GIT_TRACE=1 git commit -m \"Trace keygen commands with GIT_TRACE\"\n>11:13:49.771601 git.c:455               trace: built-in: git commit -m\n>'Trace keygen commands with GIT_TRACE'\n>11:13:49.776095 run-command.c:668       trace: run_command: ssh-keygen\n>-Y sign -n git -f\n>/var/folders/jj/sfgpggbj5b13gvljxf977zq80000gn/T//.git_signing_key_tmp1FkZ52\n>/var/folders/jj/sfgpggbj5b13gvljxf977zq80000gn/T//.git_signing_buffer_tmpBweN52\n>11:13:49.814072 run-command.c:668       trace: run_command: git\n>maintenance run --auto --no-quiet\n>11:13:49.819952 git.c:455               trace: built-in: git\n>maintenance run --auto --no-quiet\n>[main 633e567] Trace keygen commands with GIT_TRACE\n> 1 file changed, 59 insertions(+)\n> create mode 100644 git-bugreport-2021-11-19-0311.txt\n>\n>$ GIT_TRACE=1 git verify-commit HEAD\n>11:14:40.274423 git.c:455               trace: built-in: git verify-commit HEAD\n>11:14:40.277417 run-command.c:668       trace: run_command: ssh-keygen\n>-Y find-principals -f ~/.config/git/allowed_signers -s\n>/var/folders/jj/sfgpggbj5b13gvljxf977zq80000gn/T//.git_vtag_tmpEI3SAu\n>11:14:40.284075 run-command.c:668       trace: run_command: ssh-keygen\n>-Y check-novalidate -n git -s\n>/var/folders/jj/sfgpggbj5b13gvljxf977zq80000gn/T//.git_vtag_tmpEI3SAu\n>Good \"git\" signature with ED25519 key\n>SHA256:x3FRAl3XR188M9KR3UE+TuG3jkZzPQMjfBo+ddbM0dk\n>Too few arguments for sign/verify: missing namespace\n>\n\nOk. OpenSSH 8.1p1 does not have the required functionality for the ssh\nsigning feature. Normally a git warning would trigger to notify you\nabout this. Unfortunately it seems as openssh introduced the features\nbetween 8.0 and 8.2 and exactly the 8.1 version has some of them but not\nall and does not produce the expected error for the find-principals call\n:/. I'll check if can do something about this and print the correct\nerror.\n\nI'd recommend to upgrade to the latest openssh 8.8. If you don't want to\nupgrade your OS version you can install to another prefix (e.g.: /opt)\nand point git to the newer ssh-keygen command like this:\n`git config --global gpg.ssh.program /opt/openssh/ssh-keygen`.\n\nFabian\n"},{"id":"441771","messageId":"CAMn8hCeOkGk5TQyzqcjsDhs4UW0QpFzAsz_OM3UZ1ZqYioWnPw@mail.gmail.com","threadId":"56940","inReplyTo":"20211119110722.noxoecfk5zk5hssv@fs","subject":"Re: Ambiguous verification response when ssh-based signatures","fromName":"Thor Andreas Rognan","fromEmail":"thor.rognan@gmail.com","sentAt":"2021-11-19T18:26:18Z","receivedAt":"2021-11-19T18:26:37Z","isPatch":false,"sender":{"key":"thor.rognan@gmail.com","avatar":null},"body":"Hi Fabian,\n\nI upgraded and it works, thank you for your help! :)\n\nBest regards,\nThor\n\nOn Fri, 19 Nov 2021 at 12:07, Fabian Stelzer <fs@gigacodes.de> wrote:\n>\n> On 19.11.2021 11:26, Thor Andreas Rognan wrote:\n> >Hi Fabian,\n> >\n> >Thank you for your quick response! Commands and output below:\n> >\n> >$ ssh -V\n> >OpenSSH_8.1p1, LibreSSL 2.7.3\n> >\n> >$ GIT_TRACE=1 git commit -m \"Trace keygen commands with GIT_TRACE\"\n> >11:13:49.771601 git.c:455               trace: built-in: git commit -m\n> >'Trace keygen commands with GIT_TRACE'\n> >11:13:49.776095 run-command.c:668       trace: run_command: ssh-keygen\n> >-Y sign -n git -f\n> >/var/folders/jj/sfgpggbj5b13gvljxf977zq80000gn/T//.git_signing_key_tmp1FkZ52\n> >/var/folders/jj/sfgpggbj5b13gvljxf977zq80000gn/T//.git_signing_buffer_tmpBweN52\n> >11:13:49.814072 run-command.c:668       trace: run_command: git\n> >maintenance run --auto --no-quiet\n> >11:13:49.819952 git.c:455               trace: built-in: git\n> >maintenance run --auto --no-quiet\n> >[main 633e567] Trace keygen commands with GIT_TRACE\n> > 1 file changed, 59 insertions(+)\n> > create mode 100644 git-bugreport-2021-11-19-0311.txt\n> >\n> >$ GIT_TRACE=1 git verify-commit HEAD\n> >11:14:40.274423 git.c:455               trace: built-in: git verify-commit HEAD\n> >11:14:40.277417 run-command.c:668       trace: run_command: ssh-keygen\n> >-Y find-principals -f ~/.config/git/allowed_signers -s\n> >/var/folders/jj/sfgpggbj5b13gvljxf977zq80000gn/T//.git_vtag_tmpEI3SAu\n> >11:14:40.284075 run-command.c:668       trace: run_command: ssh-keygen\n> >-Y check-novalidate -n git -s\n> >/var/folders/jj/sfgpggbj5b13gvljxf977zq80000gn/T//.git_vtag_tmpEI3SAu\n> >Good \"git\" signature with ED25519 key\n> >SHA256:x3FRAl3XR188M9KR3UE+TuG3jkZzPQMjfBo+ddbM0dk\n> >Too few arguments for sign/verify: missing namespace\n> >\n>\n> Ok. OpenSSH 8.1p1 does not have the required functionality for the ssh\n> signing feature. Normally a git warning would trigger to notify you\n> about this. Unfortunately it seems as openssh introduced the features\n> between 8.0 and 8.2 and exactly the 8.1 version has some of them but not\n> all and does not produce the expected error for the find-principals call\n> :/. I'll check if can do something about this and print the correct\n> error.\n>\n> I'd recommend to upgrade to the latest openssh 8.8. If you don't want to\n> upgrade your OS version you can install to another prefix (e.g.: /opt)\n> and point git to the newer ssh-keygen command like this:\n> `git config --global gpg.ssh.program /opt/openssh/ssh-keygen`.\n>\n> Fabian\n"}]}