From ebd40dd89933629baf775cc61dfcf603fadfa772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Weing=C3=A4rtner?= Date: Mon, 9 Apr 2018 11:34:50 -0300 Subject: [PATCH] Remove 'md5Hashed' variable from Javascript. We no longer hash password in the user side. All of the password processing is executed in the server side according to the priority of hashing mechanism defined by the administrator. --- ui/scripts/accounts.js | 6 ------ ui/scripts/accountsWizard.js | 12 ++---------- ui/scripts/cloudStack.js | 6 +----- ui/scripts/installWizard.js | 2 +- ui/scripts/sharedFunctions.js | 4 ---- 5 files changed, 4 insertions(+), 26 deletions(-) diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js index a9f7381e6415..529e5e391d0b 100644 --- a/ui/scripts/accounts.js +++ b/ui/scripts/accounts.js @@ -1359,9 +1359,6 @@ }; var password = args.data.password; - if (md5Hashed) { - password = $.md5(password); - } $.extend(data, { password: password }); @@ -1502,9 +1499,6 @@ var password = args.data.newPassword; - if (md5Hashed) - password = $.md5(password); - $.ajax({ url: createURL('updateUser'), data: { diff --git a/ui/scripts/accountsWizard.js b/ui/scripts/accountsWizard.js index 7fc4014de68b..78d4dd50e626 100644 --- a/ui/scripts/accountsWizard.js +++ b/ui/scripts/accountsWizard.js @@ -205,20 +205,12 @@ } if (!ldapStatus) { - var password = args.data.password; - if (md5Hashed) { - password = $.md5(password); - } array1.push("&email=" + args.data.email); array1.push("&firstname=" + args.data.firstname); array1.push("&lastname=" + args.data.lastname); - password = args.data.password; - if (md5Hashed) { - password = $.md5(password); - } else { - password = todb(password); - } + var password = args.data.password; + password = todb(password); array1.push("&password=" + password); } diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js index 119013326fb4..f2173e1a9658 100644 --- a/ui/scripts/cloudStack.js +++ b/ui/scripts/cloudStack.js @@ -223,11 +223,7 @@ var array1 = []; array1.push("&username=" + encodeURIComponent(args.data.username)); - var password; - if (md5HashedLogin) - password = $.md5(args.data.password); - else - password = todb(args.data.password); + var password = todb(args.data.password); array1.push("&password=" + password); var domain; diff --git a/ui/scripts/installWizard.js b/ui/scripts/installWizard.js index 9d7c23da476f..8ba82dd28ae3 100644 --- a/ui/scripts/installWizard.js +++ b/ui/scripts/installWizard.js @@ -35,7 +35,7 @@ url: createURL('updateUser'), data: { id: cloudStack.context.users[0].userid, - password: md5Hashed ? $.md5(args.data.password) : args.data.password + password: args.data.password }, type: 'POST', dataType: 'json', diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index 923ab76b5bf4..a2dc4eb21e68 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -45,10 +45,6 @@ var ERROR_INTERNET_NAME_NOT_RESOLVED = 12007; var ERROR_INTERNET_CANNOT_CONNECT = 12029; var ERROR_VMOPS_ACCOUNT_ERROR = 531; -// Default password is MD5 hashed. Set the following variable to false to disable this. -var md5Hashed = false; -var md5HashedLogin = false; - //page size for API call (e.g."listXXXXXXX&pagesize=N" ) var pageSize = 20; //var pageSize = 1; //for testing only