mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
improved logging
This commit is contained in:
parent
1bdf070dfe
commit
cb813ba402
2 changed files with 5 additions and 4 deletions
|
@ -497,7 +497,8 @@ def bool_to_string(state):
|
||||||
|
|
||||||
def get_hmac_salt(dxcallsign: bytes, mycallsign: bytes):
|
def get_hmac_salt(dxcallsign: bytes, mycallsign: bytes):
|
||||||
filename = f"freedata_hmac_STATION_{dxcallsign.decode('utf-8')}_REMOTE_{mycallsign.decode('utf-8')}.txt"
|
filename = f"freedata_hmac_STATION_{dxcallsign.decode('utf-8')}_REMOTE_{mycallsign.decode('utf-8')}.txt"
|
||||||
print(f"looking for file {filename}")
|
log.info("[SCK] [HMAC] File lookup", file=filename)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(filename, "r") as file:
|
with open(filename, "r") as file:
|
||||||
line = file.readlines()
|
line = file.readlines()
|
||||||
|
|
|
@ -782,11 +782,11 @@ class ThreadedTCPRequestHandler(socketserver.StreamRequestHandler):
|
||||||
binarydata = base64.b64decode(base64data)
|
binarydata = base64.b64decode(base64data)
|
||||||
# check if hmac hash is provided
|
# check if hmac hash is provided
|
||||||
try:
|
try:
|
||||||
print("looking for hmac salt...")
|
log.info("[SCK] [HMAC] Looking for salt/token", local=mycallsign, remote=dxcallsign)
|
||||||
hmac_salt = helpers.get_hmac_salt(dxcallsign, mycallsign)
|
hmac_salt = helpers.get_hmac_salt(dxcallsign, mycallsign)
|
||||||
print(f" ... {hmac_salt}")
|
log.info("[SCK] [HMAC] Salt found", local=mycallsign, remote=dxcallsign, salt=hmac_salt)
|
||||||
except Exception:
|
except Exception:
|
||||||
print("no hmac salt found...")
|
log.warning("[SCK] [HMAC] No salt/token found")
|
||||||
hmac_salt = ''
|
hmac_salt = ''
|
||||||
DATA_QUEUE_TRANSMIT.put(
|
DATA_QUEUE_TRANSMIT.put(
|
||||||
["ARQ_RAW", binarydata, arq_uuid, mycallsign, dxcallsign, attempts, hmac_salt]
|
["ARQ_RAW", binarydata, arq_uuid, mycallsign, dxcallsign, attempts, hmac_salt]
|
||||||
|
|
Loading…
Reference in a new issue