diff --git a/auth/interface.go b/auth/interface.go index 7fdd7396879d40871b21315d498e78400eee3391..52b1d9dd3febeb03b3f792b570e977ddd2341fc1 100644 --- a/auth/interface.go +++ b/auth/interface.go @@ -54,6 +54,7 @@ type State interface { // ratcheted // The confirm sends as a critical message, if the round send on fails, it // will be auto resent by the cmix client + // This will not be useful if either side has ratcheted ReplayConfirm(partner *id.ID) (id.Round, error) // ReplayRequests will iterate through all pending contact requests and replay diff --git a/auth/receivedRequest.go b/auth/receivedRequest.go index eaea3ddd66ec6f81271cb89099224ed5a86d873c..1a58f62b213cba4aa79c737b7281d05e988fee2c 100644 --- a/auth/receivedRequest.go +++ b/auth/receivedRequest.go @@ -7,8 +7,8 @@ import ( "github.com/pkg/errors" jww "github.com/spf13/jwalterweatherman" "gitlab.com/elixxir/client/auth/store" - "gitlab.com/elixxir/client/cmix/rounds" "gitlab.com/elixxir/client/cmix/identity/receptionID" + "gitlab.com/elixxir/client/cmix/rounds" "gitlab.com/elixxir/client/e2e/ratchet" "gitlab.com/elixxir/crypto/contact" cAuth "gitlab.com/elixxir/crypto/e2e/auth" @@ -236,7 +236,7 @@ func (rrs *receivedRequestService) Process(message format.Message, //autoconfirm if we should if autoConfirm || reset { - _, _ = state.confirmRequestAuth(c, state.params.getConfirmTag(reset)) + _, _ = state.confirm(c, state.params.getConfirmTag(reset)) //handle callbacks if autoConfirm { state.callbacks.Confirm(c, receptionID, round) diff --git a/auth/replayConfirm.go b/auth/replayConfirm.go index 70b4ba61922b35d047f8a68bd7488cc4c92c0094..09540fe298680ffbc1a2bfba522306b22bd8f781 100644 --- a/auth/replayConfirm.go +++ b/auth/replayConfirm.go @@ -2,7 +2,16 @@ package auth import "gitlab.com/xx_network/primitives/id" -//todo implement replay confirm +// ReplayConfirm is used to resend a confirm func (s *state) ReplayConfirm(partner *id.ID) (id.Round, error) { - return 0, nil + + confirmPayload, mac, keyfp, err := s.store.LoadConfirmation(partner) + if err != nil { + return 0, err + } + + rid, err := sendAuthConfirm(s.net, partner, keyfp, + confirmPayload, mac, s.event, s.params.ResetConfirmTag) + + return rid, err }