(hx509_cms_create_signed_1): provide a best effort path to the trust

anchors to be stored in the SignedData packet, if find parents until
trust anchor or max length.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19094 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-11-23 18:08:23 +00:00
parent 36b3f8b61a
commit 94d63f5092

View File

@@ -936,7 +936,7 @@ hx509_cms_create_signed_1(hx509_context context,
const void *data, size_t length, const void *data, size_t length,
const AlgorithmIdentifier *digest_alg, const AlgorithmIdentifier *digest_alg,
hx509_cert cert, hx509_cert cert,
hx509_certs trust_anchors, hx509_certs anchors,
hx509_certs pool, hx509_certs pool,
heim_octet_string *signed_data) heim_octet_string *signed_data)
{ {
@@ -1125,21 +1125,18 @@ hx509_cms_create_signed_1(hx509_context context,
goto out; goto out;
} }
if (trust_anchors) { /*
ret = _hx509_calculate_path(context, * Provide best effort path
trust_anchors, */
if (pool) {
_hx509_calculate_path(context,
anchors,
0, 0,
cert, cert,
pool, pool,
&path); &path);
if (ret) {
_hx509_path_free(&path);
ret = _hx509_path_append(context, &path, cert);
}
} else } else
ret = _hx509_path_append(context, &path, cert); _hx509_path_append(context, &path, cert);
if (ret)
goto out;
if (path.len) { if (path.len) {