Skip to content

Conversation

vszakats
Copy link
Member

Before this patch OpenSSL and mbedTLS advertised both SHA2 and SHA1 host key algos, even when SHA1 was not supported by the crypto backend or forcefully disabled via LIBSSH2_NO_RSA_SHA1.

Reported-by: João M. S. Silva
Fixes #1092
Closes #1093

@vszakats vszakats added the bug label Jun 14, 2023
@willco007
Copy link
Member

willco007 commented Jun 14, 2023

wincng and os400 backends would also need this change. Also, I don't think this is the actual issue in #1092. If sha2 was configured correctly on that server, rsa-sha2-512 or rsa-sha2-256 would match before ssh-rsa and it would carry on it's merry way and auth successfully.

Before this patch OpenSSL, mbedTLS, WinCNG and OS/400 advertised both
SHA2 and SHA1 host key algos, even when SHA1 was not supported by the
crypto backend or when forcefully disabled via `LIBSSH2_NO_RSA_SHA1`.

Reported-by: João M. S. Silva
Fixes libssh2#1092
Closes libssh2#1093
@vszakats vszakats force-pushed the dont-advert-ssh-rsa-with-sha1-disabled branch from 00a3512 to 61129ae Compare June 14, 2023 17:33
@vszakats
Copy link
Member Author

vszakats commented Jun 14, 2023

@willco007 Yes, it's strange; it'd be useful to understand what is happening there exactly. Thanks for the heads up about OS/400 and WinCNG, tackled those as well now with a force-push.

@willco007
Copy link
Member

This looks good regardless of if it fixes #1092 or not.

@vszakats
Copy link
Member Author

According to #1092 (comment), this patch fixes #1092.

@vszakats vszakats changed the title src: do not advertize ssh-rsa when SHA1 is disabled src: do not advertise ssh-rsa when SHA1 is disabled Jun 14, 2023
@vszakats vszakats changed the title src: do not advertise ssh-rsa when SHA1 is disabled hostkey: do not advertise ssh-rsa when SHA1 is disabled Jun 14, 2023
@vszakats vszakats closed this in 82d1b8f Jun 14, 2023
@vszakats vszakats deleted the dont-advert-ssh-rsa-with-sha1-disabled branch June 14, 2023 21:02
lampmanyao pushed a commit to lampmanyao/libssh2 that referenced this pull request Jul 16, 2023
Before this patch OpenSSL, mbedTLS, WinCNG and OS/400 advertised both
SHA2 and SHA1 host key algos, even when SHA1 was not supported by the
crypto backend or when forcefully disabled via `LIBSSH2_NO_RSA_SHA1`.

Reported-by: João M. S. Silva
Fixes libssh2#1092
Closes libssh2#1093
agreppin pushed a commit to agreppin/libssh2 that referenced this pull request Jul 14, 2024
Before this patch OpenSSL, mbedTLS, WinCNG and OS/400 advertised both
SHA2 and SHA1 host key algos, even when SHA1 was not supported by the
crypto backend or when forcefully disabled via `LIBSSH2_NO_RSA_SHA1`.

Reported-by: João M. S. Silva
Fixes libssh2#1092
Closes libssh2#1093
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SHA1/2 issue
2 participants