MCPcopy Create free account
hub / github.com/brainboxdotcc/DPP / external_proposal

Method external_proposal

mlspp/src/messages.cpp:911–945  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

909}
910
911MLSMessage
912external_proposal(CipherSuite suite,
913 const bytes& group_id,
914 epoch_t epoch,
915 const Proposal& proposal,
916 uint32_t signer_index,
917 const SignaturePrivateKey& sig_priv)
918{
919 switch (proposal.proposal_type()) {
920 // These proposal types are OK
921 case ProposalType::add:
922 case ProposalType::remove:
923 case ProposalType::psk:
924 case ProposalType::reinit:
925 case ProposalType::group_context_extensions:
926 break;
927
928 // These proposal types are forbidden
929 case ProposalType::invalid:
930 case ProposalType::update:
931 case ProposalType::external_init:
932 default:
933 throw ProtocolError("External proposal has invalid type");
934 }
935
936 auto content = GroupContent{ group_id,
937 epoch,
938 { ExternalSenderIndex{ signer_index } },
939 { /* no authenticated data */ },
940 { proposal } };
941 auto content_auth = AuthenticatedContent::sign(
942 WireFormat::mls_public_message, std::move(content), suite, sig_priv, {});
943
944 return PublicMessage::protect(std::move(content_auth), suite, {}, {});
945}
946
947} // namespace mlspp

Callers

nothing calls this directly

Calls 2

ProtocolErrorClass · 0.85
proposal_typeMethod · 0.80

Tested by

no test coverage detected