diff --git a/httpsig/sign.py b/httpsig/sign.py index a75d5e7..6cd6811 100644 --- a/httpsig/sign.py +++ b/httpsig/sign.py @@ -30,6 +30,8 @@ def __init__(self, secret, algorithm=None, sign_algorithm=None): if algorithm != DEFAULT_ALGORITHM: print("Algorithm: {} is deprecated please update to {}".format(algorithm, DEFAULT_ALGORITHM)) + elif algorithm == DEFAULT_ALGORITHM and sign_algorithm is None: + raise HttpSigException("Required sign algorithm for {} algorithm not set".format(DEFAULT_ALGORITHM)) if isinstance(secret, six.string_types): secret = secret.encode("ascii") diff --git a/httpsig/verify.py b/httpsig/verify.py index 5fb9381..b06e629 100644 --- a/httpsig/verify.py +++ b/httpsig/verify.py @@ -98,13 +98,8 @@ def __init__(self, headers, secret, required_headers=None, method=None, self.host = host self.derived_algorithm = 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: - raise HttpSigException("Required sign algorithm for {} algorithm not set".format(DEFAULT_ALGORITHM)) - super(HeaderVerifier, self).__init__( - secret, algorithm=self.auth_dict['algorithm'], sign_algorithm=sign_algorithm) + secret, algorithm=self.auth_dict['algorithm'], sign_algorithm=sign_algorithm) def verify(self): """