diff --git a/auth/callback.go b/auth/callback.go index 2ae9446f1e6826a867c89b1243eb96a2cefd5aa8..34f8eb064222a1d02a899a1e96b72e7a785b501d 100644 --- a/auth/callback.go +++ b/auth/callback.go @@ -107,10 +107,19 @@ func (m *Manager) handleRequest(cmixMsg format.Message, jww.TRACE.Printf("handleRequest ECRPAYLOAD: %v", baseFmt.GetEcrPayload()) jww.TRACE.Printf("handleRequest MAC: %v", cmixMsg.GetMac()) + ecrPayload := baseFmt.GetEcrPayload() success, payload := cAuth.Decrypt(myHistoricalPrivKey, - partnerPubKey, baseFmt.GetEcrPayload(), + partnerPubKey, ecrPayload, cmixMsg.GetMac(), grp) + if !success { + jww.WARN.Printf("Attempting to decrypt old request packet...") + ecrPayload = append(ecrPayload, baseFmt.GetVersion()) + success, payload = cAuth.Decrypt(myHistoricalPrivKey, + partnerPubKey, ecrPayload, + cmixMsg.GetMac(), grp) + } + if !success { jww.WARN.Printf("Received auth request failed " + "its mac check")