File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ const EventEmitter = require('events').EventEmitter
2
2
, inherits = require ( 'util' ) . inherits
3
3
, crypto = require ( 'crypto' )
4
4
, bl = require ( 'bl' )
5
- , bufferEq = require ( 'buffer-equal-constant-time' )
6
5
7
6
function create ( options ) {
8
7
if ( typeof options != 'object' )
@@ -37,7 +36,7 @@ function create (options) {
37
36
}
38
37
39
38
function verify ( signature , data ) {
40
- return bufferEq ( Buffer . from ( signature ) , Buffer . from ( sign ( data ) ) )
39
+ return crypto . timingSafeEqual ( Buffer . from ( signature ) , Buffer . from ( sign ( data ) ) )
41
40
}
42
41
43
42
function handler ( req , res , callback ) {
Original file line number Diff line number Diff line change 18
18
},
19
19
"license" : " MIT" ,
20
20
"dependencies" : {
21
- "bl" : " ~1.1.2" ,
22
- "buffer-equal-constant-time" : " ~1.0.1"
21
+ "bl" : " ~1.1.2"
23
22
},
24
23
"devDependencies" : {
25
24
"@types/node" : " *" ,
You can’t perform that action at this time.
0 commit comments