Skip to content

Commit

Permalink
Fix sending to self (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
Puneetha17 authored and conor10 committed Oct 17, 2018
1 parent eebdb98 commit f6f7b3a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 15 deletions.
30 changes: 23 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

## 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

16 changes: 8 additions & 8 deletions enclave/enclave.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit f6f7b3a

Please sign in to comment.