confium 0.4.1-aarch64-linux-musl

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.
Files changed (47) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +284 -0
  3. data/Cargo.lock +2215 -0
  4. data/Cargo.toml +9 -0
  5. data/LICENSE.txt +21 -0
  6. data/README.adoc +143 -0
  7. data/Rakefile +30 -0
  8. data/confium.gemspec +55 -0
  9. data/lib/confium/audit.rb +126 -0
  10. data/lib/confium/cfm.rb +23 -0
  11. data/lib/confium/composite.rb +50 -0
  12. data/lib/confium/crypto.rb +51 -0
  13. data/lib/confium/digest.rb +62 -0
  14. data/lib/confium/errors/coerce.rb +47 -0
  15. data/lib/confium/errors/crypto_error.rb +15 -0
  16. data/lib/confium/errors/index_error.rb +15 -0
  17. data/lib/confium/errors/not_found_error.rb +15 -0
  18. data/lib/confium/errors/parse_error.rb +15 -0
  19. data/lib/confium/errors/policy_violation_error.rb +15 -0
  20. data/lib/confium/errors/threshold_error.rb +16 -0
  21. data/lib/confium/errors/unresolved_signer_error.rb +14 -0
  22. data/lib/confium/errors/validation_error.rb +17 -0
  23. data/lib/confium/errors/verification_error.rb +15 -0
  24. data/lib/confium/errors.rb +26 -0
  25. data/lib/confium/ffi.rb +23 -0
  26. data/lib/confium/lib.rb +33 -0
  27. data/lib/confium/openpgp.rb +156 -0
  28. data/lib/confium/pki/certificate_builder.rb +60 -0
  29. data/lib/confium/pki/cms/signed_data_builder.rb +95 -0
  30. data/lib/confium/pki/cms.rb +15 -0
  31. data/lib/confium/pki/cnml.rb +80 -0
  32. data/lib/confium/pki.rb +15 -0
  33. data/lib/confium/policy.rb +138 -0
  34. data/lib/confium/secure_bytes.rb +126 -0
  35. data/lib/confium/tc/coordinator.rb +68 -0
  36. data/lib/confium/tc/session.rb +51 -0
  37. data/lib/confium/tc/session_stub.rb +43 -0
  38. data/lib/confium/tc/share_file.rb +87 -0
  39. data/lib/confium/tc.rb +17 -0
  40. data/lib/confium/transparency/ots.rb +63 -0
  41. data/lib/confium/transparency.rb +12 -0
  42. data/lib/confium/version.rb +5 -0
  43. data/lib/confium.rb +98 -0
  44. data/lib/confium_native/3.1/confium_native.so +0 -0
  45. data/lib/confium_native/3.2/confium_native.so +0 -0
  46. data/lib/confium_native/3.3/confium_native.so +0 -0
  47. metadata +166 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ba6917bd8f5f9a9d29112814e607ddc48244aeee77b9aa296dcbb916e63b2572
