Changed log format to JSON; fixed missing return value in get_potential_matches

This commit is contained in:
Salvatore Ingala
2019-10-08 16:32:09 +07:00
parent 1b229cb441
commit ed0cb4f632
11 changed files with 87 additions and 85 deletions

View File

@@ -1,8 +1,7 @@
from hashlib import sha256
from binascii import unhexlify, hexlify
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
from pisa import logging
from pisa import logging, M
# FIXME: EncryptedBlob is assuming AES-128-GCM. A cipher field should be part of the object and the decryption should be
@@ -23,11 +22,12 @@ class EncryptedBlob:
sk = master_key[:16]
nonce = master_key[16:]
logging.info("[Watcher] creating new blob")
logging.info("[Watcher] master key: {}".format(hexlify(master_key).decode()))
logging.info("[Watcher] sk: {}".format(hexlify(sk).decode()))
logging.info("[Watcher] nonce: {}".format(hexlify(nonce).decode()))
logging.info("[Watcher] encrypted_blob: {}".format(self.data))
logging.info(M("[Watcher] creating new blob.",
master_key=hexlify(master_key).decode(),
sk=hexlify(sk).decode(),
nonce=hexlify(sk).decode(),
encrypted_blob=self.data
))
# Decrypt
aesgcm = AESGCM(sk)