comparison src/memory/params.py @ 1931:2c55e7e99ef3

core (memory/params): fixed exception when setting an empty password
author Goffi <goffi@goffi.org>
date Sat, 26 Mar 2016 18:43:54 +0100
parents fb94f92dc740
children 2daf7b4c6756
comparison
equal deleted inserted replaced
1930:70ce9421c4d3 1931:2c55e7e99ef3
877 crypto_key=value, 877 crypto_key=value,
878 profile=profile) 878 profile=profile)
879 d.addCallback(lambda dummy: PasswordHasher.hash(value)) # profile password is hashed (empty value stays empty) 879 d.addCallback(lambda dummy: PasswordHasher.hash(value)) # profile password is hashed (empty value stays empty)
880 elif value: # other non empty passwords are encrypted with the personal key 880 elif value: # other non empty passwords are encrypted with the personal key
881 d = BlockCipher.encrypt(personal_key, value) 881 d = BlockCipher.encrypt(personal_key, value)
882 else:
883 d = defer.succeed(value)
882 else: 884 else:
883 d = defer.succeed(value) 885 d = defer.succeed(value)
884 886
885 def gotFinalValue(value): 887 def gotFinalValue(value):
886 if self.host.memory.isSessionStarted(profile): 888 if self.host.memory.isSessionStarted(profile):