diff options
author | drebs <drebs@leap.se> | 2013-01-20 16:29:53 -0200 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-01-20 16:29:53 -0200 |
commit | a2ab7b2b9ca71f7c9fc99f6ddb614d6061c17b81 (patch) | |
tree | 5d6da63cd5843662f6ffa8ec607d6161ced0f760 /__init__.py | |
parent | a2a0800f0edc952f378fc09baf4022393a3fe2a0 (diff) |
SQLCipher backend syncs using a LeapSyncTarget.
Diffstat (limited to '__init__.py')
-rw-r--r-- | __init__.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/__init__.py b/__init__.py index 6c313f77..26e982ba 100644 --- a/__init__.py +++ b/__init__.py @@ -13,10 +13,10 @@ import util class Soledad(object): # paths - PREFIX = os.environ['HOME'] + '/.config/leap/soledad' - SECRET_PATH = PREFIX + '/secret.gpg' - GNUPG_HOME = PREFIX + '/gnupg' - U1DB_PATH = PREFIX + '/soledad.u1db' + PREFIX = os.environ['HOME'] + '/.config/leap/soledad' + SECRET_PATH = PREFIX + '/secret.gpg' + GNUPG_HOME = PREFIX + '/gnupg' + LOCAL_DB_PATH = PREFIX + '/soledad.u1db' # other configs SECRET_LENGTH = 50 @@ -28,7 +28,7 @@ class Soledad(object): if not gpghome: gpghome = self.GNUPG_HOME self._gpg = util.GPGWrapper(gpghome=gpghome) - # loaa/generate OpenPGP keypair + # load/generate OpenPGP keypair if not self._has_openpgp_keypair(): self._gen_openpgp_keypair() self._load_openpgp_keypair() @@ -39,7 +39,7 @@ class Soledad(object): # instantiate u1db # TODO: verify if secret for sqlcipher should be the same as the one # for symmetric encryption. - self._db = sqlcipher.open(self.U1DB_PATH, True, self._secret) + self._db = sqlcipher.open(self.LOCAL_DB_PATH, True, self._secret) #------------------------------------------------------------------------- # Management of secret for symmetric encryption @@ -112,6 +112,7 @@ class Soledad(object): """ Publish OpenPGP public key to a keyserver. """ + # TODO: this has to talk to LEAP's Nickserver. pass #------------------------------------------------------------------------- @@ -199,6 +200,7 @@ class Soledad(object): Synchronize the local encrypted database with LEAP server. """ # TODO: create authentication scheme for sync with server. - return self._db.sync(url, creds=None, autocreate=True) + return self._db.sync(url, creds=None, autocreate=True, soledad=self) __all__ = ['util'] + |