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

Assert failure using RSA #3

Open
mangodan2003 opened this issue Mar 22, 2022 · 1 comment
Open

Assert failure using RSA #3

mangodan2003 opened this issue Mar 22, 2022 · 1 comment

Comments

@mangodan2003
Copy link

In rsa.dart line 430 (https://github.com/hoylen/ssh_key/blob/master/lib/src/keys/rsa.dart#L420) an 8 byte prefix is generated but then lower down blockOverflow is calculated and used to make the final result length a multiple of 16 without taking the prefix into account. This can result in an assertion failure as the result can be out by 8 bytes.

@hoylen
Copy link
Owner

hoylen commented Mar 22, 2022

Thank you for reporting that.

That has been fixed it in the 0.8.0-beta code from the "rsa-private" branch in GitHub.

final blockOverflow = ((dummyPrefix.length + pvt.length) % _pvtBlockSize);

I hope to find some time to publish a new release in the coming months. Meanwhile, you can reference the Git branch in your pubspec.yaml file.

Implementation support for private keys is experimental, since the format is not documented anywhere I could find. Public keys are designed to be exchanged, and private keys are not: so every implementation stores them however they want and don't bother documenting the format.

@hoylen hoylen closed this as completed Mar 22, 2022
@hoylen hoylen reopened this Mar 22, 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

No branches or pull requests

2 participants