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/sql_settings.jsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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

diff --git a/web/react/components/admin_console/sql_settings.jsx b/web/react/components/admin_console/sql_settings.jsx
index cac017770..ad01b5963 100644
--- a/web/react/components/admin_console/sql_settings.jsx
+++ b/web/react/components/admin_console/sql_settings.jsx
@@ -33,7 +33,7 @@ export default class SqlSettings extends React.Component {
         config.SqlSettings.AtRestEncryptKey = React.findDOMNode(this.refs.AtRestEncryptKey).value.trim();
 
         if (config.SqlSettings.AtRestEncryptKey === '') {
-            config.SqlSettings.AtRestEncryptKey = crypto.randomBytes(256).toString('base64').substring(0, 31);
+            config.SqlSettings.AtRestEncryptKey = crypto.randomBytes(256).toString('base64').substring(0, 32);
             React.findDOMNode(this.refs.AtRestEncryptKey).value = config.SqlSettings.AtRestEncryptKey;
         }
 
@@ -73,7 +73,7 @@ export default class SqlSettings extends React.Component {
 
     handleGenerate(e) {
         e.preventDefault();
-        React.findDOMNode(this.refs.AtRestEncryptKey).value = crypto.randomBytes(256).toString('base64').substring(0, 31);
+        React.findDOMNode(this.refs.AtRestEncryptKey).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

