[client] Calls: four MLS kinds (call, callAnswer, callIce, callEnd) with the frame key in the offer; coturn in the NixOS module; Caddy's global logger mkDefault; v0.3.0
This commit is contained in:
@@ -199,6 +199,26 @@ impl fmt::Debug for FileKey {
|
||||
}
|
||||
}
|
||||
|
||||
fixed_bytes!(
|
||||
/// A call: 16 random bytes made by the caller, naming the call in its four MLS kinds (`PROTOCOL.md`
|
||||
/// §4, calls). The relay never sees it.
|
||||
CallId,
|
||||
16
|
||||
);
|
||||
fixed_bytes!(
|
||||
/// A call's frame key: 32 random bytes made by the caller for one call, travelling only inside the
|
||||
/// MLS-sealed offer (`PROTOCOL.md` §4, `call`). The app seals every media frame under it.
|
||||
CallKey,
|
||||
32
|
||||
);
|
||||
|
||||
// A call key is a secret: never printed.
|
||||
impl fmt::Debug for CallKey {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.write_str("CallKey(..)")
|
||||
}
|
||||
}
|
||||
|
||||
impl Token {
|
||||
/// The hash the relay stores and compares against.
|
||||
pub fn hash(&self) -> Sha256Hash {
|
||||
@@ -232,7 +252,7 @@ macro_rules! debug_as_wire {
|
||||
}
|
||||
)*};
|
||||
}
|
||||
debug_as_wire!(MailboxId, InviteId, Sha256Hash, Author, FileId);
|
||||
debug_as_wire!(MailboxId, InviteId, Sha256Hash, Author, FileId, CallId);
|
||||
|
||||
/// The SHA-256 of a blob: how its recipient acknowledges it.
|
||||
pub fn blob_hash(blob: &[u8]) -> Sha256Hash {
|
||||
|
||||
@@ -329,3 +329,13 @@ fn a_file_key_is_never_printed_and_a_file_id_prints_as_its_wire() {
|
||||
assert!(u64::from(MAX_FILE_CHUNKS) * plain >= 100 * 1024 * 1024);
|
||||
assert!(u64::from(MAX_FILE_CHUNKS - 1) * plain < 100 * 1024 * 1024);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_call_key_is_never_printed_and_a_call_id_prints_as_its_wire() {
|
||||
let key = CallKey::from_bytes([5; 32]);
|
||||
assert_eq!(format!("{key:?}"), "CallKey(..)");
|
||||
assert_eq!(CallKey::parse(&key.to_wire()), Ok(key));
|
||||
let id = CallId::from_bytes([6; 16]);
|
||||
assert_eq!(format!("{id:?}"), format!("CallId({})", id.to_wire()));
|
||||
assert!(CallId::parse(&id.to_wire()[..21]).is_err());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user