From dbb58973051359e7047664252d938da05957e0e7 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Fri, 25 Aug 2017 09:55:26 -0400 Subject: [PATCH] fix nil, initialize public and private key buffers --- contrib/backends/srndv2/src/srnd/util.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/backends/srndv2/src/srnd/util.go b/contrib/backends/srndv2/src/srnd/util.go index 2591458..bc3a346 100644 --- a/contrib/backends/srndv2/src/srnd/util.go +++ b/contrib/backends/srndv2/src/srnd/util.go @@ -414,13 +414,15 @@ func cryptoSignFucky(h, sk []byte) string { // convert seed to secret key func seedToKeyPair(seed []byte) (pub ed25519.PublicKey, full ed25519.PrivateKey) { + pub = make(ed25519.PublicKey, ed25519.PublicKeySize) + full = make(ed25519.PrivateKey, ed25519.PrivateKeySize) var in [32]byte var out [32]byte copy(in[:], seed[0:32]) curve25519.ScalarBaseMult(&out, &in) copy(pub[:], out[:]) copy(full[:], in[:]) - copy(full[:32], pub[:]) + copy(full[32:], pub[:]) return }