@@ -58,6 +58,7 @@ def verify_store_signature(store_response, duration, verifying_key) :
58
58
decoded_signature = base64 .urlsafe_b64decode (store_response ['signature' ])
59
59
60
60
vk = crypto .SIG_PublicKey (verifying_key )
61
+ # VerifySignature returns 1 for a valid sig, 0 for an invalid sig and -1 on error
61
62
return vk .VerifySignature (signing_hash , decoded_signature )
62
63
63
64
# -----------------------------------------------------------------
@@ -76,7 +77,7 @@ def verify_store_signature(store_response, duration, verifying_key) :
76
77
result = client .store_blocks ([block_data ], duration = default_duration )
77
78
assert result
78
79
79
- assert verify_store_signature (result , default_duration , client .verifying_key )
80
+ assert ( 1 == verify_store_signature (result , default_duration , client .verifying_key ) )
80
81
81
82
block_ids = result ['block_ids' ]
82
83
assert block_ids and len (block_ids ) == 1
@@ -109,7 +110,7 @@ def verify_store_signature(store_response, duration, verifying_key) :
109
110
result = client .store_blocks (block_data , duration = default_duration )
110
111
assert result
111
112
112
- assert verify_store_signature (result , default_duration , client .verifying_key )
113
+ assert ( 1 == verify_store_signature (result , default_duration , client .verifying_key ) )
113
114
114
115
block_ids = result ['block_ids' ]
115
116
logger .info ('RESULT: %s' , result )
0 commit comments