Skip to content

Commit

Permalink
signer/storage: fix a badly ordered error check (ethereum#21379)
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 authored and unclezoro committed Jan 11, 2021
1 parent 2a79ac1 commit 0a64615
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/clef/docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ with minimal requirements.
On the `client` qube, we need to create a listener which will receive the request from the Dapp, and proxy it.


[qubes-client.py](qubes/client/qubes-client.py):
[qubes-client.py](qubes/qubes-client.py):

```python

Expand Down
6 changes: 3 additions & 3 deletions signer/storage/aes_gcm_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ func encrypt(key []byte, plaintext []byte, additionalData []byte) ([]byte, []byt
return nil, nil, err
}
aesgcm, err := cipher.NewGCM(block)
nonce := make([]byte, aesgcm.NonceSize())
if _, err := io.ReadFull(rand.Reader, nonce); err != nil {
if err != nil {
return nil, nil, err
}
if err != nil {
nonce := make([]byte, aesgcm.NonceSize())
if _, err := io.ReadFull(rand.Reader, nonce); err != nil {
return nil, nil, err
}
ciphertext := aesgcm.Seal(nil, nonce, plaintext, additionalData)
Expand Down

0 comments on commit 0a64615

Please sign in to comment.