Skip to content

crypto: use byteLength in timingSafeEqual

Rodrigo Muino Tomonari requested to merge github/fork/ZaneHannanAU/patch-1 into master
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

crypto.timingSafeEqual() can cause the core to abort if the length parameter matches; however the internal byte length differs. This commit makes the length validation use bytewise (ArrayBufferLike) byteLength rather than array content length.

Reissuing of #21397 with various modifications and fixes.

Merge request reports

Loading