signer/storage: fix a badly ordered error check (#21379)

pull/21358/head
6543 4 years ago committed by GitHub
parent 8e7bee9b56
commit 79ce5537ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      cmd/clef/docs/setup.md
  2. 2
      cmd/faucet/faucet.html
  3. 6
      signer/storage/aes_gcm_storage.go

@ -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. 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 ```python

@ -49,7 +49,7 @@
<div class="row"> <div class="row">
<div class="col-lg-8 col-lg-offset-2"> <div class="col-lg-8 col-lg-offset-2">
<div class="input-group"> <div class="input-group">
<input id="url" name="url" type="text" class="form-control" placeholder="Social network URL containing your Ethereum address..."> <input id="url" name="url" type="text" class="form-control" placeholder="Social network URL containing your Ethereum address..."/>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Give me Ether <i class="fa fa-caret-down" aria-hidden="true"></i></button> <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Give me Ether <i class="fa fa-caret-down" aria-hidden="true"></i></button>
<ul class="dropdown-menu dropdown-menu-right">{{range $idx, $amount := .Amounts}} <ul class="dropdown-menu dropdown-menu-right">{{range $idx, $amount := .Amounts}}

@ -151,11 +151,11 @@ func encrypt(key []byte, plaintext []byte, additionalData []byte) ([]byte, []byt
return nil, nil, err return nil, nil, err
} }
aesgcm, err := cipher.NewGCM(block) aesgcm, err := cipher.NewGCM(block)
nonce := make([]byte, aesgcm.NonceSize()) if err != nil {
if _, err := io.ReadFull(rand.Reader, nonce); err != nil {
return nil, nil, err 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 return nil, nil, err
} }
ciphertext := aesgcm.Seal(nil, nonce, plaintext, additionalData) ciphertext := aesgcm.Seal(nil, nonce, plaintext, additionalData)

Loading…
Cancel
Save