diff options
author | Jared Hobbs <jared@pyhacker.com> | 2018-12-10 12:44:18 -0700 |
---|---|---|
committer | Jared Hobbs <jared@pyhacker.com> | 2018-12-10 12:44:18 -0700 |
commit | 242be1a5c978ed1ddeb4ab3b40e0cf5b1e97b9de (patch) | |
tree | a8685541d1c2ab0c705336c9a5b4996c0eea3b86 | |
parent | 79a6bbfe53842b2385fb77497f39f38d6a61c0fd (diff) |
ignore few rounds in bcrypt kdf call
-rw-r--r-- | paramiko/pkey.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/paramiko/pkey.py b/paramiko/pkey.py index 9db4dfe7..f2447e15 100644 --- a/paramiko/pkey.py +++ b/paramiko/pkey.py @@ -429,7 +429,15 @@ class PKey(object): salt, rounds = self._uint32_cstruct_unpack(kdf_options, "su") # run bcrypt kdf to derive key and iv/nonce (32 + 16 bytes) - key_iv = bcrypt.kdf(b(password), b(salt), 48, rounds) + key_iv = bcrypt.kdf( + b(password), + b(salt), + 48, + rounds, + # We can't control how many rounds are on disk, so no sense + # warning about it. + ignore_few_rounds=True, + ) key = key_iv[:32] iv = key_iv[32:] |