v0.10
main
v0.5.0
v0.4.0
v0.3.0
v0.2.0
v0.1.0
${ noResults }
5 Commits (2c305cf2531fa6499994c7d58e933284ebb90d81)
| Author | SHA1 | Message | Date |
|---|---|---|---|
|
|
f79d8e2de8 |
Specification 0.16 draft: a seal without accuracy, drand's JSON read strictly
The draft v0.16 of datekeys-go at 4f78854 (branch v0.16): SPEC_VERSION 0.16, and testdata, wordlists and annex synced from that commit. The annex is §79 of the draft, with the CC BY-ND 4.0 license of the specification in its title and the key of words in 79.7. A seal without accuracy proves nothing before the opening date (§29.7, §29.11, as 7e3b810): a valid seal is S4 only when its token carries accuracy and t plus the accuracy is before round_time; otherwise S5, with the first reason that holds: late, no accuracy under the BTSP policy of ETSI EN 319 421 (0.4.0.2023.1.1), or no accuracy. cms.ts reads hasAccuracy and the policy of the token (tokenIsBTSP); securitycms.ts gives SealReason, Detail.sealReason and SignerLine.reason; S5 has no fixed text any more, and verdictLines writes it and the line of a signer of F6 with the reason, the texts of Go byte for byte (sealReasonText). encryptFiles returns the verdicts of the area it wrote in Encrypted.security, as Result.Security of Go, so that a writer warns of a seal without accuracy (§62.1 rule 19). drand's JSON is read strictly (§47.1, as b570338): parseDrandJSON, as ParseDrandJSON of Go, reads RFC 8259 JSON in valid UTF-8 whose value is an object, with no name repeated in any object, names compared exactly once their escapes are decoded, a lone escaped surrogate malformed, the round a number without sign, fraction or exponent from 1 to 2^53 - 1, and signature and randomness strings, with the error texts of Go. ParsedRelease is now a Release: no round above 2^53 - 1 is read. The page reads the answers of the relays with it (drand.ts), as the client of Go does, and the pasted release with strictJSON and jsonRound (release-input.ts), so that it never reads another round than step 10. Tests: security_cms.json with seal_reason (143 cases), the 38 JSON inputs of release.json, the new cases of signature2_test.go and drandjson_test.go (with the escapes written as escapes), and the new fixtures: format3_time_and_key_words opens with the identity that the words of its words_text give with normalizeWords and wordKey, in the library and in the page, and format3_full_chunk, whose PAYLOAD_AGE ends in a full STREAM chunk, opens. check-build.mjs counts words_text among the secrets of the fixtures. Reference files made again with Go at 4f78854: mutation-texts.json (its spec field only), ibe-vectors.json (the two new fixtures, the rest unchanged) and signing-vectors.json, in an export of 4f78854 with the same frozen samples read again: the capsules are the same, and the tokens of the sealer, without accuracy, now give S5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
1 day ago |
|
|
9e5e3ba081 |
The writer signs and seals: the hooks of capsule.EncryptFiles of Go
encryptFiles gains authorKey (alg 1, an AuthorSigner such as AuthorKey), cmsSigner (alg 2, a CMS signature with certificates), sealer (seal_type 2, an RFC 3161 token) and largeArea, as EncryptOptions of Go at spec-v0.12: the same checks in the same order with the same texts, the signature and the seal made with the final control and head and before anything is written, and the security area evaluated by the reader of this library in the context of the capsule before it is written, as Go's security does. The hooks may be asynchronous. The area grows to 64 KiB only when what was signed does not fit and largeArea allows it, and the larger capsule counts in the limit of memory. security.ts encodes the area with its signature and seal, and securitycms.ts encodes SIGNERS. scripts/signing-go-vectors_test.go, run as a test in an export of datekeys-go at spec-v0.12, writes testing/signing-vectors.json: with the draws of crypto/rand of Go and the signatures and tokens of its hooks, encryptFiles writes the eight signed and sealed capsules of Go byte for byte, asks the hooks over the same messages, and fails with the text of Go in the other 15 recipes; and Go opens the five capsules that scripts/signing-ts-samples.mjs writes with this library, its own random values and certificates, with the same verdicts and lines. check-build.mjs fails when a page loads the author keys with the page, or when /inspect can load them at all. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
2 days ago |
|
|
95329eef4a |
Follow the draft v0.12: testdata at 601e6d2, the reader of certificates, the texts of the verdicts
testdata is synced with the head of the branch v0.12 of datekeys-go
(601e6d2); SPEC_VERSION stays 0.11 until the author approves the draft.
- CMS as Go reads it at the draft v0.12 (review of 2 October, T2, T6 to T8
and the TypeScript side of E7 to E9):
- the certificate field by field with the profile of section 29.10, its
errors in CertificateError with the texts of Go; one that breaks it
decides nothing unless a SignerInfo names it, and two copies are one;
- the text of a name only from UTF8String, PrintableString, IA5String,
TeletexString in ASCII and BMPString without surrogates, never from an
attribute that appears twice; the holder by givenName and surname
before the commonName, the issuer by its commonName or its
organizationName;
- object identifiers by the bytes of their DER; a SET OF may repeat an
element; RSA with NULL parameters and an odd modulus; a key of another
scheme than its algorithm is invalid; a messageImprint of another
length is S3; the crls of a token decide nothing;
- DER: UTCTime and GeneralizedTime in their X.690 forms with a date that
exists, the restricted string types as primitive, the accuracy as
minimal INTEGERs. The test of cms.test.ts that compared a function
with itself has an expected value of its own.
- The verdicts in the texts of the draft: names between « and », shown
with at most 64 code points and no two spaces in a row, or their SHA-256;
in F6 the authority of each seal and the warning that nobody checks who
issued it; foreign signers in Spanish; times with their fraction.
- security.json in its context with lines, and the 135 cases of
security_cms.json, compared field by field, lines included.
- The 218 cases of mutations.json, with the texts of capsule.Open
regenerated by scripts/mutation-go-texts.go, and ibe-vectors.json with
the fixtures format3_note, format3_unsigned and the new
format3_seal_unsupported; its frozen values do not change.
- note.json, run with checkNoteData, publicNote and unusableNote.
- inspect reads the public note on demand, only for a header with one, so
that the Unicode tables never load with /inspect; the view of inspect
-json gives public_note and public_note_unusable, as Go.
A Go/TypeScript differential of 63,623 security areas, made from the
vectors, edited element by element and signed afresh with varied
certificates, tokens and authorities, gave no difference in verdicts,
results or lines; the code before this change differed in 13,296 of the
first 42,986.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
3 days ago |
|
|
06e992fa74 |
CMS as Go reads it: the issuer by its Name, uncompressed keys, the BOM, linear readers
Fixes T1, T3, T13 and the CMS part of T5 of the review of the session of 1 and 2 October (docs, spec_v0.11/revision_sesion_1_2_octubre.md): - securitycms.ts: an issuer that breaks the rules of the declared author shows the SHA-256 of the DER of its Name, Go's sha256.Sum256(RawIssuer), and no longer that of the certificate (cms.certIssuerHash). - cms.ts: an ECDSA key counts only with its point uncompressed, 0x04 and the two coordinates, the only form that Go's x509.ParsePKIXPublicKey reads: a compressed one makes a signer not verifiable (F5) and a seal S1. - cms.ts: a UTF8String and the times of a certificate and of a token keep a leading U+FEFF, as Go reads the bytes: such a name shows the hash, and such a time breaks the profile (F1, S2). - cms.ts: oidOf and intOf take time linear in the length of the element. An arc of up to seven digits accumulates in a number, a longer one and every INTEGER are read whole from hexadecimal, never by a shift per byte, which took some 700 ms for 60 KB; attributes of one type are appended, not copied. - security.ts: evaluateSecurity never throws. A fault while it evaluates the signature gives F1, one while it evaluates the seal S2, each apart, and one while it decodes the area X, as the Go reference will from v0.12. - Tests: securitycms.test.ts and security.failure.test.ts are new. cms.test.ts now refuses a second content-type and two signature-time- stamps for the rule of the count, with every SET OF in DER order, and der.test.ts tests the depth at its boundary. cmsbuild.ts makes names, validities and compressed points of its own. capsule.EvaluateSecurityIn of the Go reference at spec-v0.11 gives the same verdicts, signer lines and Spanish lines on 25 areas made with cmsbuild.ts: issuers with ESC, U+202E, empty, of 300 bytes or with a leading U+FEFF; names and times with a leading U+FEFF; and compressed keys on P-256, P-384 and P-521, as signers and as authorities of a seal. HEAD gave other ones in 19 of them. npm run verify passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
7 days ago |
|
|
92b4d196eb |
The signature with certificates and the time seal in the library: alg 2, RFC 3161
der.ts checks DER byte by byte. cms.ts reads the CMS signature and the RFC 3161 token of spec v0.11 29.10 and 29.11 with the closed table of algorithms: RSA PKCS 1 and PSS with BigInt, ECDSA with the arithmetic of @noble/curves, no new package. securitycms.ts gives F1, F2, F5 and F6 with the signers named, and S1 to S5 with the authority of a valid seal. evaluateSecurity returns them with their detail, and verdictLines writes the lines of F6 and S4. The 22 cases of security_cms.json and the fixtures format3_signed_cms and format3_sealed give the verdicts, the signers and the seal of the Go reference. testing/cmsbuild.ts builds signatures and tokens with WebCrypto for the hostile cases ported from the Go tests, and the pending mechanism of the first sync is gone. npm run verify passes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> |
1 week ago |