Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.backends import default_backend
from cryptography.exceptions import InvalidKey, InvalidTag
from ed25519 import BadSignatureError


from nacl.signing import VerifyKey
from nacl.exceptions import BadSignatureError

import argparse
import ed25519
#import ed25519
import base64
import json
import sys
Expand Down Expand Up @@ -47,14 +51,13 @@

# Verify using Ed25519
try:
verify_key = ed25519.VerifyingKey(
os.environ['KEYGEN_PUBLIC_KEY'].encode(),
encoding='hex',
verify_key = VerifyKey(
bytes.fromhex(os.environ['KEYGEN_PUBLIC_KEY'])
)

verify_key.verify(
base64.b64decode(sig),
('license/%s' % enc).encode(),
base64.b64decode(sig),
)
except (AssertionError, BadSignatureError):
print('[error] verification failed!')
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
argparse
cryptography
ed25519
#ed25519
pynacl