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, Dec 18, 6:16 PM
Unknown Object (File)
Wed, Dec 18, 6:16 PM
Unknown Object (File)
Wed, Dec 18, 6:16 PM
Unknown Object (File)
Wed, Dec 18, 6:16 PM
Unknown Object (File)
Wed, Dec 18, 6:16 PM
Unknown Object (File)
Wed, Dec 18, 10:59 AM
Unknown Object (File)
Sat, Dec 14, 12:20 AM
Unknown Object (File)
Tue, Dec 3, 2:57 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