Skip to content

Kerberos parser written in rust with nom

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

rusticata/kerberos-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9332642 · Feb 10, 2025

History

83 Commits
Feb 10, 2025
Nov 15, 2021
Mar 11, 2018
Feb 10, 2025
Mar 15, 2023
Feb 10, 2025
Aug 5, 2019
Feb 10, 2025
Feb 10, 2025
Mar 11, 2018
Mar 11, 2018
Jul 9, 2019

Repository files navigation

Kerberos parser

License: MIT Apache License 2.0 Build Status Crates.io Version

Kerberos Parser

A Kerberos v5 (RFC4120) parser, implemented with the nom parser combinator framework.

The code is available on Github.

Specific parsing functions are provided for Kerberos message types. For ex. to parse a KRB_AS_REQ message, use parse_as_req.

Examples

Parsing a KRB_AS_REQ message:

use kerberos_parser::krb5::MessageType;
use kerberos_parser::krb5_parser::parse_as_req;

static AS_REQ: &'static [u8] = include_bytes!("../assets/as-req.bin");

let res = parse_as_req(AS_REQ);
match res {
    Ok((rem, kdc_req)) => {
        assert!(rem.is_empty());
        //
        assert_eq!(kdc_req.msg_type, MessageType::KRB_AS_REQ);
    },
    _ => panic!("KRB_AS_REQ parsing failed: {:?}", res),
}

Rusticata

This parser is part of the rusticata project. The goal of this project is to provide safe parsers, that can be used in other projects.

Testing of the parser is done manually, and also using unit tests and cargo-fuzz. Please fill a bugreport if you find any issue.

Feel free to contribute: tests, feedback, doc, suggestions (or code) of new parsers etc. are welcome.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.