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

Unable to match signature header - sha1 issue #36

Open
zajinx opened this issue Jun 18, 2024 · 1 comment
Open

Unable to match signature header - sha1 issue #36

zajinx opened this issue Jun 18, 2024 · 1 comment

Comments

@zajinx
Copy link

zajinx commented Jun 18, 2024

When using webhook the signature header validation fails on Almalinux 9.4 and php83 (via virtualmin) because it uses sha1, when i update the code to use sha2 the problem went away.

/src/Controllers/WebhookController.php
line 31 changed from
$encodedSignature = $request->header('x-postal-signature');
to
$encodedSignature = $request->header('x-postal-signature-256');

and

line 39 changed from
$result = openssl_verify($body, $signature, $rsa_key, OPENSSL_ALGO_SHA1);
to
$result = openssl_verify($body, $signature, $rsa_key, OPENSSL_ALGO_SHA256);

@willpower232
Copy link
Member

I see they added sha2 in 3.2.0.

What error message did you get before updating the code?

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