core, memory, bridge: added profile password + password encryption:
/!\ This changeset updates the database version to 2 and modify the database content!
Description:
- new parameter General / Password to store the profile password
- profile password is initialized with XMPP password value, it is stored hashed
- bridge methods asyncCreateProfile/asyncConnect takes a new argument "password" (default = "")
- bridge method asyncConnect returns a boolean (True = connection already established, False = connection initiated)
- profile password is checked before initializing the XMPP connection
- new private individual parameter to store the personal encryption key of each profile
- personal key is randomly generated and encrypted with the profile password
- personal key is decrypted after profile authentification and stored in a Sessions instance
- personal key is used to encrypt/decrypt other passwords when they need to be retrieved/modified
- modifying the profile password re-encrypt the personal key
- Memory.setParam now returns a Deferred (the bridge method "setParam" is unchanged)
- Memory.asyncGetParamA eventually decrypts the password, Memory.getParamA would fail on a password parameter
TODO:
- if profile authentication is OK but XMPP authentication is KO, prompt the user for another XMPP password
- fix the method "registerNewAccount" (and move it to a plugin)
- remove bridge method "connect", sole "asyncConnect" should be used
This commit is contained in:
parent
c9f4397000
commit
0d28c03d27
1 changed files with 478 additions and 166 deletions
|
|
@ -99,11 +99,11 @@ class DBusBridgeFrontend(BridgeFrontend):
|
|||
def addContact(self, entity_jid, profile_key="@DEFAULT@"):
|
||||
return self.db_core_iface.addContact(entity_jid, profile_key)
|
||||
|
||||
def asyncConnect(self, profile_key="@DEFAULT@", callback=None, errback=None):
|
||||
return self.db_core_iface.asyncConnect(profile_key, reply_handler=callback, error_handler=lambda err:errback(err._dbus_error_name[len(const_ERROR_PREFIX)+1:]))
|
||||
def asyncConnect(self, profile_key="@DEFAULT@", password='', callback=None, errback=None):
|
||||
return self.db_core_iface.asyncConnect(profile_key, password, reply_handler=callback, error_handler=lambda err:errback(err._dbus_error_name[len(const_ERROR_PREFIX)+1:]))
|
||||
|
||||
def asyncCreateProfile(self, profile, callback=None, errback=None):
|
||||
return self.db_core_iface.asyncCreateProfile(profile, reply_handler=callback, error_handler=lambda err:errback(err._dbus_error_name[len(const_ERROR_PREFIX)+1:]))
|
||||
def asyncCreateProfile(self, profile, password='', callback=None, errback=None):
|
||||
return self.db_core_iface.asyncCreateProfile(profile, password, reply_handler=callback, error_handler=lambda err:errback(err._dbus_error_name[len(const_ERROR_PREFIX)+1:]))
|
||||
|
||||
def asyncDeleteProfile(self, profile, callback=None, errback=None):
|
||||
return self.db_core_iface.asyncDeleteProfile(profile, reply_handler=callback, error_handler=lambda err:errback(err._dbus_error_name[len(const_ERROR_PREFIX)+1:]))
|
||||
|
|
@ -114,8 +114,8 @@ class DBusBridgeFrontend(BridgeFrontend):
|
|||
def confirmationAnswer(self, id, accepted, data, profile):
|
||||
return self.db_core_iface.confirmationAnswer(id, accepted, data, profile)
|
||||
|
||||
def connect(self, profile_key="@DEFAULT@"):
|
||||
return self.db_core_iface.connect(profile_key)
|
||||
def connect(self, profile_key="@DEFAULT@", password=''):
|
||||
return self.db_core_iface.connect(profile_key, password)
|
||||
|
||||
def delContact(self, entity_jid, profile_key="@DEFAULT@"):
|
||||
return self.db_core_iface.delContact(entity_jid, profile_key)
|
||||
|
|
|
|||
Loading…
Reference in a new issue