From 5d5d7dce3a3498bb3de4f76127224386099cfa98 Mon Sep 17 00:00:00 2001 From: joamag Date: Sat, 21 Mar 2020 18:00:25 +0000 Subject: [PATCH] New HMAC string values --- api_dropbox/src/api_dropbox/system.py | 4 ++-- api_openid/src/api_openid/system.py | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/api_dropbox/src/api_dropbox/system.py b/api_dropbox/src/api_dropbox/system.py index daf6cda9ff..217707ef05 100644 --- a/api_dropbox/src/api_dropbox/system.py +++ b/api_dropbox/src/api_dropbox/system.py @@ -57,7 +57,7 @@ """ The content type charset value """ HMAC_SHA1_VALUE = "HMAC-SHA1" -""" The hmac SHA1 value """ +""" The HMAC SHA1 value """ RSA_SHA1_VALUE = "RSA-SHA1" """ The RSA SHA1 value """ @@ -89,7 +89,7 @@ HMAC_HASH_MODULES_MAP = { HMAC_SHA1_VALUE : hashlib.sha1 } -""" The map associating the hmac values with the hashlib hash function modules """ +""" The map associating the HMAC values with the hashlib hash function modules """ BASE_REST_URL = "http://api.dropbox.com/1/" """ The base REST URL to be used """ diff --git a/api_openid/src/api_openid/system.py b/api_openid/src/api_openid/system.py index 6d7c406828..7a29b476d1 100644 --- a/api_openid/src/api_openid/system.py +++ b/api_openid/src/api_openid/system.py @@ -122,7 +122,7 @@ """ The id res value """ HMAC_SHA1_VALUE = "HMAC-SHA1" -""" The hmac SHA1 value """ +""" The HMAC SHA1 value """ HMAC_SHA256_VALUE = "HMAC-SHA256" """ The HMAC SHA256 value """ @@ -160,7 +160,7 @@ DH_SHA1_VALUE : hashlib.sha1, DH_SHA256_VALUE : hashlib.sha1 } -""" The map associating the hmac values with the hashlib +""" The map associating the HMAC values with the hashlib hash function modules """ DIFFIE_HELLMAN_ASSOCIATION_TYPES = ( @@ -635,7 +635,7 @@ def get_response_parameters(self): # decodes the MAC key using Base64 decoded_mac_key = base64.b64decode(self.openid_structure.mac_key) - # retrieves the hash module from the hmac hash modules map + # retrieves the hash module from the HMAC hash modules map hash_module = HMAC_HASH_MODULES_MAP.get(mac_key_type, None) # encodes the key value in order to be used in the xor operation @@ -755,11 +755,11 @@ def _get_mac_key_type(self): return self.openid_structure.association_type # in case the current session is of type DH SHA1 elif self.openid_structure.session_type == DH_SHA1_VALUE: - # returns the hmac SHA1 value + # returns the HMAC SHA1 value return HMAC_SHA1_VALUE # in case the current session is of type DH SHA256 elif self.openid_structure.session_type == DH_SHA256_VALUE: - # returns the hmac sha256 value + # returns the HMAC sha256 value return HMAC_SHA256_VALUE def _generate_signature(self): @@ -795,7 +795,7 @@ def _generate_signature(self): # decodes the signature MAC key from Base64 signature_mac_key = base64.b64decode(self.openid_structure.mac_key) - # retrieves the hash module from the hmac hash modules map + # retrieves the hash module from the HMAC hash modules map hash_module = HMAC_HASH_MODULES_MAP.get(self.openid_structure.association_type, None) # in case no hash module is set @@ -1205,7 +1205,7 @@ def openid_verify(self, return_openid_structure, strict = True): # decodes the signature MAC key from Base64 signature_mac_key = base64.b64decode(self.openid_structure.mac_key) - # retrieves the hash module from the hmac hash modules map + # retrieves the hash module from the HMAC hash modules map hash_module = HMAC_HASH_MODULES_MAP.get(self.openid_structure.association_type, None) # in case no hash module is set