inspircd / inspircd-contrib

Third-party InspIRCd module repository.
https://www.inspircd.org
66 stars 72 forks source link

m_sslmodeuser cannot be set on connect #184

Closed KoraggKnightWolf closed 5 years ago

KoraggKnightWolf commented 5 years ago

When the m_sslmodeuser umode +z is added to modes="" in a tag it does not get set. Yet if a user does /mode nick +z it works as intended. This behaviour occurs on InspIRCd 2.0.27. Other extras modes as e.g. m_blockinvite with umode +V do not suffer this issue. Hopefully it can be resolved as soon as possible as it can be useful e.g. during floods and with webchats using SSL by default.

Regards,

Koragg

genius3000 commented 5 years ago

I recall looking into this before (don't remember if it was for this specific reason or maybe for insp3). This is due to m_sslinfo creating the CertExt item in OnUserConnect(), m_conn_umodes sets modes in OnUserConnect() which it hooks at first priority, and m_sslmodeuser looks up the CertExt to verify SSL connection.
TL;DR: the mode can't be set when conn_umodes tries because the SSL connection check returns no due to timing of the one hook.
When I get a minute I'll see if insp3 suffers this (appreciate anyone else testing :smile: ) and if something else can be done here. Edit: as noted below (and verified) this works fine in insp3, it's just this extras module for insp20.

SadieCat commented 5 years ago

This should not affect insp3 as insp3 creates the ssl_cert ext on demand rather than when the user fully connects.