Skip to content
Snippets Groups Projects
Commit e6d6fb53 authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

fixed an edge case in auth confirmation

parent a30fc1f6
Branches
Tags
No related merge requests found
...@@ -152,7 +152,7 @@ func (m *Manager) handleRequest(cmixMsg format.Message, ...@@ -152,7 +152,7 @@ func (m *Manager) handleRequest(cmixMsg format.Message,
" msgDigest: %s which has been requested, auto-confirming", " msgDigest: %s which has been requested, auto-confirming",
partnerID, cmixMsg.Digest()) partnerID, cmixMsg.Digest())
// do the confirmation // do the confirmation
if err := m.doConfirm(sr2, grp, partnerPubKey, myPubKey, if err := m.doConfirm(sr2, grp, partnerPubKey, sr2.GetPartnerHistoricalPubKey(),
ecrFmt.GetOwnership()); err != nil { ecrFmt.GetOwnership()); err != nil {
jww.WARN.Printf("Auto Confirmation with %s failed: %s", jww.WARN.Printf("Auto Confirmation with %s failed: %s",
partnerID, err) partnerID, err)
...@@ -250,10 +250,10 @@ func (m *Manager) handleConfirm(cmixMsg format.Message, sr *auth.SentRequest, ...@@ -250,10 +250,10 @@ func (m *Manager) handleConfirm(cmixMsg format.Message, sr *auth.SentRequest,
} }
func (m *Manager) doConfirm(sr *auth.SentRequest, grp *cyclic.Group, func (m *Manager) doConfirm(sr *auth.SentRequest, grp *cyclic.Group,
partnerPubKey, myPubKeyOwnershipProof *cyclic.Int, ownershipProof []byte) error { partnerPubKey, partnerPubKeyOwnershipProof *cyclic.Int, ownershipProof []byte) error {
// verify the message came from the intended recipient // verify the message came from the intended recipient
if !cAuth.VerifyOwnershipProof(sr.GetMyPrivKey(), if !cAuth.VerifyOwnershipProof(sr.GetMyPrivKey(),
myPubKeyOwnershipProof, grp, ownershipProof) { partnerPubKeyOwnershipProof, grp, ownershipProof) {
return errors.Errorf("Failed authenticate identity for auth "+ return errors.Errorf("Failed authenticate identity for auth "+
"confirmation of %s", sr.GetPartner()) "confirmation of %s", sr.GetPartner())
} }
......
...@@ -41,7 +41,6 @@ import ( ...@@ -41,7 +41,6 @@ import (
) )
const debugTrackPeriod = 1 * time.Minute const debugTrackPeriod = 1 * time.Minute
const maxChecked = 100000
//comms interface makes testing easier //comms interface makes testing easier
type followNetworkComms interface { type followNetworkComms interface {
......
...@@ -17,9 +17,9 @@ func newPollTracker() *pollTracker { ...@@ -17,9 +17,9 @@ func newPollTracker() *pollTracker {
func (pt *pollTracker) Track(ephID ephemeral.Id, source *id.ID) { func (pt *pollTracker) Track(ephID ephemeral.Id, source *id.ID) {
if _, exists := (*pt)[*source]; !exists { if _, exists := (*pt)[*source]; !exists {
(*pt)[*source] = make(map[int64]uint) (*pt)[*source] = make(map[int64]uint)
(*pt)[*source][ephID.Int64()] = 0 (*pt)[*source][ephID.Int64()] = 1
} else if _, exists := (*pt)[*source][ephID.Int64()]; !exists { } else if _, exists := (*pt)[*source][ephID.Int64()]; !exists {
(*pt)[*source][ephID.Int64()] = 0 (*pt)[*source][ephID.Int64()] = 1
} else { } else {
(*pt)[*source][ephID.Int64()] = (*pt)[*source][ephID.Int64()] + 1 (*pt)[*source][ephID.Int64()] = (*pt)[*source][ephID.Int64()] + 1
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment