diff options
| author | mo khan <mo.khan@gmail.com> | 2021-01-30 21:37:05 -0700 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2021-01-30 21:37:05 -0700 |
| commit | 9d46474008bcf7945a8c4a479852ccfd3d6fa811 (patch) | |
| tree | cfeeb0065e0bc25897f117d78af80f8ced148742 /lib/xml/kit/decryption.rb | |
| parent | 2bdb4a1b341160c52a39cc0d339f6f6b4514ad08 (diff) | |
style: fix linter errorsv0.5.0
Diffstat (limited to 'lib/xml/kit/decryption.rb')
| -rw-r--r-- | lib/xml/kit/decryption.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/xml/kit/decryption.rb b/lib/xml/kit/decryption.rb index 98535bc..0a9aa29 100644 --- a/lib/xml/kit/decryption.rb +++ b/lib/xml/kit/decryption.rb @@ -56,12 +56,10 @@ module Xml def symmetric_key_from(encrypted_key, attempts = private_keys.count) cipher, algorithm = cipher_and_algorithm_from(encrypted_key) private_keys.each do |private_key| - begin - attempts -= 1 - return to_plaintext(cipher, private_key, algorithm) - rescue OpenSSL::PKey::RSAError - raise if attempts.zero? - end + attempts -= 1 + return to_plaintext(cipher, private_key, algorithm) + rescue OpenSSL::PKey::RSAError + raise if attempts.zero? end raise DecryptionError, private_keys end |
