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

@@ -52,12 +52,16 @@ parse_certificate(hx509_context context, const char *fn,
const void *data, size_t len,
const AlgorithmIdentifier *ai)
{
heim_error_t error = NULL;
hx509_cert cert;
int ret;
ret = hx509_cert_init_data(context, data, len, &cert);
if (ret)
cert = hx509_cert_init_data(context, data, len, &error);
if (cert == NULL) {
ret = heim_error_get_code(error);
heim_release(error);
return ret;
}
ret = _hx509_collector_certs_add(context, c, cert);
hx509_cert_free(cert);