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
58
59
60
61
62
use red_asn1::{SequenceOf, Asn1Object};
use red_asn1_derive::Sequence;
use crate::{Int32, PaData, KdcReqBody};
use crate::{AsReq, TgsReq};
#[derive(Sequence, Debug, PartialEq, Clone)]
pub struct KdcReq {
#[seq_field(context_tag = 1)]
pub pvno: Int32,
#[seq_field(context_tag = 2)]
pub msg_type: Int32,
#[seq_field(context_tag = 3)]
pub padata: Option<SequenceOf<PaData>>,
#[seq_field(context_tag = 4)]
pub req_body: KdcReqBody,
}
impl Default for KdcReq {
fn default() -> Self {
return Self {
pvno: 5,
msg_type: Int32::default(),
padata: Option::default(),
req_body: KdcReqBody::default()
}
}
}
impl From<AsReq> for KdcReq {
fn from(req: AsReq) -> Self {
Self {
pvno: req.pvno,
msg_type: req.msg_type,
padata: req.padata,
req_body: req.req_body
}
}
}
impl From<TgsReq> for KdcReq {
fn from(req: TgsReq) -> Self {
Self {
pvno: req.pvno,
msg_type: req.msg_type,
padata: req.padata,
req_body: req.req_body
}
}
}