mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
Encrypt the data store instead of signing it.
This commit is contained in:
parent
1e514b57c5
commit
36f8fff888
@ -157,7 +157,6 @@ class Unwrapper(object):
|
|||||||
|
|
||||||
self.type = msg_type
|
self.type = msg_type
|
||||||
self.message = "".join(Unwrapper.unwrap(self.body, self.type)).lstrip()
|
self.message = "".join(Unwrapper.unwrap(self.body, self.type)).lstrip()
|
||||||
self.gpg_data.message = self.message
|
|
||||||
|
|
||||||
return self.gpg_data
|
return self.gpg_data
|
||||||
|
|
||||||
|
|||||||
@ -500,13 +500,16 @@ class Santiago(object):
|
|||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
logging.exception(e)
|
logging.exception(e)
|
||||||
data = dict()
|
data = dict()
|
||||||
|
else:
|
||||||
for message in pgpprocessor.Unwrapper(data, gpg=self.gpg):
|
for message in pgpprocessor.Unwrapper(data, gpg=self.gpg):
|
||||||
|
# iterations end when unwrapping complete.
|
||||||
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
data = dict(ast.literal_eval(message.message))
|
data = dict(ast.literal_eval(str(message)))
|
||||||
except ValueError as e:
|
except (ValueError, SyntaxError) as e:
|
||||||
logging.exception(e)
|
logging.exception(e)
|
||||||
continue
|
data = dict()
|
||||||
|
|
||||||
logging.debug("santiago.Santiago.load_data: found {0}: {1}".format(
|
logging.debug("santiago.Santiago.load_data: found {0}: {1}".format(
|
||||||
key, data))
|
key, data))
|
||||||
@ -537,10 +540,17 @@ class Santiago(object):
|
|||||||
|
|
||||||
data = Santiago.convert_data(data, list)
|
data = Santiago.convert_data(data, list)
|
||||||
|
|
||||||
data = str(self.gpg.sign(str(data), keyid=self.me))
|
logging.debug(
|
||||||
|
"santiago.Santiago.save_data: saving {0}: {1}".format(key, data))
|
||||||
|
|
||||||
|
data = str(self.gpg.encrypt(str(data), recipients=[self.me],
|
||||||
|
sign=self.me))
|
||||||
|
|
||||||
self.shelf[key] = data
|
self.shelf[key] = data
|
||||||
|
|
||||||
|
logging.debug(
|
||||||
|
"santiago.Santiago.save_data: saved {0}: {1}".format(key, data))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def convert_data(cls, data, acallable):
|
def convert_data(cls, data, acallable):
|
||||||
"""Convert the data in the sub-dictionary by calling callable on it.
|
"""Convert the data in the sub-dictionary by calling callable on it.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user