(store_func): use hx509_cert_binary
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19911 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -678,16 +678,12 @@ static int
|
||||
store_func(hx509_context context, void *ctx, hx509_cert c)
|
||||
{
|
||||
FILE *f = (FILE *)ctx;
|
||||
size_t size;
|
||||
heim_octet_string data;
|
||||
int ret;
|
||||
|
||||
ASN1_MALLOC_ENCODE(Certificate, data.data, data.length,
|
||||
_hx509_get_cert(c), &size, ret);
|
||||
ret = hx509_cert_binary(context, c, &data);
|
||||
if (ret)
|
||||
return ret;
|
||||
if (data.length != size)
|
||||
_hx509_abort("internal ASN.1 encoder error");
|
||||
|
||||
dump_pem_file(context, "CERTIFICATE", f, data.data, data.length);
|
||||
free(data.data);
|
||||
|
@@ -488,11 +488,11 @@ store_func(hx509_context context, void *ctx, hx509_cert c)
|
||||
os.data = NULL;
|
||||
os.length = 0;
|
||||
|
||||
ASN1_MALLOC_ENCODE(Certificate, os.data, os.length,
|
||||
_hx509_get_cert(c), &size, ret);
|
||||
ret = hx509_cert_binary(context, c, &os);
|
||||
if (ret)
|
||||
goto out;
|
||||
ASN1_MALLOC_ENCODE(PKCS12_OctetString,
|
||||
return ret;
|
||||
|
||||
ASN1_MALLOC_ENCODE(PKCS12_OctetString,
|
||||
cb.certValue.data,cb.certValue.length,
|
||||
&os, &size, ret);
|
||||
free(os.data);
|
||||
|
Reference in New Issue
Block a user