diff options
author | james <james@e7ae566f-a301-0410-adde-c780ea21d3b5> | 2005-11-12 23:06:53 +0000 |
---|---|---|
committer | james <james@e7ae566f-a301-0410-adde-c780ea21d3b5> | 2005-11-12 23:06:53 +0000 |
commit | e78206c0c18d1f6011416be7bcff615d1e9caa54 (patch) | |
tree | a0f545b132cb36bdfccccb9654e3f7930d353d35 | |
parent | Reduce sensitivity to system clock instability (diff) | |
download | openvpn-e78206c0c18d1f6011416be7bcff615d1e9caa54.tar.xz |
PKCS#11 fixes to interact with new backtrack-hardened
openvpn_time function.
svn merge -r 802:803 $SO/contrib/alon/BETA21/openvpn .
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@804 e7ae566f-a301-0410-adde-c780ea21d3b5
-rw-r--r-- | pkcs11-helper-config.h | 2 | ||||
-rw-r--r-- | pkcs11-helper.c | 20 |
2 files changed, 12 insertions, 10 deletions
diff --git a/pkcs11-helper-config.h b/pkcs11-helper-config.h index 5cb6852..f5d4608 100644 --- a/pkcs11-helper-config.h +++ b/pkcs11-helper-config.h @@ -77,6 +77,8 @@ #define PKCS11_PRM_OBJ_TYPE "--pkcs11-id-type" #define PKCS11_PRM_OBJ_ID "--pkcs11-id" +#define PKCS11_TIME openvpn_time + #if defined(WIN32) || defined(PKCS11_USE_CYGWIN) #include "cryptoki-win32.h" #else diff --git a/pkcs11-helper.c b/pkcs11-helper.c index 181c31f..a5c4b15 100644 --- a/pkcs11-helper.c +++ b/pkcs11-helper.c @@ -586,7 +586,7 @@ _pkcs11h_getSlotByLabel ( PKCS11DLOG ( PKCS11_LOG_DEBUG2, - "_PKCS#11: pkcs11h_getSlotByLabel entry szLabel=%s, provider=%p, slot=%p", + "PKCS#11: _pkcs11h_getSlotByLabel entry szLabel=%s, provider=%p, slot=%p", szLabel, (void *)provider, (void *)slot @@ -760,7 +760,7 @@ _pkcs11h_getSession ( szLabel[sizeof (szLabel)-1] = 0; PKCS11DLOG ( PKCS11_LOG_DEBUG1, - "Calling card_prompt hook for %s", + "PKCS#11: Calling card_prompt hook for %s", szLabel ); if ( @@ -773,7 +773,7 @@ _pkcs11h_getSession ( } PKCS11DLOG ( PKCS11_LOG_DEBUG1, - "card_prompt returned rv=%ld", + "PKCS#11: card_prompt returned rv=%ld", rv ); } @@ -870,7 +870,7 @@ _pkcs11h_getSession ( } else { (*session)->timePINExpire = ( - openvpn_time (NULL) + + PKCS11_TIME (NULL) + (time_t)nPINCachePeriod ); (*session)->nPINCachePeriod = nPINCachePeriod; @@ -979,7 +979,7 @@ _pkcs11h_resetSession ( if (!fFound) { PKCS11DLOG ( PKCS11_LOG_DEBUG1, - "Calling card_prompt hook for %s", + "PKCS#11: Calling card_prompt hook for %s", session->szLabel ); @@ -990,7 +990,7 @@ _pkcs11h_resetSession ( PKCS11DLOG ( PKCS11_LOG_DEBUG1, - "card_prompt returned %d", + "PKCS#11: card_prompt returned %d", fCancel ? 1 : 0 ); } @@ -1095,7 +1095,7 @@ _pkcs11h_validateSession ( if ( session->timePINExpire != (time_t)0 && - session->timePINExpire < openvpn_time (NULL) + session->timePINExpire < PKCS11_TIME (NULL) ) { _pkcs11h_logout (session); } @@ -1163,7 +1163,7 @@ _pkcs11h_login ( ) { PKCS11DLOG ( PKCS11_LOG_DEBUG1, - "Calling pin_prompt hook for %s", + "PKCS#11: Calling pin_prompt hook for %s", session->szLabel ); @@ -1184,7 +1184,7 @@ _pkcs11h_login ( PKCS11DLOG ( PKCS11_LOG_DEBUG1, - "pin_prompt hook return rv=%ld", + "PKCS#11: pin_prompt hook return rv=%ld", rv ); @@ -1195,7 +1195,7 @@ _pkcs11h_login ( } else { session->timePINExpire = ( - openvpn_time (NULL) + + PKCS11_TIME (NULL) + (time_t)session->nPINCachePeriod ); } |