Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed various gpg verification security issues #97

Merged

Conversation

adrelanos
Copy link
Collaborator

- fixed check gpg before sha512 martinholovsky#94
- fixed gpg --verify is insecure for verification of `--clearsign`ed files, use gpg --decrypt instead martinholovsky#95
- fixed no need to download unsigned stage3-amd64-hardened-20150108.tar.bz2.DIGESTS when you download `--clearsign`ed stage3-amd64-hardened-20150108.tar.bz2.DIGESTS.asc martinholovsky#96
@adrelanos
Copy link
Collaborator Author

gpg ${GPG_EXTRA_OPTS} --homedir /etc/portage/gpg --decrypt "${STAGE3LATESTFILE##*/}.DIGESTS.asc" > "stage3latestfile_clear_text"

My major mistake:
--decrypt isn't safe either:
http://lists.gnupg.org/pipermail/gnupg-users/2015-January/052205.html
(It would exit 0 if it was an encrypted, but unsigned text. Very bad. [Anyone could encrypt a text to the signing public keys.])

Werner Koch = gnupg lead developer. He wrote, quote:

You better check the status lines; in particular watch out for
[GNUPG:] VALIDSIG E4B868C8F90C.....
or use gpgv.

Hopefully we find an alternative to using status lines. It's doable but not super simple.

I guess gpgv alone won't work for that --clearsigned file because gpgv has no option to store the verified text (without potential malicious surroundings) in another file. Maybe a combination of gpgv + gpg --out out file.asc could do the trick.


Minor importance:
I/O redirection (>) is unnecessary here. Should use --output instead.

@martinholovsky
Copy link
Owner

quite difficult to let us know if file has been spoofed/modified or not... I wouldn't expect this from gpg...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants