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

RSA SHA2 256/512 key upgrade support RFC 8332 #536 (#626) #1888

Merged

Conversation

julianmesa-gitkraken
Copy link
Contributor

@julianmesa-gitkraken julianmesa-gitkraken commented Jan 11, 2022

Notes:

  • Host Key RSA 256/512 support #536
  • Client side key hash upgrading for RFC 8332
  • Support for server-sig-algs, ext-info-c server messages
  • Customizing preferred server-sig-algs via the preference LIBSSH2_METHOD_SIGN_ALGO

Credit: Anders Borum, Will Cosgrove

This PR will fix the error when trying to use ssh protocol in github due this changes:
Improving Git protocol security on GitHub

Original commit: RSA SHA2 256/512 key upgrade support RFC 8332 #536 (#626)

Also more commits from libssh2 has been added:

  • Fix a memcmp errors in code that was changed from memmem to memcmp
  • ssh: Add support for userauth banner
  • Support rsa-sha2 agent flags
  • Legacy Agent support for rsa2 key upgrading/downgrading
  • free RSA2 related memory
  • NULL terminate server_sign_algorithms string

Notes:
* Host Key RSA 256/512 support nodegit#536
* Client side key hash upgrading for RFC 8332
* Support for server-sig-algs, ext-info-c server messages
* Customizing preferred server-sig-algs via the preference LIBSSH2_METHOD_SIGN_ALGO

Credit: Anders Borum, Will Cosgrove
…odegit#656 )

Notes:
Fixed supported algo prefs list check when upgrading rsa keys

Credit: Michael Buckley
The new libssh2_userauth_banner API allows to get an optional
userauth banner sent with SSH_MSG_USERAUTH_BANNER packet by the
server.

Closes  issue 610
File: agent.c
Notes: implements rsa-sha2 flags used to tell the agent which signing algo to use.
 https://tools.ietf.org/id/draft-miller-ssh-agent-01.html#rfc.section.4.5.1

Credit:
Ian Hattendorf
@julianmesa-gitkraken julianmesa-gitkraken marked this pull request as draft January 14, 2022 15:43
Files: libssh2.h, agent.c, userauth.c

Notes:
Part 2 of the fix for issue 659. This adds rsa key downgrading for agents that don't support sha2 upgrading. It also adds better trace output for debugging/logging around key upgrading.

Credit:
Will Cosgrove (signed off by Michael Buckley)
@julianmesa-gitkraken julianmesa-gitkraken force-pushed the fix-rsa-sha1-update-libssh2 branch 2 times, most recently from 0022e22 to e1a95fc Compare January 18, 2022 07:56
test/tests/clone.js Outdated Show resolved Hide resolved
@julianmesa-gitkraken julianmesa-gitkraken marked this pull request as ready for review February 7, 2022 18:19
@ianhattendorf ianhattendorf self-assigned this Feb 7, 2022
Free `server_sign_algorithms` and `sign_algo_prefs`.
files: packet.c, libssh2_priv.h

notes:
* Fix heap buffer overflow in _libssh2_key_sign_algorithm

When allocating `session->server_sign_algorithms` which is a `char*` is is important to also allocate space for the string-terminating null byte at the end and make sure the string is actually null terminated.

Without this fix, the `strchr()` call inside the `_libssh2_key_sign_algorithm` (line 1219) function will try to parse the string and go out of buffer on the last invocation.

Credit: tihmstar
Co-authored-by: Will Cosgrove <will@panic.com>
@ianhattendorf ianhattendorf merged commit 2d15900 into nodegit:master Feb 8, 2022
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.

None yet

2 participants