From 2b2fe1f9fa0406523bb2196b3e62c8bf57136e14 Mon Sep 17 00:00:00 2001 From: Alessio Di Mauro Date: Tue, 30 Jun 2015 11:14:36 +0200 Subject: [PATCH] Added basic version of slot info functions. --- lib/internal.h | 8 +- lib/ykpiv.c | 95 +++++++++++++------- lib/ykpiv.h | 87 ++++++++++--------- lib/ykpiv.map | 2 + ykcs11/Makefile.am | 1 + ykcs11/ykcs11.c | 211 ++++++++++++++++++++++++++++++--------------- 6 files changed, 263 insertions(+), 141 deletions(-) diff --git a/lib/internal.h b/lib/internal.h index b506233..9152379 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -41,10 +41,16 @@ #endif #endif +#define READER_LEN 32 +#define MAX_READERS 16 + struct ykpiv_state { SCARDCONTEXT context; SCARDHANDLE card; - int verbose; + unsigned long n_readers; + char readers[MAX_READERS][READER_LEN]; + unsigned long tot_readers_len; + int verbose; }; union u_APDU { diff --git a/lib/ykpiv.c b/lib/ykpiv.c index a02edd8..2481d2a 100644 --- a/lib/ykpiv.c +++ b/lib/ykpiv.c @@ -20,7 +20,7 @@ * If you modify this program, or any covered work, by linking or * combining it with the OpenSSL project's OpenSSL library (or a * modified version of that library), containing parts covered by the - * terms of the OpenSSL or SSLeay licenses, We grant you additional + * terms of the OpenSSL or SSLeay licenses, We grant you additional * permission to convey the resulting work. Corresponding Source for a * non-source form of such a combination shall include the source code * for the parts of OpenSSL used as well as that of the covered work. @@ -131,6 +131,7 @@ ykpiv_rc ykpiv_connect(ykpiv_state *state, const char *wanted) { unsigned long active_protocol; char reader_buf[1024]; long rc; + int i; char *reader_ptr; rc = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &state->context); @@ -164,19 +165,31 @@ ykpiv_rc ykpiv_connect(ykpiv_state *state, const char *wanted) { return YKPIV_PCSC_ERROR; } + // TODO: improve here + state->n_readers = 0; + state->tot_readers_len = num_readers; + reader_ptr = reader_buf; + for (i = 0; i < num_readers; i++) + if (reader_buf[i] == '\0' && i != num_readers - 1) { + strcpy(state->readers[state->n_readers], reader_ptr); // TODO: strdup? + state->n_readers = state->n_readers + 1; + reader_ptr += i + 1; + } + // ********* + reader_ptr = reader_buf; if(wanted) { while(*reader_ptr != '\0') { if(strstr(reader_ptr, wanted)) { - if(state->verbose) { - fprintf(stderr, "using reader '%s' matching '%s'.\n", reader_ptr, wanted); - } - break; + if(state->verbose) { + fprintf(stderr, "using reader '%s' matching '%s'.\n", reader_ptr, wanted); + } + break; } else { - if(state->verbose) { - fprintf(stderr, "skipping reader '%s' since it doesn't match.\n", reader_ptr); - } - reader_ptr += strlen(reader_ptr) + 1; + if(state->verbose) { + fprintf(stderr, "skipping reader '%s' since it doesn't match.\n", reader_ptr); + } + reader_ptr += strlen(reader_ptr) + 1; } } } @@ -266,7 +279,7 @@ ykpiv_rc ykpiv_transfer_data(ykpiv_state *state, const unsigned char *templ, } if(*out_len + recv_len - 2 > max_out) { if(state->verbose) { - fprintf(stderr, "Output buffer to small, wanted to write %lu, max was %lu.\n", *out_len + recv_len - 2, max_out); + fprintf(stderr, "Output buffer to small, wanted to write %lu, max was %lu.\n", *out_len + recv_len - 2, max_out); } return YKPIV_SIZE_ERROR; } @@ -400,7 +413,7 @@ ykpiv_rc ykpiv_authenticate(ykpiv_state *state, unsigned const char *key) { *dataptr++ = 8; if(RAND_pseudo_bytes(dataptr, 8) == -1) { if(state->verbose) { - fprintf(stderr, "Failed getting randomness for authentication.\n"); + fprintf(stderr, "Failed getting randomness for authentication.\n"); } return YKPIV_RANDOMNESS_ERROR; } @@ -440,11 +453,11 @@ ykpiv_rc ykpiv_set_mgmkey(ykpiv_state *state, const unsigned char *new_key) { DES_set_odd_parity(&key_tmp); if(DES_is_weak_key(&key_tmp) != 0) { if(state->verbose) { - fprintf(stderr, "Won't set new key '"); - dump_hex(new_key + i * 8, 8); - fprintf(stderr, "' since it's weak (with parity the key is: "); - dump_hex(key_tmp, 8); - fprintf(stderr, ").\n"); + fprintf(stderr, "Won't set new key '"); + dump_hex(new_key + i * 8, 8); + fprintf(stderr, "' since it's weak (with parity the key is: "); + dump_hex(key_tmp, 8); + fprintf(stderr, ").\n"); } return YKPIV_GENERIC_ERROR; } @@ -519,26 +532,26 @@ static ykpiv_rc _general_authenticate(ykpiv_state *state, pad_len = 128; case YKPIV_ALGO_RSA2048: if(pad_len == 0) { - pad_len = 256; + pad_len = 256; } if(!decipher) { - if(in_len + RSA_PKCS1_PADDING_SIZE > pad_len) { - return YKPIV_SIZE_ERROR; - } - RSA_padding_add_PKCS1_type_1(sign_in, pad_len, raw_in, in_len); - in_len = pad_len; + if(in_len + RSA_PKCS1_PADDING_SIZE > pad_len) { + return YKPIV_SIZE_ERROR; + } + RSA_padding_add_PKCS1_type_1(sign_in, pad_len, raw_in, in_len); + in_len = pad_len; } else { - if(in_len != pad_len) { - return YKPIV_SIZE_ERROR; - } - memcpy(sign_in, raw_in, in_len); + if(in_len != pad_len) { + return YKPIV_SIZE_ERROR; + } + memcpy(sign_in, raw_in, in_len); } break; case YKPIV_ALGO_ECCP256: if(!decipher && in_len > 32) { - return YKPIV_SIZE_ERROR; + return YKPIV_SIZE_ERROR; } else if(decipher && in_len != 65) { - return YKPIV_SIZE_ERROR; + return YKPIV_SIZE_ERROR; } memcpy(sign_in, raw_in, in_len); break; @@ -734,7 +747,7 @@ ykpiv_rc ykpiv_save_object(ykpiv_state *state, int object_id, dataptr += len; if((res = ykpiv_transfer_data(state, templ, data, dataptr - data, NULL, &outlen, - &sw)) != YKPIV_OK) { + &sw)) != YKPIV_OK) { return res; } @@ -744,3 +757,27 @@ ykpiv_rc ykpiv_save_object(ykpiv_state *state, int object_id, return YKPIV_GENERIC_ERROR; } } + +ykpiv_rc ykpiv_get_reader_slot_number(ykpiv_state *state, unsigned long *slots, unsigned long *total) { + if (state == NULL) + return YKPIV_MEMORY_ERROR; + + *slots = state->n_readers; + *total = state->tot_readers_len; + + return YKPIV_OK; + +} + +ykpiv_rc ykpiv_get_reader_slot(ykpiv_state *state, unsigned long slot, char *reader) { + if (state == NULL) + return YKPIV_MEMORY_ERROR; + + if (slot >= state->n_readers) + return YKPIV_SIZE_ERROR; + + strcpy(reader, state->readers[slot]); + + return YKPIV_OK; + +} diff --git a/lib/ykpiv.h b/lib/ykpiv.h index 26a4a93..319da54 100644 --- a/lib/ykpiv.h +++ b/lib/ykpiv.h @@ -20,7 +20,7 @@ * If you modify this program, or any covered work, by linking or * combining it with the OpenSSL project's OpenSSL library (or a * modified version of that library), containing parts covered by the - * terms of the OpenSSL or SSLeay licenses, We grant you additional + * terms of the OpenSSL or SSLeay licenses, We grant you additional * permission to convey the resulting work. Corresponding Source for a * non-source form of such a combination shall include the source code * for the parts of OpenSSL used as well as that of the covered work. @@ -40,50 +40,53 @@ extern "C" { #endif - typedef struct ykpiv_state ykpiv_state; + typedef struct ykpiv_state ykpiv_state; - typedef enum { - YKPIV_OK = 0, - YKPIV_MEMORY_ERROR = -1, - YKPIV_PCSC_ERROR = -2, - YKPIV_SIZE_ERROR = -3, - YKPIV_APPLET_ERROR = -4, - YKPIV_AUTHENTICATION_ERROR = -5, - YKPIV_RANDOMNESS_ERROR = -6, - YKPIV_GENERIC_ERROR = -7, - YKPIV_KEY_ERROR = -8, - YKPIV_PARSE_ERROR = -9, - YKPIV_WRONG_PIN = -10, - YKPIV_INVALID_OBJECT = -11, - YKPIV_ALGORITHM_ERROR = -12, - } ykpiv_rc; + typedef enum { + YKPIV_OK = 0, + YKPIV_MEMORY_ERROR = -1, + YKPIV_PCSC_ERROR = -2, + YKPIV_SIZE_ERROR = -3, + YKPIV_APPLET_ERROR = -4, + YKPIV_AUTHENTICATION_ERROR = -5, + YKPIV_RANDOMNESS_ERROR = -6, + YKPIV_GENERIC_ERROR = -7, + YKPIV_KEY_ERROR = -8, + YKPIV_PARSE_ERROR = -9, + YKPIV_WRONG_PIN = -10, + YKPIV_INVALID_OBJECT = -11, + YKPIV_ALGORITHM_ERROR = -12, + } ykpiv_rc; - const char *ykpiv_strerror(ykpiv_rc err); - const char *ykpiv_strerror_name(ykpiv_rc err); + const char *ykpiv_strerror(ykpiv_rc err); + const char *ykpiv_strerror_name(ykpiv_rc err); - ykpiv_rc ykpiv_init(ykpiv_state **state, int verbose); - ykpiv_rc ykpiv_done(ykpiv_state *state); - ykpiv_rc ykpiv_connect(ykpiv_state *state, const char *wanted); - ykpiv_rc ykpiv_disconnect(ykpiv_state *state); - ykpiv_rc ykpiv_transfer_data(ykpiv_state *state, const unsigned char *templ, - const unsigned char *in_data, long in_len, - unsigned char *out_data, unsigned long *out_len, int *sw); - ykpiv_rc ykpiv_authenticate(ykpiv_state *state, const unsigned char *key); - ykpiv_rc ykpiv_set_mgmkey(ykpiv_state *state, const unsigned char *new_key); - ykpiv_rc ykpiv_hex_decode(const char *hex_in, size_t in_len, - unsigned char *hex_out, size_t *out_len); - ykpiv_rc ykpiv_sign_data(ykpiv_state *state, const unsigned char *sign_in, - size_t in_len,unsigned char *sign_out, size_t *out_len, - unsigned char algorithm, unsigned char key); - ykpiv_rc ykpiv_decipher_data(ykpiv_state *state, const unsigned char *enc_in, - size_t in_len, unsigned char *enc_out, size_t *out_len, - unsigned char algorithm, unsigned char key); - ykpiv_rc ykpiv_get_version(ykpiv_state *state, char *version, size_t len); - ykpiv_rc ykpiv_verify(ykpiv_state *state, const char *pin, int *tries); - ykpiv_rc ykpiv_fetch_object(ykpiv_state *state, int object_id, - unsigned char *data, unsigned long *len); + ykpiv_rc ykpiv_init(ykpiv_state **state, int verbose); + ykpiv_rc ykpiv_done(ykpiv_state *state); + ykpiv_rc ykpiv_connect(ykpiv_state *state, const char *wanted); + ykpiv_rc ykpiv_disconnect(ykpiv_state *state); + ykpiv_rc ykpiv_transfer_data(ykpiv_state *state, const unsigned char *templ, + const unsigned char *in_data, long in_len, + unsigned char *out_data, unsigned long *out_len, int *sw); + ykpiv_rc ykpiv_authenticate(ykpiv_state *state, const unsigned char *key); + ykpiv_rc ykpiv_set_mgmkey(ykpiv_state *state, const unsigned char *new_key); + ykpiv_rc ykpiv_hex_decode(const char *hex_in, size_t in_len, + unsigned char *hex_out, size_t *out_len); + ykpiv_rc ykpiv_sign_data(ykpiv_state *state, const unsigned char *sign_in, + size_t in_len,unsigned char *sign_out, size_t *out_len, + unsigned char algorithm, unsigned char key); + ykpiv_rc ykpiv_decipher_data(ykpiv_state *state, const unsigned char *enc_in, + size_t in_len, unsigned char *enc_out, size_t *out_len, + unsigned char algorithm, unsigned char key); + ykpiv_rc ykpiv_get_version(ykpiv_state *state, char *version, size_t len); + ykpiv_rc ykpiv_verify(ykpiv_state *state, const char *pin, int *tries); + ykpiv_rc ykpiv_fetch_object(ykpiv_state *state, int object_id, + unsigned char *data, unsigned long *len); ykpiv_rc ykpiv_save_object(ykpiv_state *state, int object_id, - unsigned char *indata, size_t len); + unsigned char *indata, size_t len); + + ykpiv_rc ykpiv_get_reader_slot_number(ykpiv_state *state, unsigned long *slots, unsigned long *total); + ykpiv_rc ykpiv_get_reader_slot(ykpiv_state *state, unsigned long slot, char *reader); #define YKPIV_ALGO_3DES 0x03 #define YKPIV_ALGO_RSA1024 0x06 @@ -118,7 +121,7 @@ extern "C" #define YKPIV_INS_GET_DATA 0xcb #define YKPIV_INS_PUT_DATA 0xdb - /* Yubico vendor specific instructions */ + /* Yubico vendor specific instructions */ #define YKPIV_INS_SET_MGMKEY 0xff #define YKPIV_INS_IMPORT_KEY 0xfe #define YKPIV_INS_GET_VERSION 0xfd diff --git a/lib/ykpiv.map b/lib/ykpiv.map index 19969cc..d7fb74c 100644 --- a/lib/ykpiv.map +++ b/lib/ykpiv.map @@ -52,4 +52,6 @@ YKPIV_0.2.0 { global: ykpiv_decipher_data; + ykpiv_get_reader_slot_number; + ykpiv_get_reader_slot; } YKPIV_0.1.0; diff --git a/ykcs11/Makefile.am b/ykcs11/Makefile.am index f0b1879..a30eed8 100644 --- a/ykcs11/Makefile.am +++ b/ykcs11/Makefile.am @@ -29,6 +29,7 @@ SUBDIRS = . AM_CFLAGS = $(WERROR_CFLAGS) $(WARN_CFLAGS) AM_CPPFLAGS = $(OPENSSL_CFLAGS) $(PCSC_CFLAGS) $(LIBNSPR_CFLAGS) +AM_CPPFLAGS += -I$(top_srcdir)/lib -I$(top_builddir)/lib lib_LTLIBRARIES = libykcs11.la diff --git a/ykcs11/ykcs11.c b/ykcs11/ykcs11.c index 71844c8..9011620 100644 --- a/ykcs11/ykcs11.c +++ b/ykcs11/ykcs11.c @@ -1,5 +1,9 @@ #include "pkcs11.h" #include +#include +#include + +// TODO: do a bit of backend magic or should be handled by libykpiv? #define D(x) do { \ printf ("debug: %s:%d (%s): ", __FILE__, __LINE__, __FUNCTION__); \ @@ -7,9 +11,24 @@ printf ("\n"); \ } while (0) -#define DBG(x) if (debug) { D(x); } +#define YKCS11_DBG 1 // General debug, must be either 1 or 0 +#define YKCS11_DINOUT 1 // Function in/out debug, must be either 1 or 0 -static const int debug = 1; +#if YKCS11_DBG +#define DBG(x) D(x); +#else +#define DBG(x) +#endif + +#if YKCS11_DINOUT +#define DIN D(("In")); +#define DOUT D(("Out")); +#else +#define DIN +#define DOUT +#endif + +static ykpiv_state *piv_state = NULL; extern CK_FUNCTION_LIST function_list; @@ -19,8 +38,22 @@ CK_DEFINE_FUNCTION(CK_RV, C_Initialize)( CK_VOID_PTR pInitArgs ) { - DBG(("In")); + DIN; + // TODO: check for locks and mutexes + if (piv_state != NULL) + return CKR_CRYPTOKI_ALREADY_INITIALIZED; + if (ykpiv_init(&piv_state, YKCS11_DBG) != YKPIV_OK) { + DBG(("Unable to initialize YubiKey")); + return CKR_FUNCTION_FAILED; // TODO: better error? + } + + if(ykpiv_connect(piv_state, NULL) != YKPIV_OK) { + DBG(("Unable to connect to reader")); + return CKR_FUNCTION_FAILED; + } + + DOUT; return CKR_OK; } @@ -28,8 +61,21 @@ CK_DEFINE_FUNCTION(CK_RV, C_Finalize)( CK_VOID_PTR pReserved ) { - DBG(("In")); + DIN; + if (pReserved != NULL_PTR) { + DBG(("Finalized called with pReserved != NULL")); + return CKR_ARGUMENTS_BAD; + } + if (piv_state == NULL) { + DBG(("Ykpiv is not finalized")); + return CKR_CRYPTOKI_NOT_INITIALIZED; + } + + ykpiv_done(piv_state); // TODO: this calls disconnect... + piv_state == NULL; + + DOUT; return CKR_OK; } @@ -46,7 +92,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_GetFunctionList)( CK_FUNCTION_LIST_PTR_PTR ppFunctionList ) { - DBG(("In")); + DIN; if(ppFunctionList == NULL_PTR) { return CKR_ARGUMENTS_BAD; } @@ -63,8 +109,23 @@ CK_DEFINE_FUNCTION(CK_RV, C_GetSlotList)( CK_ULONG_PTR pulCount ) { - DBG(("In")); + DIN; + unsigned long tot_readers_len; + ykpiv_get_reader_slot_number(piv_state, pulCount, &tot_readers_len); + //DBG(("%u val %x ptr", *pulCount, pSlotList)); + if (pSlotList == NULL_PTR) { + // Just return the number of slots + return CKR_OK; + } + pSlotList[0] = 0; + return CKR_OK; + /*if ((*pulCount / sizeof(CK_SLOT_ID)) < tot_readers_len) { + DBG(("Buffer too small: needed %u, provided %u", tot_readers_len, *pulCount / sizeof(CK_SLOT_ID))) + return CKR_BUFFER_TOO_SMALL; + }*/ + DBG(("%d token", tokenPresent)); + DBG(("%u count", *pulCount)); return CKR_OK; } @@ -73,7 +134,19 @@ CK_DEFINE_FUNCTION(CK_RV, C_GetSlotInfo)( CK_SLOT_INFO_PTR pInfo ) { - DBG(("In")); + DIN; + /* + * According to pcsc-lite, the format of a reader name is: + * name [interface] (serial) index slot + * http://ludovicrousseau.blogspot.se/2010/05/what-is-in-pcsc-reader-name.html + */ + ykpiv_get_reader_slot(piv_state, 0, pInfo->slotDescription); + strcpy(pInfo->manufacturerID, "ADD SLOT MANUFACTURER NAME HERE"); + pInfo->flags = CKF_TOKEN_PRESENT | CKF_REMOVABLE_DEVICE | CKF_HW_SLOT; + + DBG(("slotID %u, pInfo %s", slotID, pInfo->slotDescription)); + + return CKR_OK; } @@ -83,7 +156,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_GetTokenInfo)( CK_TOKEN_INFO_PTR pInfo ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -94,7 +167,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_WaitForSlotEvent)( CK_VOID_PTR pReserved ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -105,7 +178,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_GetMechanismList)( CK_ULONG_PTR pulCount ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -116,7 +189,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_GetMechanismInfo)( CK_MECHANISM_INFO_PTR pInfo ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -128,7 +201,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_InitToken)( CK_UTF8CHAR_PTR pLabel ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -139,7 +212,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_InitPIN)( CK_ULONG ulPinLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -152,7 +225,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_SetPIN)( CK_ULONG ulNewLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -165,7 +238,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_OpenSession)( CK_SESSION_HANDLE_PTR phSession ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -174,7 +247,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_CloseSession)( CK_SESSION_HANDLE hSession ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -183,7 +256,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_CloseAllSessions)( CK_SLOT_ID slotID ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -193,7 +266,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_GetSessionInfo)( CK_SESSION_INFO_PTR pInfo ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -204,7 +277,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_GetOperationState)( CK_ULONG_PTR pulOperationStateLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -217,7 +290,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_SetOperationState)( CK_OBJECT_HANDLE hAuthenticationKey ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -229,7 +302,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_Login)( CK_ULONG ulPinLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -238,7 +311,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_Logout)( CK_SESSION_HANDLE hSession ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -250,7 +323,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_CreateObject)( CK_OBJECT_HANDLE_PTR phObject ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -263,7 +336,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_CopyObject)( CK_OBJECT_HANDLE_PTR phNewObject ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -273,7 +346,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_DestroyObject)( CK_OBJECT_HANDLE hObject ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -284,7 +357,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_GetObjectSize)( CK_ULONG_PTR pulSize ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -296,7 +369,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_GetAttributeValue)( CK_ULONG ulCount ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -308,7 +381,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_SetAttributeValue)( CK_ULONG ulCount ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -319,7 +392,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_FindObjectsInit)( CK_ULONG ulCount ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -331,7 +404,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_FindObjects)( CK_ULONG_PTR pulObjectCount ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -340,7 +413,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_FindObjectsFinal)( CK_SESSION_HANDLE hSession ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -351,7 +424,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_EncryptInit)( CK_OBJECT_HANDLE hKey ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -364,7 +437,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_Encrypt)( CK_ULONG_PTR pulEncryptedDataLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -377,7 +450,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_EncryptUpdate)( CK_ULONG_PTR pulEncryptedPartLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -388,7 +461,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_EncryptFinal)( CK_ULONG_PTR pulLastEncryptedPartLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -399,7 +472,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_DecryptInit)( CK_OBJECT_HANDLE hKey ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -412,7 +485,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_Decrypt)( CK_ULONG_PTR pulDataLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -425,7 +498,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_DecryptUpdate)( CK_ULONG_PTR pulPartLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -436,7 +509,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_DecryptFinal)( CK_ULONG_PTR pulLastPartLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -446,7 +519,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_DigestInit)( CK_MECHANISM_PTR pMechanism ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -459,7 +532,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_Digest)( CK_ULONG_PTR pulDigestLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -470,7 +543,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_DigestUpdate)( CK_ULONG ulPartLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -480,7 +553,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_DigestKey)( CK_OBJECT_HANDLE hKey ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -491,7 +564,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_DigestFinal)( CK_ULONG_PTR pulDigestLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -502,7 +575,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_SignInit)( CK_OBJECT_HANDLE hKey ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -515,7 +588,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_Sign)( CK_ULONG_PTR pulSignatureLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -526,7 +599,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_SignUpdate)( CK_ULONG ulPartLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -537,7 +610,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_SignFinal)( CK_ULONG_PTR pulSignatureLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -548,7 +621,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_SignRecoverInit)( CK_OBJECT_HANDLE hKey ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -561,7 +634,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_SignRecover)( CK_ULONG_PTR pulSignatureLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -572,7 +645,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_VerifyInit)( CK_OBJECT_HANDLE hKey ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -585,7 +658,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_Verify)( CK_ULONG ulSignatureLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -596,7 +669,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_VerifyUpdate)( CK_ULONG ulPartLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -607,7 +680,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_VerifyFinal)( CK_ULONG ulSignatureLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -618,7 +691,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_VerifyRecoverInit)( CK_OBJECT_HANDLE hKey ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -631,7 +704,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_VerifyRecover)( CK_ULONG_PTR pulDataLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -644,7 +717,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_DigestEncryptUpdate)( CK_ULONG_PTR pulEncryptedPartLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -657,7 +730,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_DecryptDigestUpdate)( CK_ULONG_PTR pulPartLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -670,7 +743,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_SignEncryptUpdate)( CK_ULONG_PTR pulEncryptedPartLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -683,7 +756,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_DecryptVerifyUpdate)( CK_ULONG_PTR pulPartLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -696,7 +769,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_GenerateKey)( CK_OBJECT_HANDLE_PTR phKey ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -712,7 +785,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_GenerateKeyPair)( CK_OBJECT_HANDLE_PTR phPrivateKey ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -726,7 +799,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_WrapKey)( CK_ULONG_PTR pulWrappedKeyLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -742,7 +815,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_UnwrapKey)( CK_OBJECT_HANDLE_PTR phKey ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -756,7 +829,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_DeriveKey)( CK_OBJECT_HANDLE_PTR phKey ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -769,7 +842,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_SeedRandom)( CK_ULONG ulSeedLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -780,7 +853,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_GenerateRandom)( CK_ULONG ulRandomLen ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -789,7 +862,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_GetFunctionStatus)( CK_SESSION_HANDLE hSession ) { - DBG(("In")); + DIN; return CKR_OK; } @@ -798,7 +871,7 @@ CK_DEFINE_FUNCTION(CK_RV, C_CancelFunction)( CK_SESSION_HANDLE hSession ) { - DBG(("In")); + DIN; return CKR_OK; }