Repository navigation
Release 0.3.0: ML-DSA-87, COSE and the hash envelope; text under N6's own Unicode 15.0.0 rule, and a key function that returns a function refused - #23
Merged
Conversation
… own Unicode 15.0.0 rule, and a key function that returns a function refused Three public modules ship (MLDSA87, COSE, COSE.HashEnvelope); Ed25519 and the behaviour are unchanged, so a 0.2 host moves by the requirement alone. Two independent review lanes read every module added since 0.2.1 (key handling and error surfaces; encoding and cryptographic correctness); what they found is fixed here. - Keys: a key function that returned a function was resolved twice. COSE computed the kid from the placeholder and signed a carrier with a 48-byte zero kid. Every key read now requires the key's bytes at their size, so the kid is always the signing key's thumbprint. - Text: the encoder followed the runtime's NFC normaliser. N6 v0.1 section 2.4 pins Unicode 15.0.0 and refuses format and bidirectional controls, unassigned code points and NFC quick-check MAYBE, with no normaliser. lib/beam_mcp/signer/cose/text.ex applies that rule over lib/beam_mcp/signer/cose/unicode.ex, generated by tools/unicode_tables.sh from the three data files it pins by sha256. An issuer such as "ab" was signed and is now refused. Text and byte-string issuers are at most 65,536 bytes. - COSE judges the issuer before calling either key function. A :crypto refusal while hashing is answered, not raised with the public key in the frame. The encoder refuses an improper list. sign_stream/2 refuses a function that is not an enumerable. - Documented: sign_digest/2 cannot know its bytes are a digest; one key per scheme; when the seed is and is not held during a stream. - Tests: the data files are fixtures, read by the tests' own parser. Every one of the 1,112,064 scalar values and 20,000 random combining sequences get the rule's verdict. The census bars a normaliser, the process dictionary, ports and binary_to_term in every module. The 10 GiB test also bounds peak RSS (VmHWM, reset before the stream). - Release: version 0.3.0, the CHANGELOG heading and review record, supported versions 0.3.x. The package lists Unicode-3.0 beside Apache-2.0 and ships LICENSES/Unicode-3.0.txt; NOTICE says so. Measured locally: the new tests run against main's code give 14 failures (a carrier back under a nested key function, the issuer's key functions called first, a non-enumerable function read, :not_nfc where the rule says :nfc_maybe, no Unicode tables); 92 tests pass on OTP 28.5.0.8 over OpenSSL 3.5.9 three times, 96 with the ML-DSA tests excluded over 3.0.13. Twelve mutants of the new code each fail the suite. The 10 GiB test passes (RSS growth 2.8 MB). Both cross-verifiers pass a fresh sample. Signed-off-by: Ayla Croft <aylacroft@proton.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The 0.3.0 release, with the fixes from a pre-release review. Three public modules ship:
BeamMCP.Signer.MLDSA87,BeamMCP.Signer.COSEandBeamMCP.Signer.COSE.HashEnvelope(non-claimed).Ed25519and core'sBeamMCP.Signerbehaviour are unchanged, so a0.2host moves by the requirement alone.The review. Two independent lanes read every module added since 0.2.1, one on key handling and error surfaces and one on encoding and cryptographic correctness. They are recorded in the CHANGELOG. They are not a review under
docs/security-review.md, whose definition is a person reading the code. What they found is fixed here:kidfrom the placeholder and returned a valid carrier whose signedkidwas 48 zero bytes. Every key read now requires the key's bytes at their size ({:public_key, :not_2592_bytes}), so thekidis always the signing key's thumbprint."ab"(a right-to-left override) was signed.text.exapplies §2.4 overunicode.ex, whichtools/unicode_tables.shgenerates from three Unicode data files it pins by sha256.:cryptorefusal while hashing is answered, not raised with the public key in the frame.sign_stream/2refuses a function that is not an enumerable.binary_to_termin every module.sign_digest/2cannot know its bytes are a digest; one key per scheme; when the seed is and is not held during a stream.VmHWMafter a reset, so there is no sampling gap.Licensing.
unicode.exholds tables generated from the Unicode Character Database. The package listsUnicode-3.0besideApache-2.0, shipsLICENSES/Unicode-3.0.txt, and NOTICE says so.Evidence
:not_nfcwhere the rule says:nfc_maybe, and there are no Unicode tables.mix hex.buildlists the eightlib/files, README, CHANGELOG, LICENSE, NOTICE andLICENSES/Unicode-3.0.txt.After merge: the maintainer tags
v0.3.0(signed), publishes withtools/release_tarball.sh v0.3.0 … --publish, and pushes the tag. The tag's provenance run attests the tarball and holds it to hex.pm's bytes.