Page MenuHomePhabricator

[native/rust_library] Adding unit test for the `sign_string_with_private_key` function
AcceptedPublic

Authored by max on Dec 22 2022, 7:42 AM.
Tags
None
Referenced Files
F2102800: D6000.id20077.diff
Tue, Jun 25, 1:24 AM
Unknown Object (File)
Sun, Jun 23, 8:40 PM
Unknown Object (File)
Fri, Jun 21, 12:47 AM
Unknown Object (File)
Wed, Jun 19, 8:04 PM
Unknown Object (File)
Wed, Jun 19, 3:41 PM
Unknown Object (File)
Sat, Jun 15, 6:03 AM
Unknown Object (File)
Sat, Jun 15, 2:20 AM
Unknown Object (File)
Fri, Jun 14, 9:33 PM
Subscribers

Details

Summary

This diff introduces the unit test for the sign_string_with_private_key function. This function gets the string to be signed and the private key and returns a sha256 signature. We will use this function in the Tunnelbroker client's new session creation because we need to provide the signed string to the Tunnelbroker to prove the ownership of the keys.

In this unit test, we will generate the keypair and sign the string, then we will verify the signature by the OpenSSL verifier.

Linear task: ENG-1333

Test Plan

Run cargo unit tests by nix develop --accept-flake-config -c bash -c "cargo t".
All tests should pass.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

max held this revision as a draft.
max edited the test plan for this revision. (Show Details)
max added reviewers: jon, bartek.

Rebasing on parent changes.

max published this revision for review.Dec 22 2022, 8:19 AM

Change STRING_TO_BE_SIGNED to NONCE.

This revision is now accepted and ready to land.Dec 23 2022, 2:31 PM

Rebasing and merging on master changes.

This diff will be landed after ENG-2563 will be resolved.

This revision is now accepted and ready to land.Dec 29 2022, 8:13 AM