Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(encryption): add backwards-compatibility-test for encrypt/decrypt #367

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

legobeat
Copy link
Contributor

@legobeat legobeat commented May 1, 2024

Encryption in this library is historically using tweetnacl and tweetnacl-util as encryption libraries. tweetnacl-util was replaced with @scure/base in #358 and tweetnacl is also due for removal.

This adds a snapshot of encryption.ts as test-legacy-encryption.ts, and adds compatibility tests in both directions to ensure that new versions of the code can decrypt messages produced by the old version and vice-versa.

It does this by wrapping the entire existing encryption-test-suite and injecting the functions under test.


Note for reviewers: Most of the diff in encryption.test.ts is indentation, which can be ignored by git diff -w).

Copy link

socket-security bot commented May 1, 2024

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/tweetnacl-util@0.15.1 None 0 8.14 kB dchest

View full report↗︎

@legobeat legobeat changed the title test(encryption): add compatibility-test to v7.0.1 test(encryption): add backwards-compatibility-test for encrypt/decrypt May 1, 2024
@legobeat legobeat requested a review from a team May 1, 2024 07:51
@legobeat legobeat marked this pull request as ready for review May 1, 2024 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant