Skip to content
Snippets Groups Projects
Commit e6f5b747 authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

modify debug messages and drop empty pubkey check

parent c83dddde
Branches
Tags
3 merge requests!510Release,!226WIP: Api2.0,!207WIP: Client Restructure
......@@ -3,6 +3,7 @@ package messenger
import (
"encoding/binary"
"encoding/json"
"github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/api"
......@@ -108,7 +109,7 @@ func loadOrInitE2e(client *api.Client) (e2e.Handler, error) {
func (m *Client) GetUser() user.Info {
u := m.Client.GetUser()
u.E2eDhPrivateKey = m.e2e.GetHistoricalDHPrivkey()
u.E2eDhPublicKey = m.e2e.GetHistoricalDHPrivkey()
u.E2eDhPublicKey = m.e2e.GetHistoricalDHPubkey()
return u
}
......
......@@ -55,9 +55,9 @@ func (rrs *receivedRequestService) Process(message format.Message,
jww.INFO.Printf("partnerPubKey: %v", partnerPubKey.TextVerbose(16, 0))
jww.TRACE.Printf("processing requests: \n\t MYPUBKEY: %s "+
jww.TRACE.Printf("processing requests: \n\t MYHISTORICALPUBKEY: %s "+
"\n\t PARTNERPUBKEY: %s \n\t ECRPAYLOAD: %s \n\t MAC: %s",
state.e2e.GetHistoricalDHPubkey().Text(16),
state.e2e.GetHistoricalDHPubkey().TextVerbose(16, 0),
partnerPubKey.TextVerbose(16, 0),
base64.StdEncoding.EncodeToString(baseFmt.data),
base64.StdEncoding.EncodeToString(message.GetMac()))
......@@ -80,6 +80,7 @@ func (rrs *receivedRequestService) Process(message format.Message,
jww.WARN.Printf("Failed to decode the auth request: %+v", err)
return
}
jww.INFO.Printf("\t PARTNERSIDHPUBKEY: %v", partnerSIDHPubKey)
//create the contact, note that no facts are sent in the payload
c := contact.Contact{
......
......@@ -65,12 +65,18 @@ func (s *state) request(partner contact.Contact, myfacts fact.FactList,
me := s.e2e.GetReceptionID()
dhPriv, dhPub := genDHKeys(s.e2e.GetGroup(), rng)
dhGrp := s.e2e.GetGroup()
dhPriv, dhPub := genDHKeys(dhGrp, rng)
sidhPriv, sidhPub := util.GenerateSIDHKeyPair(
sidh.KeyVariantSidhA, rng)
ownership := cAuth.MakeOwnershipProof(s.e2e.GetHistoricalDHPrivkey(),
partner.DhPubKey, s.e2e.GetGroup())
historicalDHPriv := s.e2e.GetHistoricalDHPrivkey()
historicalDHPub := diffieHellman.GeneratePublicKey(historicalDHPriv,
dhGrp)
ownership := cAuth.MakeOwnershipProof(historicalDHPriv,
partner.DhPubKey, dhGrp)
confirmFp := cAuth.MakeOwnershipProofFP(ownership)
// Add the sent request and use the return to build the
......@@ -110,8 +116,17 @@ func (s *state) request(partner contact.Contact, myfacts fact.FactList,
}
contents := request.Marshal()
jww.TRACE.Printf("Request ECRPAYLOAD: %v", request.GetEcrPayload())
jww.TRACE.Printf("Request MAC: %v", mac)
jww.TRACE.Printf("AuthRequest MYPUBKEY: %v", dhPub.TextVerbose(16, 0))
jww.TRACE.Printf("AuthRequest PARTNERPUBKEY: %v",
partner.DhPubKey.TextVerbose(16, 0))
jww.TRACE.Printf("AuthRequest MYSIDHPUBKEY: %s",
sidhPub)
jww.TRACE.Printf("AuthRequest HistoricalPUBKEY: %v",
historicalDHPub.TextVerbose(16, 0))
jww.TRACE.Printf("AuthRequest ECRPAYLOAD: %v", request.GetEcrPayload())
jww.TRACE.Printf("AuthRequest MAC: %v", mac)
jww.INFO.Printf("Requesting Auth with %s, msgDigest: %s, confirmFp: %s",
partner.ID, format.DigestContents(contents), confirmFp)
......
......@@ -15,9 +15,6 @@ import (
"encoding/json"
"errors"
"fmt"
"gitlab.com/elixxir/client/api/messenger"
"gitlab.com/elixxir/client/backup"
"gitlab.com/elixxir/client/e2e"
"io/fs"
"io/ioutil"
"log"
......@@ -28,6 +25,10 @@ import (
"sync"
"time"
"gitlab.com/elixxir/client/api/messenger"
"gitlab.com/elixxir/client/backup"
"gitlab.com/elixxir/client/e2e"
"gitlab.com/elixxir/client/catalog"
"gitlab.com/elixxir/client/cmix"
"gitlab.com/elixxir/client/e2e/ratchet/partner/session"
......@@ -195,6 +196,8 @@ var rootCmd = &cobra.Command{
client := initClient()
user := client.GetUser()
jww.INFO.Printf("USERPUBKEY: %s",
user.E2eDhPublicKey.TextVerbose(16, 0))
jww.INFO.Printf("User: %s", user.ReceptionID)
writeContact(user.GetContact())
......
......@@ -103,6 +103,7 @@ func readContact() contact.Contact {
if err != nil {
jww.FATAL.Panicf("Failed to unmarshal contact: %+v", err)
}
jww.INFO.Printf("PubKey READ: %s", c.DhPubKey.Text(10))
jww.INFO.Printf("CONTACTPUBKEY READ: %s",
c.DhPubKey.TextVerbose(16, 0))
return c
}
......@@ -8,7 +8,6 @@
package user
import (
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/crypto/backup"
"gitlab.com/elixxir/crypto/contact"
"gitlab.com/elixxir/crypto/cyclic"
......@@ -57,10 +56,6 @@ type Info struct {
}
func (u Info) GetContact() contact.Contact {
if u.E2eDhPublicKey == nil ||
u.E2eDhPublicKey.GetLargeInt().Int64() <= 1 {
jww.FATAL.Panicf("Public key empty, invalid contact")
}
return contact.Contact{
ID: u.ReceptionID.DeepCopy(),
DhPubKey: u.E2eDhPublicKey,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment