Browse Source

fix #733

tags/v2.0.0-rc1
Shivaram Lingamneni 4 years ago
parent
commit
1b35c6887f
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      irc/accounts.go

+ 7
- 0
irc/accounts.go View File

@@ -1439,6 +1439,13 @@ func (ac *AccountCredentials) SetPassphrase(passphrase string, bcryptCost uint)
1439 1439
 }
1440 1440
 
1441 1441
 func (ac *AccountCredentials) AddCertfp(certfp string) (err error) {
1442
+	// XXX we require that certfp is already normalized (rather than normalize here
1443
+	// and pass back the normalized version as an additional return parameter);
1444
+	// this is just a final sanity check:
1445
+	if len(certfp) != 64 {
1446
+		return utils.ErrInvalidCertfp
1447
+	}
1448
+
1442 1449
 	for _, current := range ac.Certfps {
1443 1450
 		if certfp == current {
1444 1451
 			return errNoop

Loading…
Cancel
Save