hypercore 10.24.0 → 10.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core.js +1 -1
- package/lib/manifest.js +4 -0
- package/package.json +1 -1
package/lib/core.js
CHANGED
|
@@ -494,7 +494,7 @@ module.exports = class Core {
|
|
|
494
494
|
|
|
495
495
|
const verifier = this.verifier || createVerifier(manifest, { compat: isCompat(this.header.key, manifest), crypto: this.crypto, legacy: this._legacy })
|
|
496
496
|
|
|
497
|
-
if (!
|
|
497
|
+
if (!verifier.verify(batch, batch.signature)) {
|
|
498
498
|
throw INVALID_SIGNATURE('Proof contains an invalid signature')
|
|
499
499
|
}
|
|
500
500
|
|
package/lib/manifest.js
CHANGED
|
@@ -44,6 +44,7 @@ class CompatVerifier {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
verify (batch, signature) {
|
|
47
|
+
if (!signature) return false
|
|
47
48
|
return this.crypto.verify(batch.signableCompat(this.legacy), signature, this.publicKey)
|
|
48
49
|
}
|
|
49
50
|
}
|
|
@@ -63,6 +64,7 @@ class SingleVerifier {
|
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
verify (batch, signature) {
|
|
67
|
+
if (!signature) return false
|
|
66
68
|
return this.crypto.verify(batch.signable(this.namespace), signature, this.publicKey)
|
|
67
69
|
}
|
|
68
70
|
}
|
|
@@ -82,6 +84,8 @@ class MultiVerifier {
|
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
verify (batch, signature) {
|
|
87
|
+
if (!signature) return false
|
|
88
|
+
|
|
85
89
|
const inputs = multisig.inflate(signature)
|
|
86
90
|
|
|
87
91
|
if (inputs.length < this.quorum) return false
|