diff options
author | james <james@e7ae566f-a301-0410-adde-c780ea21d3b5> | 2006-11-01 00:07:21 +0000 |
---|---|---|
committer | james <james@e7ae566f-a301-0410-adde-c780ea21d3b5> | 2006-11-01 00:07:21 +0000 |
commit | 1d89886e00a36788cf16d1c5de9cca224074edcf (patch) | |
tree | 4a377c091d927368dcde5678f8e6157aca333f03 /pkcs11.c | |
parent | Version 2.1_beta16 released (diff) | |
download | openvpn-1d89886e00a36788cf16d1c5de9cca224074edcf.tar.xz |
Merged Alon's branch:v2.1_rc1
svn merge -r1322:1392 https://svn.openvpn.net/projects/openvpn/contrib/alon/21rc/openvpn .
Version 2.1_rc1 released
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@1420 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'pkcs11.c')
-rw-r--r-- | pkcs11.c | 42 |
1 files changed, 30 insertions, 12 deletions
@@ -166,14 +166,20 @@ _pkcs11_openvpn_token_prompt ( "Please insert %s token", token->label ); - get_user_pass ( - &token_resp, - NULL, - "token-insertion-request", - GET_USER_PASS_MANAGEMENT|GET_USER_PASS_NEED_OK - ); - return strcmp (token_resp.password, "ok") == 0; + if ( + !get_user_pass ( + &token_resp, + NULL, + "token-insertion-request", + GET_USER_PASS_MANAGEMENT|GET_USER_PASS_NEED_OK|GET_USER_PASS_NOFATAL + ) + ) { + return false; + } + else { + return strcmp (token_resp.password, "ok") == 0; + } } static @@ -195,15 +201,27 @@ _pkcs11_openvpn_pin_prompt ( token_pass.defined = false; token_pass.nocache = true; - get_user_pass (&token_pass, NULL, szPrompt, GET_USER_PASS_MANAGEMENT|GET_USER_PASS_PASSWORD_ONLY); - strncpynt (szPIN, token_pass.password, nMaxPIN); - purge_user_pass (&token_pass, true); - if (strlen (szPIN) == 0) { + if ( + !get_user_pass ( + &token_pass, + NULL, + szPrompt, + GET_USER_PASS_MANAGEMENT|GET_USER_PASS_PASSWORD_ONLY|GET_USER_PASS_NOFATAL + ) + ) { return false; } else { - return true; + strncpynt (szPIN, token_pass.password, nMaxPIN); + purge_user_pass (&token_pass, true); + + if (strlen (szPIN) == 0) { + return false; + } + else { + return true; + } } } |