diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js index 9a30abb33..a7bea1fb9 100644 --- a/www/common/outer/async-store.js +++ b/www/common/outer/async-store.js @@ -495,8 +495,15 @@ define([ }; toSign.drive = secret.channel; toSign.edPublic = edPublic; - var signKey = Crypto.Nacl.util.decodeBase64(secret.keys.signKey); + var signKey = Crypto.Nacl.util.decodeBase64(store.proxy.edPrivate); var proof = Crypto.Nacl.sign.detached(Crypto.Nacl.util.decodeUTF8(Sortify(toSign)), signKey); + + var check = Crypto.Nacl.sign.detached.verify(Crypto.Nacl.util.decodeUTF8(Sortify(toSign)), + proof, + Crypto.Nacl.util.decodeBase64(edPublic)); + + if (!check) { console.error('signed message failed verification'); } + var proofTxt = Crypto.Nacl.util.encodeBase64(proof); cb({ proof: proofTxt,