iPXE
|
Online Certificate Status Protocol. More...
#include <stdarg.h>
#include <time.h>
#include <ipxe/asn1.h>
#include <ipxe/x509.h>
#include <ipxe/refcnt.h>
#include <config/crypto.h>
Go to the source code of this file.
Data Structures | |
struct | ocsp_request |
An OCSP request. More... | |
struct | ocsp_responder |
An OCSP responder. More... | |
struct | ocsp_response |
An OCSP response. More... | |
struct | ocsp_check |
An OCSP check. More... | |
Macros | |
#define | OCSP_ENABLED 0 |
#define | OCSP_ALGORITHM_IDENTIFIER(...) |
OCSP algorithm identifier. More... | |
#define | OCSP_STATUS_SUCCESSFUL 0x00 |
#define | OCSP_STATUS_MALFORMED_REQUEST 0x01 |
#define | OCSP_STATUS_INTERNAL_ERROR 0x02 |
#define | OCSP_STATUS_TRY_LATER 0x03 |
#define | OCSP_STATUS_SIG_REQUIRED 0x05 |
#define | OCSP_STATUS_UNAUTHORIZED 0x06 |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static struct ocsp_check * | ocsp_get (struct ocsp_check *ocsp) |
Get reference to OCSP check. More... | |
static void | ocsp_put (struct ocsp_check *ocsp) |
Drop reference to OCSP check. More... | |
static int | ocsp_required (struct x509_certificate *cert) |
Check if X.509 certificate requires an OCSP check. More... | |
int | ocsp_check (struct x509_certificate *cert, struct x509_certificate *issuer, struct ocsp_check **ocsp) |
Create OCSP check. More... | |
int | ocsp_response (struct ocsp_check *ocsp, const void *data, size_t len) |
Receive OCSP response. More... | |
int | ocsp_validate (struct ocsp_check *check, time_t time) |
Validate OCSP response. More... | |
Online Certificate Status Protocol.
Definition in file ocsp.h.
#define OCSP_ALGORITHM_IDENTIFIER | ( | ... | ) |
OCSP algorithm identifier.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Get reference to OCSP check.
ocsp | OCSP check |
ocsp | OCSP check |
Definition at line 107 of file ocsp.h.
References ref_get, and ocsp_check::refcnt.
|
inlinestatic |
Drop reference to OCSP check.
ocsp | OCSP check |
Definition at line 118 of file ocsp.h.
References ref_put, and ocsp_check::refcnt.
Referenced by ocsp_check(), ocsp_test_exec(), validator_free(), validator_ocsp_validate(), and validator_start_ocsp().
|
inlinestatic |
Check if X.509 certificate requires an OCSP check.
cert | X.509 certificate |
ocsp_required | An OCSP check is required |
Definition at line 128 of file ocsp.h.
References x509_extensions::auth_info, ocsp_check::cert, x509_certificate::extensions, x509_ocsp_responder::good, asn1_cursor::len, x509_authority_info_access::ocsp, OCSP_ENABLED, and x509_ocsp_responder::uri.
Referenced by validator_step(), and x509_validate().
int ocsp_check | ( | struct x509_certificate * | cert, |
struct x509_certificate * | issuer, | ||
struct ocsp_check ** | ocsp | ||
) |
Create OCSP check.
cert | Certificate to check |
issuer | Issuing certificate |
ocsp | OCSP check |
rc | Return status code |
Definition at line 279 of file ocsp.c.
References assert(), ENOMEM, NULL, ocsp_free(), ocsp_put(), ocsp_uri_string(), rc, ref_init, x509_certificate::root, x509_get(), and zalloc().
int ocsp_response | ( | struct ocsp_check * | ocsp, |
const void * | data, | ||
size_t | len | ||
) |
Receive OCSP response.
ocsp | OCSP check |
data | Response data |
len | Length of response data |
rc | Return status code |
Definition at line 812 of file ocsp.c.
References data, asn1_cursor::data, ocsp_response::data, ENOMEM, free, len, asn1_cursor::len, malloc(), memcpy(), NULL, ocsp_parse_response(), rc, ocsp_check::response, ocsp_response::signer, and x509_put().
int ocsp_validate | ( | struct ocsp_check * | ocsp, |
time_t | time | ||
) |
Validate OCSP response.
ocsp | OCSP check |
time | Time at which to validate response |
rc | Return status code |
Definition at line 879 of file ocsp.c.
References assert(), x509_extensions::auth_info, x509_extended_key_usage::bits, ocsp_check::cert, ocsp_response::data, DBGC, DBGC2, EACCES_NON_OCSP_SIGNING, EACCES_STALE, x509_extensions::ext_usage, x509_certificate::extensions, x509_ocsp_responder::good, ocsp_check::issuer, ocsp_response::next_update, NULL, x509_authority_info_access::ocsp, ocsp_check_signature(), rc, ocsp_check::response, x509_certificate::root, ocsp_response::signer, strerror(), ocsp_response::this_update, TIMESTAMP_ERROR_MARGIN, x509_invalidate(), x509_name(), X509_OCSP_SIGNING, and x509_validate().
Referenced by validator_ocsp_validate().