|
|
|
@ -19,19 +19,26 @@ class TheOperator(Operator):
|
|
|
|
|
def phone(self):
|
|
|
|
|
global TELEPHONE
|
|
|
|
|
from komrade.backend.the_telephone import TheTelephone
|
|
|
|
|
if not TELEPHONE: TELEPHONE=TheTelephone(allow_builtin=False)
|
|
|
|
|
if not TELEPHONE: TELEPHONE=TheTelephone()
|
|
|
|
|
return TELEPHONE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, name = OPERATOR_NAME, passphrase='acc', keychain = {}):
|
|
|
|
|
def __init__(self, name = OPERATOR_NAME, passphrase='acc'):
|
|
|
|
|
"""
|
|
|
|
|
Boot up the operator. Requires knowing or setting a password of memory.
|
|
|
|
|
"""
|
|
|
|
|
# init req paths
|
|
|
|
|
# if not os.path.exists(PATH_OPERATOR): os.makedirs(PATH_OPERATOR)
|
|
|
|
|
if not passphrase:
|
|
|
|
|
passphrase=getpass.getpass('Hello, this is the Operator speaking. What is the passphrase?\n> ')
|
|
|
|
|
super().__init__(name,passphrase,path_crypt_keys=PATH_CRYPT_OP_KEYS,path_crypt_data=PATH_CRYPT_OP_DATA,keychain=keychain)
|
|
|
|
|
global OPERATOR_KEYCHAIN,TELEPHONE_KEYCHAIN
|
|
|
|
|
if not TELEPHONE_KEYCHAIN or not OPERATOR_KEYCHAIN:
|
|
|
|
|
OPERATOR_KEYCHAIN,TELEPHONE_KEYCHAIN = connect_phonelines()
|
|
|
|
|
if not passphrase: passphrase=getpass.getpass('Hello, this is the Operator speaking. What is the passphrase?\n> ')
|
|
|
|
|
super().__init__(
|
|
|
|
|
name,
|
|
|
|
|
passphrase,
|
|
|
|
|
keychain=OPERATOR_KEYCHAIN,
|
|
|
|
|
path_crypt_keys=PATH_CRYPT_OP_KEYS,
|
|
|
|
|
path_crypt_data=PATH_CRYPT_OP_DATA)
|
|
|
|
|
|
|
|
|
|
def decrypt_incoming(self,data):
|
|
|
|
|
# step 1 split:
|
|
|
|
|