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

Fixed logging messages for transport security options (#2310) #2313

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

0x7162
Copy link

@0x7162 0x7162 commented Oct 12, 2023

Old behavior:

>>> import paramiko
>>> import socket
>>> s = socket.socket()
>>> t = paramiko.Transport(s)
>>> opts = t.get_security_options()
>>> for prop in ('ciphers', 'digests', 'key_types', 'kex'):
...   try:
...     setattr(opts, prop, ['unknown'])
...   except ValueError as e:
...     print('%s: %r' % (prop, e))
...
ciphers: ValueError('unknown cipher')
digests: ValueError('unknown cipher')
key_types: ValueError('unknown cipher')
kex: ValueError('unknown cipher')

New behavior:

import paramiko
import socket
s = socket.socket()
t = paramiko.Transport(s)
opts = t.get_security_options()

for prop in ('ciphers', 'digests', 'key_types', 'kex'):
    try:
        setattr(opts, prop, ['unknown'])
    except ValueError as e:
        print(e)
unknown ciphers name: ('unknown',), possible options: ['aes128-ctr', 'aes192-ctr', 'aes256-ctr', 'aes128-cbc', 'aes192-cbc', 'aes256-cbc', '3des-cbc']

unknown macs name: ('unknown',), possible options: ['hmac-sha1', 'hmac-sha1-96', 'hmac-sha2-256', 'hmac-sha2-256-etm@openssh.com', 'hmac-sha2-512', 'hmac-sha2-512-etm@openssh.com', 'hmac-md5', 'hmac-md5-96']

unknown keys name: ('unknown',), possible options: ['ssh-rsa', 'ssh-rsa-cert-v01@openssh.com', 'rsa-sha2-256', 'rsa-sha2-256-cert-v01@openssh.com', 'rsa-sha2-512', 'rsa-sha2-512-cert-v01@openssh.com', 'ssh-dss', 'ssh-dss-cert-v01@openssh.com', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp256-cert-v01@openssh.com', 'ecdsa-sha2-nistp384', 'ecdsa-sha2-nistp384-cert-v01@openssh.com', 'ecdsa-sha2-nistp521', 'ecdsa-sha2-nistp521-cert-v01@openssh.com', 'ssh-ed25519', 'ssh-ed25519-cert-v01@openssh.com']

unknown kex name: ('unknown',), possible options: ['diffie-hellman-group1-sha1', 'diffie-hellman-group14-sha1', 'diffie-hellman-group-exchange-sha1', 'diffie-hellman-group-exchange-sha256', 'diffie-hellman-group14-sha256', 'diffie-hellman-group16-sha512', 'gss-group1-sha1-toWM5Slw5Ew8Mqkay+al2g==', 'gss-group14-sha1-toWM5Slw5Ew8Mqkay+al2g==', 'gss-gex-sha1-toWM5Slw5Ew8Mqkay+al2g==', 'ecdh-sha2-nistp256', 'ecdh-sha2-nistp384', 'ecdh-sha2-nistp521', 'curve25519-sha256@libssh.org']

paramiko/transport.py Outdated Show resolved Hide resolved
@0x7162
Copy link
Author

0x7162 commented Oct 17, 2023

Sorry for tagging you @bskinn,
but it looks like you triaged and labeled other PRs here.

I think this PR is ready to go - what is the process to settle it down?
I didn't find the process flow description neither in repo nor in the official doc ( https://www.paramiko.org/contributing.html )

@bskinn
Copy link
Contributor

bskinn commented Oct 17, 2023

No worries, @0x7162 -- yeah, I'm working my way through the notifications backlog, piecewise.

The substance looks good to me, to flag for bitprophet's review. (I'm only triaging, I'm not a maintainer.) The only thing I see is to add a CHANGELOG snip, at /sites/www/changelog.rst.

Other than that, there isn't really a process, just waiting for bitprophet's review and eval. Unfortunately, I know he's in the midst of a dry spell at the moment in terms of his open source bandwidth, so I can't give a timeline on when review will happen.

Really appreciate the contribution!

@0x7162
Copy link
Author

0x7162 commented Nov 2, 2023

@bskinn I added the changelog, please verify it is a correct change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants