Skip to content
Snippets Groups Projects
Commit bd8bb2d0 authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Add more debug info

parent 1f6e3d8f
No related branches found
No related tags found
1 merge request!23Release
...@@ -61,13 +61,13 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader, ...@@ -61,13 +61,13 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader,
"receiving a request") "receiving a request")
} else if rqType == auth.Sent { } else if rqType == auth.Sent {
resend = true resend = true
}else{ } else {
return 0, errors.Errorf("Cannot send a request after " + return 0, errors.Errorf("Cannot send a request after "+
" a stored request with unknown rqType: %d", rqType) " 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, 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") "on requesting contact status")
} }
...@@ -105,11 +105,11 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader, ...@@ -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 // in this case we have an ongoing request so we can resend the extant
// request // request
if resend{ if resend {
newPrivKey = sr.GetMyPrivKey() newPrivKey = sr.GetMyPrivKey()
newPubKey = sr.GetMyPubKey() newPubKey = sr.GetMyPubKey()
//in this case it is a new request and we must generate new keys //in this case it is a new request and we must generate new keys
}else{ } else {
//generate new keypair //generate new keypair
newPrivKey = diffieHellman.GeneratePrivateKey(256, grp, rng) newPrivKey = diffieHellman.GeneratePrivateKey(256, grp, rng)
newPubKey = diffieHellman.GeneratePublicKey(newPrivKey, grp) newPubKey = diffieHellman.GeneratePublicKey(newPrivKey, grp)
...@@ -119,8 +119,8 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader, ...@@ -119,8 +119,8 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader,
ownership := cAuth.MakeOwnershipProof(storage.E2e().GetDHPrivateKey(), ownership := cAuth.MakeOwnershipProof(storage.E2e().GetDHPrivateKey(),
partner.DhPubKey, storage.E2e().GetGroup()) partner.DhPubKey, storage.E2e().GetGroup())
jww.TRACE.Printf("RequestAuth MYPUBKEY: %v", newPubKey.Bytes()) jww.INFO.Printf("RequestAuth MYPUBKEY: %v", newPubKey.Bytes())
jww.TRACE.Printf("RequestAuth THEIRPUBKEY: %v", partner.DhPubKey.Bytes()) jww.INFO.Printf("RequestAuth THEIRPUBKEY: %v", partner.DhPubKey.Bytes())
/*encrypt payload*/ /*encrypt payload*/
requestFmt.SetID(storage.GetUser().ReceptionID) requestFmt.SetID(storage.GetUser().ReceptionID)
...@@ -140,10 +140,14 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader, ...@@ -140,10 +140,14 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader,
cmixMsg.SetMac(mac) cmixMsg.SetMac(mac)
cmixMsg.SetContents(baseFmt.Marshal()) 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*/ /*store state*/
//fixme: channel is bricked if the first store succedes but the second fails //fixme: channel is bricked if the first store succedes but the second fails
//store the in progress auth //store the in progress auth
if !resend{ if !resend {
err = storage.Auth().AddSent(partner.ID, partner.DhPubKey, newPrivKey, err = storage.Auth().AddSent(partner.ID, partner.DhPubKey, newPrivKey,
newPrivKey, confirmFp) newPrivKey, confirmFp)
if err != nil { if err != nil {
...@@ -160,7 +164,7 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader, ...@@ -160,7 +164,7 @@ func RequestAuth(partner, me contact.Contact, message string, rng io.Reader,
if err != nil { if err != nil {
// if the send fails just set it to failed, it will // if the send fails just set it to failed, it will
// but automatically retried // 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, "(msgDigest: %s) failed to transmit: %+v", partner.ID,
cmixMsg.Digest(), err) cmixMsg.Digest(), err)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment