fix gpg case, add default case of armored file

This commit is contained in:
Aaron Bieber 2020-02-09 09:23:22 -07:00
parent 827da69d4e
commit bfc313ab75
1 changed files with 4 additions and 2 deletions

View File

@ -42,11 +42,13 @@ func main() {
var ent *openpgp.Entity
switch {
case strings.HasSuffix(sig, ".sig"):
case strings.HasSuffix(sig, ".gpg"):
case strings.HasSuffix(sig, ".sig"), strings.HasSuffix(sig, ".gpg"):
ent, err = openpgp.CheckDetachedSignature(kr, open(file), open(sig))
case strings.HasSuffix(sig, ".asc"):
ent, err = openpgp.CheckArmoredDetachedSignature(kr, open(file), open(sig))
default:
// Try to open as an armored file if we don't know the extension
ent, err = openpgp.CheckArmoredDetachedSignature(kr, open(file), open(sig))
}
if err != nil {