securely compare passwords, add notice about message removal

This commit is contained in:
Aine
2022-09-23 10:19:25 +03:00
parent 1dc552686d
commit 5a19ffad08
4 changed files with 37 additions and 4 deletions

View File

@@ -6,6 +6,8 @@ import (
"gitlab.com/etke.cc/go/mxidwc"
"maunium.net/go/mautrix/id"
"gitlab.com/etke.cc/postmoogle/utils"
)
func parseMXIDpatterns(patterns []string, defaultPattern string) ([]*regexp.Regexp, error) {
@@ -78,5 +80,5 @@ func (b *Bot) AllowAuth(mailbox, password string) bool {
return false
}
return cfg.Password() != "" && cfg.Password() == password
return utils.Compare(password, cfg.Password())
}