Opened 3 years ago

Closed 3 years ago

#4465 closed change (fixed)

Move rsa.js into adblockpluscore

Reported by: kzar Assignee: kzar
Priority: P3 Milestone:
Module: Core Keywords:
Cc: trev, sebastian, greiner Blocked By: #4467
Blocking: #4223, #4466 Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29354773/

Description (last modified by trev)

Background

For the $sitekey option we need to be able to verify RSA signatures are correct. We have a library for this in the adblockpluschrome repository called rsa.js. We now need to use it from adblockpluscore too in order to continue migrating our tests from adblockplustests.

What to change

  • Copy adblockpluschrome/lib/rsa.js to adblockpluscore/lib/rsa.js.
  • Add adblockpluscore/lib/jsbn.js (current version from https://github.com/andyperlitch/jsbn that is a proper module).
  • Add adblockpluscore/lib/rusha.js from https://github.com/srijs/rusha (can be used as a module and should be faster than sha1.js we use right now).
  • Instead of dumping verifySignature into the global state turn rsa.js into a proper module using exports. Import BigInteger and SHA-1 implementation from modules instead of expecting global variables.
  • Adapt adblockpluschrome/qunit/tests/signatures.js unit test in order to run with nodeunit.

Change History (10)

comment:1 Changed 3 years ago by kzar

  • Blocking 4466 added

comment:2 Changed 3 years ago by greiner

  • Cc greiner added

comment:3 Changed 3 years ago by trev

  • Description modified (diff)

Not sure you realized but rsa.js depends on jsbn.js and sha1.js. I modified description to show what we can do with these dependencies.

comment:4 Changed 3 years ago by trev

  • Description modified (diff)

comment:5 Changed 3 years ago by trev

  • Description modified (diff)

comment:6 Changed 3 years ago by trev

  • Priority changed from Unknown to P3
  • Ready set

comment:7 Changed 3 years ago by kzar

  • Blocked By 4467 added

comment:8 Changed 3 years ago by kzar

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:9 Changed 3 years ago by abpbot

A commit referencing this issue has landed:
Issue 4465 - Move rsa module from adblockpluschrome

comment:10 Changed 3 years ago by kzar

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.