| 909 | } |
| 910 | |
| 911 | MLSMessage |
| 912 | external_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 |
nothing calls this directly
no test coverage detected