Skip to content
This repository was archived by the owner on Apr 13, 2024. It is now read-only.

Commit c5163f8

Browse files
committed
Throw exception on algorithm signature parameter and dervice algorithm mismatch
1 parent f97f6c0 commit c5163f8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

httpsig/verify.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ def __init__(self, headers, secret, required_headers=None, method=None,
9090
self.path = path
9191
self.host = host
9292

93+
if 'algorithm' in self.auth_dict and self.auth_dict['algorithm'] != self.algorithm:
94+
raise HttpSigException(
95+
"Algorithm mismath, signature parameter algorithm was: {}, but algorithm dervice from key is: {}".format(
96+
self.auth_dict['algorithm'], self.algorithm))
97+
9398
if self.auth_dict['algorithm'] != DEFAULT_ALGORITHM:
9499
print("Algorithm: {} is deprecated please update to {}".format(self.auth_dict['algorithm'], DEFAULT_ALGORITHM))
95100
elif self.auth_dict['algorithm'] == DEFAULT_ALGORITHM and sign_algorithm is None:

0 commit comments

Comments
 (0)