126 lines
3.3 KiB
Rust
126 lines
3.3 KiB
Rust
use crate::ser::{packet::DnsPacketData, text::DnsTextData};
|
|
|
|
// https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml
|
|
#[dnsbox_derive::native_enum(u8)]
|
|
#[derive(DnsPacketData, DnsTextData)]
|
|
pub enum DnsSecAlgorithm {
|
|
/// Delete DS
|
|
// [RFC4034][RFC4398][RFC8078]
|
|
DELETE = 0,
|
|
/// RSA/MD5 (deprecated, see 5)
|
|
// [RFC3110][RFC4034]
|
|
RSAMD5 = 1,
|
|
/// Diffie-Hellman
|
|
// [RFC2539][proposed standard]
|
|
DH = 2,
|
|
/// DSA/SHA1
|
|
// [RFC3755][proposed standard][RFC2536][proposed standard][Federal Information Processing Standards Publication (FIPS PUB) 186, Digital Signature Standard, 18 May 1994.][Federal Information Processing Standards Publication (FIPS PUB) 180-1, Secure Hash Standard, 17 April 1995. (Supersedes FIPS PUB 180 dated 11 May 1993.)]
|
|
DSA = 3,
|
|
|
|
// Reserved: 4 [RFC6725]
|
|
|
|
/// RSA/SHA-1
|
|
// [RFC3110][RFC4034]
|
|
RSASHA1 = 5,
|
|
/// DSA-NSEC3-SHA1
|
|
// [RFC5155][proposed standard]
|
|
DSA_NSEC3_SHA1 = 6,
|
|
/// RSASHA1-NSEC3-SHA1
|
|
// [RFC5155][proposed standard]
|
|
RSASHA1_NSEC3_SHA1 = 7,
|
|
/// RSA/SHA-256
|
|
// [RFC5702][proposed standard]
|
|
RSASHA256 = 8,
|
|
|
|
// Reserved: 9 [RFC6725]
|
|
|
|
/// RSA/SHA-512
|
|
// [RFC5702][proposed standard]
|
|
RSASHA512 = 10,
|
|
|
|
// Reserved: 11 [RFC6725]
|
|
|
|
/// GOST R 34.10-2001
|
|
// [RFC5933][standards track]
|
|
ECC_GOST = 12,
|
|
/// ECDSA Curve P-256 with SHA-256
|
|
// [RFC6605][standards track]
|
|
ECDSAP256SHA256 = 13,
|
|
/// ECDSA Curve P-384 with SHA-384
|
|
// [RFC6605][standards track]
|
|
ECDSAP384SHA384 = 14,
|
|
/// Ed25519
|
|
// [RFC8080][standards track]
|
|
ED25519 = 15,
|
|
/// Ed448
|
|
// [RFC8080][standards track]
|
|
ED448 = 16,
|
|
/// Reserved for Indirect Keys
|
|
// [RFC4034][proposed standard]
|
|
INDIRECT = 252,
|
|
/// private algorithm
|
|
// [RFC4034]
|
|
PRIVATEDNS = 253,
|
|
/// private algorithm OID
|
|
// [RFC4034]
|
|
PRIVATEOID = 254,
|
|
|
|
// Reserved: 255 [RFC4034][proposed standard]
|
|
}
|
|
|
|
#[dnsbox_derive::native_flags(u16)]
|
|
#[derive(DnsPacketData, DnsTextData)]
|
|
/// Flags for the DNSKEY RR
|
|
pub enum DnskeyFlags {
|
|
ZONE_KEY = 0x0100, // bit "7"
|
|
/// secure entry point, SEP
|
|
SECURE_ENTRY_POINT = 0x0001, // bit "15"
|
|
}
|
|
|
|
#[dnsbox_derive::native_enum(u8)]
|
|
#[derive(DnsPacketData, DnsTextData)]
|
|
/// Protocol for the DNSKEY RR (only DNSSEC(3) is valid for DNSKEY)
|
|
pub enum DnskeyProtocol {
|
|
// reserved: 0x00
|
|
TLS = 0x01,
|
|
EMAIL = 0x02,
|
|
DNSSEC = 0x03,
|
|
IPSEC = 0x04,
|
|
ALL = 0xff,
|
|
}
|
|
|
|
// https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml
|
|
#[dnsbox_derive::native_enum(u8)]
|
|
#[derive(DnsPacketData, DnsTextData)]
|
|
pub enum DnsSecDigestAlgorithm {
|
|
// Reserved: 0 [RFC3658]
|
|
SHA1 = 0x01, // [RFC3658]
|
|
SHA256 = 0x02, // [RFC4509]
|
|
GOST_R_34_11_94 = 0x03, // [RFC5933]
|
|
SHA384 = 0x04, // [RFC6605]
|
|
}
|
|
|
|
// https://www.iana.org/assignments/dnssec-nsec3-parameters/dnssec-nsec3-parameters.xhtml
|
|
#[dnsbox_derive::native_flags(u8)]
|
|
#[derive(DnsPacketData, DnsTextData)]
|
|
/// Flags for the NSEC3 RR
|
|
pub enum Nsec3Flags {
|
|
OPT_OUT = 0x01, // bit "7"
|
|
}
|
|
|
|
// https://www.iana.org/assignments/dnssec-nsec3-parameters/dnssec-nsec3-parameters.xhtml
|
|
#[dnsbox_derive::native_flags(u8)]
|
|
#[derive(DnsPacketData, DnsTextData)]
|
|
/// Flags for the NSEC3PARAM RR
|
|
pub enum Nsec3ParamFlags {
|
|
// reserved: Nsec3Flags::OPT_OUT bit "7" (0x01)
|
|
}
|
|
|
|
// https://www.iana.org/assignments/dnssec-nsec3-parameters/dnssec-nsec3-parameters.xhtml
|
|
#[dnsbox_derive::native_enum(u8)]
|
|
#[derive(DnsPacketData, DnsTextData)]
|
|
pub enum Nsec3Algorithm {
|
|
// Reserved: 0 [RFC5155]
|
|
SHA1 = 0x01, // [RFC5155]
|
|
}
|