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

fixed some more stuff in channels

parent 44e723e6
No related branches found
No related tags found
4 merge requests!510Release,!419rewrote the health tracker to both consider if there are waiting rounds and...,!386Channels restructure,!340Project/channels
......@@ -12,7 +12,7 @@ import (
"gitlab.com/elixxir/client/cmix/rounds"
cryptoBroadcast "gitlab.com/elixxir/crypto/broadcast"
cryptoChannel "gitlab.com/elixxir/crypto/channel"
"gitlab.com/xx_network/crypto/signature/rsa"
"gitlab.com/elixxir/crypto/rsa"
"gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/id/ephemeral"
"math"
......@@ -51,7 +51,7 @@ type Manager interface {
// should be wrapped in a function which defines the wire protocol
// If the final message, before being sent over the wire, is too long, this will
// return an error. The message must be at most 510 bytes long.
SendAdminGeneric(privKey *rsa.PrivateKey, channelID *id.ID,
SendAdminGeneric(privKey rsa.PrivateKey, channelID *id.ID,
messageType MessageType, msg []byte, validUntil time.Duration,
params cmix.CMIXParams) (cryptoChannel.MessageID, rounds.Round,
ephemeral.Id, error)
......
......@@ -17,7 +17,6 @@ import (
"gitlab.com/elixxir/client/storage/versioned"
cryptoBroadcast "gitlab.com/elixxir/crypto/broadcast"
cryptoChannel "gitlab.com/elixxir/crypto/channel"
"gitlab.com/elixxir/crypto/cmix"
"gitlab.com/elixxir/crypto/fastRNG"
"gitlab.com/elixxir/crypto/rsa"
"gitlab.com/elixxir/ekv"
......@@ -446,29 +445,9 @@ func Test_makeJoinedChannelKey_Consistency(t *testing.T) {
// cryptoBroadcast.NewChannel does but with a smaller RSA key and salt to make
// tests run quicker.
func newTestChannel(name, description string, rng csprng.Source) (
*cryptoBroadcast.Channel, *rsa.PrivateKey, error) {
// Uses 128 bits instead of 4096 bits
pk, err := rsa.GenerateKey(rng, 128)
if err != nil {
return nil, nil, err
}
// Uses 16 bits instead of 512 bits
salt := cmix.NewSalt(rng, 16)
channelID, err := cryptoBroadcast.NewChannelID(
name, description, salt, rsa.CreatePublicKeyPem(pk.GetPublic()))
if err != nil {
return nil, nil, err
}
return &cryptoBroadcast.Channel{
ReceptionID: channelID,
Name: name,
Description: description,
Salt: salt,
RsaPubKey: pk.GetPublic(),
}, pk, nil
*cryptoBroadcast.Channel, rsa.PrivateKey, error) {
c, pk, err := cryptoBroadcast.NewChannel(name, description, 1000, rng)
return c, pk, err
}
////////////////////////////////////////////////////////////////////////////////
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment