From: Nikos Mavrogiannopoulos Date: Sat, 22 May 2010 08:34:00 +0000 (+0200) Subject: Added gnutls_pkcs11_token_get_flags() to distinguish between hardware and soft tokens. X-Git-Tag: gnutls_2_11_3~265 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0daa4508750f85feb72818b1a246d599873bde53;p=thirdparty%2Fgnutls.git Added gnutls_pkcs11_token_get_flags() to distinguish between hardware and soft tokens. --- diff --git a/lib/pkcs11.c b/lib/pkcs11.c index da0e4e19aa..207eb5048e 100644 --- a/lib/pkcs11.c +++ b/lib/pkcs11.c @@ -52,6 +52,11 @@ struct flags_find_data_st { unsigned int slot_flags; }; +struct flags_find_data_st { + struct pkcs11_url_info info; + unsigned int slot_flags; +}; + struct crt_find_data_st { gnutls_pkcs11_obj_t *p_list; unsigned int* n_list; @@ -1549,7 +1554,6 @@ int pkcs11_login(pakchois_session_t *pks, struct token_info *info) /* force login on HW tokens. Some tokens will not list private keys * if login has not been performed. */ -// if (!(info->sinfo.flags & CKF_HW_SLOT) && (info->tinfo.flags & CKF_LOGIN_REQUIRED) == 0) { if ((info->tinfo.flags & CKF_LOGIN_REQUIRED) == 0) { gnutls_assert(); _gnutls_debug_log( "pk11: No login required.\n"); @@ -1620,7 +1624,6 @@ int pkcs11_login(pakchois_session_t *pks, struct token_info *info) return (rv == CKR_OK || rv == CKR_USER_ALREADY_LOGGED_IN) ? 0 : GNUTLS_E_PKCS11_ERROR; } - static int find_privkeys(pakchois_session_t *pks, struct token_info* info, struct pkey_list *list) { struct ck_attribute a[3];