Lines Matching refs:tbscert
180 free_tbscert(KMF_X509_TBS_CERT *tbscert)
182 if (tbscert) {
183 free_data(&tbscert->version);
184 free_bigint(&tbscert->serialNumber);
185 free_algoid(&tbscert->signature);
187 free_dn_data(&tbscert->issuer);
188 free_dn_data(&tbscert->subject);
190 free_validity(&tbscert->validity);
192 free_data(&tbscert->issuerUniqueIdentifier);
193 free_data(&tbscert->subjectUniqueIdentifier);
194 free_decoded_spki(&tbscert->subjectPublicKeyInfo);
195 free_extensions(&tbscert->extensions);
197 free_data(&tbscert->issuerUniqueIdentifier);
198 free_data(&tbscert->subjectUniqueIdentifier);
1348 KMF_X509_TBS_CERT *tbscert = NULL;
1377 tbscert = malloc(sizeof (KMF_X509_TBS_CERT));
1378 if (!tbscert) {
1383 (void) memset(tbscert, 0, sizeof (KMF_X509_TBS_CERT));
1385 if ((ret = set_der_integer(&tbscert->version, version)) != KMF_OK)
1388 if ((ret = set_bigint(&tbscert->serialNumber, &serno)) != KMF_OK)
1391 if ((ret = get_algoid(asn1, &tbscert->signature)) != KMF_OK)
1394 if ((ret = get_rdn(asn1, &tbscert->issuer)) != KMF_OK)
1397 if ((ret = get_validity(asn1, &tbscert->validity)) != KMF_OK)
1400 if ((ret = get_rdn(asn1, &tbscert->subject)) != KMF_OK)
1403 if ((ret = get_spki(asn1, &tbscert->subjectPublicKeyInfo)) != KMF_OK)
1407 tbscert->extensions.numberOfExtensions = 0;
1408 tbscert->extensions.extensions = NULL;
1424 tbscert->issuerUniqueIdentifier.Data =
1426 tbscert->issuerUniqueIdentifier.Length =
1435 tbscert->subjectUniqueIdentifier.Data =
1437 tbscert->subjectUniqueIdentifier.Length =
1441 ret = get_extensions(asn1, &tbscert->extensions);
1446 *signed_cert_ptr_ptr = tbscert;
1454 if (tbscert) {
1455 free_tbscert(tbscert);
1456 free(tbscert);
1465 KMF_X509_TBS_CERT **tbscert)
1472 if (!tbscert || !Value || !Value->Data || !Value->Length)
1485 *tbscert = newcert;
1491 *tbscert = NULL;
1520 KMF_X509_TBS_CERT *tbscert = NULL;
1545 ret = decode_tbscert_data(asn1, &tbscert);
1549 certptr->certificate = *tbscert;
1550 free(tbscert);
1551 tbscert = NULL;
1690 encode_tbs_cert(BerElement *asn1, KMF_X509_TBS_CERT *tbscert)
1696 if (tbscert->version.Length > sizeof (int))
1699 (void) memcpy(&version, tbscert->version.Data,
1700 tbscert->version.Length);
1709 (char *)tbscert->serialNumber.val,
1710 (size_t)tbscert->serialNumber.len) == -1) {
1716 if ((ret = encode_algoid(asn1, &tbscert->signature, FALSE)) != KMF_OK)
1720 if ((ret = encode_rdn(asn1, &tbscert->issuer)) != KMF_OK)
1724 if ((ret = encode_validity(asn1, &tbscert->validity)) != KMF_OK)
1728 if ((ret = encode_rdn(asn1, &tbscert->subject)) != KMF_OK)
1732 if ((ret = encode_spki(asn1, &tbscert->subjectPublicKeyInfo)) != KMF_OK)
1736 if (tbscert->issuerUniqueIdentifier.Length > 0) {
1738 &tbscert->issuerUniqueIdentifier)) != KMF_OK)
1743 if (tbscert->subjectUniqueIdentifier.Length > 0) {
1745 &tbscert->subjectUniqueIdentifier)) != KMF_OK)
1750 if (tbscert->extensions.numberOfExtensions > 0) {
1752 &tbscert->extensions)) != KMF_OK)
1816 KMF_X509_TBS_CERT *tbscert = NULL;
1827 tbscert = &signed_cert_ptr->certificate;
1840 if ((ret = encode_tbs_cert(asn1, tbscert)) != KMF_OK) {
1885 ExtractX509CertParts(KMF_DATA *x509cert, KMF_DATA *tbscert,
1894 if (tbscert == NULL || x509cert == NULL)
1921 tbscert->Data = malloc(size);
1922 if (tbscert->Data == NULL) {
1926 tbscert->Length = size;
1929 size = kmfber_read(der, (char *)tbscert->Data, tbscert->Length);
1930 if (size != tbscert->Length) {
1960 free_data(tbscert);