implement the plus variants of scram, to bind the authentication exchange to the tls connection

to get the security benefits (detecting mitm attempts), explicitly configure
clients to use a scram plus variant, e.g. scram-sha-256-plus. unfortunately,
not many clients support it yet.

imapserver scram plus support seems to work with the latest imtest (imap test
client) from cyrus-sasl. no success yet with mutt (with gsasl) though.
This commit is contained in:
Mechiel Lukkien
2023-12-23 23:07:21 +01:00
parent 4701857d7f
commit e7478ed6ac
23 changed files with 690 additions and 189 deletions

View File

@ -223,9 +223,27 @@ func (p *parser) xsaslname() string {
return r
}
func (p *parser) xchannelBinding() string {
// ../rfc/5802:889
func (p *parser) xcbname() string {
o := p.o
for ; o < len(p.s); o++ {
c := p.s[o]
if c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' || c == '.' || c == '-' {
continue
}
break
}
if o == p.o {
p.xerrorf("empty channel binding name")
}
r := p.s[p.o:o]
p.o = o
return string(r)
}
func (p *parser) xchannelBinding() []byte {
p.xtake("c=")
return string(p.xbase64())
return p.xbase64()
}
func (p *parser) xproof() []byte {