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

solo key rng hexbytes off by one bug #160

Open
atoponce opened this issue Sep 11, 2022 · 0 comments
Open

solo key rng hexbytes off by one bug #160

atoponce opened this issue Sep 11, 2022 · 0 comments

Comments

@atoponce
Copy link

atoponce commented Sep 11, 2022

Executing the following command, note the output:

% solo key rng hexbytes --count 256
Number of bytes must be between 0 and 255, you passed 256
% solo key rng hexbytes --count 0  
8ecfe207757421cd382d6a01730742060ac0706bd19af3a30d848c12c87e9af5053c47e124918438b711c0afbccd25477f5f474596ddb2b5f0
% solo key rng hexbytes --count 1
08

Given the context, it doesn't make sense to request 0 bytes and a max limit of 255 bytes is an odd upper limit. This seems like an off-by-one bug where the number of bytes should be between 1 and 256.

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

1 participant