Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(KC-799)security-audit-report Bug-fix: #1274

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion keepercommander/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
# Contact: ops@keepersecurity.com
#

__version__ = '16.11.6'
__version__ = '16.11.7'
2 changes: 1 addition & 1 deletion keepercommander/commands/security_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def decrypt_security_data(sec_data, k): # type: (bytes, RSAPrivateKey) -> Dict[
decrypted = None
if sec_data:
try:
decrypted = crypto.decrypt_rsa(sec_data, k, pad_plaintext=True)
decrypted = crypto.decrypt_rsa(sec_data, k, apply_padding=True)
except Exception as e:
error = f'Decrypt fail (incremental data): {e}'
self.get_error_report_builder().update_report_data(error)
Expand Down
6 changes: 3 additions & 3 deletions keepercommander/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ def encrypt_rsa(data, rsa_key):
return rsa_key.encrypt(data, PKCS1v15())


def decrypt_rsa(data, rsa_key, pad_plaintext=False):
size_diff = (rsa_key.key_size >> 3) - len(data)
if pad_plaintext and size_diff:
def decrypt_rsa(data, rsa_key, apply_padding=False):
size_diff = (rsa_key.key_size + 7 >> 3) - len(data)
if apply_padding and size_diff > 0:
pad_bytes = bytes(size_diff)
pad_bytearray = bytearray([b for b in pad_bytes])
data_bytearray = bytearray([b for b in data])
Expand Down
Loading