Skip to content

Commit

Permalink
avoid enrollment crash with TLS engine does not support pkcs11
Browse files Browse the repository at this point in the history
  • Loading branch information
ekoby committed Aug 4, 2023
1 parent 81199b9 commit 7eaba4d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions library/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,12 @@ int load_key_internal(tls_context *tls, tlsuv_private_key_t *key, const char *ke

static int pkcs11_gen(tls_context *tls, tlsuv_private_key_t *key, const char *lib, const char *slot, const char *pin,
const char *id, const char *label) {

if (tls->api->generate_pkcs11_key == NULL) {
ZITI_LOG(WARN, "pkcs11 key generation is not supported by TLS driver[%s]", tls->api->version());
return ZITI_KEY_GENERATION_FAILED;
}

if (tls->api->generate_pkcs11_key(key, lib, slot, pin, label)) {
return ZITI_KEY_GENERATION_FAILED;
}
Expand Down

0 comments on commit 7eaba4d

Please sign in to comment.