iPXE
|
X.509 certificates. More...
#include <stdint.h>
#include <stddef.h>
#include <time.h>
#include <ipxe/asn1.h>
#include <ipxe/refcnt.h>
#include <ipxe/list.h>
Go to the source code of this file.
Data Structures | |
struct | x509_serial |
An X.509 serial number. More... | |
struct | x509_issuer |
An X.509 issuer. More... | |
struct | x509_time |
An X.509 time. More... | |
struct | x509_validity |
An X.509 certificate validity period. More... | |
struct | x509_public_key |
An X.509 certificate public key. More... | |
struct | x509_subject |
An X.509 certificate subject. More... | |
struct | x509_signature |
An X.509 certificate signature. More... | |
struct | x509_basic_constraints |
An X.509 certificate basic constraints set. More... | |
struct | x509_key_usage |
An X.509 certificate key usage. More... | |
struct | x509_extended_key_usage |
An X.509 certificate extended key usage. More... | |
struct | x509_ocsp_responder |
X.509 certificate OCSP responder. More... | |
struct | x509_authority_info_access |
X.509 certificate authority information access. More... | |
struct | x509_subject_alt_name |
X.509 certificate subject alternative name. More... | |
struct | x509_extensions |
An X.509 certificate extensions set. More... | |
struct | x509_link |
A link in an X.509 certificate chain. More... | |
struct | x509_chain |
An X.509 certificate chain. More... | |
struct | x509_certificate |
An X.509 certificate. More... | |
struct | x509_extension |
An X.509 extension. More... | |
struct | x509_key_purpose |
An X.509 key purpose. More... | |
struct | x509_access_method |
An X.509 access method. More... | |
struct | x509_root |
An X.509 root certificate list. More... | |
Macros | |
#define | X509_PATH_LEN_UNLIMITED -2U |
Unlimited path length. More... | |
Enumerations | |
enum | x509_key_usage_bits { X509_DIGITAL_SIGNATURE = 0x0080, X509_NON_REPUDIATION = 0x0040, X509_KEY_ENCIPHERMENT = 0x0020, X509_DATA_ENCIPHERMENT = 0x0010, X509_KEY_AGREEMENT = 0x0008, X509_KEY_CERT_SIGN = 0x0004, X509_CRL_SIGN = 0x0002, X509_ENCIPHER_ONLY = 0x0001, X509_DECIPHER_ONLY = 0x8000 } |
X.509 certificate key usage bits. More... | |
enum | x509_extended_key_usage_bits { X509_CODE_SIGNING = 0x0001, X509_OCSP_SIGNING = 0x0002 } |
X.509 certificate extended key usage bits. More... | |
enum | x509_general_name_types { X509_GENERAL_NAME_DNS = ASN1_IMPLICIT_TAG ( 2 ), X509_GENERAL_NAME_URI = ASN1_IMPLICIT_TAG ( 6 ), X509_GENERAL_NAME_IP = ASN1_IMPLICIT_TAG ( 7 ) } |
X.509 certificate general name types. More... | |
enum | x509_link_flags { X509_LINK_FL_CROSSED = 0x0001, X509_LINK_FL_OCSPED = 0x0002 } |
X.509 certficate chain link flags. More... | |
enum | x509_flags { X509_FL_PERMANENT = 0x0001, X509_FL_EXPLICIT = 0x0002 } |
X.509 certificate flags. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static struct x509_certificate * | x509_get (struct x509_certificate *cert) |
Get reference to X.509 certificate. More... | |
static void | x509_put (struct x509_certificate *cert) |
Drop reference to X.509 certificate. More... | |
static struct x509_chain * | x509_chain_get (struct x509_chain *chain) |
Get reference to X.509 certificate chain. More... | |
static void | x509_chain_put (struct x509_chain *chain) |
Drop reference to X.509 certificate chain. More... | |
static struct x509_certificate * | x509_first (struct x509_chain *chain) |
Get first certificate in X.509 certificate chain. More... | |
static struct x509_certificate * | x509_last (struct x509_chain *chain) |
Get last certificate in X.509 certificate chain. More... | |
static struct x509_root * | x509_root_get (struct x509_root *root) |
Get reference to X.509 root certificate list. More... | |
static void | x509_root_put (struct x509_root *root) |
Drop reference to X.509 root certificate list. More... | |
static int | x509_is_self_signed (struct x509_certificate *cert) |
Check if X.509 certificate is self-signed. More... | |
const char * | x509_name (struct x509_certificate *cert) |
Get X.509 certificate display name. More... | |
int | x509_parse (struct x509_certificate *cert, const struct asn1_cursor *raw) |
Parse X.509 certificate from ASN.1 data. More... | |
int | x509_certificate (const void *data, size_t len, struct x509_certificate **cert) |
Create X.509 certificate. More... | |
int | x509_is_valid (struct x509_certificate *cert, struct x509_root *root) |
Check if X.509 certificate is valid. More... | |
int | x509_validate (struct x509_certificate *cert, struct x509_certificate *issuer, time_t time, struct x509_root *root) |
Validate X.509 certificate. More... | |
int | x509_check_name (struct x509_certificate *cert, const char *name) |
Check X.509 certificate name. More... | |
struct x509_chain * | x509_alloc_chain (void) |
Allocate X.509 certificate chain. More... | |
int | x509_append (struct x509_chain *chain, struct x509_certificate *cert) |
Append X.509 certificate to X.509 certificate chain. More... | |
int | x509_append_raw (struct x509_chain *chain, const void *data, size_t len) |
Append X.509 certificate to X.509 certificate chain. More... | |
void | x509_truncate (struct x509_chain *chain, struct x509_link *link) |
Truncate X.509 certificate chain. More... | |
struct x509_certificate * | x509_find (struct x509_chain *store, const struct asn1_cursor *raw) |
Identify X.509 certificate by raw certificate data. More... | |
struct x509_certificate * | x509_find_subject (struct x509_chain *store, const struct asn1_cursor *subject) |
Identify X.509 certificate by subject. More... | |
struct x509_certificate * | x509_find_issuer_serial (struct x509_chain *store, const struct asn1_cursor *issuer, const struct asn1_cursor *serial) |
Identify X.509 certificate by issuer and serial number. More... | |
struct x509_certificate * | x509_find_key (struct x509_chain *store, struct private_key *key) |
Identify X.509 certificate by corresponding public key. More... | |
int | x509_auto_append (struct x509_chain *chain, struct x509_chain *store) |
Append X.509 certificates to X.509 certificate chain. More... | |
int | x509_validate_chain (struct x509_chain *chain, time_t time, struct x509_chain *store, struct x509_root *root) |
Validate X.509 certificate chain. More... | |
int | image_x509 (struct image *image, size_t offset, struct x509_certificate **cert) |
Extract X.509 certificate object from image. More... | |
int | x509_check_issuer (struct x509_certificate *cert, struct x509_certificate *issuer) |
Check X.509 certificate against issuer certificate. More... | |
void | x509_fingerprint (struct x509_certificate *cert, struct digest_algorithm *digest, void *fingerprint) |
Calculate X.509 certificate fingerprint. More... | |
int | x509_check_root (struct x509_certificate *cert, struct x509_root *root) |
Check X.509 root certificate. More... | |
int | x509_check_time (struct x509_certificate *cert, time_t time) |
Check X.509 certificate validity period. More... | |
static void | x509_invalidate (struct x509_certificate *cert) |
Invalidate X.509 certificate. More... | |
static void | x509_invalidate_chain (struct x509_chain *chain) |
Invalidate X.509 certificate chain. More... | |
X.509 certificates.
Definition in file x509.h.
#define X509_PATH_LEN_UNLIMITED -2U |
enum x509_key_usage_bits |
X.509 certificate key usage bits.
Enumerator | |
---|---|
X509_DIGITAL_SIGNATURE | |
X509_NON_REPUDIATION | |
X509_KEY_ENCIPHERMENT | |
X509_DATA_ENCIPHERMENT | |
X509_KEY_AGREEMENT | |
X509_KEY_CERT_SIGN | |
X509_CRL_SIGN | |
X509_ENCIPHER_ONLY | |
X509_DECIPHER_ONLY |
Definition at line 100 of file x509.h.
X.509 certificate extended key usage bits.
Extended key usages are identified by OID; these bits are purely an internal definition.
Enumerator | |
---|---|
X509_CODE_SIGNING | |
X509_OCSP_SIGNING |
Definition at line 123 of file x509.h.
X.509 certificate general name types.
Enumerator | |
---|---|
X509_GENERAL_NAME_DNS | |
X509_GENERAL_NAME_URI | |
X509_GENERAL_NAME_IP |
enum x509_link_flags |
X.509 certficate chain link flags.
Definition at line 180 of file x509.h.
enum x509_flags |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Get reference to X.509 certificate.
cert | X.509 certificate |
cert | X.509 certificate |
Definition at line 266 of file x509.h.
References ref_get, and x509_certificate::refcnt.
Referenced by cert_exec(), certstore_add(), ocsp_check(), tls_new_certificate_request(), x509_append(), and x509_certificate().
|
inlinestatic |
Drop reference to X.509 certificate.
cert | X.509 certificate |
Definition at line 277 of file x509.h.
References ref_put, and x509_certificate::refcnt.
Referenced by cert_exec(), certstore_apply_settings(), certstore_del(), cms_test_exec(), icert_free(), image_x509(), ocsp_free(), ocsp_parse_certs(), ocsp_response(), ocsp_test_exec(), tls_new_certificate_request(), x509_append_raw(), x509_cached_okx(), x509_certificate(), x509_test_exec(), and x509_truncate().
|
inlinestatic |
Get reference to X.509 certificate chain.
chain | X.509 certificate chain |
chain | X.509 certificate chain |
Definition at line 288 of file x509.h.
References ref_get, and x509_chain::refcnt.
Referenced by create_validator().
|
inlinestatic |
Drop reference to X.509 certificate chain.
chain | X.509 certificate chain |
Definition at line 299 of file x509.h.
References ref_put, and x509_chain::refcnt.
Referenced by cms_free(), free_tls(), tls_new_certificate_request(), tls_parse_chain(), validator_append(), validator_free(), and x509_test_exec().
|
inlinestatic |
Get first certificate in X.509 certificate chain.
chain | X.509 certificate chain |
cert | X.509 certificate, or NULL |
Definition at line 310 of file x509.h.
References link, x509_chain::links, x509_link::list, list_first_entry, and NULL.
Referenced by cms_recipient(), cms_verify(), cms_verify_signer(), tls_send_certificate_verify(), tls_validator_done(), validator_name(), and x509_chain_okx().
|
inlinestatic |
Get last certificate in X.509 certificate chain.
chain | X.509 certificate chain |
cert | X.509 certificate, or NULL |
Definition at line 324 of file x509.h.
References link, x509_chain::links, x509_link::list, list_last_entry, and NULL.
Referenced by cms_parse_certificates(), tls_parse_chain(), validator_append(), and x509_auto_append().
Get reference to X.509 root certificate list.
root | X.509 root certificate list |
root | X.509 root certificate list |
Definition at line 392 of file x509.h.
Referenced by add_tls(), create_validator(), tls_session(), and x509_set_valid().
|
inlinestatic |
Drop reference to X.509 root certificate list.
root | X.509 root certificate list |
Definition at line 403 of file x509.h.
Referenced by free_tls(), free_tls_session(), validator_free(), x509_free(), x509_invalidate(), and x509_set_valid().
|
inlinestatic |
Check if X.509 certificate is self-signed.
cert | X.509 certificate |
is_self_signed | X.509 certificate is self-signed |
Definition at line 413 of file x509.h.
References asn1_compare(), x509_certificate::issuer, x509_subject::raw, x509_issuer::raw, and x509_certificate::subject.
Referenced by validator_step(), and x509_test_exec().
const char* x509_name | ( | struct x509_certificate * | cert | ) |
Get X.509 certificate display name.
cert | X.509 certificate |
name | Display name |
Definition at line 146 of file x509.c.
References x509_subject::common_name, asn1_cursor::data, digest_algorithm::digestsize, len, asn1_cursor::len, memcpy(), sha1_algorithm, x509_certificate::subject, and x509_fingerprint().
Referenced by certstat(), certstore_add(), certstore_apply_settings(), certstore_del(), certstore_found(), certstore_init(), cms_parse_certificates(), icert_encode(), ocsp_check_signature(), ocsp_parse_basic_response(), ocsp_parse_cert_id(), ocsp_parse_certs(), ocsp_parse_responder_id(), ocsp_parse_response_status(), ocsp_parse_response_type(), ocsp_parse_responses(), ocsp_request(), ocsp_uri_string(), ocsp_validate(), tls_new_certificate_request(), tls_parse_chain(), tls_send_certificate(), validator_append(), validator_name(), validator_ocsp_validate(), validator_progress(), validator_start_download(), validator_start_ocsp(), validator_step(), x509_append(), x509_check_alt_name(), x509_check_dnsname(), x509_check_ipaddress(), x509_check_issuer(), x509_check_name(), x509_check_root(), x509_check_signature(), x509_check_time(), x509_parse_subject(), and x509_validate().
int x509_parse | ( | struct x509_certificate * | cert, |
const struct asn1_cursor * | raw | ||
) |
Parse X.509 certificate from ASN.1 data.
cert | X.509 certificate |
raw | ASN.1 cursor |
rc | Return status code |
Definition at line 1004 of file x509.c.
References asn1_enter(), asn1_integral_bit_string(), ASN1_SEQUENCE, asn1_signature_algorithm(), asn1_skip_any(), asn1_bit_string::data, DBGC, DBGC2, DBGC2_HDA, EINVAL_ALGORITHM_MISMATCH, asn1_bit_string::len, memcpy(), raw, x509_certificate::raw, rc, signature, x509_certificate::signature, strerror(), and x509_parse_tbscertificate().
Referenced by certstore_init(), and x509_certificate().
int x509_certificate | ( | const void * | data, |
size_t | len, | ||
struct x509_certificate ** | cert | ||
) |
Create X.509 certificate.
data | Raw certificate data |
len | Length of raw data |
cert | X.509 certificate |
rc | Return status code |
On success, the caller holds a reference to the X.509 certificate, and is responsible for ultimately calling x509_put().
Definition at line 1070 of file x509.c.
References asn1_shrink_any(), certstore_add(), data, asn1_cursor::data, ENOMEM, len, asn1_cursor::len, memcpy(), NULL, raw, rc, ref_init, x509_find(), x509_free(), x509_get(), x509_parse(), x509_put(), and zalloc().
int x509_is_valid | ( | struct x509_certificate * | cert, |
struct x509_root * | root | ||
) |
Check if X.509 certificate is valid.
cert | X.509 certificate |
root | Root certificate list, or NULL to use default |
Definition at line 1310 of file x509.c.
References root, x509_certificate::root, and root_certificates.
Referenced by certstat(), ipair_window_changed(), validator_step(), x509_validate(), and x509_validate_chain_okx().
int x509_validate | ( | struct x509_certificate * | cert, |
struct x509_certificate * | issuer, | ||
time_t | time, | ||
struct x509_root * | root | ||
) |
Validate X.509 certificate.
cert | X.509 certificate |
issuer | Issuing X.509 certificate (or NULL) |
time | Time at which to validate certificate |
root | Root certificate list, or NULL to use default |
rc | Return status code |
The issuing certificate must have already been validated.
Validation results are cached: if a certificate has already been successfully validated then issuer
, time
, and root
will be ignored.
Definition at line 1363 of file x509.c.
References DBGC, DBGC2, EACCES_OCSP_REQUIRED, EACCES_OUT_OF_ORDER, EACCES_PATH_LEN, EACCES_UNTRUSTED, NULL, ocsp_required(), x509_certificate::path_remaining, rc, root, root_certificates, x509_check_issuer(), x509_check_root(), x509_check_time(), x509_is_valid(), x509_name(), and x509_set_valid().
Referenced by ocsp_validate(), and x509_validate_chain().
int x509_check_name | ( | struct x509_certificate * | cert, |
const char * | name | ||
) |
Check X.509 certificate name.
cert | X.509 certificate |
name | Name |
rc | Return status code |
Definition at line 1561 of file x509.c.
References x509_extensions::alt_name, asn1_skip_any(), x509_subject::common_name, DBGC, DBGC2, EACCES_WRONG_NAME, x509_certificate::extensions, asn1_cursor::len, memcpy(), name, x509_subject_alt_name::names, rc, x509_certificate::subject, x509_check_alt_name(), x509_check_dnsname(), and x509_name().
Referenced by cert_exec(), cms_verify(), tls_validator_done(), x509_check_name_fail_okx(), and x509_check_name_okx().
struct x509_chain* x509_alloc_chain | ( | void | ) |
Allocate X.509 certificate chain.
chain | X.509 certificate chain, or NULL |
Definition at line 1612 of file x509.c.
References DBGC2, INIT_LIST_HEAD, x509_chain::links, NULL, ref_init, x509_chain::refcnt, x509_free_chain(), and zalloc().
Referenced by cms_parse_participants(), cms_parse_signed(), tls_new_certificate_request(), tls_parse_chain(), validator_append(), and x509_chain_okx().
int x509_append | ( | struct x509_chain * | chain, |
struct x509_certificate * | cert | ||
) |
Append X.509 certificate to X.509 certificate chain.
chain | X.509 certificate chain |
cert | X.509 certificate |
rc | Return status code |
Definition at line 1635 of file x509.c.
References x509_link::cert, DBGC, ENOMEM, link, x509_chain::links, list_add_tail, x509_get(), x509_name(), and zalloc().
Referenced by cms_parse_identifier(), tls_new_certificate_request(), x509_append_raw(), x509_auto_append(), and x509_chain_okx().
int x509_append_raw | ( | struct x509_chain * | chain, |
const void * | data, | ||
size_t | len | ||
) |
Append X.509 certificate to X.509 certificate chain.
chain | X.509 certificate chain |
data | Raw certificate data |
len | Length of raw data |
rc | Return status code |
Definition at line 1660 of file x509.c.
References data, len, rc, x509_append(), and x509_put().
Referenced by cms_parse_certificates(), tls_parse_chain(), and validator_append().
void x509_truncate | ( | struct x509_chain * | chain, |
struct x509_link * | link | ||
) |
Truncate X.509 certificate chain.
chain | X.509 certificate chain |
link | Link after which to truncate chain, or NULL |
Definition at line 1690 of file x509.c.
References free, link, x509_chain::links, x509_link::list, list_del, list_entry, list_for_each_entry_safe_continue, tmp, and x509_put().
Referenced by validator_append(), x509_free_chain(), and x509_test_exec().
struct x509_certificate* x509_find | ( | struct x509_chain * | store, |
const struct asn1_cursor * | raw | ||
) |
Identify X.509 certificate by raw certificate data.
store | Certificate store, or NULL to use default |
raw | Raw certificate data |
cert | X.509 certificate, or NULL if not found |
Definition at line 1732 of file x509.c.
References asn1_compare(), certstore, link, list_for_each_entry, NULL, raw, x509_certificate::raw, x509_certificate::store, and x509_found().
Referenced by certstore_init(), and x509_certificate().
struct x509_certificate* x509_find_subject | ( | struct x509_chain * | store, |
const struct asn1_cursor * | subject | ||
) |
Identify X.509 certificate by subject.
store | Certificate store, or NULL to use default |
subject | Subject |
cert | X.509 certificate, or NULL if not found |
Definition at line 1761 of file x509.c.
References asn1_compare(), certstore, link, list_for_each_entry, NULL, x509_subject::raw, x509_certificate::store, x509_certificate::subject, and x509_found().
Referenced by x509_auto_append().
struct x509_certificate* x509_find_issuer_serial | ( | struct x509_chain * | store, |
const struct asn1_cursor * | issuer, | ||
const struct asn1_cursor * | serial | ||
) |
Identify X.509 certificate by issuer and serial number.
store | Certificate store, or NULL to use default |
issuer | Issuer |
serial | Serial number |
cert | X.509 certificate, or NULL if not found |
Definition at line 1791 of file x509.c.
References asn1_compare(), certstore, x509_certificate::issuer, link, list_for_each_entry, NULL, x509_issuer::raw, x509_serial::raw, serial, x509_certificate::serial, x509_certificate::store, and x509_found().
Referenced by cms_parse_identifier().
struct x509_certificate* x509_find_key | ( | struct x509_chain * | store, |
struct private_key * | key | ||
) |
Identify X.509 certificate by corresponding public key.
store | Certificate store, or NULL to use default |
key | Private key |
cert | X.509 certificate, or NULL if not found |
Definition at line 1821 of file x509.c.
References certstore, key, link, list_for_each_entry, NULL, privkey_cursor(), asn1_algorithm::pubkey, pubkey_match(), x509_subject::public_key, x509_public_key::raw, x509_certificate::signature_algorithm, x509_certificate::store, x509_certificate::subject, and x509_found().
Referenced by cms_keypair_okx(), cms_recipient(), and tls_new_certificate_request().
int x509_auto_append | ( | struct x509_chain * | chain, |
struct x509_chain * | store | ||
) |
Append X.509 certificates to X.509 certificate chain.
chain | X.509 certificate chain |
store | Certificate store, or NULL to use default |
rc | Return status code |
Certificates will be automatically appended to the chain based upon the subject and issuer names.
Definition at line 1854 of file x509.c.
References DBGC, EACCES_EMPTY, x509_certificate::issuer, x509_issuer::raw, rc, x509_certificate::store, x509_append(), x509_find_subject(), and x509_last().
Referenced by cms_parse_identifier(), tls_new_certificate_request(), validator_append(), and x509_validate_chain().
int x509_validate_chain | ( | struct x509_chain * | chain, |
time_t | time, | ||
struct x509_chain * | store, | ||
struct x509_root * | root | ||
) |
Validate X.509 certificate chain.
chain | X.509 certificate chain |
time | Time at which to validate certificates |
store | Certificate store, or NULL to use default |
root | Root certificate list, or NULL to use default |
rc | Return status code |
Definition at line 1894 of file x509.c.
References DBGC, EACCES_USELESS, x509_certificate::issuer, link, x509_chain::links, x509_link::list, list_for_each_entry, list_for_each_entry_continue_reverse, NULL, rc, root, x509_auto_append(), and x509_validate().
Referenced by cms_verify_signer(), validator_step(), x509_validate_chain_fail_okx(), and x509_validate_chain_okx().
int image_x509 | ( | struct image * | image, |
size_t | offset, | ||
struct x509_certificate ** | cert | ||
) |
Extract X.509 certificate object from image.
image | Image |
offset | Offset within image |
cert | X.509 certificate |
next | Offset to next image, or negative error |
On success, the caller holds a reference to the X.509 certificate, and is responsible for ultimately calling x509_put().
Definition at line 1947 of file x509.c.
References asn1_cursor::data, free, image_asn1(), asn1_cursor::len, next, offset, rc, and x509_put().
Referenced by cert_exec().
int x509_check_issuer | ( | struct x509_certificate * | cert, |
struct x509_certificate * | issuer | ||
) |
Check X.509 certificate against issuer certificate.
cert | X.509 certificate |
issuer | X.509 issuer certificate |
rc | Return status code |
Definition at line 1174 of file x509.c.
References asn1_compare(), x509_extensions::basic, x509_key_usage::bits, x509_basic_constraints::ca, asn1_cursor::data, DBGC, DBGC_HDA, EACCES_KEY_USAGE, EACCES_NOT_CA, EACCES_WRONG_ISSUER, x509_certificate::extensions, x509_certificate::issuer, asn1_cursor::len, x509_key_usage::present, x509_subject::public_key, x509_subject::raw, x509_issuer::raw, rc, x509_certificate::subject, x509_extensions::usage, x509_check_signature(), X509_KEY_CERT_SIGN, and x509_name().
Referenced by x509_check_issuer_fail_okx(), x509_check_issuer_okx(), and x509_validate().
void x509_fingerprint | ( | struct x509_certificate * | cert, |
struct digest_algorithm * | digest, | ||
void * | fingerprint | ||
) |
Calculate X.509 certificate fingerprint.
cert | X.509 certificate |
digest | Digest algorithm |
fingerprint | Fingerprint buffer |
Definition at line 1234 of file x509.c.
References ctx, digest_algorithm::ctxsize, asn1_cursor::data, digest_final(), digest_init(), digest_update(), asn1_cursor::len, and x509_certificate::raw.
Referenced by certstat(), icert_certs(), x509_check_root(), x509_fingerprint_okx(), and x509_name().
int x509_check_root | ( | struct x509_certificate * | cert, |
struct x509_root * | root | ||
) |
Check X.509 root certificate.
cert | X.509 certificate |
root | X.509 root certificate list |
rc | Return status code |
Definition at line 1252 of file x509.c.
References DBGC, DBGC2, digest_algorithm::digestsize, ENOENT, memcmp(), root, x509_fingerprint(), and x509_name().
Referenced by x509_check_root_fail_okx(), x509_check_root_okx(), and x509_validate().
int x509_check_time | ( | struct x509_certificate * | cert, |
time_t | time | ||
) |
Check X.509 certificate validity period.
cert | X.509 certificate |
time | Time at which to check certificate |
rc | Return status code |
Definition at line 1284 of file x509.c.
References DBGC, DBGC2, EACCES_EXPIRED, x509_validity::not_after, x509_validity::not_before, x509_time::time, TIMESTAMP_ERROR_MARGIN, x509_certificate::validity, and x509_name().
Referenced by x509_check_time_fail_okx(), x509_check_time_okx(), and x509_validate().
|
inlinestatic |
Invalidate X.509 certificate.
cert | X.509 certificate |
Definition at line 469 of file x509.h.
References NULL, x509_certificate::path_remaining, x509_certificate::root, and x509_root_put().
Referenced by ocsp_prepare_test(), ocsp_validate(), and x509_invalidate_chain().
|
inlinestatic |
Invalidate X.509 certificate chain.
chain | X.509 certificate chain |
Definition at line 480 of file x509.h.
References link, x509_chain::links, x509_link::list, list_for_each_entry, and x509_invalidate().
Referenced by cms_verify_fail_okx(), cms_verify_okx(), x509_validate_chain_fail_okx(), and x509_validate_chain_okx().