switch from hardware object to string

and replace mac address to disk serial number
for more predictable hash key
This commit is contained in:
Alex Bezdieniezhnykh
2025-05-02 09:41:04 +03:00
parent 28069f63f9
commit 59eb39d447
7 changed files with 16 additions and 50 deletions
+2 -4
View File
@@ -3,8 +3,6 @@ import hashlib
import os
from hashlib import sha384
from credentials cimport Credentials
from hardware_service cimport HardwareInfo
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.primitives import padding
@@ -48,8 +46,8 @@ cdef class Security:
return bytes(plaintext_bytes)
@staticmethod
cdef get_hw_hash(HardwareInfo hardware):
cdef str key = f'Azaion_{hardware.mac_address}_{hardware.cpu}_{hardware.gpu}'
cdef get_hw_hash(str hardware):
cdef str key = f'Azaion_{hardware}_%$$$)0_'
return Security.calc_hash(key)
@staticmethod