Skip to content

v0.8.0

Choose a tag to compare

@github-actions github-actions released this 25 Aug 01:50
· 241 commits to main since this release
4f43112

Highlights

xmlenc1 loses its experimental label (#1413). It gained ECDH-ES encryption, Encryptor.EncryptBytes / Decryptor.DecryptBytes, xenc:CipherReference and same-document RetrievalMethod resolution, SHA-224 support, and a long run of hardening: bounded CipherValue, EncryptedKey, OAEPparams, ConcatKDF and EC-key decoding, constant-time key-unwrap integrity checks, and cancellation observed during parsing and canonicalization.

schematron implements the queryBinding attribute, and validation of large documents is dramatically faster: it no longer rebuilds the document-order index on every expression, so validation is linear rather than quadratic in document size. The 10,000-record case from #1420 drops from 668 s and 425 GB allocated to 232 ms and 154 MB. xpath1 and xpath3 both benefit, since the document-order machinery is shared.

Upgrading

xmlenc1 wire structs are no longer exported (#1390). EncryptedData, EncryptedKey and EncryptionMethod are now internal to the package; use Encryptor and Decryptor instead. Code that referenced those types will not compile.

DefaultBlockAlgorithm changed value (#1354), from the XML Encryption 1.0 aes256-gcm URI to the standard XML Encryption 1.1 one. An Encryptor that does not set a block algorithm now writes the 1.1 URI. Set it explicitly with Encryptor.BlockAlgorithm to keep the old output, and note that Decryptor.BlockAlgorithm now accepts an out-of-band algorithm too.

xmlenc1 refuses retired crypto (#1404), and parses more strictly: it validates EncryptionMethod children (#1411), requires RetrievalMethod URIs (#1412), rejects conflicting key material and duplicate KeyInfo/EC nodes, refuses a non-XML @Type in Decrypt, and no longer reads CarriedKeyName. Documents that relied on any of that are now rejected rather than silently accepted. Triple DES remains available as a documented exception. CBC padding is read the way xmlenc-core1 writes it (#1397), with Decryptor.StrictPKCS7Padding to opt into strict checking.

schematron now reads the queryBinding attribute instead of ignoring it, and refuses a binding it does not implement. A schema carrying queryBinding="xslt2", "xpath2", "xquery", "exslt", "stx", or any other unrecognized value compiled and validated on v0.7.0; it now fails compilation with schematron.ErrUnsupportedQueryBinding. Accepted values are the ones ISO/IEC 19757-3 defines and this release implements: an absent attribute or xslt (Annex C) evaluates with XPath 1.0, and xslt3 (2020 Annex J) or xpath3 (2020 Annex K) evaluates with XPath 3.1. To keep the old lenient behavior for a schema whose binding you cannot change, force it:

schema, err := schematron.NewCompiler().
    QueryBinding(schematron.QueryBindingXPath1).
    CompileFile(ctx, "rules.sch")

Two XSD 1.0 fixes change validation verdicts (#1389, #1392). Attribute inheritance and duplicate attribute use on an extension are now handled correctly, so a schema that previously compiled or validated may now be reported as invalid.

New resource caps are opt-in through Decryptor.MaxCipherValueBytes and Decryptor.MaxEncryptedKeyBytes, defaulting to DefaultMaxCipherValueBytes (10 MiB) and DefaultMaxEncryptedKeyBytes (64 KiB).

What's Changed

Full Changelog: v0.7.0...v0.8.0