File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ def is_valid_hmac(dict_object, hmac_key):
4545 del dict_object ['additionalData' ]
4646 merchant_sign = generate_hpp_sig (dict_object , hmac_key )
4747 merchant_sign_str = merchant_sign .decode ("utf-8" )
48- return merchant_sign_str == expected_sign
48+ return hmac . compare_digest ( merchant_sign_str , expected_sign )
4949
5050
5151def generate_notification_sig (dict_object , hmac_key ):
@@ -97,4 +97,4 @@ def is_valid_hmac_notification(dict_object, hmac_key):
9797 del dict_object ['additionalData' ]
9898 merchant_sign = generate_notification_sig (dict_object , hmac_key )
9999 merchant_sign_str = merchant_sign .decode ("utf-8" )
100- return merchant_sign_str == expected_sign
100+ return hmac . compare_digest ( merchant_sign_str , expected_sign )
You can’t perform that action at this time.
0 commit comments