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
F3491114: D5927.id20171.diff
Wed, Dec 18, 6:17 PM
F3491113: D5927.id19782.diff
Wed, Dec 18, 6:17 PM
F3491112: D5927.id19549.diff
Wed, Dec 18, 6:17 PM
F3488680: D5927.id.diff
Wed, Dec 18, 10:59 AM
Unknown Object (File)
Mon, Dec 16, 7:19 AM
Unknown Object (File)
Thu, Nov 28, 5:19 AM
Unknown Object (File)
Nov 8 2024, 4:17 PM
Unknown Object (File)
Nov 8 2024, 4:17 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
Branch
commtest-helpers-sign-string
Lint
No Lint Coverage
Unit
No Test Coverage

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