aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/crypto.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-30 20:24:20 +0800
committerobscuren <geffobscura@gmail.com>2015-01-30 20:24:20 +0800
commitc48644490f039fb9756b4cd1fedf11fbb1c4a16f (patch)
tree1e574af895c8702e64bd958b52d20df2a28b1c24 /crypto/crypto.go
parent54927dc0e0b99009f92fbb7b28d71ae20179ce1e (diff)
downloadgo-tangerine-c48644490f039fb9756b4cd1fedf11fbb1c4a16f.tar.gz
go-tangerine-c48644490f039fb9756b4cd1fedf11fbb1c4a16f.tar.zst
go-tangerine-c48644490f039fb9756b4cd1fedf11fbb1c4a16f.zip
Fixed whisper pub key bug
* Unrecoverable messages would cause segfault when recovering invalid pub key
Diffstat (limited to 'crypto/crypto.go')
-rw-r--r--crypto/crypto.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/crypto.go b/crypto/crypto.go
index effa703d0..d56b9112f 100644
--- a/crypto/crypto.go
+++ b/crypto/crypto.go
@@ -92,7 +92,7 @@ func ToECDSAPub(pub []byte) *ecdsa.PublicKey {
}
func FromECDSAPub(pub *ecdsa.PublicKey) []byte {
- if pub == nil {
+ if pub == nil || pub.X == nil || pub.Y == nil {
return nil
}
return elliptic.Marshal(S256(), pub.X, pub.Y)