Merge pull request #1965 from mtrmac/verify-error

Fix error handling of signature.NewEphemeralGPGSigningMechanism
This commit is contained in:
Miloslav Trmač
2023-04-06 21:44:58 +02:00
committed by GitHub

View File

@@ -116,11 +116,15 @@ func (opts *standaloneVerifyOptions) run(args []string, stdout io.Writer) error
return fmt.Errorf("Error reading public keys from %s: %w", opts.publicKeyFile, err)
}
mech, publicKeyfingerprints, err = signature.NewEphemeralGPGSigningMechanism(publicKeys)
if err != nil {
return fmt.Errorf("Error initializing GPG: %w", err)
}
} else {
mech, err = signature.NewGPGSigningMechanism()
}
if err != nil {
return fmt.Errorf("Error initializing GPG: %w", err)
if err != nil {
return fmt.Errorf("Error initializing GPG: %w", err)
}
}
defer mech.Close()