ocsp_resp_parse.h File Reference

OCSP response parsing. More...

#include "ocsp/ocsp_common.h"

Go to the source code of this file.

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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.4

Definition in file ocsp_resp_parse.h.

Function Documentation

◆ ocspParseBasicResponse()

error_t ocspParseBasicResponse ( const uint8_t *  data,
size_t  length,
OcspBasicResponse basicResponse 
)

Parse BasicOCSPResponse structure.

Parameters
[in]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]basicResponseInformation 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]certIdInformation resulting from the parsing process
Returns
Error code

Definition at line 752 of file ocsp_resp_parse.c.

◆ ocspParseCerts()

error_t ocspParseCerts ( const uint8_t *  data,
size_t  length,
OcspCerts certs 
)

Parse Certs structure.

Parameters
[in]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]certsInformation 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]singleResponseInformation 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]certIdInformation 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]criticalCritical extension flag
[in]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]nonceInformation 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]responderIdInformation 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]dataPointer to the X.509 certificate to parse
[in]lengthLength of the X.509 certificate
[out]responseInformation 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]responseInformation 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]responseExtensionsInformation 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]tbsResponseDataInformation 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]statusOCSP 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]revocationReasonReason 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]revokedInfoInformation 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]singleExtensionsInformation 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]singleResponseInformation 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]tbsResponseDataInformation 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]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]versionInformation resulting from the parsing process
Returns
Error code

Definition at line 460 of file ocsp_resp_parse.c.