1 // This file was extracted from the TCG Published
2 // Trusted Platform Module Library
3 // Part 3: Commands
4 // Family "2.0"
5 // Level 00 Revision 01.16
6 // October 30, 2014
7 
8 #include "InternalRoutines.h"
9 #include "DictionaryAttackLockReset_fp.h"
10 TPM_RC
TPM2_DictionaryAttackLockReset(DictionaryAttackLockReset_In * in)11 TPM2_DictionaryAttackLockReset(
12    DictionaryAttackLockReset_In      *in             // IN: input parameter list
13    )
14 {
15    TPM_RC         result;
16 
17    // Input parameter is not reference in command action
18    in = NULL;
19 
20    // The command needs NV update. Check if NV is available.
21    // A TPM_RC_NV_UNAVAILABLE or TPM_RC_NV_RATE error may be returned at
22    // this point
23    result = NvIsAvailable();
24    if(result != TPM_RC_SUCCESS) return result;
25 
26 // Internal Data Update
27 
28    // Set failed tries to 0
29    gp.failedTries = 0;
30 
31    // Record the changes to NV
32    NvWriteReserved(NV_FAILED_TRIES, &gp.failedTries);
33 
34    return TPM_RC_SUCCESS;
35 }
36