mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-11 00:14:50 +03:00
Login password RSA encrypt/decrypt
This commit is contained in:
parent
dfb3a07536
commit
1066af98d4
10 changed files with 4695 additions and 94 deletions
|
|
@ -163,29 +163,10 @@
|
|||
}, this)
|
||||
;
|
||||
|
||||
if (!!Settings.settingsGet('UseRsaEncryption') && Utils.rsaEncode.supported)
|
||||
if (!!Settings.settingsGet('UseRsaEncryption') && Utils.rsaEncode.supported &&
|
||||
Settings.settingsGet('RsaPublicKey'))
|
||||
{
|
||||
Remote.getPublicKey(_.bind(function (sResult, oData) {
|
||||
|
||||
var bRequest = false;
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result &&
|
||||
Utils.isArray(oData.Result) && oData.Result[0] && oData.Result[1] && oData.Result[2])
|
||||
{
|
||||
var sEncryptedPassword = Utils.rsaEncode(sPassword, oData.Result[0], oData.Result[1], oData.Result[2]);
|
||||
if (sEncryptedPassword)
|
||||
{
|
||||
fLoginRequest(sEncryptedPassword);
|
||||
bRequest = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!bRequest)
|
||||
{
|
||||
this.submitRequest(false);
|
||||
this.submitError(Utils.getNotification(Enums.Notification.UnknownError));
|
||||
}
|
||||
|
||||
}, this));
|
||||
fLoginRequest(Utils.rsaEncode(sPassword, Settings.settingsGet('RsaPublicKey')));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue