diff --git a/openpgp/packet/public_key.go b/openpgp/packet/public_key.go index ec903ee9..3402b8c1 100644 --- a/openpgp/packet/public_key.go +++ b/openpgp/packet/public_key.go @@ -415,6 +415,10 @@ func (pk *PublicKey) parseEdDSA(r io.Reader) (err error) { return } + if len(pk.p.Bytes()) == 0 { + return errors.StructuralError("empty EdDSA public key") + } + pub := eddsa.NewPublicKey(c) switch flag := pk.p.Bytes()[0]; flag {