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

fixed the handling of the ownership proof when recieving a request after having already sent one

parent ec1b14a4
No related branches found
No related tags found
No related merge requests found
...@@ -144,7 +144,7 @@ func (m *Manager) handleRequest(cmixMsg format.Message, ...@@ -144,7 +144,7 @@ func (m *Manager) handleRequest(cmixMsg format.Message,
// then exit, nothing else needed // then exit, nothing else needed
case auth.Sent: case auth.Sent:
// do the confirmation // do the confirmation
if err := m.doConfirm(sr2, grp, partnerPubKey, if err := m.doConfirm(sr2, grp, partnerPubKey, myPubKey,
ecrFmt.GetOwnership()); err != nil { ecrFmt.GetOwnership()); err != nil {
jww.WARN.Printf("Confirmation failed: %s", err) jww.WARN.Printf("Confirmation failed: %s", err)
} }
...@@ -232,7 +232,8 @@ func (m *Manager) handleConfirm(cmixMsg format.Message, sr *auth.SentRequest, ...@@ -232,7 +232,8 @@ func (m *Manager) handleConfirm(cmixMsg format.Message, sr *auth.SentRequest,
} }
// finalize the confirmation // finalize the confirmation
if err := m.doConfirm(sr, grp, partnerPubKey, ecrFmt.GetOwnership()); err != nil { if err := m.doConfirm(sr, grp, partnerPubKey, sr.GetPartnerHistoricalPubKey(),
ecrFmt.GetOwnership()); err != nil {
jww.WARN.Printf("Confirmation failed: %s", err) jww.WARN.Printf("Confirmation failed: %s", err)
m.storage.Auth().Fail(sr.GetPartner()) m.storage.Auth().Fail(sr.GetPartner())
return return
...@@ -240,10 +241,10 @@ func (m *Manager) handleConfirm(cmixMsg format.Message, sr *auth.SentRequest, ...@@ -240,10 +241,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 *cyclic.Int, ownershipProof []byte) error { partnerPubKey, myPubKeyOwnershipProof *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(),
sr.GetPartnerHistoricalPubKey(), grp, ownershipProof) { myPubKeyOwnershipProof, 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())
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment