tangled
alpha
login
or
join now
vielle.dev
/
pdsls
forked from
pds.ls/pdsls
0
fork
atom
atproto explorer
0
fork
atom
overview
issues
pulls
pipelines
fix uint8array type errors
handle.invalid
6 months ago
10cdef46
63109085
+6
-2
1 changed file
expand all
collapse all
unified
split
src
utils
verify.ts
+6
-2
src/utils/verify.ts
···
149
const { sig, ...unsigned } = commit;
150
151
const data = CBOR.encode(unsigned);
152
-
const valid = await verifySig(publicKey, CBOR.fromBytes(sig), data);
0
0
0
0
153
154
if (!valid) {
155
errors.push({ message: `signature verification failed` });
···
234
key = key.substring(0, entry.p) + decoder.decode(CBOR.fromBytes(entry.k));
235
236
// Calculate depth based on leading zeros in the hash
237
-
const keyDigest = await toSha256(encoder.encode(key));
238
let zeroCount = 0;
239
240
outerLoop: for (const byte of keyDigest) {
···
149
const { sig, ...unsigned } = commit;
150
151
const data = CBOR.encode(unsigned);
152
+
const valid = await verifySig(
153
+
publicKey,
154
+
CBOR.fromBytes(sig) as Uint8Array<ArrayBuffer>,
155
+
data as Uint8Array<ArrayBuffer>,
156
+
);
157
158
if (!valid) {
159
errors.push({ message: `signature verification failed` });
···
238
key = key.substring(0, entry.p) + decoder.decode(CBOR.fromBytes(entry.k));
239
240
// Calculate depth based on leading zeros in the hash
241
+
const keyDigest = await toSha256(encoder.encode(key) as Uint8Array<ArrayBuffer>);
242
let zeroCount = 0;
243
244
outerLoop: for (const byte of keyDigest) {