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

Fix tests, fix formatting

parent 589f4484
No related branches found
No related tags found
3 merge requests!67Release,!60Hotfic/preimage,!55fully implemented trial hashing of identity fingerprints. Needs tests.
Showing with 85 additions and 118 deletions
......@@ -315,7 +315,6 @@ func (m *Manager) doConfirm(sr *auth.SentRequest, grp *cyclic.Group,
sr.GetPartner(), err)
}
//remove the confirm fingerprint
fp := sr.GetFingerprint()
if err := m.storage.GetEdge().Remove(edge.Preimage{
......
......@@ -18,6 +18,3 @@ func VerifyOwnership(received, verified contact.Contact, storage *storage.Sessio
return cAuth.VerifyOwnershipProof(myHistoricalPrivKey, verified.DhPubKey,
storage.E2e().GetGroup(), received.OwnershipProof)
}
......@@ -15,7 +15,6 @@ import (
"gitlab.com/elixxir/crypto/fingerprint"
)
type NotificationForMeReport struct {
forMe bool
tYpe string
......@@ -34,7 +33,6 @@ func (nfmr *NotificationForMeReport)Source()[]byte{
return nfmr.source
}
// NotificationForMe Check if a notification received is for me
func NotificationForMe(messageHash, idFP string, preimages string) (*NotificationForMeReport, error) {
//handle message hash and idFP
......
......@@ -6,7 +6,6 @@ import (
"gitlab.com/xx_network/primitives/id"
)
type PreimageNotification interface {
Notify(identity []byte, deleted bool)
}
......
......@@ -207,7 +207,6 @@ type MultiLookupCallback interface {
Callback(Succeeded *ContactList, failed *IdList, errors string)
}
type lookupResponse struct {
C contact.Contact
err error
......@@ -292,7 +291,5 @@ func (ud UserDiscovery) MultiLookup(ids *IdList, callback MultiLookupCallback,
callback.Callback(&ContactList{list: returnedContactList}, &IdList{list: failedIDList}, concatonatedErrs)
}()
return nil
}
......@@ -89,7 +89,7 @@ var singleCmd = &cobra.Command{
jww.FATAL.Panicf("Could not add single use process: %+v", err)
}
for numReg, total := 1, 100; numReg < total; {
for numReg, total := 1, 100; numReg < (total*3)/4; {
time.Sleep(1 * time.Second)
numReg, total, err = client.GetNodeRegistrationStatus()
if err != nil {
......
......@@ -15,7 +15,6 @@ func Generate(data []byte, t string) []byte {
return h.Sum(nil)
}
func GenerateRequest(recipient *id.ID) []byte {
// Hash fingerprints
h, _ := blake2b.New256(nil)
......@@ -25,4 +24,3 @@ func GenerateRequest(recipient *id.ID) []byte {
// Base 64 encode hash and truncate
return h.Sum(nil)
}
......@@ -7,8 +7,4 @@ const(
Rekey = "rekey"
E2e = "e2e"
Group = "group"
)
......@@ -228,21 +228,6 @@ const relationshipFpLength = 15
// relationship. The fingerprint is a base 64 encoded hash of of the two
// relationship fingerprints truncated to 15 characters.
func (m *Manager) GetRelationshipFingerprint() string {
// Sort fingerprints
var fps [][]byte
if bytes.Compare(m.receive.fingerprint, m.send.fingerprint)==1{
fps = [][]byte{m.receive.fingerprint,m.send.fingerprint}
}else{
fps = [][]byte{m.receive.fingerprint,m.send.fingerprint}
}
// Hash fingerprints
h, _ := blake2b.New256(nil)
for _, fp := range fps {
h.Write(fp)
}
// Base 64 encode hash and truncate
return base64.StdEncoding.EncodeToString(m.GetRelationshipFingerprintBytes())[:relationshipFpLength]
......@@ -254,9 +239,8 @@ func (m *Manager) GetRelationshipFingerprintBytes() []byte {
// Sort fingerprints
var fps [][]byte
if bytes.Compare(m.receive.fingerprint, m.send.fingerprint) == 1 {
fps = [][]byte{m.receive.fingerprint,m.send.fingerprint}
fps = [][]byte{m.send.fingerprint, m.receive.fingerprint}
} else {
fps = [][]byte{m.receive.fingerprint, m.send.fingerprint}
}
......@@ -282,4 +266,3 @@ func (m *Manager) GetE2EPreimage() []byte {
func (m *Manager) GetRekeyPreimage() []byte {
return preimage.Generate(m.GetRelationshipFingerprintBytes(), preimage.Rekey)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment