diff --git a/auth/request.go b/auth/request.go index 76af994787f8e1658e13345bf14883e091e7790d..b001757c3182345f2509c647d4c8fb759f5d6ba6 100644 --- a/auth/request.go +++ b/auth/request.go @@ -61,13 +61,13 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader, "receiving a request") } else if rqType == auth.Sent { resend = true - }else{ - return 0, errors.Errorf("Cannot send a request after " + + } else { + return 0, errors.Errorf("Cannot send a request after "+ " a stored request with unknown rqType: %d", rqType) } - }else if !strings.Contains(err.Error(), auth.NoRequest){ + } else if !strings.Contains(err.Error(), auth.NoRequest) { return 0, errors.WithMessage(err, - "Cannot send a request after receiving unknown error " + + "Cannot send a request after receiving unknown error "+ "on requesting contact status") } @@ -105,11 +105,11 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader, // in this case we have an ongoing request so we can resend the extant // request - if resend{ + if resend { newPrivKey = sr.GetMyPrivKey() newPubKey = sr.GetMyPubKey() - //in this case it is a new request and we must generate new keys - }else{ + //in this case it is a new request and we must generate new keys + } else { //generate new keypair newPrivKey = diffieHellman.GeneratePrivateKey(256, grp, rng) newPubKey = diffieHellman.GeneratePublicKey(newPrivKey, grp) @@ -119,8 +119,8 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader, ownership := cAuth.MakeOwnershipProof(storage.E2e().GetDHPrivateKey(), partner.DhPubKey, storage.E2e().GetGroup()) - jww.TRACE.Printf("RequestAuth MYPUBKEY: %v", newPubKey.Bytes()) - jww.TRACE.Printf("RequestAuth THEIRPUBKEY: %v", partner.DhPubKey.Bytes()) + jww.INFO.Printf("RequestAuth MYPUBKEY: %v", newPubKey.Bytes()) + jww.INFO.Printf("RequestAuth THEIRPUBKEY: %v", partner.DhPubKey.Bytes()) /*encrypt payload*/ requestFmt.SetID(storage.GetUser().ReceptionID) @@ -140,10 +140,14 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader, cmixMsg.SetMac(mac) cmixMsg.SetContents(baseFmt.Marshal()) + jww.INFO.Printf("RequestAuth SALT: %v", salt) + jww.INFO.Printf("RequestAuth ECRPAYLOAD: %v", baseFmt.GetEcrPayload()) + jww.INFO.Printf("RequestAuth MAC: %v", mac) + /*store state*/ //fixme: channel is bricked if the first store succedes but the second fails //store the in progress auth - if !resend{ + if !resend { err = storage.Auth().AddSent(partner.ID, partner.DhPubKey, newPrivKey, newPrivKey, confirmFp) if err != nil { @@ -160,7 +164,7 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader, if err != nil { // if the send fails just set it to failed, it will // but automatically retried - return 0, errors.WithMessagef(err, "Auth Request with %s " + + return 0, errors.WithMessagef(err, "Auth Request with %s "+ "(msgDigest: %s) failed to transmit: %+v", partner.ID, cmixMsg.Digest(), err) }