diff options
author | Bo <bohende@gmail.com> | 2017-11-13 04:24:42 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-11-13 04:24:42 +0800 |
commit | cb8bbe70819839e6399c44fff6a75ab3d16b8791 (patch) | |
tree | 1beb6efbe63416f7921f4914d228cc7d78b49c09 /vendor/golang.org/x/crypto/openpgp | |
parent | f47adc9ea8f16544a023ea9b67d1ed320750c5e7 (diff) | |
download | dexon-cb8bbe70819839e6399c44fff6a75ab3d16b8791.tar.gz dexon-cb8bbe70819839e6399c44fff6a75ab3d16b8791.tar.zst dexon-cb8bbe70819839e6399c44fff6a75ab3d16b8791.zip |
puppeth: handle encrypted ssh keys (closes #15442) (#15443)
* cmd/puppeth: handle encrypted ssh keys
* cmd/puppeth: fix unconvert linter error
Diffstat (limited to 'vendor/golang.org/x/crypto/openpgp')
-rw-r--r-- | vendor/golang.org/x/crypto/openpgp/packet/symmetric_key_encrypted.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vendor/golang.org/x/crypto/openpgp/packet/symmetric_key_encrypted.go b/vendor/golang.org/x/crypto/openpgp/packet/symmetric_key_encrypted.go index 4b1105b6f..744c2d2c4 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/symmetric_key_encrypted.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/symmetric_key_encrypted.go @@ -88,10 +88,10 @@ func (ske *SymmetricKeyEncrypted) Decrypt(passphrase []byte) ([]byte, CipherFunc return nil, ske.CipherFunc, errors.UnsupportedError("unknown cipher: " + strconv.Itoa(int(cipherFunc))) } plaintextKey = plaintextKey[1:] - if l := len(plaintextKey); l == 0 || l%cipherFunc.blockSize() != 0 { - return nil, cipherFunc, errors.StructuralError("length of decrypted key not a multiple of block size") + if l, cipherKeySize := len(plaintextKey), cipherFunc.KeySize(); l != cipherFunc.KeySize() { + return nil, cipherFunc, errors.StructuralError("length of decrypted key (" + strconv.Itoa(l) + ") " + + "not equal to cipher keysize (" + strconv.Itoa(cipherKeySize) + ")") } - return plaintextKey, cipherFunc, nil } |