OCSP response parsing. More...
#include "ocsp/ocsp_resp_parse.h"
#include "encoding/asn1.h"
#include "encoding/oid.h"
#include "pkix/x509_cert_parse.h"
#include "pkix/x509_cert_ext_parse.h"
#include "pkix/x509_sign_parse.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL OCSP_TRACE_LEVEL |
Functions | |
error_t | ocspParseResponse (const uint8_t *data, size_t length, OcspResponse *response) |
Parse OCSPResponse structure. More... | |
error_t | ocspParseResponseStatus (const uint8_t *data, size_t length, size_t *totalLength, OcspResponseStatus *status) |
Parse ResponseStatus field. More... | |
error_t | ocspParseResponseBytes (const uint8_t *data, size_t length, OcspResponse *response) |
Parse ResponseBytes structure. More... | |
error_t | ocspParseBasicResponse (const uint8_t *data, size_t length, OcspBasicResponse *basicResponse) |
Parse BasicOCSPResponse structure. More... | |
error_t | ocspParseTbsResponseData (const uint8_t *data, size_t length, size_t *totalLength, OcspTbsResponseData *tbsResponseData) |
Parse TbsResponseData structure. More... | |
error_t | ocspParseVersion (const uint8_t *data, size_t length, size_t *totalLength, OcspVersion *version) |
Parse Version field. More... | |
error_t | ocspParseResponderId (const uint8_t *data, size_t length, size_t *totalLength, OcspResponderId *responderId) |
Parse ResponderID structure. More... | |
error_t | ocspParseResponses (const uint8_t *data, size_t length, size_t *totalLength, OcspTbsResponseData *tbsResponseData) |
Parse Responses structure. More... | |
error_t | ocspParseSingleResponse (const uint8_t *data, size_t length, size_t *totalLength, OcspSingleResponse *singleResponse) |
Parse SingleResponse structure. More... | |
error_t | ocspParseCertId (const uint8_t *data, size_t length, size_t *totalLength, OcspCertId *certId) |
Parse CertID structure. More... | |
error_t | ocspParseHashAlgo (const uint8_t *data, size_t length, size_t *totalLength, OcspCertId *certId) |
Parse HashAlgorithm structure. More... | |
error_t | ocspParseCertStatus (const uint8_t *data, size_t length, size_t *totalLength, OcspSingleResponse *singleResponse) |
Parse CertStatus structure. More... | |
error_t | ocspParseRevokedInfo (const uint8_t *data, size_t length, OcspRevokedInfo *revokedInfo) |
Parse RevokedInfo structure. More... | |
error_t | ocspParseRevocationReason (const uint8_t *data, size_t length, X509CrlReasons *revocationReason) |
Parse RevocationReason field. More... | |
error_t | ocspParseCerts (const uint8_t *data, size_t length, OcspCerts *certs) |
Parse Certs structure. More... | |
error_t | ocspParseResponseExtensions (const uint8_t *data, size_t length, OcspExtensions *responseExtensions) |
Parse ResponseExtensions structure. More... | |
error_t | ocspParseSingleExtensions (const uint8_t *data, size_t length, OcspSingleExtensions *singleExtensions) |
Parse SingleExtensions structure. More... | |
error_t | ocspParseNonceExtension (bool_t critical, const uint8_t *data, size_t length, X509OctetString *nonce) |
Parse Nonce extension. More... | |
Detailed Description
OCSP response parsing.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneCRYPTO Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file ocsp_resp_parse.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL OCSP_TRACE_LEVEL |
Definition at line 32 of file ocsp_resp_parse.c.
Function Documentation
◆ ocspParseBasicResponse()
error_t ocspParseBasicResponse | ( | const uint8_t * | data, |
size_t | length, | ||
OcspBasicResponse * | basicResponse | ||
) |
Parse BasicOCSPResponse structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] basicResponse Information resulting from the parsing process
- Returns
- Error code
Definition at line 250 of file ocsp_resp_parse.c.
◆ ocspParseCertId()
error_t ocspParseCertId | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength, | ||
OcspCertId * | certId | ||
) |
Parse CertID structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] totalLength Number of bytes that have been parsed [out] certId Information resulting from the parsing process
- Returns
- Error code
Definition at line 752 of file ocsp_resp_parse.c.
◆ ocspParseCerts()
Parse Certs structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] certs Information resulting from the parsing process
- Returns
- Error code
Definition at line 1042 of file ocsp_resp_parse.c.
◆ ocspParseCertStatus()
error_t ocspParseCertStatus | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength, | ||
OcspSingleResponse * | singleResponse | ||
) |
Parse CertStatus structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] totalLength Number of bytes that have been parsed [out] singleResponse Information resulting from the parsing process
- Returns
- Error code
Definition at line 884 of file ocsp_resp_parse.c.
◆ ocspParseHashAlgo()
error_t ocspParseHashAlgo | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength, | ||
OcspCertId * | certId | ||
) |
Parse HashAlgorithm structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] totalLength Number of bytes that have been parsed [out] certId Information resulting from the parsing process
- Returns
- Error code
Definition at line 841 of file ocsp_resp_parse.c.
◆ ocspParseNonceExtension()
error_t ocspParseNonceExtension | ( | bool_t | critical, |
const uint8_t * | data, | ||
size_t | length, | ||
X509OctetString * | nonce | ||
) |
Parse Nonce extension.
- Parameters
-
[in] critical Critical extension flag [in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] nonce Information resulting from the parsing process
- Returns
- Error code
Definition at line 1217 of file ocsp_resp_parse.c.
◆ ocspParseResponderId()
error_t ocspParseResponderId | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength, | ||
OcspResponderId * | responderId | ||
) |
Parse ResponderID structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] totalLength Number of bytes that have been parsed [out] responderId Information resulting from the parsing process
- Returns
- Error code
Definition at line 514 of file ocsp_resp_parse.c.
◆ ocspParseResponse()
error_t ocspParseResponse | ( | const uint8_t * | data, |
size_t | length, | ||
OcspResponse * | response | ||
) |
Parse OCSPResponse structure.
- Parameters
-
[in] data Pointer to the X.509 certificate to parse [in] length Length of the X.509 certificate [out] response Information resulting from the parsing process
- Returns
- Error code
Definition at line 55 of file ocsp_resp_parse.c.
◆ ocspParseResponseBytes()
error_t ocspParseResponseBytes | ( | const uint8_t * | data, |
size_t | length, | ||
OcspResponse * | response | ||
) |
Parse ResponseBytes structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] response Information resulting from the parsing process
- Returns
- Error code
Definition at line 170 of file ocsp_resp_parse.c.
◆ ocspParseResponseExtensions()
error_t ocspParseResponseExtensions | ( | const uint8_t * | data, |
size_t | length, | ||
OcspExtensions * | responseExtensions | ||
) |
Parse ResponseExtensions structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] responseExtensions Information resulting from the parsing process
- Returns
- Error code
Definition at line 1071 of file ocsp_resp_parse.c.
◆ ocspParseResponses()
error_t ocspParseResponses | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength, | ||
OcspTbsResponseData * | tbsResponseData | ||
) |
Parse Responses structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] totalLength Number of bytes that have been parsed [out] tbsResponseData Information resulting from the parsing process
- Returns
- Error code
Definition at line 577 of file ocsp_resp_parse.c.
◆ ocspParseResponseStatus()
error_t ocspParseResponseStatus | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength, | ||
OcspResponseStatus * | status | ||
) |
Parse ResponseStatus field.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] totalLength Number of bytes that have been parsed [out] status OCSP response status
- Returns
- Error code
Definition at line 128 of file ocsp_resp_parse.c.
◆ ocspParseRevocationReason()
error_t ocspParseRevocationReason | ( | const uint8_t * | data, |
size_t | length, | ||
X509CrlReasons * | revocationReason | ||
) |
Parse RevocationReason field.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] revocationReason Reason why the certificate was revoked
- Returns
- Error code
Definition at line 1002 of file ocsp_resp_parse.c.
◆ ocspParseRevokedInfo()
error_t ocspParseRevokedInfo | ( | const uint8_t * | data, |
size_t | length, | ||
OcspRevokedInfo * | revokedInfo | ||
) |
Parse RevokedInfo structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] revokedInfo Information resulting from the parsing process
- Returns
- Error code
Definition at line 946 of file ocsp_resp_parse.c.
◆ ocspParseSingleExtensions()
error_t ocspParseSingleExtensions | ( | const uint8_t * | data, |
size_t | length, | ||
OcspSingleExtensions * | singleExtensions | ||
) |
Parse SingleExtensions structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] singleExtensions Information resulting from the parsing process
- Returns
- Error code
Definition at line 1152 of file ocsp_resp_parse.c.
◆ ocspParseSingleResponse()
error_t ocspParseSingleResponse | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength, | ||
OcspSingleResponse * | singleResponse | ||
) |
Parse SingleResponse structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] totalLength Number of bytes that have been parsed [out] singleResponse Information resulting from the parsing process
- Returns
- Error code
Definition at line 631 of file ocsp_resp_parse.c.
◆ ocspParseTbsResponseData()
error_t ocspParseTbsResponseData | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength, | ||
OcspTbsResponseData * | tbsResponseData | ||
) |
Parse TbsResponseData structure.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] totalLength Number of bytes that have been parsed [out] tbsResponseData Information resulting from the parsing process
- Returns
- Error code
Definition at line 348 of file ocsp_resp_parse.c.
◆ ocspParseVersion()
error_t ocspParseVersion | ( | const uint8_t * | data, |
size_t | length, | ||
size_t * | totalLength, | ||
OcspVersion * | version | ||
) |
Parse Version field.
- Parameters
-
[in] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] totalLength Number of bytes that have been parsed [out] version Information resulting from the parsing process
- Returns
- Error code
Definition at line 460 of file ocsp_resp_parse.c.