Skip to main content

ms_kile_fast/
lib.rs

1//! # ms-kile-fast (pre-alpha)
2//!
3//! RFC 6113 **FAST** (Flexible Authentication Secure Tunneling) armor for
4//! Kerberos AS-REQ / TGS-REQ.  Wraps the inner request inside a
5//! `PA-FX-FAST-REQUEST` PA-DATA element with an armor key derived from
6//! either a machine-account TGT or (planned) an anonymous-PKINIT TGT
7//! (RFC 8062, via [ms-pkca][ms-pkca]).
8//!
9//! **STATUS: 0.1.0-dev** — the KRB-FX-CF2 (RFC 6113 §5.1) primitive and its
10//! PRF+/PRF/DK dependencies are fully wired against RFC 3961 §A test vectors
11//! (see `nfold::tests`).  The outer PA-FX-FAST-REQUEST envelope is emitted
12//! with a structurally-correct DER TLV skeleton; the `EncryptedData` /
13//! `Checksum` fields are documented placeholders (see
14//! [`FastArmor::wrap_as_req`]).  Anon-PKINIT-sourced armor keys return
15//! [`Error::AnonPkinitStub`] until the ms-pkca network layer lands.
16//!
17//! ## What this crate is for
18//! FAST is the pre-req for Kerberos armoring against pre-auth abuse
19//! (AS-REP roasting, ASREQ-observer replay, weak-etype negotiation).  A KDC
20//! that requires FAST rejects any unarmored AS-REQ with
21//! `KDC_ERR_PREAUTH_FAILED` / `KDC_ERR_POLICY`.  This crate produces the
22//! armored envelope + the derived armor key that the caller then feeds to
23//! its Kerberos etype layer to encrypt the inner `KrbFastReq`.
24//!
25//! ## Etype support
26//! Only `aes256-cts-hmac-sha1-96` (etype 18) is wired — the modern Windows
27//! default.  Others are one-line additions (see [`prf`] for the pattern).
28//!
29//! ## Minimal (compile-only) example
30//! ```no_run
31//! use ms_kile_fast::{ArmorSource, FastArmor};
32//!
33//! let armor = FastArmor::from_source(ArmorSource::MachineTgt {
34//!     ticket: vec![/* opaque TGT bytes */ 0xDE],
35//!     session_key: [0u8; 32].to_vec(), // 32-byte AES-256 session key
36//! }).unwrap();
37//!
38//! let inner_as_req: &[u8] = b"\x6a\x00"; // placeholder inner AS-REQ
39//! let per_req_subkey = [1u8; 32];
40//! let armored = armor.wrap_as_req(inner_as_req, &per_req_subkey).unwrap();
41//! // send `armored` to the KDC …
42//! ```
43//!
44//! [ms-pkca]: https://crates.io/crates/ms-pkca
45
46pub mod armor;
47pub mod cf2;
48pub mod der;
49pub mod error;
50pub mod nfold;
51pub mod prf;
52
53pub use armor::{ArmorSource, FastArmor};
54pub use error::{Error, Result};