SHA1 HMAC is a keyed 160bit CRC anyway. Use that

crc16
Simon 4 years ago
parent 078cf4a84a
commit 0230c39f9a
No known key found for this signature in database
GPG Key ID: 6ACF11630B5D8F82

@ -2058,13 +2058,13 @@ class routerHBP(HBSYSTEM):
systems[system]._report.send_bridgeEvent('UNIT DATA,START,TX,{},{},{},{},{},{}'.format(_target, int_id(_stream_id), int_id(_peer_id), int_id(_rf_src), 1, _int_dst_id).encode(encoding='utf-8', errors='ignore'))
def dmrd_received(self, _peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data):
def dmrd_received(self, _peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data,_hash):
pkt_time = time()
dmrpkt = _data[20:53]
_bits = _data[15]
#_pkt_crc = Crc32.calc(_data[4:53])
_pkt_crc = _data[53:]
_pkt_crc = _hash
_nine = bytes_3(9)

@ -33,7 +33,7 @@ from binascii import a2b_hex as bhex
from random import randint
from hashlib import sha256, sha1
from hmac import new as hmac_new, compare_digest
from time import time
from collections import deque
# Twisted is pretty important, so I keep it separate
@ -166,7 +166,7 @@ class OPENBRIDGE(DatagramProtocol):
logger.debug('(%s) *BridgeControl* Not sent BCSQ Source Quench TARGET_IP not known , TG: %s, Stream ID: %s',self._system,int_id(_tgid))
def dmrd_received(self, _peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data):
def dmrd_received(self, _peer_id, _rf_src, _dst_id, _seq, _slot, _call_type, _frame_type, _dtype_vseq, _stream_id, _data,_hash):
pass
#print(int_id(_peer_id), int_id(_rf_src), int_id(_dst_id), int_id(_seq), _slot, _call_type, _frame_type, repr(_dtype_vseq), int_id(_stream_id))

Loading…
Cancel
Save

Powered by TurnKey Linux.