Skip to content

Commit

Permalink
pass test_passive_client
Browse files Browse the repository at this point in the history
  • Loading branch information
yngrtc committed Aug 27, 2023
1 parent 473de81 commit a008f25
Show file tree
Hide file tree
Showing 11 changed files with 3,033 additions and 75 deletions.
4 changes: 2 additions & 2 deletions src/crypto/crypto_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fn test_derive_secret(
tc: &DeriveSecretTest,
) -> Result<()> {
let out = crypto_provider.derive_secret(cipher_suite, &tc.secret, tc.label.as_bytes())?;
assert_eq!(out.as_ref(), &tc.out,);
assert_eq!(out.as_ref(), &tc.out);
Ok(())
}

Expand Down Expand Up @@ -110,7 +110,7 @@ fn test_derive_tree_secret(
tc.generation,
tc.length,
)?;
assert_eq!(out.as_ref(), &tc.out,);
assert_eq!(out.as_ref(), &tc.out);
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion src/key/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub type KeyPackageRef = Bytes;
pub struct KeyPackage {
pub(crate) version: ProtocolVersion,
pub(crate) cipher_suite: CipherSuite,
init_key: HpkePublicKey,
pub(crate) init_key: HpkePublicKey,
pub(crate) leaf_node: LeafNode,
extensions: Vec<Extension>,
signature: Bytes,
Expand Down
12 changes: 6 additions & 6 deletions src/message/group_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ use crate::tree::{deserialize_extensions, serialize_extensions, Extension};

#[derive(Default, Debug, Clone, Eq, PartialEq)]
pub struct GroupInfo {
group_context: GroupContext,
extensions: Vec<Extension>,
pub(crate) group_context: GroupContext,
pub(crate) extensions: Vec<Extension>,
confirmation_tag: Bytes,
signer: LeafIndex,
pub(crate) signer: LeafIndex,
signature: Bytes,
}

Expand Down Expand Up @@ -115,8 +115,8 @@ impl GroupInfo {
#[derive(Default, Debug, Clone, Eq, PartialEq)]
pub struct GroupSecrets {
pub(crate) joiner_secret: Bytes,
path_secret: Option<Bytes>,
psk_ids: Vec<PreSharedKeyID>,
pub(crate) path_secret: Option<Bytes>,
pub(crate) psk_ids: Vec<PreSharedKeyID>,
}

impl Deserializer for GroupSecrets {
Expand Down Expand Up @@ -172,7 +172,7 @@ impl Serializer for GroupSecrets {
impl GroupSecrets {
// verifySingleReInitOrBranchPSK verifies that at most one key has type
// resumption with usage reinit or branch.
fn verify_single_reinit_or_branch_psk(&self) -> bool {
pub(crate) fn verify_single_reinit_or_branch_psk(&self) -> bool {
let mut n = 0;
for psk in &self.psk_ids {
if let Psk::Resumption(resumption) = &psk.psk {
Expand Down
10 changes: 5 additions & 5 deletions src/message/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ use crate::tree::*;

#[derive(Default, Debug, Clone, Eq, PartialEq)]
pub struct Commit {
proposals: Vec<ProposalOrRef>,
path: Option<UpdatePath>,
pub(crate) proposals: Vec<ProposalOrRef>,
pub(crate) path: Option<UpdatePath>,
}

impl Deserializer for Commit {
Expand Down Expand Up @@ -154,7 +154,7 @@ pub fn verify_proposal_list(
Ok(())
}

fn proposal_list_needs_path(proposals: &[Proposal]) -> bool {
pub(crate) fn proposal_list_needs_path(proposals: &[Proposal]) -> bool {
if proposals.is_empty() {
return true;
}
Expand Down Expand Up @@ -234,7 +234,7 @@ impl Welcome {
None
}

fn decrypt_group_secrets(
pub(crate) fn decrypt_group_secrets(
&self,
crypto_provider: &impl CryptoProvider,
r: &KeyPackageRef,
Expand All @@ -256,7 +256,7 @@ impl Welcome {
}
}

fn decrypt_group_info(
pub(crate) fn decrypt_group_info(
&self,
crypto_provider: &impl CryptoProvider,
joiner_secret: &[u8],
Expand Down
Loading

0 comments on commit a008f25

Please sign in to comment.