fix gpg case, add default case of armored file
This commit is contained in:
parent
827da69d4e
commit
bfc313ab75
6
main.go
6
main.go
|
@ -42,11 +42,13 @@ func main() {
|
||||||
var ent *openpgp.Entity
|
var ent *openpgp.Entity
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case strings.HasSuffix(sig, ".sig"):
|
case strings.HasSuffix(sig, ".sig"), strings.HasSuffix(sig, ".gpg"):
|
||||||
case strings.HasSuffix(sig, ".gpg"):
|
|
||||||
ent, err = openpgp.CheckDetachedSignature(kr, open(file), open(sig))
|
ent, err = openpgp.CheckDetachedSignature(kr, open(file), open(sig))
|
||||||
case strings.HasSuffix(sig, ".asc"):
|
case strings.HasSuffix(sig, ".asc"):
|
||||||
ent, err = openpgp.CheckArmoredDetachedSignature(kr, open(file), open(sig))
|
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 {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue