From a8c5d3f8c17df1fdd5853d68e2f136b91ec2cf39 Mon Sep 17 00:00:00 2001 From: Marcos Zuriaga Date: Thu, 6 Oct 2016 19:52:36 +0200 Subject: [PATCH] Fix server DDOS due to encrypted files data --- js/app/services/credentialservice.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/app/services/credentialservice.js b/js/app/services/credentialservice.js index 9657bbde..d25be57d 100644 --- a/js/app/services/credentialservice.js +++ b/js/app/services/credentialservice.js @@ -172,15 +172,15 @@ angular.module('passmanApp') }; var promise_credential_update = function(){ - console.log(this); service.getCredential(credential_id).then((function (credential) { this.parent.plain_credential = service.decryptCredential(credential, this.parent.old_password); - this.parent.new_credential_cryptogram = service.encryptCredential(this.parent.plain_credential, this.parent.new_password); + var tmp = angular.copy(this.parent.plain_credential); + this.parent.new_credential_cryptogram = service.encryptCredential(tmp, this.parent.new_password); this.call_progress(new progress_datatype(1, 2)); // Save data - service.updateCredential(this.parent.new_credential_cryptogram, true).then((function(){ + service.updateCredential(this.parent.new_credential_cryptogram, true).then((function(data){ this.call_progress(new progress_datatype(2, 2)); this.call_then(this.parent.plain_credential); }).bind(this)); @@ -263,6 +263,7 @@ angular.module('passmanApp') }).then(function(data){ master_promise.plain_credential = data; master_promise.promises ++; + (new C_Promise(promise_files_update, new password_data())).progress(function(data){ master_promise.call_progress(data); }).then(function(data){