Skip to content
Snippets Groups Projects
Commit b274f043 authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

printed single use keys on creation and on use to figure out why they are broken

parent d01ba446
No related branches found
No related tags found
2 merge requests!53Release,!31Test/print single use keys
......@@ -108,5 +108,8 @@ func (m *Manager) processTransmission(msg format.Message,
c := NewContact(payload.GetRID(transmitMsg.GetPubKey(grp)),
transmitMsg.GetPubKey(grp), dhKey, payload.GetTagFP(), payload.GetMaxParts())
jww.INFO.Printf("generated by singe use receiver reception id for single use: %s, " +
"ephId: %d, pubkey: %x, msg: %s", c.partner, "unknown:", transmitMsg.GetPubKey(grp), msg)
return payload.GetContents(), c, nil
}
......@@ -289,5 +289,8 @@ func makeIDs(msg *transmitMessagePayload, publicKey *cyclic.Int,
jww.DEBUG.Printf("ephemeral.GetId(%s, %d, %d) = %d", rid, addressSize, timeNow.UnixNano(), ephID.Int64())
}
jww.INFO.Printf("generated by singe use sender reception id for single use: %s, " +
"ephId: %d, pubkey: %x, msg: %s", rid, ephID.Int64(), publicKey.Bytes(), msg)
return rid, ephID, nil
}
......@@ -9,6 +9,7 @@ package single
import (
"encoding/binary"
"fmt"
"github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/crypto/cyclic"
......@@ -246,3 +247,12 @@ func (mp transmitMessagePayload) SetContents(contents []byte) {
copy(mp.contents, contents)
}
// String returns the contents for printing adhering to the stringer interface.
func (mp transmitMessagePayload) String()string {
return fmt.Sprintf("Data: %x [tagFP: %x, nonce: %x, " +
"maxParts: %x, size: %x, content: %x]", mp.data, mp.tagFP,
mp.nonce, mp.maxParts, mp.size, mp.contents)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment