fix public key extraction for abnormal ExtractPublicKey semantics

This commit is contained in:
vyzo 2018-10-14 11:59:28 +03:00
parent 4eb6b7cada
commit 8a8966b4ab
1 changed files with 3 additions and 0 deletions

View File

@ -53,6 +53,9 @@ func messagePubKey(m *pb.Message) (crypto.PubKey, error) {
if err != nil {
return nil, fmt.Errorf("cannot extract signing key: %s", err.Error())
}
if pubk == nil {
return nil, fmt.Errorf("cannot extract signing key")
}
} else {
pubk, err = crypto.UnmarshalPublicKey(m.Key)
if err != nil {