X509_get0_signature, X509_REQ_set0_signature, X509_REQ_set1_signature_algo,
X509_get_signature_nid, X509_get0_tbs_sigalg, X509_REQ_get0_signature,
X509_REQ_get_signature_nid, X509_CRL_get0_signature, X509_CRL_get_signature_nid,
+X509_CRL_get0_tbs_sigalg, X509_get_signature_info,
+X509_SIG_INFO_get, X509_SIG_INFO_set,
X509_ACERT_get0_signature, X509_ACERT_get0_info_sigalg,
-X509_ACERT_get_signature_nid, X509_get_signature_info,
-X509_SIG_INFO_get, X509_SIG_INFO_set - signature information
+X509_ACERT_get_signature_nid - signature information
=head1 SYNOPSIS
const ASN1_BIT_STRING **psig,
const X509_ALGOR **palg);
int X509_CRL_get_signature_nid(const X509_CRL *crl);
+ const X509_ALGOR *X509_CRL_get0_tbs_sigalg(const X509_crl *crl);
int X509_get_signature_info(X509 *x, int *mdnid, int *pknid, int *secbits,
uint32_t *flags);
X509_set0_signature() and X509_REQ_set1_signature_algo() are the
equivalent setters for the two values of X509_get0_signature().
-X509_get0_tbs_sigalg() returns the signature algorithm in the signed
-portion of B<x>.
+X509_get0_tbs_sigalg() and X509_CRL_get0_tbs_sigalg() return the signature
+algorithm in the signed portion of the certificate or CRL.
X509_get_signature_nid() returns the NID corresponding to the signature
algorithm of B<x>.
X509_CRL_get0_signature() and X509_CRL_get_signature_nid() perform the
same function for certificate requests and CRLs.
-X509_ACERT_get0_signature(), X509_ACERT_get_signature_nid() and
-X509_ACERT_get0_info_sigalg() perform the same function for attribute
-certificates.
-
X509_get_signature_info() retrieves information about the signature of
certificate B<x>. The NID of the signing digest is written to B<*mdnid>,
the public key algorithm to B<*pknid>, the effective security bits to
signature information: most applications will never need to call
them.
+X509_ACERT_get0_signature(), X509_ACERT_get_signature_nid() and
+X509_ACERT_get0_info_sigalg() perform the same function for attribute
+certificates.
+
=head1 NOTES
These functions provide lower level access to signatures in certificates
The X509_ACERT_get0_signature(), X509_ACERT_get0_info_sigalg() and
X509_ACERT_get_signature_nid() functions were added in OpenSSL 3.4.
+The X509_CRL_get0_tbs_sigalg() function was added in OpenSSL 3.6.
+
=head1 COPYRIGHT
Copyright 2015-2024 The OpenSSL Project Authors. All Rights Reserved.
{
X509_CRL *basic_crl = CRL_from_strings(kBasicCRL);
X509_CRL *revoked_crl = CRL_from_strings(kRevokedCRL);
+ const X509_ALGOR *alg = NULL, *tbsalg;
int r;
r = TEST_ptr(basic_crl)
&& TEST_int_eq(verify(test_leaf, test_root,
make_CRL_stack(basic_crl, revoked_crl),
X509_V_FLAG_CRL_CHECK), X509_V_ERR_CERT_REVOKED);
+ if (r) {
+ X509_CRL_get0_signature(basic_crl, NULL, &alg);
+ tbsalg = X509_CRL_get0_tbs_sigalg(basic_crl);
+ r = TEST_ptr(alg)
+ && TEST_ptr(tbsalg)
+ && TEST_int_eq(X509_ALGOR_cmp(alg, tbsalg), 0);
+ }
+
X509_CRL_free(basic_crl);
X509_CRL_free(revoked_crl);
return r;