creds: Secretkey should be generated upto 40 characters in length. (#4471)

Current code allowed it wrongly to generate secret key upto 100
we should only use 100 as a value to validate but for generating
it should be 40.

Fixes #4470
This commit is contained in:
Harshavardhana
2017-06-05 15:18:03 -07:00
committed by GitHub
parent 986aa8fabf
commit 1c3f244fc5
4 changed files with 31 additions and 18 deletions
+3
View File
@@ -23,6 +23,9 @@ func TestMustGetNewCredential(t *testing.T) {
if !cred.IsValid() {
t.Fatalf("Failed to get new valid credential")
}
if len(cred.SecretKey) != secretKeyMaxLenMinio {
t.Fatalf("Invalid length %d of the secretKey credential generated, expected %d", len(cred.SecretKey), secretKeyMaxLenMinio)
}
}
func TestCreateCredential(t *testing.T) {