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

HS* algs yield invalid key sizes #7

Closed
alacham opened this issue Jan 3, 2023 · 2 comments
Closed

HS* algs yield invalid key sizes #7

alacham opened this issue Jan 3, 2023 · 2 comments

Comments

@alacham
Copy link

alacham commented Jan 3, 2023

  • jwskate version: 0.5.0
  • Python version: 3.7.9
  • Operating System: Fedora 31

Description

I wanted to create HS512 key.
Generated key was shorter than expected.

(for required length see) https://www.rfc-editor.org/rfc/rfc7518#section-3.2

What I Did

from jwskate import Jwk, Jwt
print(Jwk.generate_for_alg(alg="HS512"))
{'kty': 'oct', 'k': 'OaFBpH2kogyNz-LvmfYYBw', 'alg': 'HS512'}

I created a PR with a fix #6

@guillp
Copy link
Owner

guillp commented Jan 9, 2023

Many thanks for the report and PR.
I will fix it a bit differently, and will remove SymmetricJwk.generate_for_alg() override which is unnecessary.

guillp pushed a commit that referenced this issue Jan 10, 2023
@guillp guillp closed this as completed in c668132 Jan 11, 2023
@alacham
Copy link
Author

alacham commented Jan 16, 2023

Thanks!

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