Updated verify_signature_standard_ops to only return signature verification

This commit is contained in:
Vivek Teega 2022-07-10 13:29:31 +00:00
parent 0a3bf90767
commit a386de5197

View File

@ -403,7 +403,7 @@ def verify_signature(sig, pub_key, msg):
return True if result else False return True if result else False
def verify_signature_standard_ops(floID, pubKey, message, sign): def verify_signature_standard_ops(sig, pub_key, msg):
""" """
Verify signature for message and given public key Verify signature for message and given public key
@ -413,16 +413,14 @@ def verify_signature_standard_ops(floID, pubKey, message, sign):
:return: boolean. :return: boolean.
""" """
url = 'https://flo-sign-validator.duckdns.org' url = 'https://flo-sign-validator.duckdns.org'
myobj = { post_data = {
'floID': floID, 'pubKey': pub_key,
'pubKey': pubKey, 'message': msg,
'message': message, 'sign': sig
'sign': sign
} }
x = requests.post(url, json = myobj) signature_verification = requests.post(url, json = post_data)
x = json.loads(x.text) signature_verification = json.loads(signature_verification.text)
# Three possible cases over there.. 2 failures and 1 success return True if signature_verification['message_sign_match'] else return False
return x
def to_base(n, base): def to_base(n, base):
@ -635,4 +633,3 @@ def is_valid_signature_encoding(sig):
if (len_s > 1) and (sig[len_r + 6] == 0x00) and (not sig[len_r + 7] & 0x80): if (len_s > 1) and (sig[len_r + 6] == 0x00) and (not sig[len_r + 7] & 0x80):
return False return False
return True return True