Page MenuHomePhabricator

[services] Tunnelbroker - Expose string to be signed to the Rust
ClosedPublic

Authored by max on Dec 19 2022, 12:36 PM.
Tags
None
Referenced Files
F2105073: D5946.id.diff
Tue, Jun 25, 6:26 AM
Unknown Object (File)
Mon, Jun 24, 3:52 AM
Unknown Object (File)
Sun, Jun 23, 11:54 PM
Unknown Object (File)
Sat, Jun 22, 8:53 PM
Unknown Object (File)
Sat, Jun 22, 1:03 PM
Unknown Object (File)
Fri, Jun 14, 10:00 PM
Unknown Object (File)
Fri, Jun 14, 4:36 PM
Unknown Object (File)
Thu, Jun 13, 11:34 PM
Subscribers

Details

Summary

This diff introduces adding of the getStringToSign C++ function which is exposed to the Rust using the CXX bridge to get the string to verify from the DynamoDB database by the deviceID.
To create a new session client first gets the verification string from the server and then sign it with the private key. The randomly generated string is saved into the DynamoDB table for the corresponding deviceID during the request. To verify the string in the following D5947 and Rust verify function in D5945 we should get this string.

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.

Adding of the empty result from the database check.

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.

going to rubber stamp this,

CI should get fixed if you rebase on master

would like for @tomek to take a look as well. (My c++ isn't great)

This revision is now accepted and ready to land.Dec 21 2022, 2:02 PM
This revision now requires review to proceed.Dec 21 2022, 2:02 PM
This revision is now accepted and ready to land.Dec 22 2022, 7:07 AM

Changing the function name from getStringToSign to getSavedNonceToSign which will be more self describing and based on the D5947#181356 comment.

Fix merging, rebasing on master.