mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
new: fixed rsa identity generation and implemented api enrollment plugin
This commit is contained in:
@ -1,14 +1,4 @@
|
||||
import os
|
||||
|
||||
from Crypto.PublicKey import RSA
|
||||
import hashlib
|
||||
|
||||
def new_session_id():
|
||||
return ':'.join(['%02x' % b for b in os.urandom(6)])
|
||||
|
||||
|
||||
def get_identity(config):
|
||||
pubkey = None
|
||||
with open(config['main']['pubkey']) as fp:
|
||||
pubkey = RSA.importKey(fp.read())
|
||||
return pubkey, hashlib.sha256(pubkey.exportKey('DER')).hexdigest()
|
||||
|
Reference in New Issue
Block a user