Crates.io | kerberos-parser |
lib.rs | kerberos-parser |
version | 0.8.0 |
source | src |
created_at | 2018-03-15 06:58:42.781087 |
updated_at | 2024-02-29 09:14:10.948392 |
description | Parser for the Kerberos protocol |
homepage | https://github.com/rusticata/kerberos-parser |
repository | https://github.com/rusticata/kerberos-parser.git |
max_upload_size | |
id | 55743 |
size | 85,460 |
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
.
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),
}
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.
Licensed under either of
at your option.
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.