Wire Sysio Wire Sysion 1.0.0
|
#include <sys/types.h>
#include <sys/stat.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <cmdline.h>
#include <yubihsm.h>
#include <openssl/rsa.h>
#include "debug_p11.h"
#include "util_pkcs11.h"
#include "yubihsm_pkcs11.h"
#include "../common/insecure_memzero.h"
Go to the source code of this file.
Macros | |
#define | YUBIHSM_PKCS11_MANUFACTURER "Yubico (www.yubico.com)" |
#define | YUBIHSM_PKCS11_LIBDESC "YubiHSM PKCS#11 Library" |
#define | YUBIHSM_PKCS11_MIN_PIN_LEN 12 |
#define | YUBIHSM_PKCS11_MAX_PIN_LEN 68 |
#define | UNUSED(x) |
#define | GLOBAL_LOCK_OR_RETURN |
#define | GLOBAL_UNLOCK_OR_RETURN |
#define GLOBAL_LOCK_OR_RETURN |
Definition at line 48 of file yubihsm_pkcs11.c.
#define GLOBAL_UNLOCK_OR_RETURN |
Definition at line 59 of file yubihsm_pkcs11.c.
#define UNUSED | ( | x | ) |
Definition at line 46 of file yubihsm_pkcs11.c.
#define YUBIHSM_PKCS11_LIBDESC "YubiHSM PKCS#11 Library" |
Definition at line 42 of file yubihsm_pkcs11.c.
#define YUBIHSM_PKCS11_MANUFACTURER "Yubico (www.yubico.com)" |
Definition at line 41 of file yubihsm_pkcs11.c.
#define YUBIHSM_PKCS11_MAX_PIN_LEN 68 |
Definition at line 44 of file yubihsm_pkcs11.c.
#define YUBIHSM_PKCS11_MIN_PIN_LEN 12 |
Definition at line 43 of file yubihsm_pkcs11.c.
CK_DEFINE_FUNCTION | ( | CK_RV | , |
C_CancelFunction | ) |
Definition at line 5114 of file yubihsm_pkcs11.c.
CK_DEFINE_FUNCTION | ( | CK_RV | , |
C_CloseAllSessions | ) |
Definition at line 916 of file yubihsm_pkcs11.c.
CK_DEFINE_FUNCTION | ( | CK_RV | , |
C_CloseSession | ) |
Definition at line 868 of file yubihsm_pkcs11.c.
CK_DEFINE_FUNCTION | ( | CK_RV | , |
C_Finalize | ) |
Definition at line 334 of file yubihsm_pkcs11.c.
CK_DEFINE_FUNCTION | ( | CK_RV | , |
C_FindObjectsFinal | ) |
Definition at line 2281 of file yubihsm_pkcs11.c.
CK_DEFINE_FUNCTION | ( | CK_RV | , |
C_GetInfo | ) |
Definition at line 371 of file yubihsm_pkcs11.c.
CK_DEFINE_FUNCTION | ( | CK_RV | , |
C_Initialize | ) |
Definition at line 101 of file yubihsm_pkcs11.c.
CK_DEFINE_FUNCTION | ( | CK_RV | , |
C_Logout | ) |
Definition at line 1160 of file yubihsm_pkcs11.c.
DBG_ERR | ( | "Verification update with %lu bytes" | , |
ulPartLen | ) |
DBG_INFO | ( | "After padding and transformation there are %u bytes" | , |
session->operation. | buffer_length ) |
DBG_INFO | ( | "Allocated session %lu" | , |
* | phSession ) |
DBG_INFO | ( | "Can return %lu object(s)" | , |
ulMaxObjectCount | ) |
DBG_INFO | ( | "Created object %04lx" | , |
* | phKey ) |
DBG_INFO | ( | "Created object %08lx" | , |
* | phObject ) |
DBG_INFO | ( | "Decrypt update with %lu bytes" | , |
ulEncryptedPartLen | ) |
DBG_INFO | ( | "Digest update with %lu bytes" | , |
ulPartLen | ) |
DBG_INFO | ( | "Encrypt update with %lu bytes" | , |
ulPartLen | ) |
DBG_INFO | ( | "Encrypting %lu bytes" | , |
ulDataLen | ) |
DBG_INFO | ( | "find with %lu attributes" | , |
ulCount | ) |
DBG_INFO | ( | "Found %lu mechanisms" | , |
* | pulCount ) |
DBG_INFO | ( | "Got %lu butes back" | , |
* | pulEncryptedDataLen ) |
DBG_INFO | ( | "Got %lu bytes back" | , |
* | pulLastEncryptedPartLen ) |
DBG_INFO | ( | "Sending %lu bytes to digest" | , |
ulDataLen | ) |
DBG_INFO | ( | "Sending %lu bytes to sign" | , |
ulDataLen | ) |
DBG_INFO | ( | "Signature successfully verified" | ) |
DBG_INFO | ( | "Signature update with %lu bytes" | , |
ulPartLen | ) |
DBG_INFO | ( | "The size of the data will be %lu" | , |
datalen | ) |
DBG_INFO | ( | "The size of the signature will be %u" | , |
session->operation.op.sign. | sig_len ) |
DBG_INFO | ( | "Trying to decrypt data with mechanism 0x%04lx and key %08lx" | , |
pMechanism-> | mechanism, | ||
hKey | ) |
DBG_INFO | ( | "Trying to digest data with mechanism 0x%04lx" | , |
pMechanism-> | mechanism ) |
DBG_INFO | ( | "Trying to encrypt data with mechanism 0x%04lx and key %08lx" | , |
pMechanism-> | mechanism, | ||
hKey | ) |
DBG_INFO | ( | "Trying to sign data with mechanism 0x%04lx and key %08lx" | , |
pMechanism-> | mechanism, | ||
hKey | ) |
DBG_INFO | ( | "Trying to verify data with mechanism 0x%04lx and key %lx" | , |
pMechanism-> | mechanism, | ||
hKey | ) |
DBG_INFO | ( | "Unwrapped object %08lx" | , |
* | phKey ) |
DBG_INFO | ( | "Using key %04x" | , |
session->operation.op.decrypt. | key_id ) |
DBG_INFO | ( | "Using key %04x" | , |
session->operation.op.sign. | key_id ) |
DBG_INFO | ( | "Using key %04x" | , |
session->operation.op.verify. | key_id ) |
memset & ecdh_key | ( | ecdh_key | ) |
for | ( | ) |
Definition at line 1245 of file yubihsm_pkcs11.c.
for | ( | ListItem * | item = g_ctx.slots.head; item != NULL; item = item->next | ) |
Definition at line 468 of file yubihsm_pkcs11.c.
for | ( | uint16_t | i = 0; i < ulMaxObjectCount && session->operation.op.find.current_object < session->operation.op.find.n_objects; session->operation.op.find.current_object++ | ) |
Definition at line 2227 of file yubihsm_pkcs11.c.
if | ( | ! | pulCount | ) |
Definition at line 432 of file yubihsm_pkcs11.c.
if | ( | (expected_key_length > 0) &&(expected_key_length !=out_len) | ) |
Definition at line 5008 of file yubihsm_pkcs11.c.
if | ( | (flags &CKF_SERIAL_SESSION) | = = 0 | ) |
Definition at line 829 of file yubihsm_pkcs11.c.
if | ( | basekey_type | = = ECDH_KEY_TYPE | ) |
Definition at line 4931 of file yubihsm_pkcs11.c.
if | ( | check_decrypt_mechanism(session->slot, pMechanism) ! | = true | ) |
Definition at line 2673 of file yubihsm_pkcs11.c.
if | ( | check_digest_mechanism(pMechanism) ! | = true | ) |
Definition at line 3116 of file yubihsm_pkcs11.c.
if | ( | check_encrypt_mechanism(session->slot, pMechanism) ! | = true | ) |
Definition at line 2369 of file yubihsm_pkcs11.c.
if | ( | check_sign_mechanism(session->slot, pMechanism) ! | = true | ) |
Definition at line 3477 of file yubihsm_pkcs11.c.
if | ( | check_verify_mechanism(session->slot, pMechanism) ! | = true | ) |
Definition at line 3901 of file yubihsm_pkcs11.c.
if | ( | check_wrap_mechanism(session->slot, pMechanism) ! | = true | ) |
Definition at line 4741 of file yubihsm_pkcs11.c.
if | ( | class. | set = = false | ) |
Definition at line 1299 of file yubihsm_pkcs11.c.
if | ( | create_session(slot, flags, phSession) | = = false | ) |
Definition at line 851 of file yubihsm_pkcs11.c.
if | ( | g_yh_initialized | = = false | ) |
Definition at line 427 of file yubihsm_pkcs11.c.
if | ( | get_mechanism_info(slot, type, pInfo) | = = false | ) |
Definition at line 752 of file yubihsm_pkcs11.c.
Definition at line 4979 of file yubihsm_pkcs11.c.
else if | ( | is_ECDSA_sign_mechanism(session->operation.mechanism.mechanism) | ) |
Definition at line 4054 of file yubihsm_pkcs11.c.
if | ( | is_HMAC_sign_mechanism(session->operation.mechanism.mechanism) | = = true | ) |
else if | ( | is_RSA_sign_mechanism(session->operation.mechanism.mechanism) | = = true | ) |
Definition at line 4051 of file yubihsm_pkcs11.c.
if | ( | key | = = NULL | ) |
Definition at line 4750 of file yubihsm_pkcs11.c.
if | ( | key_type. | set = = false || class.set == false | ) |
Definition at line 4413 of file yubihsm_pkcs11.c.
if | ( | len ! | = ulRandomLen || pRandomData == NULL | ) |
Definition at line 5063 of file yubihsm_pkcs11.c.
if | ( | len | , |
* | pulWrappedKeyLen ) |
Definition at line 4782 of file yubihsm_pkcs11.c.
if | ( | object->object.type ! | = YH_WRAP_KEY | ) |
Definition at line 2376 of file yubihsm_pkcs11.c.
else if | ( | object->object. | type = = YH_ASYMMETRIC_KEY && yh_is_rsa(object->object.algorithm) | ) |
Definition at line 2680 of file yubihsm_pkcs11.c.
if | ( | object | = = NULL | ) |
Definition at line 1626 of file yubihsm_pkcs11.c.
if | ( | overflow | = = true | ) |
Definition at line 492 of file yubihsm_pkcs11.c.
Definition at line 4965 of file yubihsm_pkcs11.c.
Definition at line 1106 of file yubihsm_pkcs11.c.
if | ( | pData | = = NULL | ) |
Definition at line 2863 of file yubihsm_pkcs11.c.
if | ( | pDigest | = = NULL | ) |
Definition at line 3186 of file yubihsm_pkcs11.c.
if | ( | pEncryptedData | = = NULL | ) |
Definition at line 2431 of file yubihsm_pkcs11.c.
if | ( | pEncryptedPart | = = NULL | ) |
Definition at line 2956 of file yubihsm_pkcs11.c.
if | ( | phObject | = = NULL || ulMaxObjectCount == 0 || pulObjectCount == NULL | ) |
Definition at line 2214 of file yubihsm_pkcs11.c.
if | ( | phSession | = = NULL | ) |
Definition at line 824 of file yubihsm_pkcs11.c.
if | ( | pInfo | = = NULL | ) |
Definition at line 741 of file yubihsm_pkcs11.c.
if | ( | pLastEncryptedPart | = = NULL | ) |
Definition at line 2589 of file yubihsm_pkcs11.c.
if | ( | pLastPart | = = NULL | ) |
Definition at line 3040 of file yubihsm_pkcs11.c.
if | ( | pMechanism->mechanism ! | = CKM_GENERIC_SECRET_KEY_GEN | ) |
Definition at line 4345 of file yubihsm_pkcs11.c.
else if | ( | pMechanism-> | mechanism = = CKM_RSA_PKCS_KEY_PAIR_GEN | ) |
Definition at line 4573 of file yubihsm_pkcs11.c.
if | ( | pMechanism | = = NULL || pMechanism->mechanism != CKM_YUBICO_AES_CCM_WRAP | ) |
Definition at line 2331 of file yubihsm_pkcs11.c.
if | ( | pPart | = = NULL | ) |
Definition at line 2508 of file yubihsm_pkcs11.c.
if | ( | ppFunctionList | = = NULL | ) |
Definition at line 409 of file yubihsm_pkcs11.c.
if | ( | pSignature | = = NULL | ) |
Definition at line 3623 of file yubihsm_pkcs11.c.
if | ( | pSlotList | = = NULL | ) |
Definition at line 439 of file yubihsm_pkcs11.c.
Definition at line 1216 of file yubihsm_pkcs11.c.
if | ( | pulCount | = = NULL | ) |
Definition at line 698 of file yubihsm_pkcs11.c.
if | ( | pulDigestLen | = = NULL | ) |
Definition at line 3180 of file yubihsm_pkcs11.c.
if | ( | pulSize | = = NULL | ) |
Definition at line 1664 of file yubihsm_pkcs11.c.
if | ( | pWrappedKey | = = NULL | ) |
Definition at line 4727 of file yubihsm_pkcs11.c.
if | ( | rc ! | = YHR_SUCCESS | ) |
Definition at line 4656 of file yubihsm_pkcs11.c.
Definition at line 974 of file yubihsm_pkcs11.c.
Definition at line 1119 of file yubihsm_pkcs11.c.
if | ( | rv | = = CKR_BUFFER_TOO_SMALL | ) |
Definition at line 710 of file yubihsm_pkcs11.c.
if | ( | seq | , |
MAX_ECDH_SESSION_KEYS | ) |
Definition at line 4987 of file yubihsm_pkcs11.c.
if | ( | session->operation.mechanism.mechanism ! | = CKM_YUBICO_AES_CCM_WRAP | ) |
Definition at line 2422 of file yubihsm_pkcs11.c.
else if | ( | session->operation.mechanism. | mechanism = = CKM_YUBICO_AES_CCM_WRAP | ) |
Definition at line 2568 of file yubihsm_pkcs11.c.
if | ( | session->operation.op.decrypt. | finalized = = false | ) |
Definition at line 2878 of file yubihsm_pkcs11.c.
if | ( | session->operation.op.digest. | is_multipart = = true | ) |
Definition at line 3174 of file yubihsm_pkcs11.c.
if | ( | session->operation.type ! | = OPERATION_NOOP | ) |
Definition at line 1230 of file yubihsm_pkcs11.c.
if | ( | session->session_state & | SESSION_NOT_AUTHENTICATED | ) |
Definition at line 1911 of file yubihsm_pkcs11.c.
if | ( | slot | = = NULL | ) |
Definition at line 519 of file yubihsm_pkcs11.c.
if | ( | template. | exportable = = ATTRIBUTE_TRUE | ) |
Definition at line 1310 of file yubihsm_pkcs11.c.
if | ( | terminate | = = true | ) |
Definition at line 2474 of file yubihsm_pkcs11.c.
if | ( | type | = = ECDH_KEY_TYPE | ) |
Definition at line 1608 of file yubihsm_pkcs11.c.
Definition at line 1890 of file yubihsm_pkcs11.c.
if | ( | ulPinLen< YUBIHSM_PKCS11_MIN_PIN_LEN||ulPinLen > | YUBIHSM_PKCS11_MAX_PIN_LEN | ) |
Definition at line 1097 of file yubihsm_pkcs11.c.
if | ( | ulSignatureLen ! | = siglen | ) |
Definition at line 4063 of file yubihsm_pkcs11.c.
if | ( | unknown | = = false | ) |
Definition at line 2098 of file yubihsm_pkcs11.c.
if | ( | unwrapping_key_type | = = ECDH_KEY_TYPE | ) |
Definition at line 4839 of file yubihsm_pkcs11.c.
Definition at line 1092 of file yubihsm_pkcs11.c.
if | ( | wrapped_key_type | = = ECDH_KEY_TYPE || wrapping_key_type == ECDH_KEY_TYPE | ) |
Definition at line 4711 of file yubihsm_pkcs11.c.
if | ( | yh_check_capability &->., "-" | wrapped = = false | ) |
Definition at line 4756 of file yubihsm_pkcs11.c.
if | ( | yh_check_capability &->., "--" | wrap = = false | ) |
Definition at line 4763 of file yubihsm_pkcs11.c.
if | ( | yh_connector_has_device(slot->connector) | = = true | ) |
Definition at line 542 of file yubihsm_pkcs11.c.
if | ( | yh_is_rsa(object->object.algorithm) | ) |
Definition at line 3927 of file yubihsm_pkcs11.c.
if | ( | yh_is_rsa(template.algorithm) | ) |
Definition at line 4607 of file yubihsm_pkcs11.c.
if | ( | yh_util_delete_object(session->slot->device_session, object->object.id, object->object.type) ! | = YHR_SUCCESS | ) |
Definition at line 1632 of file yubihsm_pkcs11.c.
if | ( | yh_util_get_object_info(session->slot->device_session, target_id, target_type, &object) ! | = YHR_SUCCESS | ) |
Definition at line 4879 of file yubihsm_pkcs11.c.
if | ( | yh_util_get_object_info(session->slot->device_session, template.id, type, &object) ! | = YHR_SUCCESS | ) |
Definition at line 1545 of file yubihsm_pkcs11.c.
if | ( | yh_util_get_object_info(session->slot->device_session, template.id, YH_ASYMMETRIC_KEY, &object) ! | = YHR_SUCCESS | ) |
Definition at line 4664 of file yubihsm_pkcs11.c.
if | ( | yrc ! | = YHR_SUCCESS | ) |
Definition at line 615 of file yubihsm_pkcs11.c.
insecure_memzero | ( | ecdh_key. | ecdh_key, |
out_len | ) |
memcpy | ( | pWrappedKey | , |
buf | , | ||
len | ) |
memset | ( | pInfo-> | manufacturerID, |
' ' | , | ||
32 | ) |
memset | ( | pInfo-> | model, |
' ' | , | ||
16 | ) |
memset | ( | pInfo-> | slotDescription, |
' ' | , | ||
64 | ) |
list_append & session | ( | void * | ) | & |
switch | ( | session-> | session_state | ) |
Definition at line 982 of file yubihsm_pkcs11.c.
memset & template | ( | template | ) |
memset & template | ( | yubihsm_pkcs11_object_template | ) |
UNUSED | ( | flags | ) |
UNUSED | ( | hAuthenticationKey | ) |
UNUSED | ( | hEncryptionKey | ) |
UNUSED | ( | hKey | ) |
UNUSED | ( | hObject | ) |
UNUSED | ( | hSession | ) |
UNUSED | ( | Notify | ) |
UNUSED | ( | pApplication | ) |
UNUSED | ( | pData | ) |
UNUSED | ( | pEncryptedPart | ) |
UNUSED | ( | phNewObject | ) |
UNUSED | ( | pLabel | ) |
UNUSED | ( | pMechanism | ) |
UNUSED | ( | pNewPin | ) |
UNUSED | ( | pOldPin | ) |
UNUSED | ( | pOperationState | ) |
UNUSED | ( | pPart | ) |
UNUSED | ( | pPin | ) |
UNUSED | ( | pReserved | ) |
UNUSED | ( | pSeed | ) |
UNUSED | ( | pSignature | ) |
UNUSED | ( | pSlot | ) |
UNUSED | ( | pTemplate | ) |
UNUSED | ( | pulDataLen | ) |
UNUSED | ( | pulEncryptedPartLen | ) |
UNUSED | ( | pulOperationStateLen | ) |
UNUSED | ( | pulPartLen | ) |
UNUSED | ( | pulSignatureLen | ) |
UNUSED | ( | slotID | ) |
UNUSED | ( | ulAttributeCount | ) |
UNUSED | ( | ulCount | ) |
UNUSED | ( | ulDataLen | ) |
UNUSED | ( | ulEncryptedPartLen | ) |
UNUSED | ( | ulNewLen | ) |
UNUSED | ( | ulOldLen | ) |
UNUSED | ( | ulOperationStateLen | ) |
UNUSED | ( | ulPartLen | ) |
UNUSED | ( | ulPinLen | ) |
UNUSED | ( | ulSeedLen | ) |
UNUSED | ( | ulSignatureLen | ) |
yh_get_connector_address | ( | slot-> | connector, |
& | s ) |
yh_get_connector_version | ( | slot-> | connector, |
& | major, | ||
& | minor, | ||
& | patch ) |
c_gt_out __pad0__ |
Definition at line 665 of file yubihsm_pkcs11.c.
c_ei_out __pad10__ |
Definition at line 2388 of file yubihsm_pkcs11.c.
c_e_out __pad11__ |
Definition at line 2471 of file yubihsm_pkcs11.c.
c_eu_out __pad12__ |
Definition at line 2527 of file yubihsm_pkcs11.c.
c_ef_out __pad13__ |
Definition at line 2609 of file yubihsm_pkcs11.c.
c_di_out __pad14__ |
Definition at line 2799 of file yubihsm_pkcs11.c.
c_d_out __pad15__ |
Definition at line 2913 of file yubihsm_pkcs11.c.
c_du_out __pad16__ |
Definition at line 2978 of file yubihsm_pkcs11.c.
c_df_out __pad17__ |
Definition at line 3071 of file yubihsm_pkcs11.c.
c_di_out __pad18__ |
Definition at line 3138 of file yubihsm_pkcs11.c.
c_d_out __pad19__ |
Definition at line 3238 of file yubihsm_pkcs11.c.
c_gml_out __pad1__ |
Definition at line 722 of file yubihsm_pkcs11.c.
c_du_out __pad20__ |
Definition at line 3298 of file yubihsm_pkcs11.c.
c_df_out __pad21__ |
Definition at line 3404 of file yubihsm_pkcs11.c.
c_si_out __pad22__ |
Definition at line 3584 of file yubihsm_pkcs11.c.
c_s_out __pad23__ |
Definition at line 3672 of file yubihsm_pkcs11.c.
c_su_out __pad24__ |
Definition at line 3730 of file yubihsm_pkcs11.c.
c_sf_out __pad25__ |
Definition at line 3798 of file yubihsm_pkcs11.c.
c_vi_out __pad26__ |
Definition at line 3988 of file yubihsm_pkcs11.c.
c_v_out __pad27__ |
Definition at line 4094 of file yubihsm_pkcs11.c.
c_vu_out __pad28__ |
Definition at line 4150 of file yubihsm_pkcs11.c.
c_vf_out __pad29__ |
Definition at line 4210 of file yubihsm_pkcs11.c.
c_os_out __pad2__ |
Definition at line 861 of file yubihsm_pkcs11.c.
c_gk_out __pad30__ |
Definition at line 4528 of file yubihsm_pkcs11.c.
c_gkp_out __pad31__ |
Definition at line 4674 of file yubihsm_pkcs11.c.
c_wk_out __pad32__ |
Definition at line 4794 of file yubihsm_pkcs11.c.
c_uk_out __pad33__ |
Definition at line 4890 of file yubihsm_pkcs11.c.
c_drv_out __pad34__ |
Definition at line 5028 of file yubihsm_pkcs11.c.
c_gr_out __pad35__ |
Definition at line 5094 of file yubihsm_pkcs11.c.
c_l_out __pad3__ |
Definition at line 1153 of file yubihsm_pkcs11.c.
c_co_out __pad4__ |
Definition at line 1557 of file yubihsm_pkcs11.c.
c_do_out __pad5__ |
Definition at line 1645 of file yubihsm_pkcs11.c.
c_gav_out __pad6__ |
Definition at line 1775 of file yubihsm_pkcs11.c.
c_sav_out __pad7__ |
Definition at line 1856 of file yubihsm_pkcs11.c.
c_foi_out __pad8__ |
Definition at line 2182 of file yubihsm_pkcs11.c.
c_fo_out __pad9__ |
Definition at line 2274 of file yubihsm_pkcs11.c.
yh_algorithm algorithm = 0 |
Definition at line 1929 of file yubihsm_pkcs11.c.
int basekey_type = hBaseKey >> 16 |
Definition at line 4930 of file yubihsm_pkcs11.c.
uint8_t buf[2048] |
Definition at line 4770 of file yubihsm_pkcs11.c.
session operation buffer_length = 0 |
Definition at line 2384 of file yubihsm_pkcs11.c.
goto c_co_out |
Definition at line 1541 of file yubihsm_pkcs11.c.
goto c_d_out |
Definition at line 2858 of file yubihsm_pkcs11.c.
goto c_df_out |
Definition at line 3037 of file yubihsm_pkcs11.c.
goto c_di_out |
Definition at line 2781 of file yubihsm_pkcs11.c.
goto c_drv_out |
Definition at line 4975 of file yubihsm_pkcs11.c.
goto c_e_out |
Definition at line 2448 of file yubihsm_pkcs11.c.
goto c_ef_out |
Definition at line 2574 of file yubihsm_pkcs11.c.
goto c_gk_out |
Definition at line 4512 of file yubihsm_pkcs11.c.
goto c_gkp_out |
Definition at line 4586 of file yubihsm_pkcs11.c.
goto c_s_out |
Definition at line 3640 of file yubihsm_pkcs11.c.
goto c_si_out |
Definition at line 3565 of file yubihsm_pkcs11.c.
goto c_v_out |
Definition at line 4060 of file yubihsm_pkcs11.c.
goto c_vi_out |
Definition at line 3916 of file yubihsm_pkcs11.c.
yh_capabilities capabilities = {{0}} |
Definition at line 1305 of file yubihsm_pkcs11.c.
return CKR_FUNCTION_NOT_PARALLEL |
Definition at line 5111 of file yubihsm_pkcs11.c.
return CKR_FUNCTION_NOT_SUPPORTED |
Definition at line 682 of file yubihsm_pkcs11.c.
return CKR_OK |
Definition at line 417 of file yubihsm_pkcs11.c.
return CKR_RANDOM_SEED_NOT_SUPPORTED |
Definition at line 5047 of file yubihsm_pkcs11.c.
struct { ... } class |
Definition at line 2178 of file yubihsm_pkcs11.c.
CK_ULONG d |
Definition at line 1238 of file yubihsm_pkcs11.c.
CK_ULONG datalen = YH_CCM_WRAP_OVERHEAD + ulDataLen |
Definition at line 2428 of file yubihsm_pkcs11.c.
yh_capabilities delegated_capabilities = {{0}} |
Definition at line 1306 of file yubihsm_pkcs11.c.
session operation op digest digest_len = digest_length |
Definition at line 3126 of file yubihsm_pkcs11.c.
digest_length = get_digest_bytelength(pMechanism->mechanism) |
Definition at line 3123 of file yubihsm_pkcs11.c.
DIN |
Definition at line 407 of file yubihsm_pkcs11.c.
uint16_t domains = 0 |
Definition at line 1926 of file yubihsm_pkcs11.c.
DOUT |
Definition at line 416 of file yubihsm_pkcs11.c.
ecdh_session_key ecdh_key |
Definition at line 4998 of file yubihsm_pkcs11.c.
else |
Definition at line 755 of file yubihsm_pkcs11.c.
size_t expected_key_length = 0 |
Definition at line 4939 of file yubihsm_pkcs11.c.
bool extractable_set = false |
Definition at line 1932 of file yubihsm_pkcs11.c.
Definition at line 661 of file yubihsm_pkcs11.c.
pInfo flags = CKF_REMOVABLE_DEVICE | CKF_HW_SLOT |
Definition at line 540 of file yubihsm_pkcs11.c.
bool full = false |
Definition at line 466 of file yubihsm_pkcs11.c.
CK_FUNCTION_LIST function_list |
Definition at line 5124 of file yubihsm_pkcs11.c.
GLOBAL_LOCK_OR_RETURN |
Definition at line 437 of file yubihsm_pkcs11.c.
GLOBAL_UNLOCK_OR_RETURN |
Definition at line 497 of file yubihsm_pkcs11.c.
Definition at line 659 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR CK_ULONG CK_OBJECT_HANDLE CK_OBJECT_HANDLE hAuthenticationKey |
Definition at line 1035 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_MECHANISM_PTR CK_OBJECT_HANDLE hBaseKey |
Definition at line 4899 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR CK_ULONG CK_OBJECT_HANDLE hEncryptionKey |
Definition at line 1034 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_MECHANISM_PTR CK_OBJECT_HANDLE CK_OBJECT_HANDLE hKey |
Definition at line 2320 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_OBJECT_HANDLE hObject |
Definition at line 1565 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE hSession |
Definition at line 780 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_MECHANISM_PTR CK_OBJECT_HANDLE hUnwrappingKey |
Definition at line 4803 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_MECHANISM_PTR CK_OBJECT_HANDLE hWrappingKey |
Definition at line 4685 of file yubihsm_pkcs11.c.
ecdh_key id = id.d |
Definition at line 1304 of file yubihsm_pkcs11.c.
size_t in_len = params->ulPublicDataLen |
Definition at line 4978 of file yubihsm_pkcs11.c.
Definition at line 3294 of file yubihsm_pkcs11.c.
uint16_t j = 0 |
Definition at line 465 of file yubihsm_pkcs11.c.
Definition at line 4747 of file yubihsm_pkcs11.c.
Definition at line 1104 of file yubihsm_pkcs11.c.
session operation op verify key_len = key_length |
Definition at line 3475 of file yubihsm_pkcs11.c.
size_t key_length |
Definition at line 3467 of file yubihsm_pkcs11.c.
struct { ... } key_type |
int l = strlen(s) |
Definition at line 525 of file yubihsm_pkcs11.c.
label = NULL |
Definition at line 1883 of file yubihsm_pkcs11.c.
char* label_buf = NULL |
Definition at line 4937 of file yubihsm_pkcs11.c.
size_t label_len = 0 |
Definition at line 4938 of file yubihsm_pkcs11.c.
Definition at line 4771 of file yubihsm_pkcs11.c.
uint8_t major = major |
Definition at line 546 of file yubihsm_pkcs11.c.
EVP_MD_CTX* mdctx = NULL |
Definition at line 2628 of file yubihsm_pkcs11.c.
session operation mechanism mechanism = pMechanism->mechanism |
Definition at line 2374 of file yubihsm_pkcs11.c.
Definition at line 547 of file yubihsm_pkcs11.c.
Definition at line 1909 of file yubihsm_pkcs11.c.
CK_SLOT_ID CK_FLAGS CK_VOID_PTR CK_NOTIFY Notify |
Definition at line 809 of file yubihsm_pkcs11.c.
yh_object_descriptor object |
Definition at line 1544 of file yubihsm_pkcs11.c.
Definition at line 1908 of file yubihsm_pkcs11.c.
size_t out_len = sizeof(ecdh_key.ecdh_key) |
Definition at line 5000 of file yubihsm_pkcs11.c.
bool overflow = false |
Definition at line 467 of file yubihsm_pkcs11.c.
CK_SLOT_ID CK_FLAGS CK_VOID_PTR pApplication |
Definition at line 809 of file yubihsm_pkcs11.c.
CK_ECDH1_DERIVE_PARAMS* params = pMechanism->pParameter |
Definition at line 4963 of file yubihsm_pkcs11.c.
uint8_t patch |
Definition at line 548 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR CK_ULONG CK_BYTE_PTR pData |
Definition at line 2394 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR pDigest |
Definition at line 3147 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR pEncryptedData |
Definition at line 2395 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR pEncryptedPart |
Definition at line 2483 of file yubihsm_pkcs11.c.
* phKey |
Definition at line 4316 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_OBJECT_HANDLE CK_ATTRIBUTE_PTR CK_ULONG CK_OBJECT_HANDLE_PTR phNewObject |
Definition at line 1567 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_OBJECT_HANDLE_PTR phObject |
Definition at line 1205 of file yubihsm_pkcs11.c.
* phPrivateKey |
Definition at line 4539 of file yubihsm_pkcs11.c.
* phPublicKey = object.sequence << 24 | (object.type | 0x80) << 16 | object.id |
Definition at line 4539 of file yubihsm_pkcs11.c.
CK_SLOT_ID CK_FLAGS CK_VOID_PTR CK_NOTIFY CK_SESSION_HANDLE_PTR phSession |
Definition at line 810 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_SESSION_INFO_PTR pInfo |
Definition at line 504 of file yubihsm_pkcs11.c.
CK_SLOT_ID CK_UTF8CHAR_PTR CK_ULONG CK_UTF8CHAR_PTR pLabel |
Definition at line 766 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR pLastEncryptedPart |
Definition at line 2540 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR pLastPart |
Definition at line 2991 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_MECHANISM_PTR pMechanism |
Definition at line 2319 of file yubihsm_pkcs11.c.
CK_SLOT_ID CK_MECHANISM_TYPE_PTR pMechanismList |
Definition at line 686 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_UTF8CHAR_PTR CK_ULONG CK_UTF8CHAR_PTR pNewPin |
Definition at line 794 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_UTF8CHAR_PTR pOldPin |
Definition at line 793 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR pOperationState |
Definition at line 1019 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR CK_ULONG CK_BYTE_PTR pPart |
Definition at line 2482 of file yubihsm_pkcs11.c.
* ppFunctionList |
Definition at line 404 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_USER_TYPE CK_UTF8CHAR_PTR pPin = 4 |
Definition at line 765 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_MECHANISM_PTR CK_ATTRIBUTE_PTR CK_ULONG CK_ATTRIBUTE_PTR pPrivateKeyTemplate |
Definition at line 4538 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_MECHANISM_PTR CK_ATTRIBUTE_PTR pPublicKeyTemplate |
Definition at line 4537 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR pRandomData |
Definition at line 5051 of file yubihsm_pkcs11.c.
CK_FLAGS CK_SLOT_ID_PTR CK_VOID_PTR pReserved |
Definition at line 673 of file yubihsm_pkcs11.c.
Definition at line 4996 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR pSeed |
Definition at line 5038 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR pSignature |
Definition at line 3593 of file yubihsm_pkcs11.c.
CK_FLAGS CK_SLOT_ID_PTR pSlot |
Definition at line 673 of file yubihsm_pkcs11.c.
CK_BBOOL CK_SLOT_ID_PTR pSlotList |
Definition at line 423 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_MECHANISM_PTR CK_OBJECT_HANDLE CK_ATTRIBUTE_PTR pTemplate |
Definition at line 1204 of file yubihsm_pkcs11.c.
bool pub = false |
Definition at line 1928 of file yubihsm_pkcs11.c.
CK_BYTE_PTR pubkey = params->pPublicData |
Definition at line 4984 of file yubihsm_pkcs11.c.
CK_SLOT_ID CK_MECHANISM_TYPE_PTR CK_ULONG_PTR pulCount |
Definition at line 423 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR CK_ULONG CK_BYTE_PTR CK_ULONG_PTR pulDataLen |
Definition at line 2812 of file yubihsm_pkcs11.c.
* pulDigestLen |
Definition at line 3147 of file yubihsm_pkcs11.c.
* pulEncryptedDataLen |
Definition at line 2395 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR CK_ULONG CK_BYTE_PTR CK_ULONG_PTR pulEncryptedPartLen |
Definition at line 2483 of file yubihsm_pkcs11.c.
* pulLastEncryptedPartLen |
Definition at line 2541 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR CK_ULONG_PTR pulLastPartLen |
Definition at line 2992 of file yubihsm_pkcs11.c.
* pulObjectCount |
Definition at line 2196 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR CK_ULONG_PTR pulOperationStateLen |
Definition at line 1020 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR CK_ULONG CK_BYTE_PTR CK_ULONG_PTR pulPartLen |
Definition at line 2927 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR CK_ULONG CK_BYTE_PTR CK_ULONG_PTR pulSignatureLen |
Definition at line 3593 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_OBJECT_HANDLE CK_ULONG_PTR pulSize |
Definition at line 1653 of file yubihsm_pkcs11.c.
* pulWrappedKeyLen |
Definition at line 4686 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_MECHANISM_PTR CK_OBJECT_HANDLE CK_BYTE_PTR pWrappedKey |
Definition at line 4685 of file yubihsm_pkcs11.c.
yh_rc rc |
Definition at line 1308 of file yubihsm_pkcs11.c.
CK_RV ret = get_session(&g_ctx, hSession, &session, 0) |
Definition at line 973 of file yubihsm_pkcs11.c.
Definition at line 569 of file yubihsm_pkcs11.c.
char * s = "YubiHSM Connector " |
Definition at line 524 of file yubihsm_pkcs11.c.
bool secret_key = false |
Definition at line 1931 of file yubihsm_pkcs11.c.
int seq = session->ecdh_session_keys.length + 1 |
Definition at line 4986 of file yubihsm_pkcs11.c.
uint32_t serial |
Definition at line 611 of file yubihsm_pkcs11.c.
Definition at line 629 of file yubihsm_pkcs11.c.
c_gr_out session = NULL |
Definition at line 972 of file yubihsm_pkcs11.c.
bool set |
Definition at line 1237 of file yubihsm_pkcs11.c.
CK_ULONG siglen |
Definition at line 4029 of file yubihsm_pkcs11.c.
Definition at line 518 of file yubihsm_pkcs11.c.
uint16_t target_id |
Definition at line 4867 of file yubihsm_pkcs11.c.
yh_object_type target_type |
Definition at line 4868 of file yubihsm_pkcs11.c.
memset & template |
Definition at line 1242 of file yubihsm_pkcs11.c.
bool terminate = true |
Definition at line 2400 of file yubihsm_pkcs11.c.
CK_BBOOL tokenPresent |
Definition at line 423 of file yubihsm_pkcs11.c.
Definition at line 730 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_MECHANISM_PTR CK_OBJECT_HANDLE CK_ATTRIBUTE_PTR CK_ULONG ulAttributeCount |
Definition at line 4805 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_MECHANISM_PTR CK_ATTRIBUTE_PTR CK_ULONG ulCount |
Definition at line 1204 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR CK_ULONG ulDataLen |
Definition at line 2394 of file yubihsm_pkcs11.c.
pInfo ulDeviceError = 0 |
Definition at line 1007 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR CK_ULONG ulEncryptedDataLen |
Definition at line 2812 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR CK_ULONG ulEncryptedPartLen |
Definition at line 2927 of file yubihsm_pkcs11.c.
pInfo ulFreePrivateMemory = CK_UNAVAILABLE_INFORMATION |
Definition at line 655 of file yubihsm_pkcs11.c.
pInfo ulFreePublicMemory = CK_UNAVAILABLE_INFORMATION |
Definition at line 653 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_OBJECT_HANDLE_PTR CK_ULONG ulMaxObjectCount |
Definition at line 2196 of file yubihsm_pkcs11.c.
pInfo ulMaxPinLen |
Definition at line 648 of file yubihsm_pkcs11.c.
pInfo ulMaxRwSessionCount |
Definition at line 641 of file yubihsm_pkcs11.c.
pInfo ulMaxSessionCount |
Definition at line 634 of file yubihsm_pkcs11.c.
pInfo ulMinPinLen |
Definition at line 650 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_UTF8CHAR_PTR CK_ULONG CK_UTF8CHAR_PTR CK_ULONG ulNewLen |
Definition at line 794 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_UTF8CHAR_PTR CK_ULONG ulOldLen |
Definition at line 793 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR CK_ULONG ulOperationStateLen |
Definition at line 1034 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR CK_ULONG ulPartLen |
Definition at line 2482 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_USER_TYPE CK_UTF8CHAR_PTR CK_ULONG ulPinLen |
Definition at line 765 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_MECHANISM_PTR CK_ATTRIBUTE_PTR CK_ULONG CK_ATTRIBUTE_PTR CK_ULONG ulPrivateKeyAttributeCount |
Definition at line 4538 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_MECHANISM_PTR CK_ATTRIBUTE_PTR CK_ULONG ulPublicKeyAttributeCount |
Definition at line 4537 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR CK_ULONG ulRandomLen |
Definition at line 5051 of file yubihsm_pkcs11.c.
pInfo ulRwSessionCount |
Definition at line 645 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR CK_ULONG ulSeedLen |
Definition at line 5038 of file yubihsm_pkcs11.c.
pInfo ulSessionCount |
Definition at line 638 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_BYTE_PTR CK_ULONG ulSignatureLen |
Definition at line 3997 of file yubihsm_pkcs11.c.
pInfo ulTotalPrivateMemory = CK_UNAVAILABLE_INFORMATION |
Definition at line 654 of file yubihsm_pkcs11.c.
pInfo ulTotalPublicMemory = CK_UNAVAILABLE_INFORMATION |
Definition at line 652 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_MECHANISM_PTR CK_OBJECT_HANDLE CK_BYTE_PTR CK_ULONG ulWrappedKeyLen |
Definition at line 4804 of file yubihsm_pkcs11.c.
bool unknown = false |
Definition at line 1930 of file yubihsm_pkcs11.c.
int unwrapping_key_type = hUnwrappingKey >> 16 |
Definition at line 4838 of file yubihsm_pkcs11.c.
CK_SESSION_HANDLE CK_USER_TYPE userType |
Definition at line 1080 of file yubihsm_pkcs11.c.
CK_VERSION ver = {major, (minor * 100) + patch} |
Definition at line 657 of file yubihsm_pkcs11.c.
int wrapped_key_type = hKey >> 16 |
Definition at line 4709 of file yubihsm_pkcs11.c.
int wrapping_key_type = hWrappingKey >> 16 |
Definition at line 4710 of file yubihsm_pkcs11.c.
yh_rc yrc |
Definition at line 606 of file yubihsm_pkcs11.c.