mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
commit
01e1a01fa2
@ -378,9 +378,6 @@ func (am *AccountManager) Register(client *Client, account string, callbackNames
|
||||
tx.Set(registeredTimeKey, registeredTimeStr, setOptions)
|
||||
tx.Set(credentialsKey, credStr, setOptions)
|
||||
tx.Set(callbackKey, callbackSpec, setOptions)
|
||||
if certfp != "" {
|
||||
tx.Set(certFPKey, casefoldedAccount, setOptions)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}()
|
||||
@ -1439,6 +1436,13 @@ func (ac *AccountCredentials) SetPassphrase(passphrase string, bcryptCost uint)
|
||||
}
|
||||
|
||||
func (ac *AccountCredentials) AddCertfp(certfp string) (err error) {
|
||||
// XXX we require that certfp is already normalized (rather than normalize here
|
||||
// and pass back the normalized version as an additional return parameter);
|
||||
// this is just a final sanity check:
|
||||
if len(certfp) != 64 {
|
||||
return utils.ErrInvalidCertfp
|
||||
}
|
||||
|
||||
for _, current := range ac.Certfps {
|
||||
if certfp == current {
|
||||
return errNoop
|
||||
|
Loading…
Reference in New Issue
Block a user