@ghostlytools/cli 1.10.3 → 1.10.4
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/dist/assets/{api-BdaxsDvA.js → api-DgS7f5TT.js} +2 -2
- package/dist/assets/{api-C4MLg5Rs.js → api-DkcMOWLX.js} +12 -12
- package/dist/assets/api-DkcMOWLX.js.map +1 -0
- package/dist/assets/{apiKit-BbNaxZGZ.js → apiKit-D6Oj-vFx.js} +2 -2
- package/dist/assets/{apiKit-BbNaxZGZ.js.map → apiKit-D6Oj-vFx.js.map} +1 -1
- package/dist/assets/{apps-BluQgEhv.js → apps-B22SeD6T.js} +3 -3
- package/dist/assets/{apps-BluQgEhv.js.map → apps-B22SeD6T.js.map} +1 -1
- package/dist/assets/{apps-BtGFth7o.js → apps-DgALLHzS.js} +1 -1
- package/dist/assets/{arkade-DdZx4b_I.js → arkade-D5cPr_dV.js} +2 -2
- package/dist/assets/{arkade-DdZx4b_I.js.map → arkade-D5cPr_dV.js.map} +1 -1
- package/dist/assets/{backup-I1n7ccz7.js → backup-DndsW2uX.js} +1 -1
- package/dist/assets/{backup-DyDsW7sC.js → backup-dzJLzg-k.js} +6 -6
- package/dist/assets/{backup-DyDsW7sC.js.map → backup-dzJLzg-k.js.map} +1 -1
- package/dist/assets/{blobFiles-BnjN_Vrz.js → blobFiles-XZ9PEXYy.js} +2 -2
- package/dist/assets/{blobFiles-BnjN_Vrz.js.map → blobFiles-XZ9PEXYy.js.map} +1 -1
- package/dist/assets/{buttons-Do7dCku6.js → buttons-ByKT_vP8.js} +3 -3
- package/dist/assets/{buttons-Do7dCku6.js.map → buttons-ByKT_vP8.js.map} +1 -1
- package/dist/assets/buttons-TVCNj280.js +2 -0
- package/dist/assets/{client-CWsjRiH8.js → client-q7dVOtYb.js} +10 -4
- package/dist/assets/client-q7dVOtYb.js.map +1 -0
- package/dist/assets/{codec-DPaXhuYc.js → codec-HD6iOn_D.js} +2 -2
- package/dist/assets/{codec-DPaXhuYc.js.map → codec-HD6iOn_D.js.map} +1 -1
- package/dist/assets/{envelope-5Gu9yGk_.js → envelope-C-0tfbOG.js} +2 -2
- package/dist/assets/{envelope-5Gu9yGk_.js.map → envelope-C-0tfbOG.js.map} +1 -1
- package/dist/assets/{fileBytes-DjBYYyXT.js → fileBytes-BABGEF13.js} +2 -2
- package/dist/assets/{fileBytes-DjBYYyXT.js.map → fileBytes-BABGEF13.js.map} +1 -1
- package/dist/assets/{fileBytes-DMzrIdCu.js → fileBytes-CQQK2uOh.js} +1 -1
- package/dist/assets/{fileBytes-Douk1yOp.js → fileBytes-DqnfKIkj.js} +2 -2
- package/dist/assets/{fileBytes-Douk1yOp.js.map → fileBytes-DqnfKIkj.js.map} +1 -1
- package/dist/assets/fileBytesIdb-BtXATa7j.js +2 -0
- package/dist/assets/{fileBytesIdb-CkClu9YI.js → fileBytesIdb-DrXmDUSy.js} +2 -2
- package/dist/assets/{fileBytesIdb-CkClu9YI.js.map → fileBytesIdb-DrXmDUSy.js.map} +1 -1
- package/dist/assets/{fileBytesOpfs-WryQuOgK.js → fileBytesOpfs-udKCzcLe.js} +6 -9
- package/dist/assets/{fileBytesOpfs-WryQuOgK.js.map → fileBytesOpfs-udKCzcLe.js.map} +1 -1
- package/dist/assets/{fixedHosts-PR1BcfKX.js → fixedHosts-CN3CsslV.js} +3 -3
- package/dist/assets/{fixedHosts-PR1BcfKX.js.map → fixedHosts-CN3CsslV.js.map} +1 -1
- package/dist/assets/{groupFiles-BuToTMUk.js → groupFiles-BFv9K_za.js} +104 -81
- package/dist/assets/groupFiles-BFv9K_za.js.map +1 -0
- package/dist/assets/{host-fkQYBvKH.js → host-C-wwtVt2.js} +162 -41
- package/dist/assets/host-C-wwtVt2.js.map +1 -0
- package/dist/assets/{hyperdhtRelay-DDCak5PY.js → hyperdhtRelay-B9EQTm_M.js} +2 -2
- package/dist/assets/{hyperdhtRelay-DDCak5PY.js.map → hyperdhtRelay-B9EQTm_M.js.map} +1 -1
- package/dist/assets/{irohWeb-B4_swKx0.js → irohWeb-o0H_NlCF.js} +2 -2
- package/dist/assets/{irohWeb-B4_swKx0.js.map → irohWeb-o0H_NlCF.js.map} +1 -1
- package/dist/assets/{main-ClYsttvY.js → main-CLUIPy4d.js} +19 -19
- package/dist/assets/{main-ClYsttvY.js.map → main-CLUIPy4d.js.map} +1 -1
- package/dist/assets/{mainline-Hsk2SZ1B.js → mainline-B2qmNsib.js} +94 -2
- package/dist/assets/mainline-B2qmNsib.js.map +1 -0
- package/dist/assets/{networkReason-C9Hr-hO7.js → networkReason-BEl-DDWd.js} +3 -3
- package/dist/assets/{networkReason-C9Hr-hO7.js.map → networkReason-BEl-DDWd.js.map} +1 -1
- package/dist/assets/{nwc-BbK6qNxS.js → nwc-BNkhjJHN.js} +3 -3
- package/dist/assets/{nwc-BbK6qNxS.js.map → nwc-BNkhjJHN.js.map} +1 -1
- package/dist/assets/{nwcProvider-D_tt2X3Z.js → nwcProvider-CvaRJdHT.js} +2 -2
- package/dist/assets/{nwcProvider-D_tt2X3Z.js.map → nwcProvider-CvaRJdHT.js.map} +1 -1
- package/dist/assets/{ownDid-DkK_jem4.js → ownDid-D67KNdJq.js} +3 -2
- package/dist/assets/ownDid-D67KNdJq.js.map +1 -0
- package/dist/assets/{profiles-aV9vaK0B.js → profiles-QDB7V_Qt.js} +3 -3
- package/dist/assets/{profiles-aV9vaK0B.js.map → profiles-QDB7V_Qt.js.map} +1 -1
- package/dist/assets/{registry-CEjnubep.js → registry-BKkSnpjL.js} +123 -17
- package/dist/assets/registry-BKkSnpjL.js.map +1 -0
- package/dist/assets/{registry-C9T6tYCO.js → registry-DN5a8Ul6.js} +1 -1
- package/dist/assets/{resolve-BBOrN13E.js → resolve-DhpAggDP.js} +2 -2
- package/dist/assets/{resolve-BBOrN13E.js.map → resolve-DhpAggDP.js.map} +1 -1
- package/dist/assets/{server-BJ3T-kx3.js → server-7w2O5wsv.js} +722 -183
- package/dist/assets/server-7w2O5wsv.js.map +1 -0
- package/dist/assets/{src-BIdfHB7t.js → src-BZkY6N3J.js} +668 -140
- package/dist/assets/src-BZkY6N3J.js.map +1 -0
- package/dist/assets/{sshForges-CRg-NGld.js → sshForges-Cxjt3c51.js} +2 -2
- package/dist/assets/{sshForges-CRg-NGld.js.map → sshForges-Cxjt3c51.js.map} +1 -1
- package/dist/assets/{translate-b0X61WMI.js → translate-v8wF1GcF.js} +2 -2
- package/dist/assets/{translate-b0X61WMI.js.map → translate-v8wF1GcF.js.map} +1 -1
- package/dist/assets/{usdt-6CQdfye1.js → usdt-63gYjM5E.js} +3 -3
- package/dist/assets/{usdt-6CQdfye1.js.map → usdt-63gYjM5E.js.map} +1 -1
- package/dist/assets/{words-Dk6o6wz4.js → words-PUnyO4ph.js} +3 -3
- package/dist/assets/words-PUnyO4ph.js.map +1 -0
- package/dist/ghostly.mjs +1 -1
- package/package.json +1 -1
- package/dist/assets/api-C4MLg5Rs.js.map +0 -1
- package/dist/assets/buttons-DpjwXePb.js +0 -2
- package/dist/assets/client-CWsjRiH8.js.map +0 -1
- package/dist/assets/fileBytesIdb-CD5Uv490.js +0 -2
- package/dist/assets/groupFiles-BuToTMUk.js.map +0 -1
- package/dist/assets/host-fkQYBvKH.js.map +0 -1
- package/dist/assets/mainline-Hsk2SZ1B.js.map +0 -1
- package/dist/assets/ownDid-DkK_jem4.js.map +0 -1
- package/dist/assets/registry-CEjnubep.js.map +0 -1
- package/dist/assets/server-BJ3T-kx3.js.map +0 -1
- package/dist/assets/src-BIdfHB7t.js.map +0 -1
- package/dist/assets/words-Dk6o6wz4.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as SSHSIG_NAMESPACE, At as didJwsAlg, Bt as parseDidSignaturePaste, Bu as RELAY_PAYLOAD_MAX_BYTES, Cn as pubkyProofFile, Ct as DID_DOCUMENT_MAX_BYTES, Dt as checkDidJws, En as pubkyHomeserverOf, Et as DidError, Ft as didWebFileUrl, Ht as staticDidDocument, It as didWebHost, Lt as normalizeDid, Mt as didWebDocumentUrl, Nt as didWebFile, Ot as checkDidSignature, Pt as didWebFileNames, Rt as parseDid, Sn as pubkyProofCapability, St as verifyAtprotoRecordProof, Tn as homeserverWebEndpoint, Ut as strictBase64Url, Uu as openRelayPayload, Vt as signingKeys, Wt as DidDhtError, Yt as resolveDidDht, _n as PUBKY_PROOF_MAX_BYTES, _t as isAtprotoDid, ad as toBase64Url, at as verifySshSignature, bn as newPubkyProofFolder, bt as shortAtprotoDid, ca as dnsProofName, cd as utf8Encode, ct as decodeAnyBitcoinAddress, dt as ATPROTO_PROOF_COLLECTION, et as SshSigError, ft as ATPROTO_PROOF_SCOPE, gt as checkAtprotoProofRecord, ht as atprotoProofRkey, id as randomBytes, it as sshSignCommand, ji as IdentityCheckUnavailable, jt as didSignedMessages, kt as didGhostlyServiceEntry, la as domainTxtRecord, lt as ATPROTO_DECLARED_SCOPE, ma as normalizeDomain, mt as atprotoProofRecord, nd as fromBase64Url, nt as parseSshSignature, ot as verifyBitcoinMessage, sd as utf8Decode, st as BitcoinAddressError, tt as parseSshPublicKey, ua as domainWellKnownFile, ut as ATPROTO_FULL_SCOPE, vn as isPubkyKey, vt as normalizeAtprotoHandle, wn as pubkyProofPath, wt as DID_FILE_MAX_BYTES, xn as normalizePubkyKey, xt as AtprotoProofError, ya as wellKnownUrl, yn as isPubkyProofFolder, zt as parseDidDocument } from "./src-
|
|
2
|
-
import { c as boundedIdentityFetch, i as registeredIdentityProviders, s as reserveAdapterIds, t as ownDid, u as testBuild } from "./ownDid-
|
|
3
|
-
import { a as verifiedAtprotoHandle, c as assertDomainRecord, d as chosenResolver, f as resolverById, i as resolveAtprotoHandle, l as assertNip05, p as pkarrRelays, r as resolveAtprotoDid, s as DomainCheckError, t as assertPublicServer, u as assertPublicHost } from "./resolve-
|
|
4
|
-
import { a as PUBKY_RELAYS, c as isConfigured, d as providerForIssuer, i as validForgeLogin, l as issuerFor, n as SSH_FORGE_LABEL, o as audiences, r as checkSshForge, s as clientIdFor, t as SSH_FORGE_HOST, u as oidcProviders } from "./sshForges-
|
|
1
|
+
import { $ as SSHSIG_NAMESPACE, At as didJwsAlg, Bt as parseDidSignaturePaste, Bu as RELAY_PAYLOAD_MAX_BYTES, Cn as pubkyProofFile, Ct as DID_DOCUMENT_MAX_BYTES, Dt as checkDidJws, En as pubkyHomeserverOf, Et as DidError, Ft as didWebFileUrl, Ht as staticDidDocument, It as didWebHost, Lt as normalizeDid, Mt as didWebDocumentUrl, Nt as didWebFile, Ot as checkDidSignature, Pt as didWebFileNames, Rt as parseDid, Sn as pubkyProofCapability, St as verifyAtprotoRecordProof, Tn as homeserverWebEndpoint, Ut as strictBase64Url, Uu as openRelayPayload, Vt as signingKeys, Wt as DidDhtError, Yt as resolveDidDht, _n as PUBKY_PROOF_MAX_BYTES, _t as isAtprotoDid, ad as toBase64Url, at as verifySshSignature, bn as newPubkyProofFolder, bt as shortAtprotoDid, ca as dnsProofName, cd as utf8Encode, ct as decodeAnyBitcoinAddress, dt as ATPROTO_PROOF_COLLECTION, et as SshSigError, ft as ATPROTO_PROOF_SCOPE, gt as checkAtprotoProofRecord, ht as atprotoProofRkey, id as randomBytes, it as sshSignCommand, ji as IdentityCheckUnavailable, jt as didSignedMessages, kt as didGhostlyServiceEntry, la as domainTxtRecord, lt as ATPROTO_DECLARED_SCOPE, ma as normalizeDomain, mt as atprotoProofRecord, nd as fromBase64Url, nt as parseSshSignature, ot as verifyBitcoinMessage, sd as utf8Decode, st as BitcoinAddressError, tt as parseSshPublicKey, ua as domainWellKnownFile, ut as ATPROTO_FULL_SCOPE, vn as isPubkyKey, vt as normalizeAtprotoHandle, wn as pubkyProofPath, wt as DID_FILE_MAX_BYTES, xn as normalizePubkyKey, xt as AtprotoProofError, ya as wellKnownUrl, yn as isPubkyProofFolder, zt as parseDidDocument } from "./src-BZkY6N3J.js";
|
|
2
|
+
import { c as boundedIdentityFetch, i as registeredIdentityProviders, s as reserveAdapterIds, t as ownDid, u as testBuild } from "./ownDid-D67KNdJq.js";
|
|
3
|
+
import { a as verifiedAtprotoHandle, c as assertDomainRecord, d as chosenResolver, f as resolverById, i as resolveAtprotoHandle, l as assertNip05, p as pkarrRelays, r as resolveAtprotoDid, s as DomainCheckError, t as assertPublicServer, u as assertPublicHost } from "./resolve-DhpAggDP.js";
|
|
4
|
+
import { a as PUBKY_RELAYS, c as isConfigured, d as providerForIssuer, i as validForgeLogin, l as issuerFor, n as SSH_FORGE_LABEL, o as audiences, r as checkSshForge, s as clientIdFor, t as SSH_FORGE_HOST, u as oidcProviders } from "./sshForges-Cxjt3c51.js";
|
|
5
5
|
import { ed25519 } from "@noble/curves/ed25519.js";
|
|
6
6
|
import { sha256 } from "@noble/hashes/sha2.js";
|
|
7
7
|
import { schnorr } from "@noble/curves/secp256k1.js";
|
|
@@ -718,6 +718,10 @@ var PGP_LIMITS = {
|
|
|
718
718
|
sharedKey: 9216,
|
|
719
719
|
/** User IDs kept in the minimal key and shown. */
|
|
720
720
|
userIds: 16,
|
|
721
|
+
/** Signatures of one kind on one part of a shared key (self-certifications of a user ID, binding signatures, revocations). */
|
|
722
|
+
signaturesPerKind: 2,
|
|
723
|
+
/** Signatures in a shared key, back-signatures included: each costs one verification, ~10 ms in JavaScript for brainpoolP512r1. */
|
|
724
|
+
keySignatures: 20,
|
|
721
725
|
/** Bytes per user ID. */
|
|
722
726
|
userIdLength: 256,
|
|
723
727
|
/** A keyserver response. */
|
|
@@ -894,6 +898,92 @@ async function readOneKey(pgp, input) {
|
|
|
894
898
|
assertRsaSizes(key);
|
|
895
899
|
return key;
|
|
896
900
|
}
|
|
901
|
+
/** Every signature group of a key, with what it signs. */
|
|
902
|
+
function signedParts(pgp, key) {
|
|
903
|
+
const t = pgp.enums.signature, primary = key.keyPacket;
|
|
904
|
+
const direct = key.directSignatures ?? [];
|
|
905
|
+
return [
|
|
906
|
+
{
|
|
907
|
+
sigs: key.revocationSignatures,
|
|
908
|
+
type: t.keyRevocation,
|
|
909
|
+
data: { key: primary },
|
|
910
|
+
by: primary
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
sigs: direct,
|
|
914
|
+
type: t.key,
|
|
915
|
+
data: { key: primary },
|
|
916
|
+
by: primary
|
|
917
|
+
},
|
|
918
|
+
...key.users.flatMap((u) => [{
|
|
919
|
+
sigs: u.selfCertifications,
|
|
920
|
+
type: t.certGeneric,
|
|
921
|
+
data: {
|
|
922
|
+
userID: u.userID,
|
|
923
|
+
key: primary
|
|
924
|
+
},
|
|
925
|
+
by: primary
|
|
926
|
+
}, {
|
|
927
|
+
sigs: u.revocationSignatures,
|
|
928
|
+
type: t.certRevocation,
|
|
929
|
+
data: {
|
|
930
|
+
userID: u.userID,
|
|
931
|
+
key: primary
|
|
932
|
+
},
|
|
933
|
+
by: primary
|
|
934
|
+
}]),
|
|
935
|
+
...key.subkeys.flatMap((s) => {
|
|
936
|
+
const data = {
|
|
937
|
+
key: primary,
|
|
938
|
+
bind: s.keyPacket
|
|
939
|
+
};
|
|
940
|
+
return [
|
|
941
|
+
{
|
|
942
|
+
sigs: s.bindingSignatures,
|
|
943
|
+
type: t.subkeyBinding,
|
|
944
|
+
data,
|
|
945
|
+
by: primary
|
|
946
|
+
},
|
|
947
|
+
{
|
|
948
|
+
sigs: s.bindingSignatures.flatMap((b) => b.embeddedSignature ? [b.embeddedSignature] : []),
|
|
949
|
+
type: t.keyBinding,
|
|
950
|
+
data,
|
|
951
|
+
by: s.keyPacket
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
sigs: s.revocationSignatures,
|
|
955
|
+
type: t.subkeyRevocation,
|
|
956
|
+
data,
|
|
957
|
+
by: primary
|
|
958
|
+
}
|
|
959
|
+
];
|
|
960
|
+
})
|
|
961
|
+
];
|
|
962
|
+
}
|
|
963
|
+
/** Whether a signature verifies, at `date` or, with null, whenever. OpenPGP.js caches a success, not a failure. */
|
|
964
|
+
var holds = (part, sig, date, cfg) => sig.verify(part.by, part.type, part.data, date, void 0, cfg).then(() => true, () => false);
|
|
965
|
+
/**
|
|
966
|
+
* A contact's key has the shape `minimalKey` writes, and every signature in it verifies, before OpenPGP.js
|
|
967
|
+
* looks at it: it re-verifies a signature that failed on each of its passes over the key, so padding a key
|
|
968
|
+
* with spoiled copies of its own self-signatures (which pass the hash-prefix check) multiplied the cost of a check.
|
|
969
|
+
* Here each signature is verified once, success is cached, and the first failure refuses the key.
|
|
970
|
+
*/
|
|
971
|
+
async function assertMinimalKey(pgp, key) {
|
|
972
|
+
const cfg = config(pgp);
|
|
973
|
+
const parts = signedParts(pgp, key);
|
|
974
|
+
if (key.users.length > PGP_LIMITS.userIds || key.subkeys.length > 1 || key.users.some((u) => !u.userID || u.otherCertifications.length) || parts.some((p) => p.sigs.length > PGP_LIMITS.signaturesPerKind) || parts.reduce((n, p) => n + p.sigs.length, 0) > PGP_LIMITS.keySignatures) throw new PgpProofError("Invalid OpenPGP proof");
|
|
975
|
+
for (const part of parts) for (const sig of part.sigs) if (!await holds(part, sig, null, cfg)) throw new PgpProofError("Invalid OpenPGP proof");
|
|
976
|
+
}
|
|
977
|
+
/** The newest signature of `part` valid at each date, once each: what a check at those dates uses. */
|
|
978
|
+
async function newestValid(part, dates, cfg) {
|
|
979
|
+
const kept = /* @__PURE__ */ new Set();
|
|
980
|
+
for (const date of dates) {
|
|
981
|
+
let best;
|
|
982
|
+
for (const sig of part.sigs) if ((!best || sig.created >= best.created) && await holds(part, sig, date, cfg)) best = sig;
|
|
983
|
+
if (best) kept.add(best);
|
|
984
|
+
}
|
|
985
|
+
return [...kept];
|
|
986
|
+
}
|
|
897
987
|
/** Valid, unrevoked, self-certified user IDs at `at`. */
|
|
898
988
|
async function validUserIds(key, at, cfg) {
|
|
899
989
|
const valid = [];
|
|
@@ -906,20 +996,30 @@ async function validUserIds(key, at, cfg) {
|
|
|
906
996
|
/**
|
|
907
997
|
* The transferable key a contact receives: primary key and its direct/revocation
|
|
908
998
|
* signatures, valid user IDs with self-certifications only (third-party
|
|
909
|
-
* certifications and photos dropped), and the one subkey that signed.
|
|
999
|
+
* certifications and photos dropped), and the one subkey that signed. Of each
|
|
1000
|
+
* kind of self-signature, only the newest valid now and the newest valid when
|
|
1001
|
+
* it signed are kept (superseded ones are what `assertMinimalKey` refuses).
|
|
910
1002
|
*/
|
|
911
|
-
async function minimalKey(pgp, key, signer, at, cfg) {
|
|
1003
|
+
async function minimalKey(pgp, key, signer, at, signedAt, cfg) {
|
|
1004
|
+
const parts = signedParts(pgp, key);
|
|
1005
|
+
const part = (sigs) => parts.find((p) => p.sigs === sigs);
|
|
1006
|
+
const kept = (sigs) => newestValid(part(sigs), [at, signedAt], cfg);
|
|
1007
|
+
const revocations = async (sigs) => {
|
|
1008
|
+
const valid = [];
|
|
1009
|
+
for (const sig of sigs) if (await holds(part(sigs), sig, null, cfg)) valid.push(sig);
|
|
1010
|
+
return valid.sort((a, b) => b.created.getTime() - a.created.getTime()).slice(0, PGP_LIMITS.signaturesPerKind);
|
|
1011
|
+
};
|
|
912
1012
|
const packets = new pgp.PacketList();
|
|
913
|
-
packets.push(key.keyPacket, ...key.revocationSignatures);
|
|
914
|
-
|
|
915
|
-
packets.push(...
|
|
916
|
-
for (const user of await validUserIds(key, at, cfg)) packets.push(user.userID, ...user.selfCertifications, ...user.revocationSignatures);
|
|
1013
|
+
packets.push(key.keyPacket, ...await revocations(key.revocationSignatures));
|
|
1014
|
+
packets.push(...await kept(parts[1].sigs));
|
|
1015
|
+
for (const user of await validUserIds(key, at, cfg)) packets.push(user.userID, ...await kept(user.selfCertifications), ...await revocations(user.revocationSignatures));
|
|
917
1016
|
if (signer !== key) {
|
|
918
1017
|
const sub = signer;
|
|
919
|
-
packets.push(sub.keyPacket, ...sub.bindingSignatures, ...sub.revocationSignatures);
|
|
1018
|
+
packets.push(sub.keyPacket, ...await kept(sub.bindingSignatures), ...await revocations(sub.revocationSignatures));
|
|
920
1019
|
}
|
|
1020
|
+
const sigs = packets.filter((p) => p instanceof pgp.SignaturePacket);
|
|
921
1021
|
const bytes = new pgp.PublicKey(packets).write();
|
|
922
|
-
if (bytes.length > PGP_LIMITS.sharedKey) throw new PgpProofError("This key is too large to share, even without third-party certifications. Remove old user IDs or use a smaller key.");
|
|
1022
|
+
if (bytes.length > PGP_LIMITS.sharedKey || sigs.length + sigs.filter((s) => s.embeddedSignature).length > PGP_LIMITS.keySignatures) throw new PgpProofError("This key is too large to share, even without third-party certifications. Remove old user IDs or use a smaller key.");
|
|
923
1023
|
return bytes;
|
|
924
1024
|
}
|
|
925
1025
|
async function keyInfo(key, signer, algorithm, at, cfg) {
|
|
@@ -1074,11 +1174,12 @@ async function preparePgpEvidence(input, options = {}) {
|
|
|
1074
1174
|
single.push(sig);
|
|
1075
1175
|
const signature = new pgp.Signature(single).write();
|
|
1076
1176
|
if (signature.length > PGP_LIMITS.sharedSignature) throw new PgpProofError("This signature is too large to share.");
|
|
1077
|
-
const
|
|
1177
|
+
const now = options.now ?? nowSeconds();
|
|
1178
|
+
const at = /* @__PURE__ */ new Date(now * 1e3), signedAt = /* @__PURE__ */ new Date(Math.min(info.signedAt, now) * 1e3);
|
|
1078
1179
|
return {
|
|
1079
1180
|
evidence: {
|
|
1080
1181
|
scheme: PGP_SCHEME,
|
|
1081
|
-
key: toBase64Url(await minimalKey(pgp, key, signer, at, config(pgp))),
|
|
1182
|
+
key: toBase64Url(await minimalKey(pgp, key, signer, at, signedAt, config(pgp))),
|
|
1082
1183
|
signature: toBase64Url(signature)
|
|
1083
1184
|
},
|
|
1084
1185
|
verified: info
|
|
@@ -1107,7 +1208,9 @@ async function verifyPgpEvidence(raw, statement, options = {}) {
|
|
|
1107
1208
|
const evidence = parsePgpEvidence(raw);
|
|
1108
1209
|
const keyBytes = fromBase64Url(evidence.key), sigBytes = fromBase64Url(evidence.signature);
|
|
1109
1210
|
const pgp = await loadOpenPgp();
|
|
1110
|
-
|
|
1211
|
+
const key = await readOneKey(pgp, { binary: keyBytes });
|
|
1212
|
+
await assertMinimalKey(pgp, key);
|
|
1213
|
+
return (await verifyPacket(pgp, key, await readSignaturePacket(pgp, { binary: sigBytes }), statement, options)).info;
|
|
1111
1214
|
}
|
|
1112
1215
|
/** Groups of four, as gpg prints fingerprints. */
|
|
1113
1216
|
function formatFingerprint(fingerprint) {
|
|
@@ -1450,7 +1553,10 @@ function forgeProvider(forge) {
|
|
|
1450
1553
|
defaultDays: 90,
|
|
1451
1554
|
maxDays: 365
|
|
1452
1555
|
},
|
|
1453
|
-
recheck: {
|
|
1556
|
+
recheck: {
|
|
1557
|
+
afterSeconds: 600,
|
|
1558
|
+
...forge === "github" && { perHour: 30 }
|
|
1559
|
+
},
|
|
1454
1560
|
privacy: `Your contact's app asks ${host} for this account's public SSH keys, when you share it and on each re-check: ${label} learns the account was looked up, and from which IP address. So does this app when you add it.`,
|
|
1455
1561
|
signers: [sshKeygenSigner(forge)],
|
|
1456
1562
|
parseEvidence: parseSshEvidence,
|
|
@@ -3607,4 +3713,4 @@ function identityProvider(id, providers = identityProviders()) {
|
|
|
3607
3713
|
//#endregion
|
|
3608
3714
|
export { identityProvider as n, identityProviders as r, IDENTITY_PROVIDERS as t };
|
|
3609
3715
|
|
|
3610
|
-
//# sourceMappingURL=registry-
|
|
3716
|
+
//# sourceMappingURL=registry-BKkSnpjL.js.map
|