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

remove asyncssh patching #404

Merged
merged 1 commit into from
Feb 10, 2025
Merged

remove asyncssh patching #404

merged 1 commit into from
Feb 10, 2025

Conversation

skshetry
Copy link
Member

@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 iterative/dvc#6983 - specially iterative/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
Member 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
Member 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