Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mammon.ext.ircv3.sasl: Allow 400-length continuation lines #89

Merged
merged 1 commit into from
Jan 30, 2016

Conversation

DanielOaks
Copy link
Member

This lets the AUTHENTICATE command accept the 400-length continuation lines. This allows four 400-length lines and one more line (either just a + or the rest of the password).

If they send more 400-length lines after those first four, it will reject it for length. We can change that without too much trouble, but it's probably good to limit it to stop it from just endlessly growing.

Fixes #87 and #70.

Also threw in a small fix in m_sasl_plain to dump 904 when they send an invalid line.

cli.sasl_tmp = ''
cli.sasl_tmp += raw_data
# allow 4 'continuation' lines before rejecting for length
if len(cli.sasl_tmp) > 400 * 4:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make this configurable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could if we really wanted to, but I don't think users can REG a passphrase
long enough to overrun this right now. (Though, given we accept 2048 rather
than 512... might do it actually. Don't think I took that into account)

Once we have other mechanisms than PLAIN, might be good to allow larger
values too.

On Saturday, January 30, 2016, Valentin Lorentz notifications@github.com
wrote:

In mammon/ext/ircv3/sasl.py
#89 (comment):

         cli.dump_numeric('905', ['SASL message too long'])
         cli.sasl = None
  •        cli.sasl_tmp = ''
    
  •        return
    
  •    elif len(raw_data) == 400:
    
  •        if not hasattr(cli, 'sasl_tmp'):
    
  •            cli.sasl_tmp = ''
    
  •        cli.sasl_tmp += raw_data
    
  •        # allow 4 'continuation' lines before rejecting for length
    
  •        if len(cli.sasl_tmp) > 400 \* 4:
    

Could you make this configurable?


Reply to this email directly or view it on GitHub
https://github.com/mammon-ircd/mammon/pull/89/files#r51342828.

@progval
Copy link
Contributor

progval commented Jan 30, 2016

👍

kaniini added a commit that referenced this pull request Jan 30, 2016
mammon.ext.ircv3.sasl: Allow 400-length continuation lines
@kaniini kaniini merged commit 0fd71a7 into mammon-ircd:master Jan 30, 2016
@DanielOaks DanielOaks deleted the sasl-allow-continuation branch January 30, 2016 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accept SASL AUTHENTICATE continuation lines
3 participants