From 161dba7763e75961c144d5375c2822414e1512d9 Mon Sep 17 00:00:00 2001 From: David Braden Date: Mon, 22 Apr 2024 13:46:20 -0600 Subject: [PATCH] Apply suggestions from code review Co-authored-by: ThetaSinner --- rust/sbd-client/src/lib.rs | 2 +- rust/sbd-client/src/raw_client.rs | 2 +- spec.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/sbd-client/src/lib.rs b/rust/sbd-client/src/lib.rs index b379e11..1258bc8 100644 --- a/rust/sbd-client/src/lib.rs +++ b/rust/sbd-client/src/lib.rs @@ -82,7 +82,7 @@ enum MsgType<'t> { /// A message received from a remote. /// This is just a single buffer. The first 32 bytes are the public key -/// of the sender. Any remaining bytes are the message. The buffer +/// of the sender, or 28 `0`s followed by a 4 byte command. Any remaining bytes are the message. The buffer /// contained in this type is guaranteed to be at least 32 bytes long. pub struct Msg(pub Vec); diff --git a/rust/sbd-client/src/raw_client.rs b/rust/sbd-client/src/raw_client.rs index ebe597e..d57fba5 100644 --- a/rust/sbd-client/src/raw_client.rs +++ b/rust/sbd-client/src/raw_client.rs @@ -235,7 +235,7 @@ fn priv_system_tls( for cert in rustls_native_certs::load_native_certs() .expect("failed to load system tls certs") { - roots.add(cert).expect("faild to add cert to root"); + roots.add(cert).expect("failed to add cert to root"); } if danger_disable_certificate_check { diff --git a/spec.md b/spec.md index fd5f6a8..255812a 100644 --- a/spec.md +++ b/spec.md @@ -65,7 +65,7 @@ the first 32 bytes will be altered to represent the peer from which the message #### 3.2.3. Flow -- The server MUST send `areq` with a random nonce once for every new opened connection. +- The server MUST send `areq` with a random nonce once for every newly opened connection. The server MAY send any limit messages before or after this `areq`, but it MUST come before the `srdy`. - The client MUST respond with a signature over the nonce by the private key associated with the public key sent in the url path segment websocket request