From e22e7b8b7b66f342c2df693bbfc06a85980d253e Mon Sep 17 00:00:00 2001
From: =Corey Hulen <corey@hulen.com>
Date: Tue, 22 Sep 2015 12:31:01 -0700
Subject: Fixing bug in generating key length

---
 web/react/components/admin_console/email_settings.jsx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'web/react/components/admin_console/email_settings.jsx')

diff --git a/web/react/components/admin_console/email_settings.jsx b/web/react/components/admin_console/email_settings.jsx
index d94859cdd..854988947 100644
--- a/web/react/components/admin_console/email_settings.jsx
+++ b/web/react/components/admin_console/email_settings.jsx
@@ -55,13 +55,13 @@ export default class EmailSettings extends React.Component {
 
         config.EmailSettings.InviteSalt = React.findDOMNode(this.refs.InviteSalt).value.trim();
         if (config.EmailSettings.InviteSalt === '') {
-            config.EmailSettings.InviteSalt = crypto.randomBytes(256).toString('base64').substring(0, 31);
+            config.EmailSettings.InviteSalt = crypto.randomBytes(256).toString('base64').substring(0, 32);
             React.findDOMNode(this.refs.InviteSalt).value = config.EmailSettings.InviteSalt;
         }
 
         config.EmailSettings.PasswordResetSalt = React.findDOMNode(this.refs.PasswordResetSalt).value.trim();
         if (config.EmailSettings.PasswordResetSalt === '') {
-            config.EmailSettings.PasswordResetSalt = crypto.randomBytes(256).toString('base64').substring(0, 31);
+            config.EmailSettings.PasswordResetSalt = crypto.randomBytes(256).toString('base64').substring(0, 32);
             React.findDOMNode(this.refs.PasswordResetSalt).value = config.EmailSettings.PasswordResetSalt;
         }
 
@@ -70,14 +70,14 @@ export default class EmailSettings extends React.Component {
 
     handleGenerateInvite(e) {
         e.preventDefault();
-        React.findDOMNode(this.refs.InviteSalt).value = crypto.randomBytes(256).toString('base64').substring(0, 31);
+        React.findDOMNode(this.refs.InviteSalt).value = crypto.randomBytes(256).toString('base64').substring(0, 32);
         var s = {saveNeeded: true, serverError: this.state.serverError};
         this.setState(s);
     }
 
     handleGenerateReset(e) {
         e.preventDefault();
-        React.findDOMNode(this.refs.PasswordResetSalt).value = crypto.randomBytes(256).toString('base64').substring(0, 31);
+        React.findDOMNode(this.refs.PasswordResetSalt).value = crypto.randomBytes(256).toString('base64').substring(0, 32);
         var s = {saveNeeded: true, serverError: this.state.serverError};
         this.setState(s);
     }
-- 
cgit v1.2.3-1-g7c22

