Valid, unverified/verified signatures
Lars Noodén
lars.nooden at gmx.com
Sat Oct 17 16:36:38 AEDT 2026
On 10/16/26 20:03, Lars Noodén wrote:
> I have a question about the verification of signatures made by SSH keys.
> I've pored over the manual page for ssh-keygen(1) but not seen (or
> have missed) the relevant information. The search engines have not
> turned up anything about that use-case either.
>
> The context is that when using SSH keys to sign files using ssh-
> keygen(1) there seems to be a flag which shows if a signature is
> verified or unverified. Viewing a verification while using increased
> verbosity shows a unverified status for the key being used:
>
> "debug1: Valid (unverified) signature from key SHA256:..."
>
> I presume that a corresponding verified status is possible. What should
> I be looking at to make the signature verified?
>
> /Lars
FWIW, this is how I get that debugging notice:
# create a file to be signed
$ date > datafile
# create a signing key
$ ssh-keygen -f signer -C 'a key for signing'
# create an allowed signers file
$ sed -e 's/^/namespaces="ProjectA at example.org" /' \
-e 's/^/*@example.org /' signer.pub \
>> allowed_signers
# sign the file
$ ssh-keygen -Y sign -f signer -n 'ProjectA at example.org' datafile
# verify the signed file
$ ssh-keygen -Y verify \
-n 'ProjectA at example.org' \
-s datafile.sig \
-f allowed_signers \
-I lars at example.org \
-i signer \
< datafile
Good "ProjectA at example.org" signature for fred at example.org with ED25519
key SHA256:03u96bPG5qYi7hIEohNDfxOW+KOpMS9LPi4YdiCtGaI
# increased verbosity works, too, but shows a debug warning
$ ssh-keygen -v -Y verify -n 'ProjectA at example.org' \
-s datafile.sig -f allowed_signers -I lars at example.org \
-i signer < datafile
debug1: sshsig_verify_fd: signature made with hash "sha512"
debug1: sshsig_wrap_verify: verify message length 64
debug1: Valid (unverified) signature from key
SHA256:03u96bPG5qYi7hIEohNDfxOW+KOpMS9LPi4YdiCtGaI
debug1: parse_principals_key_and_options: allowed_signers:1: matched
principal "lars at example.org"
debug1: allowed_signers:1: matched key
Good "ProjectA at example.org" signature for lars at example.org with ED25519
key SHA256:03u96bPG5qYi7hIEohNDfxOW+KOpMS9LPi4YdiCtGaI
As shown the verification is good, but there is a debug warning about
the signature being unverified. Where should I read more about the
verification process?
/Lars
More information about the openssh-unix-dev
mailing list