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

Merge branch 'hotfix/simultaneous_auth' into 'release'

Create a brand new partnerContact object instead of trying to use the existing one.

See merge request !152
parents f8a15ad3 9107435b
No related branches found
No related tags found
2 merge requests!170Release,!152Create a brand new partnerContact object instead of trying to use the existing one.
......@@ -9,6 +9,8 @@ package auth
import (
"fmt"
"strings"
"github.com/cloudflare/circl/dh/sidh"
"github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
......@@ -26,7 +28,6 @@ import (
"gitlab.com/elixxir/primitives/fact"
"gitlab.com/elixxir/primitives/format"
"gitlab.com/xx_network/crypto/csprng"
"strings"
)
func (m *Manager) StartProcesses() (stoppable.Stoppable, error) {
......@@ -185,7 +186,7 @@ func (m *Manager) handleRequest(cmixMsg format.Message,
events.Report(5, "Auth", "DuplicateRequest", em)
// if the caller of the API wants requests replayed,
// replay the duplicate request
if m.replayRequests{
if m.replayRequests {
cbList := m.requestCallbacks.Get(c.ID)
for _, cb := range cbList {
rcb := cb.(interfaces.RequestCallback)
......@@ -229,12 +230,28 @@ func (m *Manager) handleRequest(cmixMsg format.Message,
}
// If I do, delete my request on disk
_, _, partnerContact, _ := m.storage.Auth().GetRequest(partnerID)
m.storage.Auth().Delete(partnerID)
// Use the public key sent to me, not the one I
// first retrieved to initiate the auth request
partnerContact.DhPubKey = partnerPubKey
//process the inner payload
facts, _, err := fact.UnstringifyFactList(
string(requestFmt.msgPayload))
if err != nil {
em := fmt.Sprintf("failed to parse facts and message "+
"from Auth Request: %s", err)
jww.WARN.Print(em)
events.Report(10, "Auth", "RequestError", em)
return
}
// create the contact, note that we use the data
// sent in the request and not any data we had
// already
partnerContact := contact.Contact{
ID: partnerID,
DhPubKey: partnerPubKey,
OwnershipProof: copySlice(ownership),
Facts: facts,
}
// add a confirmation to disk
if err = m.storage.Auth().AddReceived(partnerContact,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment