Page MenuHomePhabricator

[services] Tunnelbroker - Adding signed string verification function
ClosedPublic

Authored by max on Dec 19 2022, 12:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 13, 5:20 AM
Unknown Object (File)
Sat, Nov 9, 3:27 AM
Unknown Object (File)
Wed, Nov 6, 6:27 AM
Unknown Object (File)
Wed, Nov 6, 6:27 AM
Unknown Object (File)
Mon, Nov 4, 5:21 AM
Unknown Object (File)
Mon, Nov 4, 3:13 AM
Unknown Object (File)
Mon, Nov 4, 3:13 AM
Unknown Object (File)
Sat, Oct 26, 12:41 AM
Subscribers

Details

Summary

This diff introduces a signed string verification function verify_signed_string to use in the "new session" creation process in the Tunnelbroker API. This function will be used in the following D5947 to verify the signed string by the public key provided to make sure the client "own" keys.

Linear task: ENG-2492

Test Plan

As this diff is a part of the stack this diff can be tested on the end of the stack at D5947.
To test it:

  • Patch to the D5947
  • Run the integration tests in D5931 using the cargo t --test tunnelbroker_integration_test command.

The expected result is passing the integration test (signing and verifying the string are successful and the new session creation test will pass).

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

max held this revision as a draft.

Rebasing on master changes.

max edited the test plan for this revision. (Show Details)
max added a reviewer: bartek. max added 1 blocking reviewer(s): jon.
max edited the summary of this revision. (Show Details)
max published this revision for review.Dec 21 2022, 6:06 AM

As we have trouble using Nix in the CI gate please ignore the Nix build fail for now.

jon requested changes to this revision.Dec 21 2022, 2:01 PM
jon added inline comments.
services/tunnelbroker/src/server/tools.rs
38–40 ↗(On Diff #19753)

can we use expect, or marshall the Error type to anhow::Error, then we can use ? for the other lines.

This revision now requires changes to proceed.Dec 21 2022, 2:01 PM
max added inline comments.
services/tunnelbroker/src/server/tools.rs
38–40 ↗(On Diff #19753)

can we use expect, or marshall the Error type to anhow::Error, then we can use ? for the other lines.

Yes, makes sense to pass the ErrorStack type by the ? and expect where it's not. Thanks, @jon !

This revision is now accepted and ready to land.Dec 23 2022, 2:30 PM
max marked an inline comment as done.

Merging fix.