v1.0.22
This commit is contained in:
1 parent
aefa5e7925
commit
b55e1e5aad
107 files changed
+2193
-443
No files matched your search
@@ -17,10 +17,10 @@ function verifySignature(payload: string, signature: string | null, secret: stri
|
||||
.createHmac('sha256', secret)
|
||||
.update(payload)
|
||||
.digest('hex');
|
||||
return crypto.timingSafeEqual(
|
||||
Buffer.from(signature),
|
||||
Buffer.from(expectedSignature)
|
||||
);
|
||||
const sigBuf = Buffer.from(signature);
|
||||
const expectedBuf = Buffer.from(expectedSignature);
|
||||
if (sigBuf.length !== expectedBuf.length) return false;
|
||||
return crypto.timingSafeEqual(sigBuf, expectedBuf);
|
||||
}
|
||||
|
||||
// GitLab uses X-Gitlab-Token which should match exactly
|
||||
|
||||
Reference in new issue
Block a user