From 5f82a9caa9462ea76a5d70ecdecec58c351a06e9 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Sun, 16 Jan 2011 21:05:03 -0800 Subject: [PATCH] complain more clearly when DSA public keys are read. --- lib/go/ext/openpgp/packet/packet.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/go/ext/openpgp/packet/packet.go b/lib/go/ext/openpgp/packet/packet.go index 26646b6e0..102416c14 100644 --- a/lib/go/ext/openpgp/packet/packet.go +++ b/lib/go/ext/openpgp/packet/packet.go @@ -332,8 +332,12 @@ func readPublicKeyPacket(r io.Reader, length uint16) (pk PublicKeyPacket, err os pk.PubKeyAlgo = PublicKeyAlgorithm(buf[5]) switch pk.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly: + // good. + case PubKeyAlgoDSA: + err = error.Unsupported("DSA public key type") + return default: - err = error.Unsupported("public key type") + err = error.Unsupported(fmt.Sprintf("public key type (%d)", pk.PubKeyAlgo)) return }