diff options
author | Ben Schmeckpeper <ben.schmeckpeper@gmail.com> | 2022-07-20 11:43:40 -0500 |
---|---|---|
committer | Ben Schmeckpeper <ben.schmeckpeper@gmail.com> | 2022-07-20 11:51:21 -0500 |
commit | 6792bebca7c4a92f7145811fc0cd3ba8551cb8a4 (patch) | |
tree | 5a617a73d32c7ff06e7070b1f15a3b32babcf6c0 | |
parent | 27c51ba2013362857c153bc370ea3ecd156a2b07 (diff) | |
download | net-ssh-6792bebca7c4a92f7145811fc0cd3ba8551cb8a4.tar.gz |
Raise an error if BCryptPbkdf doesn't give us a key
This can happen if we request fewer than 1 round or if the password or salt are
blank or keylen + ivlen is zero.
-rw-r--r-- | lib/net/ssh/authentication/ed25519.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/net/ssh/authentication/ed25519.rb b/lib/net/ssh/authentication/ed25519.rb index dccc64f..892000a 100644 --- a/lib/net/ssh/authentication/ed25519.rb +++ b/lib/net/ssh/authentication/ed25519.rb @@ -77,6 +77,7 @@ module Net raise "BCryptPbkdf is not implemented for jruby" if RUBY_PLATFORM == "java" key = BCryptPbkdf::key(password, salt, keylen + ivlen, rounds) + raise DecryptError.new("BCyryptPbkdf failed", encrypted_key: true) unless key else key = '\x00' * (keylen + ivlen) end |