hanko_xml 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +44 -0
- data/Cargo.lock +401 -0
- data/Cargo.toml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +222 -0
- data/THIRD_PARTY_LICENSES.md +392 -0
- data/dependencies.yml +87 -0
- data/ext/hanko_xml/Cargo.toml +20 -0
- data/ext/hanko_xml/build/vendor.rs +817 -0
- data/ext/hanko_xml/build.rs +298 -0
- data/ext/hanko_xml/extconf.rb +6 -0
- data/ext/hanko_xml/src/dsig.rs +1851 -0
- data/ext/hanko_xml/src/errors.rs +151 -0
- data/ext/hanko_xml/src/lib.rs +490 -0
- data/ext/hanko_xml/src/sys.rs +43 -0
- data/lib/hanko_xml/algorithms.rb +228 -0
- data/lib/hanko_xml/dom.rb +137 -0
- data/lib/hanko_xml/errors.rb +132 -0
- data/lib/hanko_xml/exc-c14n.xsd +26 -0
- data/lib/hanko_xml/input.rb +50 -0
- data/lib/hanko_xml/key.rb +213 -0
- data/lib/hanko_xml/key_info.rb +67 -0
- data/lib/hanko_xml/native_version.rb +75 -0
- data/lib/hanko_xml/nokogiri_ext.rb +34 -0
- data/lib/hanko_xml/placement.rb +127 -0
- data/lib/hanko_xml/policy.rb +502 -0
- data/lib/hanko_xml/reference.rb +49 -0
- data/lib/hanko_xml/signature_info.rb +134 -0
- data/lib/hanko_xml/signed_document.rb +155 -0
- data/lib/hanko_xml/signer.rb +572 -0
- data/lib/hanko_xml/template.rb +150 -0
- data/lib/hanko_xml/transform.rb +87 -0
- data/lib/hanko_xml/verification.rb +377 -0
- data/lib/hanko_xml/verifier.rb +694 -0
- data/lib/hanko_xml/version.rb +5 -0
- data/lib/hanko_xml/xades/verifier.rb +319 -0
- data/lib/hanko_xml/xades.rb +287 -0
- data/lib/hanko_xml/xml.rb +93 -0
- data/lib/hanko_xml/xmldsig-core-schema.xsd +332 -0
- data/lib/hanko_xml.rb +122 -0
- data/sig/hanko_xml/key.rbs +48 -0
- data/sig/hanko_xml/native.rbs +12 -0
- data/sig/hanko_xml/native_version.rbs +13 -0
- data/sig/hanko_xml/nokogiri_ext.rbs +23 -0
- data/sig/hanko_xml/placement.rbs +27 -0
- data/sig/hanko_xml/policy.rbs +83 -0
- data/sig/hanko_xml/reference.rbs +36 -0
- data/sig/hanko_xml/signed_document.rbs +66 -0
- data/sig/hanko_xml/signer.rbs +50 -0
- data/sig/hanko_xml/template.rbs +41 -0
- data/sig/hanko_xml/verification.rbs +100 -0
- data/sig/hanko_xml/verifier.rbs +45 -0
- data/sig/hanko_xml/xades.rbs +70 -0
- data/sig/hanko_xml.rbs +62 -0
- metadata +105 -0
data/dependencies.yml
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Pinned upstream C libraries.
|
|
2
|
+
#
|
|
3
|
+
# These are the versions statically vendored into the precompiled platform gems
|
|
4
|
+
# (see RELEASING.md). The source gem does not use them: it builds against the
|
|
5
|
+
# system libraries unless HANKO_XML_VENDOR=1 is set, which only CI does.
|
|
6
|
+
#
|
|
7
|
+
# The gem version does NOT track these. hanko_xml's version is SemVer over its
|
|
8
|
+
# Ruby API; what is vendored is data, reported at runtime by
|
|
9
|
+
# HankoXml::NativeVersion.build_versions. Bumping a version here is at minimum a
|
|
10
|
+
# patch release, and an upstream *security* fix is a patch release with the CVE
|
|
11
|
+
# named in CHANGELOG.md -- vendoring makes us the distributor, so that response
|
|
12
|
+
# is our obligation.
|
|
13
|
+
#
|
|
14
|
+
# The checksums are not decoration. We redistribute cryptographic code, so the
|
|
15
|
+
# build verifies SHA256 before extracting and fails hard on a mismatch.
|
|
16
|
+
#
|
|
17
|
+
# Tarballs are cached in tmp/vendor-cache/ (gitignored); override with
|
|
18
|
+
# HANKO_XML_VENDOR_CACHE to build offline or from a mirror. The cache is
|
|
19
|
+
# verified against these checksums on every build; the compiled output in
|
|
20
|
+
# tmp/vendor-build/ is not, and is a trusted input (VENDORING.md, "Trusted
|
|
21
|
+
# build inputs").
|
|
22
|
+
#
|
|
23
|
+
# To bump: change version + sha256 together, run
|
|
24
|
+
# `HANKO_XML_VENDOR=1 bundle exec rake compile spec`, and confirm
|
|
25
|
+
# `spec/symbols_spec.rb` (part of the suite) still finds no leaked
|
|
26
|
+
# xml*/xmlSec* exports.
|
|
27
|
+
|
|
28
|
+
libxml2:
|
|
29
|
+
version: "2.15.4"
|
|
30
|
+
url: "https://download.gnome.org/sources/libxml2/2.15/libxml2-2.15.4.tar.xz"
|
|
31
|
+
sha256: "98087fd181d9070724f3fbc65c7377db03038eb92bd882374daff44940138821"
|
|
32
|
+
license: "MIT"
|
|
33
|
+
|
|
34
|
+
xmlsec1:
|
|
35
|
+
version: "1.3.12"
|
|
36
|
+
# The project's own site (www.aleksey.com, the `mirror` below) sits behind
|
|
37
|
+
# Cloudflare and answers 403 to GitHub Actions runners, so the primary source
|
|
38
|
+
# is the identical tarball from the upstream GitHub release -- verified
|
|
39
|
+
# byte-for-byte against aleksey.com, same SHA256. Which host serves it does
|
|
40
|
+
# not affect trust: the checksum below is what is actually trusted.
|
|
41
|
+
url: "https://github.com/lsh123/xmlsec/releases/download/1.3.12/xmlsec1-1.3.12.tar.gz"
|
|
42
|
+
mirror: "https://www.aleksey.com/xmlsec/download/xmlsec1-1.3.12.tar.gz"
|
|
43
|
+
sha256: "24045199af12d93fe5fdbbbf7e386e823e4842071e9432e2b90ac108b889a923"
|
|
44
|
+
license: "MIT"
|
|
45
|
+
|
|
46
|
+
openssl:
|
|
47
|
+
# 3.5 is the LTS series (supported into 2030); a vendored dependency wants
|
|
48
|
+
# long support and few forced bumps. Checksum cross-checked against both the
|
|
49
|
+
# GitHub release and openssl.org's published .sha256 -- one source is not
|
|
50
|
+
# enough for the crypto we ship.
|
|
51
|
+
version: "3.5.9"
|
|
52
|
+
url: "https://github.com/openssl/openssl/releases/download/openssl-3.5.9/openssl-3.5.9.tar.gz"
|
|
53
|
+
mirror: "https://www.openssl.org/source/openssl-3.5.9.tar.gz"
|
|
54
|
+
sha256: "603f5602e2eef00d77fbd429d34dcd5822bb301757a1bc9cdb24c670f1eb859a"
|
|
55
|
+
license: "Apache-2.0"
|
|
56
|
+
|
|
57
|
+
# Why OpenSSL is vendored after all.
|
|
58
|
+
#
|
|
59
|
+
# The original plan linked the system libcrypto, on the reasoning that libxml2
|
|
60
|
+
# must be vendored (xmlDoc/xmlNode/xmlAttr are *public* structs we dereference
|
|
61
|
+
# by field offset -- that is its ABI -- and the same xmlDocPtr is shared with
|
|
62
|
+
# xmlsec) while OpenSSL is the opposite: 3.x structs are opaque behind
|
|
63
|
+
# accessors, and its pointers never enter our code at all, since the only
|
|
64
|
+
# contact is the xmlSecOpenSSLApp* wrappers, which take PEM bytes.
|
|
65
|
+
#
|
|
66
|
+
# That reasoning is still correct about *safety*. It was wrong about
|
|
67
|
+
# *feasibility* for precompiled gems, and CI proved it three times:
|
|
68
|
+
#
|
|
69
|
+
# * macOS ships no usable system libcrypto, so a vendored build baked in an
|
|
70
|
+
# absolute Homebrew path.
|
|
71
|
+
# * Cross-compiling to aarch64 found no target OpenSSL in the build
|
|
72
|
+
# container at all.
|
|
73
|
+
# * x86_64 built fine and then would not load: the build container's OpenSSL
|
|
74
|
+
# is 1.1, so the gem recorded a NEEDED entry for libcrypto.so.1.1 while
|
|
75
|
+
# every current distro ships libcrypto.so.3. Different soname, so it failed
|
|
76
|
+
# at load on a bare ruby:3.3-slim.
|
|
77
|
+
#
|
|
78
|
+
# The soname a precompiled gem records is decided by whatever OpenSSL the build
|
|
79
|
+
# container has, which is never the user's. Vendoring is the only way to make
|
|
80
|
+
# the two agree. Safety is preserved the same way it is for libxml2: the FFI
|
|
81
|
+
# boundary is PEM strings, never EVP_PKEY*, and -fvisibility=hidden plus
|
|
82
|
+
# --exclude-libs keeps our copy private from Ruby's own openssl stdlib.
|
|
83
|
+
#
|
|
84
|
+
# The cost is real and accepted: OpenSSL advisories are now our release
|
|
85
|
+
# obligation. Note also that a bundled libcrypto bypasses system crypto policy
|
|
86
|
+
# (FIPS and similar), which matters to regulated users of a signing library --
|
|
87
|
+
# they should build the source gem, which still links the system OpenSSL.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "hanko_xml"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
authors = ["Danimar Ribeiro <danimaribeiro@gmail.com>"]
|
|
6
|
+
license = "MIT"
|
|
7
|
+
publish = false
|
|
8
|
+
|
|
9
|
+
[lib]
|
|
10
|
+
crate-type = ["cdylib"]
|
|
11
|
+
|
|
12
|
+
[dependencies]
|
|
13
|
+
magnus = { version = "0.8.2" }
|
|
14
|
+
|
|
15
|
+
[build-dependencies]
|
|
16
|
+
bindgen = "0.73"
|
|
17
|
+
pkg-config = "0.3"
|
|
18
|
+
# Verifies the pinned upstream tarballs in dependencies.yml before they are
|
|
19
|
+
# extracted. Build-time only, and only exercised on the vendored path.
|
|
20
|
+
sha2 = "0.11"
|