diff --git a/httpsig/verify.py b/httpsig/verify.py index 055a74a..7158c7b 100644 --- a/httpsig/verify.py +++ b/httpsig/verify.py @@ -90,6 +90,11 @@ def __init__(self, headers, secret, required_headers=None, method=None, self.path = path self.host = host + if 'algorithm' in self.auth_dict and self.auth_dict['algorithm'] != self.algorithm: + raise HttpSigException( + "Algorithm mismath, signature parameter algorithm was: {}, but algorithm dervice from key is: {}".format( + self.auth_dict['algorithm'], self.algorithm)) + if self.auth_dict['algorithm'] != DEFAULT_ALGORITHM: print("Algorithm: {} is deprecated please update to {}".format(self.auth_dict['algorithm'], DEFAULT_ALGORITHM)) elif self.auth_dict['algorithm'] == DEFAULT_ALGORITHM and sign_algorithm is None: