Bug 2064159

Summary: OpenSSH Server don't list diffie-hellman-group-exchange-sha1 keyex
Product: Red Hat Enterprise Linux 8 Reporter: Trung Hieu <thaygiaoth>
Component: opensshAssignee: Dmitry Belyavskiy <dbelyavs>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: low Docs Contact:
Priority: low    
Version: 8.5CC: jjelen, mhavrila
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-23 10:59:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Trung Hieu 2022-03-15 07:39:19 UTC
Description of problem:

openssh server don't list key exchange algorithm:
diffie-hellman-group-exchange-sha1 

My command

# sshd -T | grep ^kexalgorithms | cut -f2 -d' ' | tr ',' '\n'
curve25519-sha256
curve25519-sha256
ecdh-sha2-nistp256
ecdh-sha2-nistp384
ecdh-sha2-nistp521
diffie-hellman-group-exchange-sha256
diffie-hellman-group16-sha512
diffie-hellman-group18-sha512
diffie-hellman-group14-sha256
diffie-hellman-group14-sha1

But when I used ssh client connect ssh server with mis-match key exchange

There was output below:

[root@rhel85 ~]# ssh -oKexAlgorithms=diffie-hellman-group1-sha1 root@localhost
Unable to negotiate with ::1 port 22: no matching key exchange method found. 
Their offer: 
curve25519-sha256,
curve25519-sha256,
ecdh-sha2-nistp256,
ecdh-sha2-nistp384,
ecdh-sha2-nistp521,
diffie-hellman-group-exchange-sha256,
diffie-hellman-group14-sha256,
diffie-hellman-group16-sha512,
diffie-hellman-group18-sha512,
diffie-hellman-group-exchange-sha1, ----------> here
diffie-hellman-group14-sha1

Actually, openssh server support diffie-hellman-group-exchange-sha1

This command ran successfully

ssh -oKexAlgorithms=diffie-hellman-group-exchange-sha1 root@localhost

Thank you very much!

Comment 1 Jakub Jelen 2022-03-16 08:43:55 UTC
The OpenSSH algorithms in RHEL8 are handled by crypto policies so if you check what the sshd server is using with ps auxf | grep sshd, you will get more commandline arguments configuring the actually used algorithms and the `diffie-hellman-group-exchange-sha1` is in that list in default policy. There is a KBS for that, but I do not have it at hand right now. But in any case, this is not a bug, bug just confusing message.

Comment 2 Trung Hieu 2022-03-16 10:05:35 UTC
Yes, this is in /etc/crypto-policies/back-ends/opensshserver.config

grep diffie-hellman-group-exchange-sha1 /etc/crypto-policies/back-ends/opensshserver.config

Tks