Skip to content

Releases

openSzigno 0.9.0

Choose a tag to compare

@hdkiller hdkiller released this 09 Sep 14:11
21e2b94

openSzigno 0.9.0 adds the timestamp command (a container timestamp without a signature), csc login with interactive credential authorisation so an OAuth2-mode remote qualified certificate can sign, TLv6 trusted lists (the live EU and Hungarian lists already are), ECDSA P-521, trusted-list signer checks per TS 119 612 clause 5.7.1, reporting of the XAdES properties AVDH-authenticated documents carry, and the verifier follow-ups from the review round. The reported enums are now non-exhaustive: a downstream match needs a wildcard arm, which is the breaking change behind the minor bump. The JSON envelope contract is unchanged at schema_version 1. Private corpus: 53 valid, unchanged.

Added

  • The certificate that signed a trusted list is now checked against what the
    list itself says and against ETSI TS 119 612 clause 5.7.1. When a list
    carries a signed xades:SigningCertificateV2 (or the older
    xades:SigningCertificate), which a TLv6 list signed as XAdES-B-B does, the
    certificate the caller supplied through --trust-list-signer or through a
    LOTL pointer must be the one that property designates; if it is not, the new
    trust_list_signer_mismatch (unknown) blocks, because the caller and the
    list disagree about who signed and this build does not pick a winner. The
    property is read only where the list's own signature covers it. The
    clause 5.7.1 restrictions on a scheme operator's certificate are reported as
    trust_list_signer_unqualified (info), one check per rule, naming which
    requirement failed: the id-tsl-kp-tslSigning extended key usage
    (0.4.0.2231.3.0), a keyUsage including digitalSignature or
    nonRepudiation, basicConstraints not saying CA=true, and an issuer that
    is either the scheme operator itself or a certificate the list names. None of
    those blocks: the clause makes the extended key usage a "should", and the
    European Commission's own LOTL signing certificate carries no
    id-tsl-kp-tslSigning at all, so blocking on it would refuse the one list
    every national list is bootstrapped from. Both new codes are additive and
    schema_version stays 1; no golden changes.

  • AVDH-authenticated documents keep being recognised for what they are. AVDH
    (azonositasra visszavezetett dokumentumhitelesites) was the Hungarian
    state service that sealed a document on behalf of an identified citizen;
    citizen AVDH ended on 2025-01-01 and the service was withdrawn after
    2025-10-31, but section 634(15) of the Code of Civil Procedure grandfathers
    every document authenticated up to 2024-12-31 indefinitely, so a reader
    keeps meeting these structures. Nothing on the read path may treat one as
    obsolete or unsupported, and three signed claims such a signature carries
    are now reported instead of being dropped or named only in passing:
    signatures[].xades.signature_policy_digest (the SigPolicyHash an
    explicit signature policy declares, as algorithm and value),
    signatures[].xades.claimed_roles (the xades:ClaimedRole values of
    SignerRole and SignerRoleV2, which is where AVDH states the identified
    citizen), and signatures[].xades.commitment_type_ids. The unverified
    signature inventory inspect and list print gains the same roles as
    signature_inventory.signatures[].claimed_roles, bounded to 8 values of
    128 displayable characters, and the human inventory line names them.
    Every one of these is a claim, reported and applied to nothing: the
    signature policy stays informational, no policy document is fetched, and
    no role is looked up anywhere. None of them may cost a signature its
    verdict, and unknown qualifying properties stay xades_not_validated
    (info). A PAdES signature inside a PDF payload is still out of scope for
    verify, and inspect, list and validate-structure describe such a
    document and warn about nothing while extract sniffs it as pdf. Every
    new JSON member is additive and appears only when the signature carries the
    property, so schema_version stays 1 and no golden changes.
    docs/architecture.md gains an "AVDH-authenticated documents" subsection,
    docs/trust.md records what could and could not be established about the
    seal's issuer, and docs/references.md cites the sources.

  • ECDSA over NIST P-521 with SHA-512
    (http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512) is inside the pinned
    algorithm policy, for a trusted list's own signature and for a dossier
    signature alike, and the matching X.509 and CMS OID
    (1.2.840.10045.4.3.4) is accepted where a certificate, CRL, OCSP response
    or timestamp token is signed with it. ETSI TS 119 612 annex B.1.2 permits any
    ETSI TS 119 312 algorithm for a list's signature, so a member state may sign
    a TLv6 list with ecdsa-sha512; such a list was refused as
    trust_list_signature_invalid for naming "a signature method outside the
    allowlist". Curve and digest stay strictly paired: a P-521 key under a
    method naming SHA-256 is still algorithm_rejected. verify only:
    sign --key still takes an RSA or NIST P-256 key, and there is no
    --algorithm value for P-384 or P-521. policy.signature_algorithms in the
    JSON report gains ecdsa-sha512; additive, schema_version stays 1.

  • Trusted lists are read in both published versions of ETSI TS 119 612.
    The EU cut over from TLv5 to TLv6 on 2026-04-29 with no transition period,
    so a verifier needs both: TLv6 for anything published from that date, TLv5
    for every archived snapshot taken before it. SchemeInformation's
    TSLVersionIdentifier decides, 5 or 6 load, anything else and a list
    that states no version at all are refused as trust_list_invalid (exit 3)
    with a message naming what the file stated. Clause 5.3.1 says the field is
    incremented exactly when the parsing rules change, so guessing at an
    unknown one would be guessing about trust anchors. The version read is
    reported as policy.trust_lists[].version, a new field alongside the
    territory/sequence_number/issue_date a report already cited, and named
    in the trust_list_loaded check message. Nothing else about TLv6
    needed branching: V2.3.1 and V2.4.1 keep the http://uri.etsi.org/02231/v2#
    namespace, the ServiceDigitalIdentity forms, PointersToOtherTSL, and
    the registered service-status URIs unchanged, and both the live EU LOTL
    (rsa-sha512) and the Hungarian list (ecdsa-sha256) sign with algorithms
    already inside the pinned allowlist. docs/trust.md gains a "TLv5 and
    TLv6" section with what changed, what did not, and a "TLv6 caveats" note.
    Additive; schema_version stays 1.

  • A trusted list whose ds:Reference names the TrustServiceStatusList
    element by a same-document #Id, rather than with the empty URI, now
    counts as covering the whole list. TS 119 612 annex B.1.0 rule 2 allows
    either; both live EU lists write the empty URI, but a list using the Id
    form was refused as partially covered. The "the signature must cover
    everything" rule itself is unchanged, and the enveloped-signature transform
    is still required in both forms.

  • openszigno timestamp FILE --output OUT --tsa URL writes a copy of a
    dossier carrying a container es:TimeStamp: one RFC 3161 token over the
    elements the e-dossier format says a timestamp at that placement protects,
    and no signature at all. It needs no key, no certificate and no passphrase.
    --scope dossier (the default) writes one timestamp over the dossier;
    --scope document, with --document SELECTOR, writes one inside each
    selected document. --tsa-cert puts the authority's issuing certificates in
    the timestamp's own xades:CertificateValues, and --online-allow-private
    and --online-proxy are the transport flags sign --tsa already has: the
    request, the destination policy, the pinned resolution, the timeouts and the
    size cap are the same code. The element written is the one
    openszigno verify already checked, so a timestamped dossier reports
    dossier_timestamp_verified or document_timestamp_verified against trust
    material the caller supplies, and dossier_timestamp_invalid once the
    container is edited. The envelope is command: "timestamp" with data
    fields output, bytes and timestamps[] (id, scope,
    document_index, gen_time). Every successful run warns
    timestamped_dossier_unverified: obtaining a token is not evidence about
    it. schema_version stays 1. See
    The timestamp command.

  • timestamp_exists (exit 4), a new stable error code: timestamp was asked
    to write an es:TimeStamp where the dossier already carries one. Adding a
    timestamp where an existing signature or timestamp covers the insertion
    point is document_already_signed, the refusal sign already makes,
    applied by the same code.

  • openszigno csc login CONFIG.toml: the OAuth 2.0 authorization-code round
    a Cloud Signature Consortium service needs, so a token no longer has to be
    obtained out of band. It is RFC 8252 in shape (a loopback listener on
    127.0.0.1, an ephemeral port unless redirect_uri pins one) with RFC 7636
    PKCE S256, checks the state before it reads the code, and prints the
    authorization URL rather than opening a browser unless --open is given.
    The token it obtains is written to the file access_token_file names, mode
    0600 on Unix, with its expiry, its refresh token and its token endpoint in
    <access_token_file>.record.json beside it; none of them is ever printed,
    and none is ever taken from or put into argv. --credential ID also
    reports that credential's authorisation mode. New flags on the command:
    --credential, --open, --json, --online-allow-private,
    --online-proxy.

  • sign --csc can now sign with an oauth2-mode credential. It runs the
    scope=credential authorization round itsel...

Read more

openSzigno 0.8.0

Choose a tag to compare

@hdkiller hdkiller released this 09 Sep 09:45
8a9b59d

openSzigno 0.8.0 is a security and correctness release built from two review rounds on 0.7.0. The verifier now weighs every revocation source instead of trusting the first embedded answer, enforces trusted-list service status at the validation time, can end a path at a listed issuing-CA service, and binds XAdES properties to what the signature actually references. sign refuses or escapes every dossier-derived value before it reaches the signed XML, fills signatures in inside their own bytes, and supports co-signing. The online transport refuses redirect downgrades and plaintext hops for credentialed requests; every caller-named file is read through one bounded reader; dossier and service strings are sanitised before display; the release workflow verifies its tooling against pinned checksums. Adds public API (new check codes, declared_encoding, sanitize_display), hence the minor bump; the JSON envelope contract is unchanged at schema_version 1. Private corpus: 53 valid, unchanged from 0.7.0.

Added

  • openszigno_core::declared_encoding, which reads the XML declaration's
    encoding pseudo-attribute and reports the label together with the byte
    range holding it, so a writer restating the declaration agrees with the
    decoder byte for byte. Additive; schema_version stays 1.
  • Two fuzz targets for code that had none. extract_plan drives the CLI's
    extraction planner with arbitrary document titles and declared extensions
    and asserts that no planned name is a path, that no two names in one
    directory collide, and that planning is idempotent; destination_url
    drives the --online destination policy and asserts that it never hands
    the fetcher an address its own verdict refuses, that a non-HTTP scheme and
    userinfo are refused whatever --online-allow-private says, and that a
    relative redirect stays on the base URL's authority. Both include the
    shipped module by #[path], because the openszigno binary crate has no
    library target to depend on, so what is fuzzed is the real source.
    decode_payload now also drives the two encrypt chains with no
    decryption key, through decode_document_with.
  • The golden output contract captures stderr. scripts/golden.py kept only
    stdout, so every human-mode golden for a fixture that fails was an empty
    file: the wording of every error and warning an operator actually reads was
    pinned nowhere, and the "no golden may carry a machine-local path" check
    never looked at the stream those messages go to. Each case now writes a
    <case>.stderr.txt beside its stdout golden and its .exit, the leak check
    runs over both streams, and an extract --stdout case pins the one output
    that is not an envelope at all. This adds files and changes none: every
    golden committed before this ran is byte-identical after it. The matrix is
    run by both the CI golden job and the release smoke test, unchanged.
  • openszigno_core::declared_encoding, which reads the XML declaration's
    encoding pseudo-attribute and reports the label together with the byte
    range holding it, so a writer restating the declaration agrees with the
    decoder byte for byte. Additive; schema_version stays 1.

Fixed

  • A delegated OCSP responder's certificate is checked for validity at the
    response's producedAt rather than at the validation time, matching the
    trusted-responder model beside it and the documented rule. Asking at the
    validation time discarded every archived response whose responder
    certificate has since expired — the certificate was in force when the
    responder spoke, which is what RFC 6960's delegation is about — and it
    admitted one that was not yet in force then. schema_version stays 1.
  • A container es:TimeStamp selects its data only through an xades:Include
    in a recognised XAdES namespace. The element was matched on its local name
    alone, so an element another vocabulary happens to call Include added its
    target to the imprint and changed what the timestamp was taken to cover.
    Every other XAdES element in the crate was already read this way.
    schema_version stays 1.
  • An OCSP unknown status is no longer reported as stale revocation data.
    RFC 6960 section 2.2 gives it its own meaning — the responder does not know
    about this certificate — and calling that staleness told an operator to
    fetch something newer when the responder they asked does not serve the
    certificate at all. It now reports the new check code
    revocation_status_unknown_by_responder (unknown), which blocks exactly as
    revocation_data_stale did. Additive: a new code keeps schema_version at
    1, and no committed fixture emits it, so no golden file changed.
  • A certificate whose outer signatureAlgorithm differs from
    tbsCertificate.signature is refused with cert_malformed. RFC 5280
    section 4.1.1.2 requires the two to be the same algorithm identifier, and
    only the inner one is covered by the CA's signature, so a reader that
    consults the outer field was verifying under an algorithm the CA never
    attested to. An absent parameters field and an explicit NULL still count
    as agreeing, which is the difference real CAs actually emit.
    schema_version stays 1.
  • --allow-legacy-algorithms no longer lets an RFC 3161 timestamp token
    report itself as verified on SHA-1. A SHA-1 messageImprint emitted
    timestamp_imprint_ok (passed) and a SHA-1 SignerInfo digest emitted
    timestamp_signature_ok (passed), so the token reached verified: true
    and its genTime became the validation time — under a flag that exists for
    diagnosis and everywhere else caps the verdict. Both now emit
    algorithm_legacy_allowed (unknown) instead, so the token stays
    unverified and the verdict stays indeterminate. Without the flag both are
    refused exactly as before. schema_version stays 1.
  • Document coverage finds the payload ds:Object whatever the dossier spells
    its identifier attribute. The parser, the reference resolver and the XAdES
    reader accept Id, ID and id; coverage read only Id, so a document
    whose payload object used one of the other two spellings was reported
    uncovered by the very signature that digests it, and the dossier's verdict
    was capped at indeterminate. schema_version stays 1.
  • An OCSP response can no longer make verify do unbounded work. The certs
    field of a BasicOCSPResponse is attacker-supplied and was read in full, and
    every certificate in it naming the responder drove a signature verification
    and, under the trusted-responder model, a whole certification-path search.
    At most max_certificates certificates are now read from a response, the
    list is deduplicated by DER, and the path search runs at most once per
    distinct responder public key. No verdict changes: the same responses are
    authorised by the same models, and schema_version stays 1.
  • A certification path may now end at any trusted-list service digital
    identity, not only at a self-signed one. In a real national list the CA/QC
    identities are the issuing CAs: the Hungarian list records NetLock's
    qualified issuing CAs as CA/QC services with undersupervision from 2003 and
    granted from 2016-06-30, and records the root that signed them only as a
    QTST service granted from 2018. A path had to climb past the issuing CA to
    the self-signed root and was then judged by that timestamping entry, so a
    2014 signature under a plainly listed qualified CA was refused with
    trust_list_service_not_granted. Following ETSI TS 119 615, the nearest
    listed certificate along a chain is now the trust anchor for that path,
    self-signed or not, when its service was granted at the validation time —
    nothing above it is validated, it is the chain's last entry with
    trust_anchor_origin: "trust_list", and qualified derives from that
    service as before. When the nearest one's service was not granted then, the
    search still climbs upward and refuses only if no listed certificate and no
    --trust-store anchor above it will end the path. --trust-store anchors
    and self-signed list entries are unchanged, no field names change, and
    schema_version stays 1.
  • Text a dossier chose no longer reaches a terminal or the JSON envelope
    unfiltered. The dossier title, document titles, MIME type halves, the
    declared extension and character set, object references, transform names and
    signature ids were printed and serialised exactly as the input wrote them, so
    a title of OK<U+202E>txt.exe displayed as OKexe.txt in a list and
    inspect --json carried the override through to whatever read it, and a
    subtype — which nothing in the format bounds — printed in full at any
    length. The C0 and C1 controls were never reachable, because the bounded XML
    parser refuses them; the Unicode Cf class and length were. Every command
    that reads a dossier now runs one pass over its finished data value, and
    the human summary is rendered from that same value, so both channels are
    covered by the same filter: Cc and Cf characters are dropped, titles are
    bounded to 256 characters and every other dossier-derived value to 128, each
    cut short value ending in ... inside its cap. Warnings and errors go
    through the filter too, and verify reports a certificate's subject and
    issuer common names the same way. Field names and types are unchanged,
    schema_version stays 1, and no golden file changed: no committed fixture
    carries such a character or exceeds a bound. An extracted file's path is
    deliberately untouched — the extraction name rules already refuse a control,
    invisible or formatting character in a title and bound the result, and the
    envelope has to keep naming the file that was written.
  • sign refuses, with document_already_signed, to write a signature into an
    element an existing signature already covers. Only a URI="" reference and
    dossier-level...
Read more

openSzigno 0.7.0

Choose a tag to compare

@hdkiller hdkiller released this 09 Sep 02:01
7ed42fc

openSzigno 0.7.0 adds authoring. create assembles a dossier from files (optionally ZIP-under-Base64, nested dossiers, and CMS encryption for recipient certificates), and sign produces XAdES signatures our own verify accepts: per document or over the whole dossier, with a software key (RSA, RSA-PSS or ECDSA P-256), an RFC 3161 timestamp from --tsa, or a qualified certificate held at a Cloud Signature Consortium API v2 remote signing service through --csc, so only the digest leaves the machine. New crate openszigno-author. The agent skill covers the new commands; docs/remote-signing.md records the research behind the remote backend. Creating and signing assert nothing about validity: verify remains the only judge, and reaching valid still needs a timestamp and revocation data.

Added

  • docs/remote-signing.md, the research behind this milestone's authoring
    commands: the Cloud Signature Consortium API versions and the hash-signing
    flow a client would run, the EUDI Wallet rQES reference components and how
    to run one locally, a remote QSCD provider table, RFC 3161 timestamp
    authorities and whether they need an account, what Hungarian courts and the
    company registry accept, a recommended first backend, and everything that
    could not be verified. Indexed in docs/index.md and docs/references.md.
    Documentation only; no behaviour changes.
  • openszigno create, the first command that writes a dossier: it builds one
    new, unsigned es:Dossier from files on disk, with
    --document PATH[::TITLE[::MIME]], --zip, --embed, --created, and
    --json. Output is deterministic (fixed element order, positional
    obj<n>/profile<n> identifiers, a pinned ZIP modification time), so the
    same inputs with the same --created produce a byte-identical file; the
    one exception is --encrypt-for below, which must draw on a random source.
    Every
    parser limit bounds it, every document title is checked against the rules
    extract applies to a filename, an existing output file is output_exists
    rather than an overwrite, and every run warns created_dossier_unsigned.
    See The create command.
  • openszigno-author, a new published crate holding that writer. It reads no
    file, opens no socket, and calls no clock; openszigno-core stays
    read-only. It depends on openszigno-verify for canonicalisation and
    openszigno-cli depends on it, so it is published after
    openszigno-verify and before openszigno-cli.
  • Stable codes for authoring: the errors no_documents,
    unsafe_document_title, invalid_dossier_title, unknown_mime_type,
    invalid_mime_type, zip_failed, and invalid_output_path, and the
    warning created_dossier_unsigned. too_many_documents,
    decoded_too_large, total_size_limit, and zip_ratio_limit are reused
    with their existing meanings. Additive: schema_version stays 1.
  • tests/fixtures/created.es3, the dossier create builds from the two new
    synthetic inputs under tests/fixtures/create/, plus a create case in
    the golden matrix.
  • openszigno create --encrypt-for CERT, repeatable, which writes every
    --document payload as a CMS EnvelopedData addressed to each recipient
    certificate (PEM or DER), the forward direction of
    extract --decrypt-key. AES-256-CBC content encryption with a fresh
    content key and initialisation vector per document, and RSAES-OAEP with
    SHA-256 and MGF1-SHA-256 key transport per recipient, named by
    issuerAndSerialNumber; --legacy-key-transport writes RSAES-PKCS1-v1_5
    instead. DES-EDE3-CBC is never written. --zip under encryption makes the
    ZIP the plaintext (zip -> encrypt -> base64); an --embed dossier stays
    in the clear. create output is not deterministic with --encrypt-for,
    because a content key must be unpredictable. Each create document now
    reports encrypted in the JSON envelope, the human summary marks such a
    document | encrypted, and the new codes are the errors
    invalid_recipient_certificate, unsupported_recipient_key,
    no_recipients, and encrypt_failed (exit 4) and the warning
    recipient_certificate_expired. Additive: schema_version stays 1.
    See Encrypting for a recipient.
  • openszigno sign, which writes a signed copy of a dossier: one enveloped
    XMLDSig/XAdES signature per document, or one over the dossier with
    --scope dossier. It writes the reference set the e-dossier scope rules
    mandate, exclusive canonicalization and SHA-256 throughout,
    xades:SigningTime and xades:SigningCertificateV2 in the signed
    properties, xades:CertificateValues from --chain and --tsa-cert, and
    the signer certificate in ds:KeyInfo. Flags: --output, --key,
    --cert, --passphrase-file, --chain, --scope, --document, --tsa,
    --tsa-cert, --signing-time, --algorithm, --online-allow-private,
    --online-proxy, and --json. RSA PKCS#1 v1.5 with SHA-256 is the default
    and is deterministic given the same key, time and inputs; rsa-pss-sha256
    and ecdsa-p256-sha256 are offered and are randomised. The key, its
    certificate and its passphrase come from files or from the existing
    OPENSZIGNO_DECRYPT_PASSPHRASE, never from argv. Signing verifies
    nothing, and every successful run warns signed_dossier_unverified. See
    The sign command.
  • --tsa URL on sign, which posts an RFC 3161 TimeStampReq and embeds the
    token as an xades:SignatureTimeStamp. It is the only thing that makes
    sign open a socket, and it goes through the same transport, destination
    policy, address pinning, timeouts and size caps verify --online uses;
    --online-allow-private and --online-proxy mean there what they mean
    there.
  • The signing library in openszigno-author (sign module): the Signer
    trait a later remote backend implements, SoftwareSigner for a local
    PKCS#8 key, the XMLDSig and XAdES rendering, and RFC 3161 requests and
    responses as bytes in and bytes out. The crate still reads no file and
    opens no socket.
  • Stable codes for signing: invalid_signing_key,
    invalid_signing_certificate, signing_certificate_required,
    signing_key_mismatch, document_not_signable, document_already_signed,
    tsa_failed, and sign_failed, plus the warning
    signed_dossier_unverified. document_not_found, invalid_output_path,
    output_exists, unsafe_output_directory and io_error are reused with
    their existing meanings. Additive: schema_version stays 1.
  • A sign refusal in the golden matrix. A successful signing run cannot be a
    golden: it needs a private key, and this repository commits none.
  • openszigno sign --csc CONFIG.toml, a second signing backend: the digest of
    the canonicalised ds:SignedInfo is signed by a Cloud Signature Consortium
    API v2 service, so a qualified certificate held by a remote signature
    creation device, or in an EUDI Wallet, produces the same XAdES structure the
    software signer does. Only the digest ever leaves the machine. The run does
    info, credentials/list when no credential is named, credentials/info
    with certificates: "chain", then per signature credentials/authorize
    with the real hash and numSignatures: 1 and signatures/signHash; the
    returned signature is verified locally against the returned certificate
    before anything is written. Discovery is read from info rather than
    compiled in, the algorithm comes from the credential's own key/algo list,
    and the chain the service publishes becomes xades:CertificateValues so
    --chain stays optional. --csc-credential ID picks one credential; the
    requests go through the same bounded transport verify --online uses, and
    the bearer token travels in the Authorization header and nowhere else.
    This round is non-interactive: an oauth2-mode credential is
    csc_authorization_required, and the OAuth 2.0 rounds it needs are the
    follow-up openszigno csc login. See
    Signing through a CSC service.
  • Stable codes for that backend: the errors csc_config_invalid,
    csc_unreachable, csc_rejected, csc_credential_ambiguous,
    csc_credential_unusable, csc_authorization_required and
    csc_signature_invalid, and the warnings csc_config_permissive and
    csc_key_unused. sign's JSON data.signatures[] entries gain signer
    (software or csc), and a csc entry also carries credential_id and
    csc_specs.

Changed

  • The extraction title sanitizer takes its rules from openszigno-author, so
    a title create refuses is exactly a title extract would refuse. No
    behaviour of extract changed.
  • author is an accepted Conventional Commits scope
    (scripts/commit-msg.sh, CONTRIBUTING.md).

openSzigno 0.6.0

Choose a tag to compare

@hdkiller hdkiller released this 08 Sep 20:50
70c57dc

openSzigno 0.6.0 adds openszigno skill, which prints the agent skill embedded in the binary: an Agent Skills document that teaches an AI agent how to inspect, extract, decrypt and verify dossiers with this CLI and how to report the result without overstating it. Install it with mkdir -p .claude/skills/openszigno && openszigno skill > .claude/skills/openszigno/SKILL.md. No JSON contract change.

Added

  • crates/openszigno-cli/skills/openszigno/SKILL.md, an Agent Skills
    document that tells an AI agent how to drive the CLI on a dossier: the
    always---json rule, exit statuses, the inspect, list, extract, decrypt
    and verify workflow, the trust-material recipe, the check codes behind
    most indeterminate verdicts, and how to report a result without
    overstating it. Linked from the README and the documentation index.
  • openszigno skill, which writes that document to stdout byte for byte
    and nothing else, so the single distributed binary carries the skill:
    openszigno skill > .claude/skills/openszigno/SKILL.md installs it with
    no checkout. It takes no FILE and no --json, and emits no JSON
    envelope.
    A .gitattributes rule keeps Markdown at LF on every checkout, so the
    embedded bytes are the same whichever host built the binary.

openSzigno 0.5.1

Choose a tag to compare

@hdkiller hdkiller released this 08 Sep 17:16
5ae38b8

openSzigno 0.5.1 is a security patch release. verify now enforces the cardinality and order the XMLDSig schema fixes for the core signature structures, so a signature with a duplicate or out-of-order critical child fails sig_structure_invalid instead of being read by first match. CMS decryption applies implicit rejection to PKCS#1 v1.5 key transport, removing the padding oracle through outcome, error and coarse timing. No public API or JSON contract change.

Fixed

  • The CI hygiene job no longer re-checks commits that are already on
    develop when a release pull request promotes develop to master;
    those passed the check on the pull request that landed them, and two
    older commits predate the rule.

Security

  • verify stage A1 now enforces the cardinality and order the XMLDSig
    schema fixes for ds:Signature, ds:SignedInfo and each ds:Reference
    before any critical child is read by name. Previously each child was
    located by a first-match lookup, so a signature carrying a second
    ds:SignatureValue, ds:SignedInfo, canonicalization or signature
    method, ds:Transforms, ds:DigestMethod or ds:DigestValue, or one
    whose children appeared out of order, was accepted: openSzigno read the
    first copy and reported a passed signature_value_ok while another
    consumer could read the other. Such a signature now fails
    sig_structure_invalid, with a message naming the element and whether it
    is a duplicate, out of order, or a child the schema does not allow there,
    and the verdict is invalid. The schema's extension points stay open:
    ds:Object and ds:KeyInfo content is unconstrained, so XAdES
    qualifying properties are unaffected, and whitespace and comments between
    children are ignored. See
    docs/architecture.md.
  • extract --decrypt-key no longer reports that a PKCS#1 v1.5 wrapped
    content-encryption key failed to unpad. The RSA key transport now rejects
    implicitly, the mitigation OpenSSL 3.2+ ships as
    RSA_PKCS1_IMPLICIT_REJECTION and RFC 5246 section 7.4.7.1 prescribes: the
    blinded private operation runs once, the block is unpadded in constant time
    against the announced content cipher's key length, and any fault is answered
    with a deterministic synthetic key derived from a per-key secret over the
    ciphertext, after which content decryption runs unconditionally. A bad
    wrapped key now fails as the content cipher does, with the same
    decrypt_failed code and decryption failed message as a tampered body, so
    a caller who submits chosen dossiers can no longer read a
    Bleichenbacher/Marvin padding oracle (RUSTSEC-2023-0071) off the outcome,
    the error, or the coarse timing. RSAES-OAEP takes the same shape. What
    remains is rsa 0.9's non-constant-time private exponentiation, which
    blinding masks and rsa 0.10 will retire; the deny.toml ignore now covers
    only that. See
    SECURITY.md
    and
    docs/architecture.md.
    One consequence: an unusable wrapped key is decrypted under the synthetic
    key, so the failure surfaces further down. Almost always that is the content
    cipher's padding, as decrypt_failed; roughly once in 256 the padding of
    garbage is valid by chance and the answer is source_size_mismatch instead.
    Decryption never asserted authenticity.

openSzigno 0.5.0

Choose a tag to compare

@hdkiller hdkiller released this 08 Sep 14:45
8ed546b

openSzigno 0.5.0 hardens --online (trust-gated fetching, destination policy, pinned DNS, bounded fetch rounds), tightens the verify contract (effective node set, strict RFC 3339 dates), and adds the quality gates that now guard every change: coverage floors, golden JSON contract tests, nightly mutation testing and fuzzing, semver checks, commit hygiene, and unused-dependency checks. Every source file is under 800 lines after two refactor rounds, and the docs were audited against the binary.

The openszigno-verify public API changed since 0.4.0 (new fields on SignatureCoverage and ChainEntry, a new RevocationPolicy variant, a renamed field); the minor bump covers it. The JSON envelope stays at schema_version 1.

Added

  • The CI semver job runs cargo-semver-checks for openszigno-core and
    openszigno-verify against the version already published on crates.io,
    failing on a breaking API change unless the crate's Cargo.toml version
    was bumped to cover it. See
    docs/releasing.md for how this applies
    to the pre-1.0 0.x crates here. The openszigno-verify step ran as
    advisory until this release, because develop carried breaking API
    changes relative to the published 0.4.0 (new public fields on
    SignatureCoverage and ChainEntry, a new RevocationPolicy variant,
    and a renamed SignatureCoverage field); the 0.5.0 bump covers them
    and both steps block again.
  • The CI hygiene job, on pull requests only, runs scripts/commit-msg.sh
    (now reusable with a file path or - for stdin, in addition to its
    original hook mode) over every commit subject in the pull request's
    range, skipping merge commits and dependabot[bot]/github-actions[bot]
    commits, and requires the pull request body to contain a
    Fixes/Closes/Refs LAB-<n> line unless the pull request is
    bot-authored or labelled no-ticket. See
    CONTRIBUTING.md.
  • The CI lint job now runs cargo machete to catch dependencies declared
    in a manifest but never used. See
    CONTRIBUTING.md for how to reproduce it
    locally and how to record a dependency that is only reachable through a
    macro or a feature.
  • Nightly fuzzing of the parsers with cargo-fuzz: a fuzz/ package (LAB-268,
    excluded from the workspace so it never touches the stable MSRV build) with
    ten targets covering dossier parsing, payload decoding, CMS decryption,
    C14N canonicalization, and CRL, OCSP, RFC 3161 timestamp, trusted-list, and
    certificate parsing, each asserting only that the function under it never
    panics. .github/workflows/fuzz.yml runs every target nightly and on
    manual dispatch; a crash uploads the minimised reproducer and opens or
    refreshes a tracking issue. See
    docs/testing.md.
  • Golden output contract tests under tests/golden/: the stdout and exit
    status of inspect, list, validate-structure, verify and extract
    over every fixture in tests/fixtures/, in --json and human mode, plus
    two trusted verify runs over the signed XMLDSig vector.
    scripts/golden.py check --bin <binary> diffs the built binary against
    them and update regenerates them; the new CI golden job and the release
    smoke test both run check. Only two clock-dependent times are masked. A
    diff is a change to the JSON envelope contract and is reviewed under the
    schema_version rule; see
    tests/golden/README.md.
  • --online-allow-private on verify, which permits --online to contact
    loopback, private, link-local and unique-local destinations and the name
    localhost. It requires --online, waives the address rules and nothing
    else, and exists for an internal CA that really does publish on the
    operator's own network.
  • policy.revocation has a fourth value, online_no_anchors, for a run given
    --online with no trust anchor configured: nothing was fetched, and both the
    revocation_policy check and every revocation_status_unknown message now
    say why rather than leaving the caller with an unexplained gap.
  • scripts/check-file-length.py, run in CI's Documentation job, fails a
    tracked crates/*/src/*.rs file over 800 physical lines or a
    crates/*/tests/*.rs file over 1500, with a shrink-only allowlist in
    scripts/file-length-allowlist.txt for files that already exceeded the
    limit before the guardrail was added. See
    CONTRIBUTING.md.
  • clippy::too_many_lines is now a workspace lint, with clippy.toml
    setting too-many-lines-threshold. See
    CONTRIBUTING.md for the current
    threshold and the plan to lower it.
  • scripts/coverage_gate.py, run in CI's Coverage job, enforces a 90%
    per-crate line-coverage floor, 80% patch coverage on lines a pull
    request adds or modifies under crates/*/src/ (when at least 20
    instrumentable lines changed), and a ratchet against
    scripts/coverage-floors.txt so a crate cannot silently drop more than
    1.0 point below its recorded coverage. The job posts and refreshes a
    single PR comment with the summary. See
    CONTRIBUTING.md.
  • .github/workflows/mutants.yml, a nightly (and manually dispatchable)
    cargo-mutants run over openszigno-core and openszigno-verify.
    scripts/mutants_gate.py enforces a ratchet against
    scripts/mutants-floors.txt, the same model as the coverage floors: a
    crate's caught-mutant percentage cannot drop more than 2.0 points below
    its recorded value. It is not a required pull-request check; a gate
    failure opens or refreshes a single "Mutation testing: survivors" issue
    instead. See docs/testing.md.

