Skip to content

Commit

Permalink
verify discoveryKey
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmarkclements committed Jun 11, 2024
1 parent b593b96 commit c241742
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions subsystems/sidecar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -728,11 +728,10 @@ class Sidecar extends ReadyResource {

if (trusted.apps.has(state.key.z32) === false) {
const author = await appBundle.db.get('author')
let authorTrusted = author !== null && await trusted.identities.get(author.publicKey)
if (authorTrusted) {
const data = '' // TODO: need correct data to verify from hypercore/hypercore
authorTrusted = await crypto.verify(data, author.attestation, author.publicKey)
}
const authorTrusted = author !== null &&
await trusted.identities.get(author.publicKey) &&
await crypto.verify(drive.discoveryKey, author.attestation, author.publicKey)

if (authorTrusted === false) {
const err = ERR_PERMISSION_REQUIRED('Permission required to run key')
err.key = state.key
Expand Down

0 comments on commit c241742

Please sign in to comment.