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
Unknown Object (File)
Wed, Nov 13, 5:22 AM
Unknown Object (File)
Sun, Nov 10, 5:55 PM
Unknown Object (File)
Thu, Nov 7, 4:29 PM
Unknown Object (File)
Wed, Nov 6, 6:30 AM
Unknown Object (File)
Mon, Nov 4, 1:18 AM
Unknown Object (File)
Mon, Nov 4, 1:18 AM
Unknown Object (File)
Mon, Nov 4, 1:18 AM
Unknown Object (File)
Mon, Nov 4, 1:18 AM
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
Branch
native-tb-client-add-sign-string-func-tests
Lint
No Lint Coverage
Unit
No Test Coverage

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