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)
Fri, Jun 21, 4:47 AM
Unknown Object (File)
Mon, Jun 17, 5:22 AM
Unknown Object (File)
Thu, Jun 13, 5:07 AM
Unknown Object (File)
Tue, Jun 11, 9:41 AM
Unknown Object (File)
Sat, Jun 1, 9:41 PM
Unknown Object (File)
May 26 2024, 2:57 PM
Unknown Object (File)
May 24 2024, 6:40 PM
Unknown Object (File)
May 24 2024, 6:40 PM
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.