* cmd/puppeth: handle encrypted ssh keys * cmd/puppeth: fix unconvert linter error
This commit is contained in:
6
vendor/golang.org/x/crypto/openpgp/packet/symmetric_key_encrypted.go
generated
vendored
6
vendor/golang.org/x/crypto/openpgp/packet/symmetric_key_encrypted.go
generated
vendored
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user