forro

Forro is a end-to-end encrypted contract form based on PGP.
git clone git://git.defalsify.org/forro.git
Log | Files | Refs | LICENSE

commit e740b599c07e75daf57427d68985de87144509d6
parent 21fcd1267b558e84c7e019c3013b2aa827f38b79
Author: lash <dev@holbrook.no>
Date:   Thu, 22 Sep 2022 07:07:49 +0000

Encrypt message for sender

Diffstat:
MCHANGELOG | 2++
Mindex.html | 11+++++++----
Mkey.js | 4++--
3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG @@ -1,3 +1,5 @@ +- 0.0.5 + * encrypt payload also for sender - 0.0.4 * settable passphrase for key encryption * delete key function diff --git a/index.html b/index.html @@ -263,11 +263,16 @@ let g_counter = undefined; binary: msg_sig_inner, }); + const enckey_local = await g_local_key.getEncryptionKey(); + const enckey_remote = await g_remote_key.getEncryptionKey(); + const enc = await openpgp.encrypt({ - encryptionKeys: g_remote_key, + encryptionKeys: [g_remote_key, g_local_key], format: 'binary', message: msg_sig, }); + + console.debug('encrypted for keys', enckey_local.getKeyID().toHex(), enckey_remote.getKeyID().toHex()); let envelope = await openpgp.createMessage({ binary: enc, @@ -316,7 +321,6 @@ let g_counter = undefined; }); const pubkey_auth = await generateAuth(g_local_key, envelope_pubkey); - res = await fetch(g_data_endpoint + '/' + PUBKEY_PFX + g_remote_key.getFingerprint(), { method: 'PUT', body: enc_pubkey, @@ -326,7 +330,6 @@ let g_counter = undefined; } }); - rcpt_pubkey = await res.text(); stateChange(rcpt_pubkey, STATE['ACK_PUBKEY']); stateChange('publickey submit complete', undefined, STATE['ACK_PUBKEY']); @@ -488,7 +491,7 @@ h1 { > - <h1><a href="https://git.defalsify.org/cgit/forro">forro v0.0.4 (GPLv3)</a></h1> + <h1><a href="https://git.defalsify.org/cgit/forro">forro v0.0.5 (GPLv3)</a></h1> <div id="app"> <div id="helpdiv" style="height: 6em;" diff --git a/key.js b/key.js @@ -5,7 +5,7 @@ async function generatePGPKey(pwd, uid) { email: "ola@nordmann.no", }; } - uid.comment = 'Generated by forro v0.0.3, openpgpjs/5.5.0'; + uid.comment = 'Generated by forro/0.0.5, openpgpjs/5.5.0'; return new Promise(async (whohoo, doh) => { let v = await openpgp.generateKey({ //type: 'ecc', @@ -95,7 +95,7 @@ async function identify(pk, name, email, pwd) { const u = openpgp.UserIDPacket.fromObject({ name: name, email: email, - comment: 'manual entry on forro', + comment: 'manual entry on forro/0.0.5, openpgp/5.5.0', }); let l = pk.toPacketList(); l.push(u);