/src/tpm2-tss/test/fuzz/Tss2_Sys_DictionaryAttackParameters_Prepare.fuzz.c
Line | Count | Source (jump to first uncovered line) |
1 | | /* SPDX-License-Identifier: BSD-2-Clause */ |
2 | | /*********************************************************************** |
3 | | * Copyright (c) 2018, Intel Corporation |
4 | | * |
5 | | * All rights reserved. |
6 | | ***********************************************************************/ |
7 | | #ifdef HAVE_CONFIG_H |
8 | | #include <config.h> |
9 | | #endif |
10 | | |
11 | | #include <inttypes.h> |
12 | | #include <stdbool.h> |
13 | | #include <stdio.h> |
14 | | #include <string.h> |
15 | | #include <poll.h> |
16 | | #include <stdarg.h> |
17 | | |
18 | | #include <setjmp.h> |
19 | | |
20 | | #include "tss2_mu.h" |
21 | | #include "tss2_sys.h" |
22 | | #include "tss2_tcti_device.h" |
23 | | |
24 | | #include "tss2-tcti/tcti-common.h" |
25 | | #include "tss2-tcti/tcti-device.h" |
26 | | |
27 | | #define LOGMODULE fuzz |
28 | | #include "tss2_tcti.h" |
29 | | #include "util/log.h" |
30 | | #include "test.h" |
31 | | #include "tss2-sys/sysapi_util.h" |
32 | | #include "tcti/tcti-fuzzing.h" |
33 | | |
34 | | int |
35 | | test_invoke ( |
36 | | TSS2_SYS_CONTEXT *sysContext) |
37 | 0 | { |
38 | 0 | int ret; |
39 | 0 | TPMI_RH_LOCKOUT lockHandle = {0}; |
40 | 0 | UINT32 newMaxTries = {0}; |
41 | 0 | UINT32 newRecoveryTime = {0}; |
42 | 0 | UINT32 lockoutRecovery = {0}; |
43 | |
|
44 | 0 | ret = fuzz_fill ( |
45 | 0 | sysContext, |
46 | 0 | 8, |
47 | 0 | sizeof (lockHandle), &lockHandle, |
48 | 0 | sizeof (newMaxTries), &newMaxTries, |
49 | 0 | sizeof (newRecoveryTime), &newRecoveryTime, |
50 | 0 | sizeof (lockoutRecovery), &lockoutRecovery |
51 | 0 | ); |
52 | 0 | if (ret) { |
53 | 0 | return ret; |
54 | 0 | } |
55 | | |
56 | 0 | Tss2_Sys_DictionaryAttackParameters_Prepare ( |
57 | 0 | sysContext, |
58 | 0 | lockHandle, |
59 | 0 | newMaxTries, |
60 | 0 | newRecoveryTime, |
61 | 0 | lockoutRecovery |
62 | 0 | ); |
63 | |
|
64 | 0 | return EXIT_SUCCESS; |
65 | 0 | } |