OQ-59 resolved to Option A: fingerprint.rs stays in alknet-core. The client-side FingerprintPinVerifier in alknet-call uses fingerprint functions and must not depend on alknet-tls (which would pull TLS setup infra into client-only deployments). The rustls dep in core is narrow — production fingerprint code uses only sha2 + manual DER parsing; the rustls::sign usage is a test helper only. alknet-tls re-exports the fingerprint functions for convenience. ADR-084: aws-lc-rs as the TLS crypto provider on all server + client config paths. Records the decision that was already in the code (to match iroh's tls-aws-lc-rs feature) but had no ADR. FIPS-capable, broad platform support, consistent across quinn/iroh/TCP+TLS/client. Switching to ring or process-default requires a new ADR. ADR-082's behavior-preservation invariant now references ADR-084 for the decision record.
2.7 KiB
OQ-59: Should fingerprint.rs Stay in alknet-core or Move to alknet-tls?
-
Origin:
docs/architecture/crates/tls/README.md(the crate spec),docs/architecture/decisions/082-alknet-tls-extraction.md(the ADR). -
Status: resolved
-
Door type: two-way (moving a module between crates is a refactor, not a wire-format change; the function signatures and types are unchanged)
-
Priority: medium
-
Resolution: Option A —
fingerprint.rsstays inalknet-core.The fingerprint functions are used by two paths with different dep profiles:
- Server path (
alknet-core::endpoint→alknet-tls): extracts the fingerprint from the presented client cert forPeerEntryresolution. This path already depends onalknet-tls— no new dep edge. - Client path (
alknet-call::FingerprintPinVerifier): matches the server's presented cert against a pinned fingerprint. This path does NOT want to depend onalknet-tls— it's a client-only deployment that needs fingerprint matching, not TLS setup. Movingfingerprint.rstoalknet-tlswould forcealknet-callto depend onalknet-tls, pullingrustls+tokio+ (optionally)quinn/tokio-rustls/rustls-acmeinto every client-only deployment. That's heavy and doesn't serve the use case.
The
rustlsdep in core is narrow: the production code infingerprint.rsuses onlysha2+hex+ manual DER parsing. Therustls::sign::public_key_to_spkiandrustls::pki_types::alg_id::ED25519usage is in the test helper only (build_ed25519_spki_der), not production. Core's production dep tree doesn't needrustlsfor fingerprint — only the test does. Therustlsandrustls-pki-typesdeps are listed directly onalknet-corefor this test helper (and forConnection's quinn/iroh integration types), but the fingerprint production path isrustls-free.Keeping
fingerprint.rsin core serves both the server path (which depends onalknet-tlsanyway) and the client path (which must not depend onalknet-tls) without forcing a heavy dep edge on the client.alknet-tlsre-exports the fingerprint functions for convenience.This is a two-way door — moving the module later is a refactor, not a wire-format change. But the rationale is clear: the client path's fingerprint-matching need doesn't justify pulling TLS setup infra.
- Server path (
-
Cross-references: ADR-082 (alknet-tls extraction), ADR-003 (crate decomposition — handler dep rules), ADR-030 §6 (fingerprint normalization),
crates/alknet-core/src/fingerprint.rs(the code),crates/alknet-call/src/client/call_client.rs(FingerprintPinVerifier— the client-side consumer)