Lines Matching refs:sigctx
1177 struct sigctx { struct
1193 struct sigctx *sigctx = ctx; in sig_process() argument
1200 SignedData *sd = &sigctx->sd; in sig_process()
1212 if (sigctx->digest_alg) { in sig_process()
1213 ret = copy_AlgorithmIdentifier(sigctx->digest_alg, &digest); in sig_process()
1219 sigctx->peer, &digest); in sig_process()
1242 ret = fill_CMSIdentifier(cert, sigctx->cmsidflag, &signer_info->sid); in sig_process()
1261 if (der_heim_oid_cmp(sigctx->eContentType, &asn1_oid_id_pkcs7_data) != 0) { in sig_process()
1274 &sigctx->content, in sig_process()
1308 sigctx->eContentType, in sig_process()
1342 sigdata.data = sigctx->content.data; in sig_process()
1343 sigdata.length = sigctx->content.length; in sig_process()
1350 _hx509_cert_private_key(cert), sigctx->peer, in sig_process()
1366 sigctx->sd.signerInfos.len++; in sig_process()
1372 if (sigctx->certs) { in sig_process()
1375 if (sigctx->pool && sigctx->leafonly == 0) { in sig_process()
1379 sigctx->anchors, in sig_process()
1382 sigctx->pool, in sig_process()
1389 ret = hx509_certs_add(context, sigctx->certs, path.val[i]); in sig_process()
1400 if (sigdata.data != sigctx->content.data) in sig_process()
1411 struct sigctx *sigctx = ctx; in cert_process() local
1412 const unsigned int i = sigctx->sd.certificates->len; in cert_process()
1416 ptr = realloc(sigctx->sd.certificates->val, in cert_process()
1417 (i + 1) * sizeof(sigctx->sd.certificates->val[0])); in cert_process()
1420 sigctx->sd.certificates->val = ptr; in cert_process()
1423 &sigctx->sd.certificates->val[i]); in cert_process()
1425 sigctx->sd.certificates->len++; in cert_process()
1452 struct sigctx sigctx; in hx509_cms_create_signed() local
1454 memset(&sigctx, 0, sizeof(sigctx)); in hx509_cms_create_signed()
1460 sigctx.digest_alg = digest_alg; in hx509_cms_create_signed()
1461 sigctx.content.data = rk_UNCONST(data); in hx509_cms_create_signed()
1462 sigctx.content.length = length; in hx509_cms_create_signed()
1463 sigctx.eContentType = eContentType; in hx509_cms_create_signed()
1464 sigctx.peer = peer; in hx509_cms_create_signed()
1471 sigctx.cmsidflag = CMS_ID_NAME; in hx509_cms_create_signed()
1473 sigctx.cmsidflag = CMS_ID_SKI; in hx509_cms_create_signed()
1479 sigctx.leafonly = (flags & HX509_CMS_SIGNATURE_LEAF_ONLY) ? 1 : 0; in hx509_cms_create_signed()
1487 ret = hx509_certs_init(context, "MEMORY:certs", 0, NULL, &sigctx.certs); in hx509_cms_create_signed()
1492 sigctx.anchors = anchors; in hx509_cms_create_signed()
1493 sigctx.pool = pool; in hx509_cms_create_signed()
1495 sigctx.sd.version = CMSVersion_v3; in hx509_cms_create_signed()
1497 der_copy_oid(eContentType, &sigctx.sd.encapContentInfo.eContentType); in hx509_cms_create_signed()
1503 ALLOC(sigctx.sd.encapContentInfo.eContent, 1); in hx509_cms_create_signed()
1504 if (sigctx.sd.encapContentInfo.eContent == NULL) { in hx509_cms_create_signed()
1510 sigctx.sd.encapContentInfo.eContent->data = malloc(length); in hx509_cms_create_signed()
1511 if (sigctx.sd.encapContentInfo.eContent->data == NULL) { in hx509_cms_create_signed()
1516 memcpy(sigctx.sd.encapContentInfo.eContent->data, data, length); in hx509_cms_create_signed()
1517 sigctx.sd.encapContentInfo.eContent->length = length; in hx509_cms_create_signed()
1525 ret = hx509_certs_iter_f(context, certs, sig_process, &sigctx); in hx509_cms_create_signed()
1530 if (sigctx.sd.signerInfos.len) { in hx509_cms_create_signed()
1535 for (i = 0; i < sigctx.sd.signerInfos.len; i++) { in hx509_cms_create_signed()
1537 &sigctx.sd.signerInfos.val[i].digestAlgorithm; in hx509_cms_create_signed()
1539 for (j = 0; j < sigctx.sd.digestAlgorithms.len; j++) in hx509_cms_create_signed()
1540 if (cmp_AlgorithmIdentifier(di, &sigctx.sd.digestAlgorithms.val[j]) == 0) in hx509_cms_create_signed()
1542 if (j == sigctx.sd.digestAlgorithms.len) { in hx509_cms_create_signed()
1543 ret = add_DigestAlgorithmIdentifiers(&sigctx.sd.digestAlgorithms, di); in hx509_cms_create_signed()
1555 if (sigctx.certs) { in hx509_cms_create_signed()
1556 ALLOC(sigctx.sd.certificates, 1); in hx509_cms_create_signed()
1557 if (sigctx.sd.certificates == NULL) { in hx509_cms_create_signed()
1563 ret = hx509_certs_iter_f(context, sigctx.certs, cert_process, &sigctx); in hx509_cms_create_signed()
1570 &sigctx.sd, &size, ret); in hx509_cms_create_signed()
1579 hx509_certs_free(&sigctx.certs); in hx509_cms_create_signed()
1580 free_SignedData(&sigctx.sd); in hx509_cms_create_signed()