Lines Matching refs:pk
423 struct crypto_public_key *pk; in crypto_public_key_import() local
425 pk = os_zalloc(sizeof(*pk)); in crypto_public_key_import()
426 if (pk == NULL) in crypto_public_key_import()
429 res = rsa_import(key, len, &pk->rsa); in crypto_public_key_import()
434 os_free(pk); in crypto_public_key_import()
438 if (pk->rsa.type != PK_PUBLIC) { in crypto_public_key_import()
441 rsa_free(&pk->rsa); in crypto_public_key_import()
442 os_free(pk); in crypto_public_key_import()
446 return pk; in crypto_public_key_import()
455 struct crypto_private_key *pk; in crypto_private_key_import() local
457 pk = os_zalloc(sizeof(*pk)); in crypto_private_key_import()
458 if (pk == NULL) in crypto_private_key_import()
461 res = rsa_import(key, len, &pk->rsa); in crypto_private_key_import()
466 os_free(pk); in crypto_private_key_import()
470 if (pk->rsa.type != PK_PRIVATE) { in crypto_private_key_import()
473 rsa_free(&pk->rsa); in crypto_private_key_import()
474 os_free(pk); in crypto_private_key_import()
478 return pk; in crypto_private_key_import()