Merge pull request #113 from libp2p/fix/public-key-extraction
fix public key extraction for abnormal ExtractPublicKey semantics
This commit is contained in:
commit
2318ce2a31
3
sign.go
3
sign.go
|
@ -53,6 +53,9 @@ func messagePubKey(m *pb.Message) (crypto.PubKey, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("cannot extract signing key: %s", err.Error())
|
return nil, fmt.Errorf("cannot extract signing key: %s", err.Error())
|
||||||
}
|
}
|
||||||
|
if pubk == nil {
|
||||||
|
return nil, fmt.Errorf("cannot extract signing key")
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
pubk, err = crypto.UnmarshalPublicKey(m.Key)
|
pubk, err = crypto.UnmarshalPublicKey(m.Key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue