Skip to content
Snippets Groups Projects
Commit e64080f9 authored by Josh Brooks's avatar Josh Brooks
Browse files

Fix interfacing in production code

parent b3d9dee2
No related branches found
No related tags found
2 merge requests!510Release,!479Xx 4415/send many assembler
......@@ -84,7 +84,7 @@ type Client interface {
// Will return an error if the network is unhealthy or if it fails to send
// (along with the reason). Blocks until successful send or err.
// WARNING: Do not roll your own crypto.
SendMany(recipients []*id.ID, assembler ManyMessageAssembler,
SendMany(recipients []*id.ID, messages []TargetedCmixMessage,
params CMIXParams) (rounds.Round, []ephemeral.Id, error)
// SendWithAssembler sends a variable cmix payload to the provided recipient.
......@@ -122,7 +122,7 @@ type Client interface {
// (along with the reason). Blocks until successful sends or errors.
// WARNING: Do not roll your own crypto.
SendManyWithAssembler(recipients []*id.ID, assembler ManyMessageAssembler,
params CMIXParams)
params CMIXParams) (rounds.Round, []ephemeral.Id, error)
/* === Message Reception ================================================ */
/* Identities are all network identities which the client is currently
......
......@@ -128,6 +128,7 @@ func (m *manager) sendCmix(packet []store.Part) {
// Encrypt each part and to a TargetedCmixMessage
messages := make([]cmix.TargetedCmixMessage, 0, len(packet))
recipients := make([]*id.ID, 0, len(packet))
for _, p := range packet {
encryptedPart, mac, fp, err :=
p.GetEncryptedPart(m.cmix.GetMaxMessageLength())
......@@ -139,7 +140,7 @@ func (m *manager) sendCmix(packet []store.Part) {
}
validParts = append(validParts, p)
recipients = append(recipients, p.Recipient())
messages = append(messages, cmix.TargetedCmixMessage{
Recipient: p.Recipient(),
Payload: encryptedPart,
......@@ -155,7 +156,7 @@ func (m *manager) sendCmix(packet []store.Part) {
jww.DEBUG.Printf("[FT] Sending %d file parts via SendManyCMIX",
len(messages))
rid, _, err := m.cmix.SendMany(messages, m.params.Cmix)
rid, _, err := m.cmix.SendMany(recipients, messages, m.params.Cmix)
if err != nil {
jww.WARN.Printf("[FT] Failed to send %d file parts via "+
"SendManyCMIX: %+v", len(messages), err)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment