Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions flaskserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@


def flask_server():
# python -O silently strips assert statements, so refuse to run unchecked
if not __debug__:
raise Exception('Refusing to run with assertions disabled (python -O)')

# Load, verify, and cache server static key at startup
# (Refuse to start if key non-existing or invalid)
PINServerECDH.load_private_key()
Expand Down
2 changes: 1 addition & 1 deletion pindb.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def _load_pin_fields(cls, pin_pubkey_hash, pin_pubkey, aes_pin_data_key):
assert version_bytes == version
hmac_payload = hmac_sha256(pin_auth_key, version_bytes + encrypted)

assert hmac_payload == hmac_received
assert compare_digest(hmac_payload, hmac_received)

storage_aes_key = hmac_sha256(aes_pin_data_key, pin_pubkey)
plaintext = decrypt(storage_aes_key, encrypted)
Expand Down
Loading