Skip to content

Commit

Permalink
fix: remove sha-1 checking where not working
Browse files Browse the repository at this point in the history
  • Loading branch information
domwebber committed Feb 15, 2024
1 parent 758c2ec commit 3457470
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/CloudAPI/CloudAPIWebhook/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,6 @@ export default class CloudAPIWebhook extends AbstractAPI {
`Received Webhook Event Notification: "${JSON.stringify(request)}"`,
);

const xHubSignature1 = request.headers["x-hub-signature"]
?.toString()
.replace("sha1=", "");
if (xHubSignature1) {
throw CloudAPIWebhookError.invalidXHubSignature();
}

const xHubSignature256 = request.headers["x-hub-signature-256"]
?.toString()
.replace("sha256=", "");
Expand All @@ -301,15 +294,6 @@ export default class CloudAPIWebhook extends AbstractAPI {
`Comparing SHA-256 signatures for integrity check: "${xHubSignature256}" === "${generatedSignature256}" (${isAuthentic256})`,
);

const generatedSignature1 = createHmac("sha1", appSecret)
.update(bodyString)
.digest("hex");

const isAuthentic1 = xHubSignature1 === generatedSignature1;
this._logger?.debug(
`Comparing SHA-1 signatures for integrity check: "${xHubSignature1}" === "${generatedSignature1}" (${isAuthentic1})`,
);

return isAuthentic256;
};

Expand Down

0 comments on commit 3457470

Please sign in to comment.