From f6f7b3a1b95ab468c0675485b63e64fd062758b1 Mon Sep 17 00:00:00 2001 From: Puneetha Karamsetty Date: Wed, 17 Oct 2018 10:21:15 +0100 Subject: [PATCH] Fix sending to self (#49) --- CHANGELOG.md | 30 +++++++++++++++++++++++------- enclave/enclave.go | 16 ++++++++-------- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f25cb5f..30dcc68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,23 @@ -## 1.0.0 - 2018-07-05 -### Added - - Crux, a secure enclave for Quorum written in Golang - - Protobuf and gRPC support. - - TLS support - - Docker images - \ No newline at end of file + ## 1.0.3 - 2018-10-17 + ### Added + - Network interface paramater to configuration + ### Changed + - Fix formatting of entire project using `go fmt` + - Fix "apk WARNING Ignoring APKINDEX" + - Fix sending payload to multiple recipients + + ## 1.0.2 - 2018-09-06 + ### Added + - Delete and Resend API from Chimera included. + + ## 1.0.1 - 2018-08-22 + ### Changed + - Fix issue with config file load + + ## 1.0.0 - 2018-07-05 + ### Added + - Crux, a secure enclave for Quorum written in Golang + - Protobuf and gRPC support. + - TLS support + - Docker images + \ No newline at end of file diff --git a/enclave/enclave.go b/enclave/enclave.go index 91e5253..bd0cf81 100644 --- a/enclave/enclave.go +++ b/enclave/enclave.go @@ -139,6 +139,14 @@ func (s *SecureEnclave) store( senderPubKey, senderPrivKey nacl.Key, recipients [][]byte) ([]byte, error) { + var toSelf bool + if len(recipients) == 0 { + toSelf = true + recipients = [][]byte{(*s.selfPubKey)[:]} + } else { + toSelf = false + } + epl, masterKey := createEncryptedPayload(message, senderPubKey, recipients) for i, recipient := range recipients { @@ -163,14 +171,6 @@ func (s *SecureEnclave) store( epl.RecipientBoxes[i] = sealedBox } - var toSelf bool - if len(recipients) == 0 { - toSelf = true - recipients = [][]byte{(*s.selfPubKey)[:]} - } else { - toSelf = false - } - // store locally recipientKey, err := utils.ToKey(recipients[0]) if err != nil {