Skip to content

Conversation

@skshetry
Copy link
Collaborator

@skshetry skshetry commented Feb 6, 2025

Looks like this is no longer necessary, GitHub seems to return proper algorithm name these days, at least it does for me.

I tried with the following script:

import asyncio

from asyncssh import ProtocolError, connect
from asyncssh.auth import MSG_USERAUTH_PK_OK, _ClientPublicKeyAuth


def _process(self, _pkttype, _pktid, packet):
    algorithm = packet.get_string()
    key_data = packet.get_string()
    packet.check_end()

    print(algorithm, self._keypair.algorithm)

    if algorithm != self._keypair.algorithm or key_data != self._keypair.public_data:
        raise ProtocolError("Key mismatch")

    self.create_task(self._send_signed_request())
    return True


_ClientPublicKeyAuth._packet_handlers[MSG_USERAUTH_PK_OK] = _process


async def func():
    async with connect(host="github.com", username="git", known_hosts=None):
        pass


asyncio.run(func())
b'rsa-sha2-256' b'rsa-sha2-256'

See treeverse/dvc#6983 - specially treeverse/dvc@25dca0b for context.

(scmrepo commit that was split from dvc: 2978b52)

Looks like this is no longer necessary, GitHub seems to
return proper algorithm name these days, at least it does for me.
@skshetry skshetry requested a review from shcheklein February 6, 2025 06:38
@skshetry
Copy link
Collaborator Author

skshetry commented Feb 6, 2025

cc @pmrowla

@pmrowla
Copy link
Contributor

pmrowla commented Feb 9, 2025

Should be fine to remove this now

@skshetry
Copy link
Collaborator Author

Thank you, @pmrowla.

@skshetry skshetry merged commit 2b6029f into main Feb 10, 2025
16 checks passed
@skshetry skshetry deleted the remove-patching branch February 10, 2025 04:31
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.

3 participants