4
+ data.tar.gz: 53e4e6f7bdac8595d37e0d33e74de62399d4ec2454811f08bae81b2cf1430920
5
+ SHA512:
6
+ metadata.gz: 074634d8734aaf41f54ffef0f81f02c1e0f68edd865853ca40b703a4c8a32572e7cfb633df3befcf1662038b92eb382a6510c51e4cb46e3d1a4e22c29b7251d3
7
+ data.tar.gz: 4320c431aa3fdce5f8e0534a7a1fc87c21687064b2cd91584e794eeb4829f8be0d042b09e486025401abc4dc5684ac2e791a563e7db95591e68a2691d6749b55
data/CHANGELOG.md ADDED
@@ -0,0 +1,284 @@
1
+ # Changelog
2
+
3
+ ## [0.4.1] — 2026-08-24
4
+
5
+ ### Fixed
6
+
7
+ - **Windows platform gems load on every supported Ruby.** A PE
8
+ import names the version-specific ruby DLL
9
+ (`x64-ucrt-ruby330.dll`), so the shared 3.3 window could not load
10
+ under 3.4 (Windows error 126). Windows gems now carry an exact
11
+ window per Ruby (3.1-3.4); the loader prefers the exact minor and
12
+ falls back to the shared 3.3 window on other platforms. The
13
+ mingw runtime is embedded (`-static-libgcc`).
14
+ - 0.4.0 shipped as a source gem only — its platform publish was
15
+ correctly blocked by the failing Windows install-check; the
16
+ platform gems first appear here.
17
+
18
+ ## [0.4.0] — 2026-08-23
19
+
20
+ ### Changed
21
+
22
+ - **The native extension is pure Rust — the vendored RNP stack
23
+ (librnp + Botan + json-c, a full C/C++ build) is gone.** It was
24
+ compiled into every install but used only for ASCII armor, which
25
+ is now implemented in pure Ruby (RFC 9580 §6, byte-for-byte
26
+ compatible with the previous output; differential vectors in
27
+ spec/fixtures/openpgp_armor_vectors.json). Source builds now need
28
+ only a Rust toolchain — no C compiler, no cmake, and no network
29
+ fetch of C sources — and compile in ~2 minutes instead of ~15.
30
+
31
+ ### Added
32
+
33
+ - **Windows (`x64-mingw-ucrt`) and musl Linux
34
+ (`x86_64-linux-musl`, `aarch64-linux-musl`) platform gems**,
35
+ unblocked by the dependency removal: pure Rust builds natively
36
+ under mingw and in Alpine containers (aarch64 under QEMU). All
37
+ are install-checked on every supported Ruby before publishing,
38
+ and Windows joins the test matrix.
39
+ - `Confium::OpenPGP.dearmor` now verifies the CRC-24 checksum and
40
+ raises `Confium::ParseError` on malformed blocks (previously a
41
+ bare rnp failure).
42
+
43
+ ## [0.3.4] — 2026-08-23
44
+
45
+ ### Fixed
46
+
47
+ - **Typed-error sweep completed.** Crypto operation failures
48
+ (FrostP256 sign, ElGamal encapsulate/decrypt/aggregate, composite
49
+ sign) raise `Confium::CryptoError` with the primitive in `details`;
50
+ `PathValidator` DER extraction failures raise `Confium::ParseError`;
51
+ `Manifest#tier_name_at` and `SignedData#certificate_at` out-of-range
52
+ raise the typed `Confium::IndexError` (unifying with the
53
+ transparency proofs — they previously raised Ruby's core
54
+ `IndexError`).
55
+ - **Zero compiler warnings.** All 80 direct
56
+ `magnus::exception::*` constructor sites are centralized into
57
+ `util::runtime`/`util::arg_error` (the deprecated API survives in
58
+ exactly one module whose job is wrapping it); the remaining magnus
59
+ deprecations (`RString::buf_new`, `RArray::each`) and dead imports
60
+ are fixed.
61
+ - **DoS guard now covers every byte input**: the duplicate local
62
+ `bytes_from_value` copies in tc/transparency — one of which
63
+ skipped the 1 MiB size cap — are consolidated onto the util
64
+ version that enforces it.
65
+
66
+ ## [0.3.3] — 2026-08-23
67
+
68
+ ### Added
69
+
70
+ - **Typed native errors everywhere**: PEM/DER, JSON, TOML, DSL, and
71
+ XML parse failures raise `Confium::ParseError`; out-of-range
72
+ sequence indexes raise `Confium::IndexError`; consistency-proof
73
+ failures raise `Confium::VerificationError` — each with a
74
+ structured `details` Hash (format, operation, index, ...).
75
+ Previously these surfaced as bare `RuntimeError`.
76
+
77
+ ### Added
78
+
79
+ - `Confium::Composite::Signature.components_to_json` /
80
+ `.from_json` — JSON transport for composite signatures with the
81
+ binary fields hex-encoded on the wire (fixes the Sinatra example's
82
+ happy path, which called a `from_json` that did not exist).
83
+ - Steep type checking in CI: the Steepfile never loaded before
84
+ (it used a `configure_code_diagnostics` API that does not exist in
85
+ steep 1.10). `sig/confium.rbs` now covers every pure-Ruby
86
+ subsystem — including the TC session machinery — and
87
+ `bundle exec steep check` is green and enforced. Only the FFI
88
+ layer is excluded (the ffi gem has no RBS signatures).
89
+
90
+ ### Fixed
91
+
92
+ - `Confium::PKI::CMS::SignedDataBuilder#build` raised KeyError on
93
+ the ECDSA-P256 path (`FrostP256.sign` returns `der`/`fixed`, not
94
+ `signature`); it now uses the DER form, which is what CMS carries.
95
+ - `Confium::PKI::CertificateBuilder`, `Confium::PKI::CNML`, and
96
+ `Confium::Transparency::OTS` were unreachable after
97
+ `require "confium"` (missing autoload wiring); the PKI namespace
98
+ file is now eager-required and registers them.
99
+ - All five `hello_*` quickstart examples, the Sinatra example's
100
+ happy path, and every page under `docs/` were rewritten against
101
+ the real APIs (see the docs audit), and CI now runs every example
102
+ on every push.
103
+
104
+ ## [0.3.2] — 2026-08-22
105
+
106
+ Native platform gems (linux x86_64/aarch64, macOS x86_64/arm64) ship
107
+ alongside the source gem — `gem install` no longer needs a Rust
108
+ toolchain on those platforms.
109
+
110
+ The 0.3.0/0.3.1 native-gem builds never actually produced platform
111
+ gems: the cross-compile task targeted a nonexistent rake task inside
112
+ a container whose shell swallowed the failure, and the fallback
113
+ `gem build` stamped platform=ruby. RubyGems blocks re-pushing a
114
+ version that ever existed, so the native gems first appear here.
115
+
116
+ ### Fixed
117
+
118
+ - Platform gems now build on native-arch runners (one per target
119
+ platform). Cross-compilation via rake-compiler-dock is impossible
120
+ for this gem: the dock images are Ubuntu 20.04 (gcc 9.4) while the
121
+ vendored RNP stack needs Botan 3.12, which requires gcc 11+.
122
+ - Each platform gem carries one extension per C-ABI window — exact
123
+ minors 3.1 and 3.2, plus 3.3 (loads on 3.3+) — because Ruby 3.2
124
+ broke the 3.1 ABI (a 3.1-built extension segfaults on 3.2) and
125
+ rb-sys references `ruby_current_vm_ptr` when built against
126
+ Ruby <= 3.2, which libruby stopped exporting in 3.3.
127
+ `lib/confium.rb` picks the window for the running Ruby; source
128
+ builds keep the flat extension path.
129
+ - The release workflow no longer builds a source gem (that burned
130
+ the 0.3.1 version slots against test-and-release.yml's publish),
131
+ refuses to push any gem stamped platform=ruby, and installs each
132
+ packaged gem on Ruby 3.1 through 3.4 before publishing.
133
+ - Windows remains unsupported: the vendored RNP (json-c + botan)
134
+ build has no MSVC/mingw story.
135
+
136
+ ## [0.3.1] — 2026-08-21
137
+
138
+ Shipped as a source gem only (the intended native platform gems
139
+ failed to materialize; see 0.3.2).
140
+
141
+ ### Added
142
+
143
+ - ERS archival binding (`Confium::EvidenceRecord`, RFC 4998) and the
144
+ `CONFIUM_LIB` explicit dylib path override.
145
+ - Audit log bindings with sign-triggered autofire and an Enumerable
146
+ `MemorySink`.
147
+ - Typed error hierarchy across all subsystems with native-error
148
+ coercion.
149
+ - CMP20/GG18 in-process threshold ECDSA (`Confium::TC::Cmp20`,
150
+ `Confium::TC::Gg18`) and TC share files with the documented
151
+ envelope shape.
152
+ - Twenty worked examples plus the examples and CNML-profile guides.
153
+
154
+ ### Fixed
155
+
156
+ - The PKI CSR spec no longer shells out to the openssl CLI (it
157
+ generated its fixture with a key file that was never created).
158
+ - CI: first `.rubocop.yml`, Ruby-3.1-compatible lockfile, and a test
159
+ matrix matching the shipped platforms.
160
+
161
+ ## [0.3.0] — 2026-08-04
162
+
163
+ Synced with Confium Rust workspace v0.3.0 (product restructuring).
164
+
165
+ ### Changed
166
+
167
+ - **Rust edition bumped to 2024** (was 2021). Requires Rust 1.85+.
168
+ - **All confium dependencies now from crates.io** (removed path deps for
169
+ `confium-tc-cmp20` and `confium-tc-gg18`). `gem install confium` now works
170
+ without a local workspace checkout.
171
+ - **Version synced to 0.3.0** (was 0.1.0) to match the workspace version.
172
+
173
+ ### Added
174
+
175
+ - Dependencies on newly published shared crypto crates:
176
+ `confium-tc-core`, `confium-crypto-vss`, `confium-crypto-zk`,
177
+ `confium-privacy`, `confium-observability`.
178
+
179
+ ### Migration from 0.1.0
180
+
181
+ - Update `Gemfile`: `gem "confium", "~> 0.3"`
182
+ - Ensure Rust 1.85+ is installed (`rustup update stable`)
183
+ - Run `bundle exec rake compile` to rebuild the native extension
184
+
185
+ ## [0.1.0] — 2026-07-27
186
+
187
+ First public release of the Ruby bindings. Replaces the previous FFI-based
188
+ prototype with a Rust native extension built via `rb_sys` + `magnus`
189
+ (parsanol-ruby pattern). The extension is compiled at `gem install` time
190
+ and exposes the high-value Confium subsystems directly to Ruby.
191
+
192
+ ### Added
193
+
194
+ - **Native extension scaffold** (`ext/confium_native/`). cdylib built via
195
+ `rb_sys` and `magnus`; required by `lib/confium.rb` at load time.
196
+ `Confium::Native.version`, `Confium::Native.loaded?`, and
197
+ `Confium.core_version` provide a smoke-test surface.
198
+
199
+ - **`Confium::Transparency::MerkleTree`** — append-only RFC 6962 Merkle
200
+ tree. `#append(artifact_hash)`, `#root`, `#length`, `#empty?`,
201
+ `#inclusion_proof(seq)`. `Confium::Transparency::InclusionProof` with
202
+ `#sequence`, `#steps`, `#verify(root)`.
203
+
204
+ - **`Confium::Composite`** — PQ-migration composite signatures.
205
+ `.generate_ed25519_keypair`, `.sign_ed25519(private_key, message)`.
206
+ `Confium::Composite::Signature.new(components)` + `#verify(message)` +
207
+ `#component_count` + `#algorithms`.
208
+ `Confium::Composite::VerificationResult#all_verified?` + `#per_component`.
209
+
210
+ - **`Confium::Attributes`** — attribute-based threshold-signing policy DSL.
211
+ `.parse(expr)` + `Confium::Attributes::Predicate#satisfied_by?(signers)`.
212
+ `Confium::Attributes::Signer.new` + `#add(key, value)` + `#has?(key)` +
213
+ `#values(key)`. DSL covers `min_count`, `min_distinct`, `any`, `all`,
214
+ `none`, `and`, `or`, `not`.
215
+
216
+ - **`Confium::PKI::Certificate`** — X.509 v3 certificate parse + inspect.
217
+ `.from_der(binary)` / `.from_pem(string)`. `#to_der`, `#to_pem`,
218
+ `#fingerprint_sha256`, `#serial_hex`, `#not_before`, `#not_after`,
219
+ `#valid_at?(iso8601)`, `#public_key_bytes`.
220
+
221
+ - **`Confium::PKI::CSR`** — PKCS#10 certificate signing request.
222
+ `.from_der` / `.from_pem` / `#to_der` / `#to_pem`.
223
+
224
+ - **`Confium::PKI::CMS::SignedData`** — JSON-backed RFC 5652 model.
225
+ `.from_json` / `#to_json` / `#signer_count` / `#content_type` /
226
+ `#content` / `#certificate_count` / `#certificate_at(index)`.
227
+
228
+ - **`Confium::PKI::CMS::Content`** — value object for optional content.
229
+ `#bytes`, `#length`.
230
+
231
+ - **`Confium::PKI::XMLDSig`** — Canonical XML (RFC 3076) and Exclusive
232
+ C14N. `.canonicalize(xml)`, `.canonicalize_exclusive(xml)`.
233
+
234
+ - **`Confium::Identity::Actor`** — actor identity from JSON.
235
+ `.from_json` / `#to_json` / `#actor_id` / `#actor_type` / `#quorum_id` /
236
+ `#registered_at` / `#expires_at` / `#certificate_count`.
237
+ `Confium::Identity.actor_types` returns the six canonical role strings
238
+ (`manufacturer`, `testing_lab`, `issuing_authority_officer`,
239
+ `biml_director`, `quorum_coordinator`, `verifier`).
240
+
241
+ - **`Confium::Config::Manifest`** — deployment manifest parse + validate.
242
+ `.from_toml` / `#deployment_name` / `#operator` / `#manifest_version` /
243
+ `#tier_count` / `#tier_name_at` / `#quorum_count` / `#validate` /
244
+ `#valid?`.
245
+
246
+ - **`Confium::TC::FrostP256`** — real P-256 Shamir + ECDSA.
247
+ `.generate_keypair`, `.split_secret(secret, t, n)`,
248
+ `.recover_secret([{x:, y:}, ...])`, `.sign(private_key, message)`.
249
+ `Confium::TC::FrostP256::Share#x` / `#y_bytes`.
250
+
251
+ - **`Confium::TC::ElGamalP256`** — threshold ElGamal-P256 KEM.
252
+ `.encapsulate(public_key)` → `{ ciphertext: { c1:, c2: }, shared_secret: }`,
253
+ `.partial_decrypt(party_index, share_bytes, ciphertext)`,
254
+ `.aggregate_partials(partials, threshold, ciphertext)`.
255
+
256
+ ### Changed
257
+
258
+ - `confium.gemspec` switched from `ffi` (pure-Ruby FFI to C ABI) to
259
+ `rb_sys` (Rust native extension). Required Ruby version bumped to 3.1.
260
+ - `lib/confium.rb` now requires `confium_native/confium_native` instead
261
+ of declaring autoloads for hand-written FFI wrappers.
262
+ - All binary inputs and outputs use `Encoding::ASCII_8BIT` Strings
263
+ (binary), the idiomatic Ruby shape for cryptographic data.
264
+
265
+ ### Removed
266
+
267
+ - The `ffi`-based modules (`Confium::FFI`, `Confium::CFM`, `Confium::Lib`,
268
+ `Confium::Crypto`, `Confium::Digest`) — replaced by the magnus-based
269
+ classes above. Old spec files deleted.
270
+
271
+ ### Known limitations
272
+
273
+ - v0.1.0 ships as a **source gem** — `gem install` requires Rust + cargo
274
+ on the host. Cross-platform binary gems for Linux/Windows via
275
+ `rake-compiler-dock` will follow in v0.2.0.
276
+ - The threshold-cryptography surface covers Shamir + Lagrange + ECDSA +
277
+ threshold ElGamal. Full multi-party FROST/CMP20/GG18 session
278
+ orchestration (the async coordinator) is not yet exposed — lands in
279
+ v0.2.0.
280
+ - The composite-signature surface verifies Ed25519 components only.
281
+ ML-DSA-65 / SLH-DSA verifiers will land when the underlying Rust
282
+ crates ship.
283
+ - RBS type signatures in `sig/` are not yet provided — planned for v0.2.0
284
+ once the API stabilizes.