/encryption fix Secret
Created
October 12, 2021 12:21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- ../dev/ssb-db2/db.js 2021-10-08 16:06:25.940263824 +0200 | |
+++ ../.npm/_npx/579807bda2bff0c6/node_modules/ssb-db2/db.js 2021-10-12 14:20:22.187917581 +0200 | |
@@ -31,6 +31,7 @@ | |
const makeBaseIndex = require('./indexes/base') | |
const KeysIndex = require('./indexes/keys') | |
const PrivateIndex = require('./indexes/private') | |
+const { reEncrypt } = require('./indexes/private') | |
const { where, fromDB, key, author, deferred, toCallback, asOffsets } = | |
operators | |
@@ -323,9 +324,12 @@ | |
(ready) => ready === true, | |
() => { | |
if (Ref.isFeedId(msgVal.author)) { | |
- const previous = (state[msgVal.author] || { value: null }).value | |
+ const previous = reEncrypt(state[msgVal.author] || { value: null }).value | |
validate2.validateSingle(hmacKey, msgVal, previous, (err, key) => { | |
if (err) { | |
+ console.log(state[msgVal.author]) | |
+ console.log(state[msgVal.author].value.content) | |
+ console.log(msgVal) | |
debug( | |
`validation failed for classic message in addImmediately(): ${err.message}` | |
) | |
@@ -343,6 +347,8 @@ | |
const previous = (state[msgVal.author] || { value: null }).value | |
const err = bendyButt.validateSingle(msgVal, previous, hmacKey) | |
if (err) { | |
+ console.log(state[msgVal.author].value.content) | |
+ console.log(msgVal) | |
debug( | |
`validation failed for bendy butt message in addImmediately(): ${err.message}` | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment