1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! # kerbcore
//!
//! Pure-Rust Kerberos building blocks — no FFI, no dependency on a host krb5,
//! `#![forbid(unsafe_code)]`. Three layers, each cross-checked against RFC
//! known-answer vectors and (for the codec) a differential re-encode oracle:
//!
//! - [`crypto`] — RFC 3961 / 3962 AES-CTS-HMAC-SHA1 (etypes 17 & 18): n-fold,
//! AES CBC-CTS, DR/DK, HMAC-SHA1-96, subkey derivation, PBKDF2 string-to-key,
//! and the generic encrypt-then-integrity primitive.
//! - [`rfc8009`] — RFC 8009 AES-SHA2 (etypes 19 & 20): SP800-108 KDF,
//! encrypt-then-MAC, string-to-key. [`rc4`] — RFC 4757 RC4-HMAC (etype 23).
//! - [`der`] + [`types`] + [`messages`] — a hand-rolled X.690 DER codec (total,
//! never-panicking decoder) and the RFC 4120 message set (Ticket, AS/TGS
//! REQ+REP, KRB-ERROR, PA-DATA). [`client`] assembles AS-REQ / TGS-REQ and
//! parses the KDC's reply — including the AP exchange (AP-REQ builder + AP-REP
//! mutual-auth verification), EncKDCRepPart nonce anti-replay, ETYPE-INFO2
//! `s2kparams`, and RFC 6806 cross-realm referral detection + credential
//! lifecycle (renew/validate).
//! - Higher protocol layers: [`gss`] (RFC 4121 krb5-gss context token + MIC +
//! Wrap), [`spnego`] (RFC 4178 negotiation), [`kkdcp`] (MS-KKDCP HTTPS proxy
//! container), [`kpasswd`] (RFC 3244 change/set-password + a KRB-PRIV codec),
//! and [`fast`] (RFC 6113 FAST wire codec + KRB-FX-CF2 armor-key math — the
//! end-to-end AES-SHA1 PRF + a live-DC round-trip are the remaining gap; see
//! the module docs).
//!
//! This is the crate that replaces `picky-krb` inside ADhammer's Kerberos stack.
//! Offensive compositions (golden / silver / diamond / S4U-abuse / PKINIT-relay)
//! intentionally do **not** live here — they stay in the ADhammer CLI per its
//! dual-use rule.
//!
//! ## Status
//! `0.2.x` — the AS/TGS crypto + codec + client are complete and live-validated
//! (real TGT + service ticket) against Windows Server 2019 / 2022 / 2025. The API
//! is pre-1.0 and may change. `0.2.0` adds the typed [`KerberosKey`] / [`Enctype`]
//! abstraction: one key value dispatches encrypt / decrypt / checksum / string-to-key
//! across the whole etype matrix (17/18/19/20/23), zeroizes its bytes on drop, and never
//! prints them via `Debug`. (The `client::build_tgs_req` wire path still targets the
//! AES-SHA1 session-key profile AD issues; migrating it onto `KerberosKey` is next.)
pub use *;
pub use ;