Skip to content

Unable to match signature header - sha1 issue #36

Open
@zajinx

Description

@zajinx

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions