summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-10-19 11:23:44 -0700
committer=Corey Hulen <corey@hulen.com>2015-10-19 11:23:44 -0700
commitf7e51b14d7a05cef38e3b439cef9d392e8ebee7d (patch)
tree9226c268e261d851b3a4d966bcf536c7946c05a6 /model
parente0d2ee3ccee80af95e1191f630802ff3fc1d55e5 (diff)
downloadchat-f7e51b14d7a05cef38e3b439cef9d392e8ebee7d.tar.gz
chat-f7e51b14d7a05cef38e3b439cef9d392e8ebee7d.tar.bz2
chat-f7e51b14d7a05cef38e3b439cef9d392e8ebee7d.zip
Allowing salts longer than 32 chars
Diffstat (limited to 'model')
-rw-r--r--model/config.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/model/config.go b/model/config.go
index 8a11b7bb7..59caf0884 100644
--- a/model/config.go
+++ b/model/config.go
@@ -184,8 +184,8 @@ func (o *Config) IsValid() *AppError {
return NewAppError("Config.IsValid", "Invalid maximum users per team for team settings. Must be a positive number.", "")
}
- if len(o.SqlSettings.AtRestEncryptKey) != 32 {
- return NewAppError("Config.IsValid", "Invalid at rest encrypt key for SQL settings. Must be 32 chars.", "")
+ if len(o.SqlSettings.AtRestEncryptKey) < 32 {
+ return NewAppError("Config.IsValid", "Invalid at rest encrypt key for SQL settings. Must be 32 chars or more.", "")
}
if !(o.SqlSettings.DriverName == DATABASE_DRIVER_MYSQL || o.SqlSettings.DriverName == DATABASE_DRIVER_POSTGRES) {
@@ -232,20 +232,20 @@ func (o *Config) IsValid() *AppError {
return NewAppError("Config.IsValid", "Invalid thumbnail width for file settings. Must be a positive number.", "")
}
- if len(o.FileSettings.PublicLinkSalt) != 32 {
- return NewAppError("Config.IsValid", "Invalid public link salt for file settings. Must be 32 chars.", "")
+ if len(o.FileSettings.PublicLinkSalt) < 32 {
+ return NewAppError("Config.IsValid", "Invalid public link salt for file settings. Must be 32 chars or more.", "")
}
if !(o.EmailSettings.ConnectionSecurity == CONN_SECURITY_NONE || o.EmailSettings.ConnectionSecurity == CONN_SECURITY_TLS || o.EmailSettings.ConnectionSecurity == CONN_SECURITY_STARTTLS) {
return NewAppError("Config.IsValid", "Invalid connection security for email settings. Must be '', 'TLS', or 'STARTTLS'", "")
}
- if len(o.EmailSettings.InviteSalt) != 32 {
- return NewAppError("Config.IsValid", "Invalid invite salt for email settings. Must be 32 chars.", "")
+ if len(o.EmailSettings.InviteSalt) < 32 {
+ return NewAppError("Config.IsValid", "Invalid invite salt for email settings. Must be 32 chars or more.", "")
}
- if len(o.EmailSettings.PasswordResetSalt) != 32 {
- return NewAppError("Config.IsValid", "Invalid password reset salt for email settings. Must be 32 chars.", "")
+ if len(o.EmailSettings.PasswordResetSalt) < 32 {
+ return NewAppError("Config.IsValid", "Invalid password reset salt for email settings. Must be 32 chars or more.", "")
}
if o.RateLimitSettings.MemoryStoreSize <= 0 {