Page MenuHomePhabricator

[services] Tunnelbroker - Adding signed string verification function
ClosedPublic

Authored by max on Dec 19 2022, 12:34 PM.
Tags
None
Referenced Files
F3493601: D5945.diff
Thu, Dec 19, 3:50 AM
F3491094: D5945.id20234.diff
Wed, Dec 18, 6:17 PM
F3491093: D5945.id20230.diff
Wed, Dec 18, 6:17 PM
F3491092: D5945.id19721.diff
Wed, Dec 18, 6:17 PM
F3491091: D5945.id20035.diff
Wed, Dec 18, 6:17 PM
F3491090: D5945.id19753.diff
Wed, Dec 18, 6:17 PM
F3488675: D5945.id.diff
Wed, Dec 18, 10:59 AM
Unknown Object (File)
Sun, Nov 24, 2: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.