From 6031fed29f3e81450b48b73eba0f9e716efcb73f Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Tue, 28 Jul 2015 16:12:40 +0200 Subject: [PATCH] Change internal rsa_(public|private)_key variable names In two places the vault plugin refers to rsa public or rsa private key although the code can handle just any kind of asymmetric algorithms, e.g. ECDSA. The patch just renames the occurences to avoid more confusion in the future. Reviewed-By: Simo Sorce Reviewed-By: Martin Basti --- ipalib/plugins/vault.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ipalib/plugins/vault.py b/ipalib/plugins/vault.py index 83dc085b5aadb4e2878e29d17449f0808cc7a9c2..4b2c8a518e5c9a93e5490841a3d2177536c905b1 100644 --- a/ipalib/plugins/vault.py +++ b/ipalib/plugins/vault.py @@ -486,11 +486,11 @@ class vault(LDAPObject): return fernet.encrypt(data) elif public_key: - rsa_public_key = load_pem_public_key( + public_key_obj = load_pem_public_key( data=public_key, backend=default_backend() ) - return rsa_public_key.encrypt( + return public_key_obj.encrypt( data, padding.OAEP( mgf=padding.MGF1(algorithm=hashes.SHA1()), @@ -513,12 +513,12 @@ class vault(LDAPObject): elif private_key: try: - rsa_private_key = load_pem_private_key( + private_key_obj = load_pem_private_key( data=private_key, password=None, backend=default_backend() ) - return rsa_private_key.decrypt( + return private_key_obj.decrypt( data, padding.OAEP( mgf=padding.MGF1(algorithm=hashes.SHA1()), -- 2.4.3