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

Compare User IDs, not keys

parent 11762604
No related branches found
No related tags found
2 merge requests!170Release,!140Compare User IDs, not keys
...@@ -165,7 +165,7 @@ func (m *Manager) handleRequest(cmixMsg format.Message, ...@@ -165,7 +165,7 @@ func (m *Manager) handleRequest(cmixMsg format.Message,
return return
} else { } else {
//check if the relationship already exists, //check if the relationship already exists,
rType, sr2, _, err := m.storage.Auth().GetRequest(partnerID) rType, _, _, err := m.storage.Auth().GetRequest(partnerID)
if err != nil && !strings.Contains(err.Error(), auth.NoRequest) { if err != nil && !strings.Contains(err.Error(), auth.NoRequest) {
// if another error is received, print it and exit // if another error is received, print it and exit
em := fmt.Sprintf("Received new Auth request for %s, "+ em := fmt.Sprintf("Received new Auth request for %s, "+
...@@ -201,13 +201,9 @@ func (m *Manager) handleRequest(cmixMsg format.Message, ...@@ -201,13 +201,9 @@ func (m *Manager) handleRequest(cmixMsg format.Message,
} }
// Check if I need to resend by comparing the // Check if I need to resend by comparing the
// SIDH Keys // IDs
mySIDH := sr2.GetMySIDHPubKey() myBytes := m.storage.GetUser().ReceptionID.Bytes()
theirSIDH := partnerSIDHPubKey theirBytes := partnerID.Bytes()
myBytes := make([]byte, mySIDH.Size())
theirBytes := make([]byte, theirSIDH.Size())
mySIDH.Export(myBytes)
theirSIDH.Export(theirBytes)
for i := 0; i < len(myBytes); i++ { for i := 0; i < len(myBytes); i++ {
if myBytes[i] > theirBytes[i] { if myBytes[i] > theirBytes[i] {
// OK, this side is dropping // OK, this side is dropping
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment