Open adrelanos opened 9 years ago
Yet to be solved. Updated the title and description of this ticket.
See this thread "Are there cases where gpg --verify will exit 0, even if verification failed?": http://lists.gnupg.org/pipermail/gnupg-users/2015-January/052212.html
They seem to disagree? But we should take Werner Koch seriously.
Werner Koch:
On Wed, 14 Jan 2015 14:40, dkg@fifthhorseman.net said:
gpg does use the return code to indicate failure of signature verification.
But recall that success does not mean that the signature is good. Check the status output or use gpgv.
http://lists.gnupg.org/pipermail/gnupg-users/2015-January/052228.html
I still don't know specific cases, but Werner Koch is very clear about this.
Werner Koch:
Do you mean, for example, the signature could be valid, but the key that signed it could be revoked and gpg would still exit 0?
Sure. It is just to complex to put it into one number. Consider the case for multiple signatures - who is going to decide whether the signature is valid. This has all been discussed about 15 years ago with the result of writing the gpgv binary which is suitable for most automated signature verification use cases.
http://lists.gnupg.org/pipermail/gnupg-users/2015-January/052232.html
Is there a shell script or bash library for parsing gpg's --status-fd output?:
No answers yet.
thats ironic, isnt it? gpgv is not in default portage tree I might add securix signature to verified files and discard gpg completely
discard gpg completely
I'd find that very wrong. Killing the patient doesn't count for healing the sickness. ;)
Created a gpg-bash-lib in meanwhile: https://github.com/Whonix/gpg-bash-lib
Still lacks documentation, but I think it's a sound solution. No negative feedback yet, but also no other users.
Usage examples:
Shall I send a pull request that adapts it?
Hi, I saw it already, but its too much code. btw did you consider different timezone, when you're checking date and time of signature? I have seen there unix time, which should be OK, but I'm not yet oriented in your code.
regarding pull request: if it could be compressed into 10 lines, then sure :]
Late answer but better than never.
btw did you consider different timezone, when you're checking date and time of signature? I have seen there unix time, which should be OK, but I'm not yet oriented in your code.
Yes. It's all unix time. Nothing depends on timezone.
gpg --verify
is insecure for verification of--clearsign
ed files. Counter intuitive.Butgpg --decrypt
should be used instead.Hard to explain with words. But code and output talks. See:https://gist.github.com/adrelanos/defdf9d693c2726514fdLine in question: https://github.com/martincmelik/Securix-Linux/blob/14e4fd445235e4bf384fd8ffb65e1c43d7bfe9ac/securix-install/install.sh#L823