diff options
author | =Corey Hulen <corey@hulen.com> | 2015-09-22 12:31:01 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-09-22 12:31:01 -0700 |
commit | e22e7b8b7b66f342c2df693bbfc06a85980d253e (patch) | |
tree | 8eddbc3001d3b35d0e21a4e29c2283ee265356ab /web/react | |
parent | fc71869a9638dbb4a715f85680915cf1c12a1ae4 (diff) | |
download | chat-e22e7b8b7b66f342c2df693bbfc06a85980d253e.tar.gz chat-e22e7b8b7b66f342c2df693bbfc06a85980d253e.tar.bz2 chat-e22e7b8b7b66f342c2df693bbfc06a85980d253e.zip |
Fixing bug in generating key length
Diffstat (limited to 'web/react')
-rw-r--r-- | web/react/components/admin_console/email_settings.jsx | 8 | ||||
-rw-r--r-- | web/react/components/admin_console/image_settings.jsx | 4 | ||||
-rw-r--r-- | web/react/components/admin_console/sql_settings.jsx | 4 |
3 files changed, 8 insertions, 8 deletions
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); } diff --git a/web/react/components/admin_console/image_settings.jsx b/web/react/components/admin_console/image_settings.jsx index 80da0a47f..f84f1c735 100644 --- a/web/react/components/admin_console/image_settings.jsx +++ b/web/react/components/admin_console/image_settings.jsx @@ -32,7 +32,7 @@ export default class ImageSettings extends React.Component { handleGenerate(e) { e.preventDefault(); - React.findDOMNode(this.refs.PublicLinkSalt).value = crypto.randomBytes(256).toString('base64').substring(0, 31); + React.findDOMNode(this.refs.PublicLinkSalt).value = crypto.randomBytes(256).toString('base64').substring(0, 32); var s = {saveNeeded: true, serverError: this.state.serverError}; this.setState(s); } @@ -53,7 +53,7 @@ export default class ImageSettings extends React.Component { config.ImageSettings.PublicLinkSalt = React.findDOMNode(this.refs.PublicLinkSalt).value.trim(); if (config.ImageSettings.PublicLinkSalt === '') { - config.ImageSettings.PublicLinkSalt = crypto.randomBytes(256).toString('base64').substring(0, 31); + config.ImageSettings.PublicLinkSalt = crypto.randomBytes(256).toString('base64').substring(0, 32); React.findDOMNode(this.refs.PublicLinkSalt).value = config.ImageSettings.PublicLinkSalt; } 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); } |