summaryrefslogtreecommitdiffstats
path: root/third_party/heimdal/lib/kadm5/fuzz-inputs-txt/test_marshall-ent0.txt
blob: 9d78e8dd07d462e4c31ba9cd24211c445c205db3 (plain)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# The body of this file contains a representation of a very small and contrived
# kadm5_principal_ent_rec meant for fuzzing.  For fuzzing purposes, the smaller
# the input, the better.
#
# To compile this input into a binary input file suitable for fuzzing:
#
#   cd build
#   make -j4
#   cd lib/kadm5
#   make test_marshall
#   ./test_marshall --in-text --byte-order-in=packed     \
#                   --byte-order-out=packed              \
#                   --out-hex                            \
#                   kadm5_principal_ent_rec              \
#                   ../../../lib/kadm5/fuzz-inputs-txt/test_marshall-ent0.txt
#
# then decode the hex (e.g., with xxd -r -p) and save it in a file.
#
# Currently we have that saved in lib/kadm5/fuzz-inputs-packed/.
#
# To build and fuzz with this input:
#
# cd build
# AFL_HARDEN=1 make -j4 CC=afl-clang all
# cd lib/kadm5
# AFL_HARDEN=1 make -j4 CC=afl-clang test_marshall
# rm -rf f; mkdir f
# ../../libtool --mode=execute afl-fuzz \
#               -i ../../../lib/kadm5/fuzz-inputs-packed \
#               -o $PWD/f                                \
#               ./test_marshall --byte-order-in=packed   \
#                               --byte-order-out=packed  \
#                               --out-hex                \
#                               kadm5_principal_ent_rec '@@'
#
# A kadm5_principal_ent_rec follows:
#
# principal name
int32 0
int32 1
string T
string f
# expiration
int32 2
# pw expiration
int32 3
# last pw change
int32 4
# max life
int32 5
# mod name optional (boolean, principal name)
int32 1
int32 0
int32 1
string T
string b
# mod time
int32 6
# attrs
int32 7
# kvno
int32 8
# master kvno
int32 9
# policy (boolean, string)
int32 1
string default
# aux attrs
int32 10
# max renew life
int32 11
# last success
int32 12
# last fail
int32 13
# fail count
int32 14
# nkeydata
int32 2
# keydata[0] (ver, kvno, type, data, type, data)
int32 15
int32 16
int32 17
data 1122
int32 18
data 2233
# keydata[1]
int32 19
int32 21
int32 22
data 3344
int32 23
data 4455
# ntldata
int32 2
# ntldata[0] (type, data)
int32 24
data 5566
# ntldata[1]
int32 25
data 6677