Tests

  • Behavioural tests for the first batch of cargo-mutants survivors from the
    LAB-267 seeding pass: decode.rs's compression-ratio boundary and ZIP
    symlink guard, scan.rs's depth/node-limit and self-closing-tag
    arithmetic, inventory.rs's first-occurrence match guards,
    trust.rs's TrustSource/RevocationSource accessors and further
    parse_rfc3339 boundaries, and scope.rs's signature-profile
    node-ownership guard. Raised the openszigno-core mutation floor from
    89.46% to 91.12% (full-crate run) and openszigno-verify from 70.59% to
    78.99% (the same --shard 1/4 slice it was seeded from). See
    docs/testing.md.

Changed

  • README.md restructured from 536 lines to a scannable front door. "Why and
    for whom" now sits directly under the security boundary instead of behind
    the installation block, and states what the tool offers agents, people, and
    anyone handling hostile input. Installation is one block per channel, the
    quick start is one human, one --json, and one verify example, and the
    command reference is a single table with each command's exit statuses. The
    reference material moved out of it, deduplicated: the flag tables, the
    global and extract flags, and the full verify flag table are now in
    docs/architecture.md, which already held the JSON
    envelope, the stable codes, the exit statuses, and the limits; the
    "what is not supported yet" list is now a "Not yet implemented" section in
    docs/roadmap.md, refreshed because M2 phase 2, M2 phase 3,
    and M3 have all shipped since it was written. The README's LEGAL section no
    longer claims that verification can report "only invalid or
    indeterminate", which stopped being true when revocation checking landed.
  • Internal module split of the CLI crate: crates/openszigno-cli/src/main.rs
    became args, input, response, render/, commands/, extract/, and
    trust, and each unit test moved next to the code it covers. No behaviour
    change — every flag, help text, message, stable code, exit status, and byte
    of JSON and human output is what it was. See
    docs/architecture.md.
  • openszigno-verify was split into one module per pipeline stage: internal
    module split, no behaviour change. dsig.rs became references, scope,
    countersign, signature and coverage; lib.rs now reads as the
    documented stages A to F with one Context threaded through them. Every
    check code, status, message, ordering and JSON field is unchanged, and the
    crate's public API keeps the paths it had. See
    docs/architecture.md.
  • Second-round internal split of the five remaining oversized
    openszigno-verify sources, moving code verbatim with no behaviour change:
    certs.rs became certs/ (extensions, purpose, names, path),
    revocation.rs became revocation/ (crl, ocsp, tiers), tsa.rs
    became tsa/ (token, imprint, path, tests), signature.rs gained
    signed_info and collect, and trustlist.rs became trustlist/
    (parse, services, qualified). Every check code, status, message,
    ordering and JSON field is unchanged, and every public item keeps its old
    path through pub use re-exports. No openszigno-verify source file is
    named in `scripts/file-l...
Read more

openSzigno 0.4.0

Choose a tag to compare

@hdkiller hdkiller released this 08 Sep 00:25
048f168

Added (M4: decryption of encrypted payloads)

  • extract --decrypt-key FILE decrypts documents whose transform chain
    contains encrypt. The specification calls that transform "S/MIME
    encryption" and names no algorithm; Microsec's own eszigno3 reference CLI
    documents its cm_decrypt as RFC 5652 CMS and exports per-recipient
    encrypted keys, so the decoded payload is read as a DER ContentInfo
    carrying id-envelopedData. The supported subset is
    KeyTransRecipientInfo recipients named by issuerAndSerialNumber or
    subjectKeyIdentifier, RSAES-PKCS1-v1_5 and RSAES-OAEP (MGF1 with
    SHA-1/256/384/512) key transport, and AES-128/192/256-CBC content
    encryption. See
    docs/architecture.md.

    openszigno extract encrypted.es3 --output ./out \
      --decrypt-key recipient.key.pem --decrypt-cert recipient.cert.pem
  • --decrypt-cert FILE, PEM or DER, is the certificate that makes a CMS
    recipient recognisable; it may be omitted when a PEM key file carries the
    certificate alongside the key. It is checked against the key, and a
    certificate that does not belong to it is decryption_key_mismatch.

  • --decrypt-passphrase-file FILE and the environment variable
    OPENSZIGNO_DECRYPT_PASSPHRASE supply the passphrase of an encrypted
    PKCS#8 key; the file wins when both are set, and one trailing newline is
    stripped from the file. No flag takes a key or a passphrase as an argument
    value
    , because argv is readable by other processes and lands in shell
    history. All three of key, certificate, and passphrase files are capped at
    1 MiB.

  • --allow-legacy-ciphers additionally decrypts DES-EDE3-CBC content.
    It is off by default because 3DES is weak, and available because it is what
    the Microsec reference tool encrypted with by default; without the flag such
    a document is document_skipped_legacy_cipher, with the OID named.

  • New JSON. Each extract extracted entry gains decrypted, and
    extract --stdout gains the same field in its data. It is true when an
    encrypt transform was reversed. schema_version stays 1; both are
    additive.

  • New error codes. invalid_decryption_key,
    invalid_decryption_certificate, decryption_certificate_required, and
    decryption_key_mismatch (exit 4, raised before the dossier is decoded);
    invalid_cms and decrypt_failed (exit 5). decrypt_failed carries the
    fixed message decryption failed and never says which step failed, because
    telling a bad RSA unwrap from bad padding is what a padding oracle is made
    of.

  • New warning codes. document_skipped_no_matching_recipient,
    document_skipped_unsupported_cipher, and
    document_skipped_legacy_cipher. All three are skips at exit 0: a dossier
    may legitimately hold documents addressed to several people, and extract
    gives the caller the ones they can read.

  • Key handling guarantees, stated in
    SECURITY.md and covered by a test:
    key bytes, the passphrase, and anything derived from them appear on neither
    stdout nor stderr nor in the JSON envelope, on a successful or a failing run;
    key and passphrase buffers are zeroed on drop; nothing is ever transmitted.

Changed (M4)

  • capabilities.encrypted_extraction in inspect --json is now the string
    "with_key", not false.
    inspect is never given a key, so it can only
    report that the tool can decrypt when extract is given one. A consumer that
    tested the field for truthiness now sees a truthy value, which is the correct
    answer; one that compared it to false must compare it to "with_key".
    schema_version stays 1: the field kept its name and its meaning, and the
    other capability fields stay boolean.
  • encrypt is now only recognised in the position the specification puts
    it.
    The forward chain is fixed as zip? -> encrypt? -> base64, so
    encrypt -> base64 and zip -> encrypt -> base64 are encrypted documents
    and encrypt anywhere else is unsupported_transform_chain /
    document_skipped_unsupported_transform rather than
    encrypted_document_unsupported / document_skipped_encrypted. Nothing
    becomes extractable that was not before.
  • encrypted_document_unsupported is not emitted by a run that holds a
    decryption key
    , because it would be untrue; what happened to each document
    is reported per document instead. Its message now points at
    extract --decrypt-key rather than saying the document cannot be extracted.
  • The RUSTSEC-2023-0071 note in deny.toml was rewritten: the tool now
    does perform an RSA private-key operation, locally, with a key the operator
    supplied, for the length of one extract run. Exploiting the advisory needs
    an attacker who can time that run on the operator's own machine, which is
    outside the threat model; the ignore is still to be revisited when rsa 0.10
    is stable.
  • New dependencies, all MIT OR Apache-2.0: aes, cbc, cipher, cms
    (already used by openszigno-verify), des, pkcs8 with encryption
    (which brings pkcs5, pbkdf2, scrypt, salsa20), and zeroize.
    rand_chacha and rand_core are test-only. cargo deny check passes.
  • The decryption tests generate their RSA keys at run time, from a fixed
    seed through ChaCha20Rng, once per test binary. No private key, in any
    encoding, is committed to this repository, and no line of it spells a
    complete PEM private-key armour header: a secret scanner cannot tell a
    synthetic key from a real one, so the project stores none and allowlists no
    scanner rule.
  • rsa, num-bigint-dig, scrypt, salsa20, and sha2 are built at
    opt-level = 3 in the dev profile.
    Generating an RSA key and running a
    PKCS#8 key derivation unoptimized costs seconds each, which is what
    generating test keys at run time would otherwise have added to every test
    run. The code under test is not optimized, and release builds are unchanged.

Not implemented, deliberately (M4)

  • PKCS#12 (.p12/.pfx) keystores. Convert with openssl first; the
    commands are in
    docs/architecture.md. A keystore parser
    is attack surface for a step the operator does once.
  • PKCS#11. A key on a smart card or HSM cannot be used.
  • RecipientInfo forms other than ktri. A key-agreement (kari)
    recipient reads as no matching recipient rather than as a named unsupported
    algorithm.
  • RFC 5083 AuthEnvelopedData (AES-GCM). Recognised only to be skipped.
    Nothing in the specification or the reference CLI suggests it is produced.
  • MIME-wrapped CMS. No available source says whether any producer wraps the
    message in MIME headers instead of emitting bare DER under the Base64
    transform. Bare DER is what is read; anything else is invalid_cms rather
    than a guess.
  • es:RecipientCertificateList. The element is optional and advisory; the
    authoritative recipient list is the CMS RecipientInfos, which is what the
    matching uses.

Added (M3: container timestamps, online revocation, trusted-list identities)

  • Unverified signature inventory in inspect and list. The structural
    model now describes every ds:Signature and container es:TimeStamp a
    dossier carries, built at parse time from the XML alone. Per signature:
    id, placement (document, dossier, nested_in_signature, other),
    document_index, parent_signature_id, canonicalization_method,
    signature_method, digest_methods, reference_count, reference_uris
    (same-document fragments, at most 16), xades_namespace,
    xades_properties (at most 32), evidence (element counts of certificates,
    CRLs, OCSP responses, signature timestamps, and archive timestamps),
    claimed_signing_time, and key_info_certificates. Per container
    timestamp: placement, document_index, include_count, and has_token.
    It appears as dossier.signature_inventory in both commands' JSON, always
    beside "verified": false, and human inspect prints one (unverified)
    line per entry. None of it is verified: no cryptography is performed,
    nothing is decoded, no certificate value is read, and no reference is
    resolved. It reports what a dossier claims, never whether the claim is true;
    verify remains the only command that answers that. signatures_present
    and timestamps_present are unchanged, and verify is untouched. The
    inventory describes at most 64 signatures and 64 container timestamps; a
    dossier with more produces the new structural warning
    signature_inventory_truncated, which, like every structural warning,
    changes no exit status.
  • extract --document <SELECTOR>, repeatable, extracts only the documents
    it names. A selector is either #<index> in source XML order or an exact
    object_ref — the ds:Object Id the DocumentProfile OBJREF points at.
    Matching is exact; a prefix matches nothing, so a selector cannot change
    meaning as a dossier grows. An unmatched selector is document_not_found
    (exit 4) and one matching several documents is document_ambiguous
    (exit 4). Selectors never reach into an embedded dossier: a selector shaped
    like a dossier_path (2/0) is refused with a message saying to extract
    the embedded dossier and run extract on the resulting file. Everything
    else is unchanged for the selected documents — the limits, naming and
    deduplication, no-clobber semantics, all-or-nothing rollback, and recursion
    into a selected embedded dossier. skipped_count counts only documents
    skipped for capability reasons among the selection.
  • extract --stdout writes one document's decoded payload bytes to
    standard output, byte for byte, with nothing else on the stream and every
    diagnostic on stderr; no file is written. It needs exactly one resolved,
    decodable document: anything else is `stdout_requires_singl...
