aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/crypto/openpgp
diff options
context:
space:
mode:
authorBo <bohende@gmail.com>2017-11-13 04:24:42 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-11-13 04:24:42 +0800
commitcb8bbe70819839e6399c44fff6a75ab3d16b8791 (patch)
tree1beb6efbe63416f7921f4914d228cc7d78b49c09 /vendor/golang.org/x/crypto/openpgp
parentf47adc9ea8f16544a023ea9b67d1ed320750c5e7 (diff)
downloadgo-tangerine-cb8bbe70819839e6399c44fff6a75ab3d16b8791.tar
go-tangerine-cb8bbe70819839e6399c44fff6a75ab3d16b8791.tar.gz
go-tangerine-cb8bbe70819839e6399c44fff6a75ab3d16b8791.tar.bz2
go-tangerine-cb8bbe70819839e6399c44fff6a75ab3d16b8791.tar.lz
go-tangerine-cb8bbe70819839e6399c44fff6a75ab3d16b8791.tar.xz
go-tangerine-cb8bbe70819839e6399c44fff6a75ab3d16b8791.tar.zst
go-tangerine-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.go6
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
}