|
3 | 3 | from cryptography.hazmat.backends import default_backend |
4 | 4 | from cryptography.exceptions import InvalidKey, InvalidTag |
5 | 5 | from ed25519 import BadSignatureError |
6 | | -from uuid import getnode as get_mac |
| 6 | +import machineid |
7 | 7 | import argparse |
8 | 8 | import ed25519 |
9 | 9 | import base64 |
10 | 10 | import json |
11 | 11 | import sys |
12 | 12 | import os |
13 | 13 |
|
14 | | -def fingerprint(): |
15 | | - """ |
16 | | - fingerprint returns a hex-encoded SHA-256 digest of the current MAC address. |
17 | | - """ |
18 | | - mac = str(get_mac()) |
19 | | - digest = hashes.Hash(hashes.SHA256()) |
20 | | - digest.update(mac.encode()) |
21 | | - return digest.finalize().hex() |
22 | | - |
23 | 14 | parser = argparse.ArgumentParser() |
24 | 15 |
|
25 | | -parser.add_argument('-p', '--path', dest='path', required=True, help='Path to machine file (required)') |
26 | | -parser.add_argument('-l', '--license', dest='license', required=True, help='License key (required)') |
27 | | -parser.add_argument('-f', '--fingerprint', dest='fingerprint', default=fingerprint(), help='Machine fingerprint') |
| 16 | +parser.add_argument('-p', '--path', dest='path', required=True, help='Path to machine file (required)') |
| 17 | +parser.add_argument('-l', '--license', dest='license', required=True, help='License key (required)') |
| 18 | +parser.add_argument('-f', '--fingerprint', dest='fingerprint', default=machineid.hashed_id('example-app'), help='Machine fingerprint') |
28 | 19 |
|
29 | 20 | args = parser.parse_args() |
30 | 21 |
|
|
0 commit comments