Read more

openSzigno 0.3.0

Choose a tag to compare

@hdkiller hdkiller released this 07 Sep 21:10
19e260b

Added (M2 phase 3: revocation and EU trusted lists)

  • verify can now report a signature valid, and exits 0 when it does.
    Reaching it needs all of: a structurally sound signature whose references and
    signature value verify under the pinned policy, a signed
    SigningCertificate binding, a path to a configured anchor at the validation
    time, a fully verified xades:SignatureTimeStamp, and fresh non-revoked
    status for every non-anchor certificate on both the signer's and each
    timestamp authority's chain. valid means every check this build makes
    passed at the stated validation time; it is not a legal opinion. See
    SECURITY.md and docs/architecture.md.
  • Offline revocation checking (stage E). Data is taken from the signature's own
    xades:RevocationValues (CRLValues/EncapsulatedCRLValue and
    OCSPValues/EncapsulatedOCSPValue, in every recognised XAdES namespace)
    and from --revocation-store DIR, in that order, with OCSP asked before CRLs
    within each tier. Embedded data is untrusted input: every CRL and every OCSP
    response is signature-checked against an authorised issuer before it is
    believed.
    • CRLs per RFC 5280 section 6.3: issuer match, signature by the issuing CA or
      by a delegate that CA issued which asserts cRLSign, thisUpdate and
      nextUpdate against the validation time with no grace period, and
      scope via issuingDistributionPoint. Delta CRLs, indirect CRLs, scopes
      restricted to reasons or attribute certificates, partitioned CRLs the
      certificate does not name, entries carrying certificateIssuer, and any
      other critical CRL extension all fail closed. certificateHold counts as
      revoked.
    • OCSP per RFC 6960: response status, responder identity byName or byKey,
      authorisation as the issuing CA or a delegate carrying id-kp-OCSPSigning,
      signature under the pinned allowlist, certID matching, and freshness. The
      nonce is deliberately ignored, because offline validation replays a
      response produced for someone else's request. SHA-1 is accepted in the
      certID and nowhere else, documented in docs/architecture.md.
    • A revocation dated after the validation time yields the distinct
      cert_revoked_after_validation_time (unknown), not cert_revoked.
    • New codes: revocation_policy (info), revocation_ok (passed),
      cert_revoked (failed), cert_revoked_after_validation_time,
      revocation_status_unknown, revocation_data_stale,
      revocation_data_invalid (all unknown). revocation_not_checked now
      means only "the caller passed --no-revocation".
  • ETSI TS 119 612 trusted lists via --trust-list FILE (repeatable). Every
    X509Certificate in the service digital identity of a granted CA/QC or
    TSA/QTST service becomes a trust anchor carrying the service's status
    timeline, and the status in force at the validation time decides whether
    a path ending there is trusted. --trust-list-signer CERT verifies the
    list's own enveloped XMLDSig signature with the same core, backend and
    allowlists a dossier gets; without it trust_list_unverified (unknown)
    blocks a valid verdict. Nothing is fetched. New codes:
    trust_list_loaded, trust_list_unverified, trust_list_signature_ok,
    trust_list_signature_invalid, certificate_qualified,
    certificate_not_qualified, certificate_qualified_unknown.
  • --lotl FILE reads the EU list of trusted lists and takes the national
    lists' signing certificates from its PointersToOtherTSL entries, so one
    out-of-band certificate bootstraps the verification of every --trust-list.
    The LOTL is verified against --trust-list-signer first, and only then are
    its pointers trusted; its own trust_list_unverified check still blocks when
    it could not be verified. The LOTL contributes no trust anchors of its own.
  • Qualified status is determined over the whole validated chain, not over
    its anchor: a chain is qualified when some certificate in it is, or was
    issued by, the service digital identity of a granted CA/QC service. Real
    trusted lists name the issuing CAs, which are intermediates, while the root
    is usually a certificate the operator pinned into --trust-store, so an
    anchor-only rule answers "not determined" for every real dossier. The signer's
    QCStatements may then contradict the list: a post-eIDAS certificate whose
    extension is present but omits QcCompliance, or will not parse, yields
    false; one carrying no such extension denies nothing and rests on the list.
    qualified_service names the service that matched. null, never false,
    when no trusted list was consulted.
  • New flags: --trust-list FILE, --lotl FILE, --trust-list-signer CERT,
    --revocation-store DIR, --no-revocation. New error codes
    trust_list_invalid and revocation_store_invalid (exit 3).
  • New JSON fields: policy.trust_lists[] (territory, sequence number, issue
    date, next update, anchor count, whether the list's signature was verified);
    signatures[].qualified and signatures[].qualified_signature_device;
    signatures[].qualified_service; chain[].trust_anchor_origin
    (trust_store or trust_list, preferring trust_list when a certificate is
    both); and chain[].revocation with status, code, source (embedded_crl,
    embedded_ocsp, store_crl, store_ocsp), revocation_time, reason,
    this_update, next_update, and produced_at. schema_version stays 1:
    these are additions, and no existing field's contract changed.
  • docs/trust.md: how to obtain, pin and lay out trust anchors, trusted lists,
    CRLs and OCSP responses, how qualified status is decided, and what makes
    revocation data unusable.

Changed (M2 phase 3)

  • New check status info, for checks that report rather than decide. It is
    the only non-blocking status, which makes "unknown always blocks" true
    without exception. Consumers must treat an unrecognised code as blocking
    unless its status is passed or info. Moved from unknown or skipped to
    info: signing_time_present, cert_key_usage_advisory,
    signature_timestamp_present, xades_signature_policy_implied,
    xades_signature_policy_explicit, xades_not_validated,
    archive_timestamp_present and dossier_timestamp_not_validated.
  • skipped now means only "a check the policy requires was not performed",
    and nothing else is filed under it. A property this build reads but does not
    act on, and evidence it declines to re-verify, are info: they did not fail
    to answer a required question. Blocking on them capped a signature at
    indeterminate for carrying more evidence than the minimum, which is
    precisely backwards — an unsigned qualifying property cannot change what a
    signature says, an archive timestamp is laid on top of one, and a
    dossier-level es:TimeStamp is a statement about the container rather than
    about any signature in it. The three remaining skipped emitters are
    xades_absent, timestamp_not_checked and revocation_not_checked.
    xades_not_validated and archive_timestamp_present are omitted entirely
    when there is nothing to report.
  • cert_revoked_after_validation_time is info when the validation time was
    proven by a fully verified xades:SignatureTimeStamp, and unknown when
    it was merely asserted by --at or the clock. This is the ETSI EN 319 102-1
    best-signature-time rule: a signature that demonstrably existed at an instant
    is not undone by a certificate being withdrawn afterwards, whereas a caller
    can pass any --at they like. Never passed either way; the time and reason
    are always reported, and the chain entry's own status reads
    revoked_after_validation_time. A timestamp authority's chain is always
    treated as asserted, because the instant it is validated at is the genTime
    the token itself claims.
  • Revocation summary messages now name which chain they are about — the
    signer's or a timestamp authority's — since a signature emits one per chain
    under the same code.
  • Embedded validation data is now harvested from
    xades141:TimeStampValidationData as well as from a plain
    xades:RevocationValues / xades:CertificateValues, for both CRLs, OCSP
    responses and certificates. Real long-term Microsec dossiers file almost all
    of their embedded OCSP responses in the former, so the previous reader found
    nothing in most real material.
  • The revocation coverage message now names which certificate lacks data, by
    role and by the public CA names around it, and repeats that certificate's CRL
    distribution point when it publishes one. The end-entity certificate's own
    subject is still never repeated.
  • timestamp_verified now summarises a token's checks excluding its
    revocation checks, which are folded into the signature's verdict separately
    so they are counted once. An unobtainable revocation answer for a TSA no
    longer stops its genTime from becoming the validation time; a TSA
    certificate that was actually revoked still sinks the signature.
  • TrustSource::anchors now yields TrustAnchor values carrying their origin
    and any trusted-list service record, and RevocationSource gained crls
    and ocsp_responses. Both are breaking changes to the openszigno-verify
    public API.

Added (M2 phase 2: XAdES signed properties and RFC 3161 timestamps)

  • crates/openszigno-verify/tests/vectors.rs and
    tests/fixtures/xmldsig/: verification vectors this project did not
    produce. Canonical forms transcribed from Canonical XML 1.0 (sections 3.2,
    3.4, 3.6) and Exclusive XML Canonicalization 1.0 (section 2.2) with the
    section cited at each, plus a complete signed dossier whose reference
    digests and ds:SignatureValue were computed by OpenSSL and Python over
    canonical octets written out by hand. The in-tests signer shares the
    canonicalizer under test, so a shared mistake cancels out the...
Read more

openSzigno 0.2.0

Choose a tag to compare

@hdkiller hdkiller released this 07 Sep 18:45
7f3da9d

Added (M2 phase 1: verify for XMLDSig signatures)

  • New crate openszigno-verify: canonicalization, the XMLDSig core, the pinned
    algorithm policy, and RFC 5280 certificate-path validation. Pure Rust,
    forbid(unsafe_code), no network, and no I/O except through the injected
    Clock, TrustSource, and RevocationSource traits.
  • openszigno verify FILE [--json] [--trust-store DIR] [--at RFC3339] [--allow-namespace URI]. It verifies every ds:Signature: canonicalization,
    reference digests, ds:SignatureValue, the mandated e-dossier reference
    scope, and the certificate path to a configured anchor.
  • This release can never report a signature as valid. Revocation and
    timestamps are emitted as blocking skipped checks
    (revocation_not_checked, timestamp_not_checked), which caps every verdict
    at indeterminate. invalid is reachable and meaningful; indeterminate
    means "nothing that was checked failed", not "trustworthy". The human output
    says so on every run, and a test asserts it.
  • Canonical XML 1.0 and Exclusive XML Canonicalization 1.0, each with and
    without comments, implemented in-tree behind a C14nBackend trait over the
    roxmltree tree openszigno-core already builds. Canonical XML 1.1 and any
    other algorithm are refused with c14n_unsupported rather than approximated.
  • Pinned algorithm policy: SHA-256/384/512 digests; RSA PKCS#1 v1.5 and RSA-PSS
    with those digests and a modulus of at least 2048 bits; ECDSA P-256 with
    SHA-256 and P-384 with SHA-384. SHA-1, MD5, DSA, every HMAC method, short RSA
    keys, and a curve that does not match the named digest are rejected rather
    than warned about (algorithm_rejected).
  • Transform allowlist: enveloped-signature, the four canonicalization
    algorithms, and base64. XSLT, XPath, and XPath Filter 2.0 are refused
    unconditionally (transform_not_allowed).
  • Strictly same-document reference resolution through the ID space
    openszigno-core validates, so a duplicate ID stays a parse error and no
    reference can reach the network or the filesystem (reference_external,
    reference_unresolved).
  • Reference-scope enforcement against the e-dossier placement rules
    (reference_scope_complete / reference_scope_incomplete /
    reference_scope_unknown), the container-aware defence against XML signature
    wrapping. Each reference's resolved location is reported as a path of element
    names in resolved_to.
  • Hand-written certificate-path validation on x509-cert: bounded path
    building, link signatures under the algorithm allowlist, validity at the
    validation time, basicConstraints, pathLenConstraint, keyUsage, name
    constraints, and rejection of unrecognised critical extensions. With no trust
    store the answer is cert_path_unknown (status unknown), never
    untrusted.
  • --trust-store DIR reading anchors/* and optional intermediates/* as PEM
    or DER; a directory of certificates with no anchors subdirectory is read as
    anchors. A file that does not parse, or a store with no anchor, is
    trust_store_invalid (exit 3) rather than a silently partial store.
  • --at <RFC3339> sets the validation time; both the requested and the
    effective time are reported.
  • Exit statuses 6 (at least one signature is invalid) and 7 (nothing
    invalid, overall verdict indeterminate). A structural failure during
    verify still exits 4.
  • --allow-legacy-algorithms admits SHA-1 digests and RSA-SHA1 signature
    methods for diagnosis only, because Hungarian dossiers span 2007 to today.
    They emit algorithm_legacy_allowed with status unknown rather than a
    passed check, so the verdict stays capped at indeterminate and the flag can
    only ever lower a verdict. MD5, DSA, every HMAC method, and RSA keys below
    2048 bits stay refused whatever it is set to, and certificate-path validation
    is not loosened at all.
  • Reference-scope matching follows what real dossiers contain: the signature's
    own profile object is located by content and satisfied by a reference to
    either the ds:Object holding an es:SignatureProfile (in any allowed
    dossier namespace) or to that element itself, in either object order; and
    xades:SignedProperties coverage is decided by what a reference resolves
    to
    — the element in any recognised XAdES namespace (1.1.1, 1.2.2, 1.3.2,
    1.4.1) or an ancestor of it — with the Type attribute as corroboration
    only, since an attacker controls it. A reference that declares the
    SignedProperties Type without resolving to one is named in the failure
    message.
  • references[].resolved_to is populated by the resolution stage, so a caller
    sees what every URI pointed at even when the run stopped at a policy failure
    before any digest was recomputed.
  • Candidate certificates are harvested from xades:CertificateValues (and any
    other xades:EncapsulatedX509Certificate under the signature's XAdES
    properties, in every recognised namespace) as well as ds:KeyInfo, which is
    what real dossiers need: they carry only the signer in ds:KeyInfo and the
    intermediates and root in CertificateValues. Only the trust store can
    supply an anchor
    — a self-signed root found inside a dossier is an
    untrusted candidate like any other. A non-self-signed file in the trust store
    is an extra untrusted intermediate; the anchors/ and intermediates/ split
    is a convention, and the verifier classifies what it is given.
  • Each chain entry now reports subject_cn, issuer_cn, serial_hex,
    not_before, not_after, is_trust_anchor, and source (key_info,
    certificate_values, or trust_store). A cert_path_untrusted failure says
    how many candidates were considered and names the issuer CN that could not be
    chained, which is the public CA name a caller needs to add to their store.
  • The signing certificate is selected as the ds:KeyInfo candidate whose key
    actually verifies ds:SignatureValue, not the first one listed: XMLDSig
    imposes no order and real material lists the issuer first, which used to
    cause a false signature_value_invalid. The choice is reported as
    signing_certificate_index, and a total failure says how many were tried.
  • xades:SigningTime is extracted into signatures[].signing_time, normalised
    to RFC 3339 UTC, with the new signing_time_present check. It is a claim:
    it never becomes the validation time, which stays --at or the clock, and it
    is unauthenticated until phase 2 binds it to a timestamp.
  • Same-document reference dereferencing now removes comments before transforms
    run, as XMLDSig 4.4.3.3 requires, so a with-comments transform cannot let an
    inserted comment change a digest.
  • Path building is bounded by a hard budget of 256 total search expansions, not
    just by completed paths: a bag of same-named certificates that never reaches
    an anchor used to be explored exponentially. Hitting the budget is the new
    cert_path_search_exhausted, which says the tool stopped looking rather than
    that no path exists.
  • Name constraints follow RFC 5280 section 4.2.1.10 and fail closed. URI
    subtrees are matched against the URI's host rather than by substring, so
    https://evil.test/example.com no longer satisfies example.com; dNSName
    and rfc822Name match on label boundaries; iPAddress subtrees are evaluated
    as address and mask instead of ignored; and an unimplemented constraint form,
    an unevaluable name, or a permitted subtree of a type the certificate carries
    but does not match are all violations.
  • Critical extensions are accepted only where their semantics are implemented:
    basicConstraints, keyUsage, nameConstraints, subjectAltName, and
    extendedKeyUsage. certificatePolicies, QCStatements,
    cRLDistributionPoints, and authorityInfoAccess marked critical now fail
    closed. A critical extendedKeyUsage must contain anyExtendedKeyUsage,
    since no standard EKU authorises document signing.
  • A malformed extension is cert_malformed rather than an absent one: a
    corrupt keyUsage or nameConstraints no longer silently vanishes.
  • Trust-store entries are parsed as X.509 certificates at load time, so one
    malformed entry among good ones fails the whole store, matching the
    documented all-or-nothing behaviour. The message names the entry's ordinal,
    never the file.
  • openszigno-core: XmlSource and id_map are public, and roxmltree is
    re-exported, so the verifier resolves references in exactly the tree the
    structural parser saw. parse is refactored onto the same entry point with
    no behaviour change.

Changed (M2)

  • AGENTS.md, README.md, SECURITY.md, docs/architecture.md, and
    docs/roadmap.md state the new boundary: verify may report invalid but
    never valid. The warning cryptographic_verification_not_performed keeps
    its meaning for inspect, list, extract, and validate-structure, and
    is deliberately not emitted by verify.
  • deny.toml ignores RUSTSEC-2023-0071 with a written reason: the Marvin-attack
    advisory covers rsa's non-constant-time private-key operation, no fixed
    release exists, and openSzigno never holds an RSA private key — signing is a
    permanent non-goal and only the public-key verification path is shipped. No
    license allowlist change was needed; every new dependency is MIT, Apache-2.0,
    BSD-3-Clause, ISC, Unicode-3.0, or Zlib.

Added

  • Distribution channels for the CLI: a shell installer, a PowerShell
    installer, a Homebrew formula in the watt-mind/homebrew-tap tap,
    cargo binstall support through [package.metadata.binstall], and a
    ghcr.io/watt-mind/openszigno container image built FROM scratch for
    linux/amd64 and linux/arm64 with a build-provenance attestation.
  • docs/releasing.md, describing how a release is cut, what each workflow
    produces, the required secrets, and how to rehearse a release with a
    prerelease tag.
  • crates.io metadata (readme, ...
Read more

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 07 Sep 18:15
ea8f9a0

What's Changed

  • chore: close factory-audit gaps and fix macOS-only test failures by @hdkiller in #7
  • feat: M1 compatible namespaces, nested dossiers, content sniffing by @hdkiller in #8
  • ci: stop Dependabot from bumping the MSRV toolchain pin by @hdkiller in #9
  • chore(deps): bump actions/upload-artifact from 4 to 7 by @dependabot[bot] in #1
  • chore(deps): bump actions/checkout from 4 to 7 by @dependabot[bot] in #4
  • chore(deps): bump softprops/action-gh-release from 2 to 3 by @dependabot[bot] in #5
  • chore(deps): bump actions/download-artifact from 4 to 8 by @dependabot[bot] in #6
  • chore(deps): bump base64 from 0.22.1 to 0.23.1 by @dependabot[bot] in #3
  • chore: add public GitHub issue templates and intake rule by @hdkiller in #10
  • docs: add the reference library index by @hdkiller in #12
  • chore: cut the 0.1.0 changelog and ignore the local refs cache by @hdkiller in #11
  • release: 0.1.0 by @hdkiller in #13

New Contributors

Full Changelog: https://github.com/watt-mind/openSzigno/commits/v0.1.0