| 1 |
# The body of this file contains a representation of a very small and contrived |
| 2 |
# kadm5_principal_ent_rec meant for fuzzing. For fuzzing purposes, the smaller |
| 3 |
# the input, the better. |
| 4 |
# |
| 5 |
# To compile this input into a binary input file suitable for fuzzing: |
| 6 |
# |
| 7 |
# cd build |
| 8 |
# make -j4 |
| 9 |
# cd lib/kadm5 |
| 10 |
# make test_marshall |
| 11 |
# ./test_marshall --in-text --byte-order-in=packed \ |
| 12 |
# --byte-order-out=packed \ |
| 13 |
# --out-hex \ |
| 14 |
# kadm5_principal_ent_rec \ |
| 15 |
# ../../../lib/kadm5/fuzz-inputs-txt/test_marshall-ent0.txt |
| 16 |
# |
| 17 |
# then decode the hex (e.g., with xxd -r -p) and save it in a file. |
| 18 |
# |
| 19 |
# Currently we have that saved in lib/kadm5/fuzz-inputs-packed/. |
| 20 |
# |
| 21 |
# To build and fuzz with this input: |
| 22 |
# |
| 23 |
# cd build |
| 24 |
# AFL_HARDEN=1 make -j4 CC=afl-clang all |
| 25 |
# cd lib/kadm5 |
| 26 |
# AFL_HARDEN=1 make -j4 CC=afl-clang test_marshall |
| 27 |
# rm -rf f; mkdir f |
| 28 |
# ../../libtool --mode=execute afl-fuzz \ |
| 29 |
# -i ../../../lib/kadm5/fuzz-inputs-packed \ |
| 30 |
# -o $PWD/f \ |
| 31 |
# ./test_marshall --byte-order-in=packed \ |
| 32 |
# --byte-order-out=packed \ |
| 33 |
# --out-hex \ |
| 34 |
# kadm5_principal_ent_rec '@@' |
| 35 |
# |
| 36 |
# A kadm5_principal_ent_rec follows: |
| 37 |
# |
| 38 |
# principal name |
| 39 |
int32 0 |
| 40 |
int32 1 |
| 41 |
string T |
| 42 |
string f |
| 43 |
# expiration |
| 44 |
int32 2 |
| 45 |
# pw expiration |
| 46 |
int32 3 |
| 47 |
# last pw change |
| 48 |
int32 4 |
| 49 |
# max life |
| 50 |
int32 5 |
| 51 |
# mod name optional (boolean, principal name) |
| 52 |
int32 1 |
| 53 |
int32 0 |
| 54 |
int32 1 |
| 55 |
string T |
| 56 |
string b |
| 57 |
# mod time |
| 58 |
int32 6 |
| 59 |
# attrs |
| 60 |
int32 7 |
| 61 |
# kvno |
| 62 |
int32 8 |
| 63 |
# master kvno |
| 64 |
int32 9 |
| 65 |
# policy (boolean, string) |
| 66 |
int32 1 |
| 67 |
string default |
| 68 |
# aux attrs |
| 69 |
int32 10 |
| 70 |
# max renew life |
| 71 |
int32 11 |
| 72 |
# last success |
| 73 |
int32 12 |
| 74 |
# last fail |
| 75 |
int32 13 |
| 76 |
# fail count |
| 77 |
int32 14 |
| 78 |
# nkeydata |
| 79 |
int32 2 |
| 80 |
# keydata[0] (ver, kvno, type, data, type, data) |
| 81 |
int32 15 |
| 82 |
int32 16 |
| 83 |
int32 17 |
| 84 |
data 1122 |
| 85 |
int32 18 |
| 86 |
data 2233 |
| 87 |
# keydata[1] |
| 88 |
int32 19 |
| 89 |
int32 21 |
| 90 |
int32 22 |
| 91 |
data 3344 |
| 92 |
int32 23 |
| 93 |
data 4455 |
| 94 |
# ntldata |
| 95 |
int32 2 |
| 96 |
# ntldata[0] (type, data) |
| 97 |
int32 24 |
| 98 |
data 5566 |
| 99 |
# ntldata[1] |
| 100 |
int32 25 |
| 101 |
data 6677 |