mirror of
https://github.com/aljazceru/python-teos.git
synced 2026-02-19 21:44:20 +01:00
Changed log format to JSON; fixed missing return value in get_potential_matches
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user