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
Unknown Object (File)
Wed, Nov 6, 3:35 PM
Unknown Object (File)
Wed, Nov 6, 6:28 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:38 AM
Unknown Object (File)
Mon, Nov 4, 5:35 AM
Unknown Object (File)
Mon, Nov 4, 5:35 AM
Unknown Object (File)
Mon, Nov 4, 5:35 AM
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
Branch
remove-cryptopp-expose-string-to-sign-from-database
Lint
No Lint Coverage
Unit
No Test Coverage

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.