working on pake

This commit is contained in:
Zack Scholl 2019-11-12 08:33:46 -08:00
parent e2038a7d69
commit 1b183b9a9e
4 changed files with 6 additions and 4 deletions

View File

@ -297,7 +297,7 @@ func (c *Client) getPAKE(keepSending bool) (err error) {
log.Error(err)
return
}
log.Debugf("payload: %s", payload)
err = c.Pake.Update(payload)
if err != nil {
log.Error(err)

View File

@ -124,14 +124,12 @@
}
const socketMessageListener = (event) => {
console.log(event.data);
var data;
if (event.data.includes("Message")) {
data = JSON.parse(event.data);
} else {
data = JSON.parse(atob(event.data));
}
console.log(data);
if (data.Message == "pake") {
log("processing pake data");
// console.log(pakeData);
@ -142,6 +140,7 @@
"Payload": pakePublic(pakeData),
})
} else if (data.Message == "offerer") {
log("i am the offerer")
log("offering the first pake");
sendMessage({
"Message": "answerer",

View File

@ -228,7 +228,10 @@ func pakeUpdate(this js.Value, inputs []js.Value) interface{} {
if err != nil {
return js.Global().Get("Error").New(err.Error())
}
P.Update(Q.Bytes())
err = P.Update(Q.Bytes())
if err != nil {
return js.Global().Get("Error").New(err.Error())
}
bJSON, _ := json.Marshal(P)
return base64.StdEncoding.EncodeToString(bJSON)
}

Binary file not shown.