Page MenuHomePhabricator

[services] Tunnelbroker - Modify server handler to use Rust signature verification
ClosedPublic

Authored by max on Dec 19 2022, 12:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 19, 3:47 AM
Unknown Object (File)
Thu, Dec 19, 3:41 AM
Unknown Object (File)
Thu, Dec 19, 3:13 AM
Unknown Object (File)
Thu, Dec 19, 2:54 AM
Unknown Object (File)
Thu, Dec 19, 1:04 AM
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
Subscribers

Details

Summary

This diff modifies the Tunnelbroker new session gRPC server handler to drop using the C++ cryptopp function for the signed string verification in a favor of using the Rust verify_signed_string function from D5945.

Removing deprecated code from the C++ codebase is in the following D5948.

Linear task: ENG-2492

Test Plan

Testing process:

  • 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
Branch
remove-cryptopp-modify-server-handler
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

max held this revision as a draft.

Rebasing on parent changes.

max edited the test plan for this revision. (Show Details)
max added a reviewer: bartek. max added 1 blocking reviewer(s): jon.
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.

There's likely a more idiomatic rust way to do this. But it escapes me (and c++ interop makes some conventions awkward).

This revision is now accepted and ready to land.Dec 21 2022, 2:06 PM
This revision now requires review to proceed.Dec 23 2022, 7:50 AM
tomek requested changes to this revision.Dec 27 2022, 3:53 AM

Shouldn't we use nonce name also here? D5999

services/tunnelbroker/src/server/mod.rs
64–73 ↗(On Diff #20067)

This code can be simplified

79–92 ↗(On Diff #20067)

We can make our match more precise

86 ↗(On Diff #20067)

Are you sure that you don't need a comma here?

This revision now requires changes to proceed.Dec 27 2022, 3:53 AM
max marked 3 inline comments as done.

Renaming a function and rebasing on parent changes.

In D5947#181356, @tomek wrote:

Shouldn't we use nonce name also here? D5999

That makes sense to make a change.
I've renamed the function to the getSavedNonceToSign (from D5946) and renamed variables. Looks better now, thanks!

services/tunnelbroker/src/server/mod.rs
79–92 ↗(On Diff #20067)

We can make our match more precise

I think it will look more complex than it is, and we are adding an empty default match here. I would prefer to leave it as is, but thanks anyway!

86 ↗(On Diff #20067)

Are you sure that you don't need a comma here?

Yes, it's removed by the rust-analyzer if we put it here.

This revision is now accepted and ready to land.Dec 28 2022, 7:31 AM

Merging with the master changes.