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 <ssorce@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Christian Heimes 2015-07-28 16:12:40 +02:00 committed by Martin Basti
parent b202afbcc0
commit cee5d9007e

View File

@ -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()),