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

Fix private VAPID key padding when importing from PEM #414

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

GribouilleVert
Copy link
Contributor

The current code pads the private key until it reaches a length of 2 * PRIVATE_KEY_LENGTH, which is 64, however, below, there is a condition that ensure that the length of said private key is PRIVATE_KEY_LENGTH, which will always fail when the private was set by importing a PEM due to it being left padded too much.

I have removed the unnecessary padding.

Here is a video of showing it working properly:
https://github.com/user-attachments/assets/3d5610e3-faed-408d-8472-6452664f00ad

@Minishlink Minishlink merged commit 9c9623b into web-push-libs:master Jan 29, 2025
0 of 9 checks passed
@Minishlink
Copy link
Member

Thank you!

@Minishlink
Copy link
Member

In 9.0.2 :)

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.

2 participants