Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)

Standard preamble:
========================================================================
..
..
.. Set up some character translations and predefined strings. \*(-- will
give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
double quote, and \*(R" will give a right double quote. \*(C+ will
give a nicer C++. Capital omega is used to do unbreakable dashes and
therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
nothing in troff, for use with C<>.
.tr \(*W- . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.

If the F register is >0, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.

Avoid warning from groff about undefined register 'F'.
.. .nr rF 0 . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] .\} . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents . \" corrections for vroff . \" for low resolution devices (crt and lpr) \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} ========================================================================

Title "OCSP_RESP_FIND_STATUS 3ossl"
OCSP_RESP_FIND_STATUS 3ossl "2023-09-19" "3.0.11" "OpenSSL"
For nroff, turn off justification. Always turn off hyphenation; it makes
way too many mistakes in technical documents.
"NAME"
OCSP_resp_find_status, OCSP_resp_count, OCSP_resp_get0, OCSP_resp_find, OCSP_single_get0_status, OCSP_resp_get0_produced_at, OCSP_resp_get0_signature, OCSP_resp_get0_tbs_sigalg, OCSP_resp_get0_respdata, OCSP_resp_get0_certs, OCSP_resp_get0_signer, OCSP_resp_get0_id, OCSP_resp_get1_id, OCSP_check_validity, OCSP_basic_verify \- OCSP response utility functions
"SYNOPSIS"
Header "SYNOPSIS" .Vb 1 #include <openssl/ocsp.h> \& int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status, int *reason, ASN1_GENERALIZEDTIME **revtime, ASN1_GENERALIZEDTIME **thisupd, ASN1_GENERALIZEDTIME **nextupd); \& int OCSP_resp_count(OCSP_BASICRESP *bs); OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx); int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last); int OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason, ASN1_GENERALIZEDTIME **revtime, ASN1_GENERALIZEDTIME **thisupd, ASN1_GENERALIZEDTIME **nextupd); \& const ASN1_GENERALIZEDTIME *OCSP_resp_get0_produced_at( const OCSP_BASICRESP* single); \& const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs); const X509_ALGOR *OCSP_resp_get0_tbs_sigalg(const OCSP_BASICRESP *bs); const OCSP_RESPDATA *OCSP_resp_get0_respdata(const OCSP_BASICRESP *bs); const STACK_OF(X509) *OCSP_resp_get0_certs(const OCSP_BASICRESP *bs); \& int OCSP_resp_get0_signer(OCSP_BASICRESP *bs, X509 **signer, STACK_OF(X509) *extra_certs); \& int OCSP_resp_get0_id(const OCSP_BASICRESP *bs, const ASN1_OCTET_STRING **pid, const X509_NAME **pname); int OCSP_resp_get1_id(const OCSP_BASICRESP *bs, ASN1_OCTET_STRING **pid, X509_NAME **pname); \& int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd, ASN1_GENERALIZEDTIME *nextupd, long sec, long maxsec); \& int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs, X509_STORE *st, unsigned long flags); .Ve
"DESCRIPTION"
Header "DESCRIPTION" \fBOCSP_resp_find_status() searches bs for an \s-1OCSP\s0 response for id. If it is successful the fields of the response are returned in *status, *reason, \fI*revtime, *thisupd and *nextupd. The *status value will be one of \fBV_OCSP_CERTSTATUS_GOOD, V_OCSP_CERTSTATUS_REVOKED or \fBV_OCSP_CERTSTATUS_UNKNOWN. The *reason and *revtime fields are only set if the status is V_OCSP_CERTSTATUS_REVOKED. If set the *reason field will be set to the revocation reason which will be one of \fB\s-1OCSP_REVOKED_STATUS_NOSTATUS\s0, \s-1OCSP_REVOKED_STATUS_UNSPECIFIED\s0, \fB\s-1OCSP_REVOKED_STATUS_KEYCOMPROMISE\s0, \s-1OCSP_REVOKED_STATUS_CACOMPROMISE\s0, \fB\s-1OCSP_REVOKED_STATUS_AFFILIATIONCHANGED\s0, \s-1OCSP_REVOKED_STATUS_SUPERSEDED\s0, \fB\s-1OCSP_REVOKED_STATUS_CESSATIONOFOPERATION\s0, \fB\s-1OCSP_REVOKED_STATUS_CERTIFICATEHOLD\s0 or \s-1OCSP_REVOKED_STATUS_REMOVEFROMCRL\s0.

\fBOCSP_resp_count() returns the number of \s-1OCSP_SINGLERESP\s0 structures in bs.

\fBOCSP_resp_get0() returns the \s-1OCSP_SINGLERESP\s0 structure in bs corresponding to index idx, where idx runs from 0 to OCSP_resp_count(bs) - 1.

\fBOCSP_resp_find() searches bs for id and returns the index of the first matching entry after last or starting from the beginning if last is -1.

\fBOCSP_single_get0_status() extracts the fields of single in *reason, \fI*revtime, *thisupd and *nextupd.

\fBOCSP_resp_get0_produced_at() extracts the producedAt field from the single response bs.

\fBOCSP_resp_get0_signature() returns the signature from bs.

\fBOCSP_resp_get0_tbs_sigalg() returns the signatureAlgorithm from bs.

\fBOCSP_resp_get0_respdata() returns the tbsResponseData from bs.

\fBOCSP_resp_get0_certs() returns any certificates included in bs.

\fBOCSP_resp_get0_signer() attempts to retrieve the certificate that directly signed bs. The \s-1OCSP\s0 protocol does not require that this certificate is included in the certs field of the response, so additional certificates can be supplied via the extra_certs if the certificates that may have signed the response are known via some out-of-band mechanism.

\fBOCSP_resp_get0_id() gets the responder id of bs. If the responder \s-1ID\s0 is a name then <*pname> is set to the name and *pid is set to \s-1NULL.\s0 If the responder \s-1ID\s0 is by key \s-1ID\s0 then *pid is set to the key \s-1ID\s0 and *pname is set to \s-1NULL.\s0

\fBOCSP_resp_get1_id() is the same as OCSP_resp_get0_id() but leaves ownership of *pid and *pname with the caller, who is responsible for freeing them unless the function returns 0.

\fBOCSP_check_validity() checks the validity of its thisupd and nextupd arguments, which will be typically obtained from OCSP_resp_find_status() or \fBOCSP_single_get0_status(). If sec is nonzero it indicates how many seconds leeway should be allowed in the check. If maxsec is positive it indicates the maximum age of thisupd in seconds.

\fBOCSP_basic_verify() checks that the basic response message bs is correctly signed and that the signer certificate can be validated. It takes st as the trusted store and certs as a set of untrusted intermediate certificates. The function first tries to find the signer certificate of the response in certs. It then searches the certificates the responder may have included in bs unless flags contains \s-1OCSP_NOINTERN\s0. It fails if the signer certificate cannot be found. Next, unless flags contains \s-1OCSP_NOSIGS\s0, the function checks the signature of bs and fails on error. Then the function already returns success if flags contains \s-1OCSP_NOVERIFY\s0 or if the signer certificate was found in certs and flags contains \s-1OCSP_TRUSTOTHER\s0. Otherwise the function continues by validating the signer certificate. If flags contains \s-1OCSP_PARTIAL_CHAIN\s0 it takes intermediate \s-1CA\s0 certificates in st as trust anchors. For more details, see the description of X509_V_FLAG_PARTIAL_CHAIN in \*(L"\s-1VERIFICATION FLAGS\*(R"\s0 in X509_VERIFY_PARAM_set_flags\|(3). If flags contains \s-1OCSP_NOCHAIN\s0 it ignores all certificates in certs and in bs, else it takes them as untrusted intermediate \s-1CA\s0 certificates and uses them for constructing the validation path for the signer certificate. Certificate revocation status checks using CRLs is disabled during path validation if the signer certificate contains the id-pkix-ocsp-no-check extension. After successful path validation the function returns success if the \s-1OCSP_NOCHECKS\s0 flag is set. Otherwise it verifies that the signer certificate meets the \s-1OCSP\s0 issuer criteria including potential delegation. If this does not succeed and the \fB\s-1OCSP_NOEXPLICIT\s0 flag is not set the function checks for explicit trust for \s-1OCSP\s0 signing in the root \s-1CA\s0 certificate.

"RETURN VALUES"
Header "RETURN VALUES" \fBOCSP_resp_find_status() returns 1 if id is found in bs and 0 otherwise.

\fBOCSP_resp_count() returns the total number of \s-1OCSP_SINGLERESP\s0 fields in bs or -1 on error.

\fBOCSP_resp_get0() returns a pointer to an \s-1OCSP_SINGLERESP\s0 structure or \s-1NULL\s0 on error, such as idx being out of range.

\fBOCSP_resp_find() returns the index of id in bs (which may be 0) or -1 on error, such as when id was not found.

\fBOCSP_single_get0_status() returns the status of single or -1 if an error occurred.

\fBOCSP_resp_get0_produced_at() returns the producedAt field from bs.

\fBOCSP_resp_get0_signature() returns the signature from bs.

\fBOCSP_resp_get0_tbs_sigalg() returns the signatureAlgorithm field from bs.

\fBOCSP_resp_get0_respdata() returns the tbsResponseData field from bs.

\fBOCSP_resp_get0_certs() returns any certificates included in bs.

\fBOCSP_resp_get0_signer() returns 1 if the signing certificate was located, or 0 if not found or on error.

\fBOCSP_resp_get0_id() and OCSP_resp_get1_id() return 1 on success, 0 on failure.

\fBOCSP_check_validity() returns 1 if thisupd and nextupd are valid time values and the current time + sec is not before thisupd and, if maxsec >= 0, the current time - maxsec is not past nextupd. Otherwise it returns 0 to indicate an error.

\fBOCSP_basic_verify() returns 1 on success, 0 on verification not successful, or -1 on a fatal error such as malloc failure.

"NOTES"
Header "NOTES" Applications will typically call OCSP_resp_find_status() using the certificate \s-1ID\s0 of interest and then check its validity using OCSP_check_validity(). They can then take appropriate action based on the status of the certificate.

An \s-1OCSP\s0 response for a certificate contains thisUpdate and nextUpdate fields. Normally the current time should be between these two values. To account for clock skew the maxsec field can be set to nonzero in \fBOCSP_check_validity(). Some responders do not set the nextUpdate field, this would otherwise mean an ancient response would be considered valid: the \fImaxsec parameter to OCSP_check_validity() can be used to limit the permitted age of responses.

The values written to *revtime, *thisupd and *nextupd by \fBOCSP_resp_find_status() and OCSP_single_get0_status() are internal pointers which \s-1MUST NOT\s0 be freed up by the calling application. Any or all of these parameters can be set to \s-1NULL\s0 if their value is not required.

"SEE ALSO"
Header "SEE ALSO" \fBcrypto\|(7), \fBOCSP_cert_to_id\|(3), \fBOCSP_request_add1_nonce\|(3), \fBOCSP_REQUEST_new\|(3), \fBOCSP_response_status\|(3), \fBOCSP_sendreq_new\|(3), \fBX509_VERIFY_PARAM_set_flags\|(3)
"COPYRIGHT"
Header "COPYRIGHT" Copyright 2015-2023 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the \*(L"License\*(R"). You may not use this file except in compliance with the License. You can obtain a copy in the file \s-1LICENSE\s0 in the source distribution or at <https://www.openssl.org/source/license.html>.