mIRC Home    About    Download    Register    News    Help

Print Thread
Valid +k(ey). #269156 01/07/21 08:19 PM
Joined: Nov 2004
Posts: 826
Jigsy Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Nov 2004
Posts: 826
So I recently started scripting my IRCd again in mIRC.

Anyway, long story short, I started wondering what constitutes as a valid channel key? What is allowed? What isn't allowed?

The nearest I could conclude is that a key cannot start with : - other than that, I don't know.

And is there a valid regex pattern for one?


What do you do at the end of the world? Are you busy? Will you save us?
Re: Valid +k(ey). [Re: Jigsy] #269166 04/07/21 09:56 PM
Joined: Jan 2005
Posts: 192
Brax Offline
Vogon poet
Offline
Vogon poet
Joined: Jan 2005
Posts: 192
This is based on personal observation not on any "official" rfc or other docs.

Key seems to be limited to 23 characters. Some IRCd's truncate longer keys. IRCu responds with numeric 525 (Key is not well formed)
Key cannot start with colon ":" It will be stripped from the actual key that is set.
Key cannot start with space. It will be stripped from the actual key that is set.
Key cannot contain space. Everything after the space is ignored.

Colon being prefix character and space being separator character per rfc1459

Everything else looks to be fair game. However different IRCd's seem to just make up their own rules.
Bahamut seems to allow entire ASCII range even non printable range except few obvious ones like char10 (Line Feed) char13 (Carriage return) and maybe few more.
IRCu throws numeric 525 when you try to use ASCII non printable range.
Solanum seems to silently strip everything but prinatble range and converting unicode.

Unicode characters also take two character spaces. Therefore key that is only unicode range can be only 11 characters long.

Pretty sure there are more quirks down the road but those are things I have discovered while writing my own scripts that deal with channel keys.


echo -a $signature
Re: Valid +k(ey). [Re: Brax] #269171 05/07/21 03:16 PM
Joined: Nov 2004
Posts: 826
Jigsy Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Nov 2004
Posts: 826
Yeah, : seems to be primarly the main thing.

bircd allowed : in a key like test:key, but another ircu server truncated everything after test.

Thanks for the reply.


What do you do at the end of the world? Are you busy? Will you save us?
Re: Valid +k(ey). [Re: Jigsy] #269172 07/07/21 03:31 PM
Joined: Nov 2004
Posts: 826
Jigsy Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Nov 2004
Posts: 826
I've just realized that comma is probably another one since: /join #chan,#chan,... key,key,...


What do you do at the end of the world? Are you busy? Will you save us?