length test

This commit is contained in:
2024-06-18 21:12:13 +01:00
parent bad06c0b8c
commit 3d328c3fe3

View File

@@ -76,6 +76,8 @@ app.post('/api', (req, res) => {
const bufferSignature = Buffer.from(signature);
const bufferDigest = Buffer.from(digest);
console.log(bufferDigest.length, bufferSignature.length)
if (bufferSignature.length === bufferDigest.length && crypto.timingSafeEqual(bufferSignature, bufferDigest)) {
// Secret is valid, update the repository
exec('/home/gnome.sh', (err, stdout, stderr) => {