pass back an heim_error from hx509_cert_init

This commit is contained in:
Love Hornquist Astrand
2012-10-07 06:33:13 -07:00
parent 216bfa564d
commit 029de6cfa4
16 changed files with 135 additions and 92 deletions

View File

@@ -688,6 +688,7 @@ collect_cert(hx509_context context,
void *ptr, CK_ATTRIBUTE *query, int num_query)
{
struct hx509_collector *collector = ptr;
heim_error_t error = NULL;
hx509_cert cert;
int ret;
@@ -697,10 +698,13 @@ collect_cert(hx509_context context,
return 0;
}
ret = hx509_cert_init_data(context, query[1].pValue,
query[1].ulValueLen, &cert);
if (ret)
cert = hx509_cert_init_data(context, query[1].pValue,
query[1].ulValueLen, &error);
if (cert == NULL) {
ret = heim_error_get_code(error);
heim_release(error);
return ret;
}
if (p->ref == 0)
_hx509_abort("pkcs11 ref == 0 on alloc");