Browse Source

length test

master
Cailean Finn 6 months ago
parent
commit
3d328c3fe3
  1. 2
      server.js

2
server.js

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

Loading…
Cancel
Save