Skip to content
Snippets Groups Projects
Commit ee81aaa7 authored by David Stainton's avatar David Stainton
Browse files

Fix TestChannelIDTracking

parent 4a1e73c8
No related branches found
No related tags found
6 merge requests!510Release,!419rewrote the health tracker to both consider if there are waiting rounds and...,!371[Channel RSAtoPrivate] Implement Reverse Asymmetric in Client/Broadcast,!354Channels impl,!340Project/channels,!338Xx 4055/channel identity tracking
......@@ -44,8 +44,6 @@ func TestLoadSaveRegistration(t *testing.T) {
func TestChannelIDTracking(t *testing.T) {
rngGen := fastRNG.NewStreamGenerator(1000, 10, csprng.NewSystemRNG)
t.Logf("rngGen: %v", rngGen)
// AddHost
stream := rngGen.GetStream()
privKey, err := rsa.GenerateKey(stream, 1024)
......@@ -94,19 +92,18 @@ func TestChannelIDTracking(t *testing.T) {
udPubKey, udPrivKey, err := ed25519.GenerateKey(stream)
require.NoError(t, err)
myTestClientIDTracker := newclientIDTracker(
comms, host, username,
kv, m.user.GetReceptionIdentity(),
udPubKey, rngGen)
rsaPrivKey, err := myTestClientIDTracker.receptionIdentity.GetRSAPrivateKey()
rsaPrivKey, err := m.user.GetReceptionIdentity().GetRSAPrivateKey()
require.NoError(t, err)
comms.SetUserRSAPubKey(rsaPrivKey.GetPublic())
comms.SetUDEd25519PrivateKey(&udPrivKey)
comms.SetUserEd25519PubKey(myTestClientIDTracker.registrationDisk.GetPublicKey())
comms.SetUsername(username)
myTestClientIDTracker := newclientIDTracker(
comms, host, username,
kv, m.user.GetReceptionIdentity(),
udPubKey, rngGen)
//sig, _ := myTestClientIDTracker.registrationDisk.GetLeaseSignature()
// XXX bad signature
sig := make([]byte, 64)
......
......@@ -63,10 +63,6 @@ func (m *mockComms) SetUserRSAPubKey(userRsaPub *rsa.PublicKey) {
m.userRsaPub = userRsaPub
}
func (m *mockComms) SetUserEd25519PubKey(key ed25519.PublicKey) {
m.userEd25519PubKey = []byte(key)
}
func (m *mockComms) SetUsername(u string) {
m.username = u
}
......@@ -84,7 +80,7 @@ func (m mockComms) SendChannelLeaseRequest(host *connect.Host, message *pb.Chann
d, _ := time.ParseDuration("4h30m")
lease := time.Now().Add(d).UnixNano()
signature := channel.SignChannelLease(m.userEd25519PubKey, m.username,
signature := channel.SignChannelLease(message.UserEd25519PubKey, m.username,
time.Unix(0, lease), *m.udPrivKey)
if err != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment