mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-02-11 08:23:49 +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.message = "".join(Unwrapper.unwrap(self.body, self.type)).lstrip()
|
||||
self.gpg_data.message = self.message
|
||||
|
||||
return self.gpg_data
|
||||
|
||||
|
||||
@ -500,13 +500,16 @@ class Santiago(object):
|
||||
except KeyError as e:
|
||||
logging.exception(e)
|
||||
data = dict()
|
||||
else:
|
||||
for message in pgpprocessor.Unwrapper(data, gpg=self.gpg):
|
||||
# iterations end when unwrapping complete.
|
||||
pass
|
||||
|
||||
for message in pgpprocessor.Unwrapper(data, gpg=self.gpg):
|
||||
try:
|
||||
data = dict(ast.literal_eval(message.message))
|
||||
except ValueError as e:
|
||||
data = dict(ast.literal_eval(str(message)))
|
||||
except (ValueError, SyntaxError) as e:
|
||||
logging.exception(e)
|
||||
continue
|
||||
data = dict()
|
||||
|
||||
logging.debug("santiago.Santiago.load_data: found {0}: {1}".format(
|
||||
key, data))
|
||||
@ -537,10 +540,17 @@ class Santiago(object):
|
||||
|
||||
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
|
||||
|
||||
logging.debug(
|
||||
"santiago.Santiago.save_data: saved {0}: {1}".format(key, data))
|
||||
|
||||
@classmethod
|
||||
def convert_data(cls, data, acallable):
|
||||
"""Convert the data in the sub-dictionary by calling callable on it.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user