Page MenuHomePhabricator

[services/commtest] Tunnelbroker - Adding of helper function for the string signing with the private key
ClosedPublic

Authored by max on Dec 19 2022, 6:30 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 26, 3:50 PM
Unknown Object (File)
Wed, Jun 26, 12:26 PM
Unknown Object (File)
Wed, Jun 26, 2:59 AM
Unknown Object (File)
Tue, Jun 25, 9:37 PM
Unknown Object (File)
Tue, Jun 25, 12:08 AM
Unknown Object (File)
Thu, Jun 13, 11:33 PM
Unknown Object (File)
Tue, Jun 4, 9:53 PM
Unknown Object (File)
Thu, May 30, 9:23 PM
Subscribers

Details

Summary

This diff introduces the function to make a signature for the string by the private key. The signature is needed to prove that the public key provided to the Tunnelbroker server belongs to the user during the session creation call.
This function is called during the session creating a call in D5931.

Test Plan

The commtest app is successfully built and the tests are successfully passed in the following D5931.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

max held this revision as a draft.
max published this revision for review.Dec 19 2022, 7:07 AM
max edited the summary of this revision. (Show Details)
max edited the test plan for this revision. (Show Details)
max added a reviewer: bartek. max added 1 blocking reviewer(s): jon.
jon added inline comments.
services/commtest/src/tunnelbroker/new_session.rs
27–29 ↗(On Diff #19549)

Not a fan of the unwrap()s, would really like to see with a Result<String, Error> being returned and we can just the try ? operator if possible.

If that's going to be a pain (e.g. multiple return types) then we should at least use expect()s which we can search for if something does fail in the future.

This revision now requires changes to proceed.Dec 19 2022, 12:07 PM

Fixing MessageDigest, using Anyhow::Result to pass the error to the caller.

max marked an inline comment as done.
max added inline comments.
services/commtest/src/tunnelbroker/new_session.rs
27–29 ↗(On Diff #19549)

Not a fan of the unwrap()s, would really like to see with a Result<String, Error> being returned and we can just the try ? operator if possible.

If that's going to be a pain (e.g. multiple return types) then we should at least use expect()s which we can search for if something does fail in the future.

I agree, it's better to use Anyhow::Result here and pass the errors to the caller. Thanks, @jon!
Changed it.

This revision is now accepted and ready to land.Dec 20 2022, 9:52 AM