primes: min and max should be inclusive #649

Merged
merged 1 commit into from Apr 24, 2016

Projects

None yet

2 participants

@damz
Contributor
damz commented Dec 24, 2015

As seen in the OpenSSH source code, the min and max values of the diffie-hellman-group-exchange-* key exchange types are supposed to be inclusive.

In the current state of the code and a standard /etc/ssh/moduli file, OpenSSH client sends min=1024, max=8192, prefer=8192, but paramiko returns one of the 7680 bits prime instead of one of the 8192 bits ones.

As far as I can see, the whole ModulusPack is untested, so not adding explicit tests for this.

@damz damz primes: min and max should be inclusive.
As seen in the [OpenSSH source code][1], the min and max values
of the 'diffie-hellman-group-exchange-*' key exchange types are
supposed to be inclusive.

In the current state of the code and a standard /etc/ssh/moduli
file, OpenSSH client sends min=1024, max=8192, prefer=8192,
but paramiko returns one of the 7680 bits prime instead of one
of the 8192 bits ones.

[1]: https://github.com/openssh/openssh-portable/blob/master/kexgexc.c#L111
7109ddf
@bitprophet bitprophet added this to the 1.17 milestone Dec 31, 2015
@bitprophet
Member

Huh. Nice catch, thanks :)

@bitprophet bitprophet merged commit 10f5ef9 into paramiko:master Apr 24, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bitprophet bitprophet added a commit that referenced this pull request Apr 24, 2016
@bitprophet bitprophet Changelog re #649 cc761c4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment