mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
[fix] Check password decryption and return the data without conversion
This commit is contained in:
parent
19b28d43d0
commit
a7249aee2d
1 changed files with 7 additions and 1 deletions
|
@ -145,4 +145,10 @@ class BaseAuthenticator(object):
|
||||||
else:
|
else:
|
||||||
gpg = gnupg.GPG()
|
gpg = gnupg.GPG()
|
||||||
gpg.encoding = 'utf-8'
|
gpg.encoding = 'utf-8'
|
||||||
return str(gpg.decrypt(enc_pwd, passphrase=session_hash))
|
|
||||||
|
decrypted = gpg.decrypt(enc_pwd, passphrase=session_hash)
|
||||||
|
if decrypted.ok != True:
|
||||||
|
# TODO: Log decrypted.status
|
||||||
|
raise MoulinetteError(errno.EINVAL,
|
||||||
|
m18r.g('unable_retrieve_session'))
|
||||||
|
return decrypted.data
|
||||||
|
|
Loading…
Reference in a new issue