ocsp_req_format.c File Reference

OCSP request formatting. More...

#include "ocsp/ocsp_req_format.h"
#include "encoding/asn1.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   OCSP_TRACE_LEVEL
 

Functions

error_t ocspFormatRequest (const OcspRequest *request, uint8_t *output, size_t *written)
 Format OCSPRequest structure. More...
 
error_t ocspFormatTbsRequest (const OcspTbsRequest *tbsRequest, uint8_t *output, size_t *written)
 Format TBSRequest structure. More...
 
error_t ocspFormatVersion (OcspVersion version, uint8_t *output, size_t *written)
 Format Version field. More...
 
error_t ocspFormatRequestList (const OcspSingleRequest *requestList, uint_t numRequests, uint8_t *output, size_t *written)
 Format RequestList structure. More...
 
error_t ocspFormatSingleRequest (const OcspSingleRequest *singleRequest, uint8_t *output, size_t *written)
 Format Request structure. More...
 
error_t ocspFormatCertId (const OcspCertId *certId, uint8_t *output, size_t *written)
 Format CertID structure. More...
 
error_t ocspFormatHashAlgo (const OcspCertId *certId, uint8_t *output, size_t *written)
 Format HashAlgorithm structure. More...
 
error_t ocspFormatRequestExtensions (const OcspExtensions *extensions, uint8_t *output, size_t *written)
 Format RequestExtensions structure. More...
 
error_t ocspFormatNonceExtension (const X509OctetString *nonce, uint8_t *output, size_t *written)
 Format Nonce extension. More...
 

Detailed Description

OCSP request formatting.

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_req_format.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   OCSP_TRACE_LEVEL

Definition at line 32 of file ocsp_req_format.c.

Function Documentation

◆ ocspFormatCertId()

error_t ocspFormatCertId ( const OcspCertId certId,
uint8_t *  output,
size_t *  written 
)

Format CertID structure.

Parameters
[in]certIdPointer to the CertID structure
[out]outputBuffer where to store the ASN.1 structure
[out]writtenLength of the resulting ASN.1 structure
Returns
Error code

Definition at line 311 of file ocsp_req_format.c.

◆ ocspFormatHashAlgo()

error_t ocspFormatHashAlgo ( const OcspCertId certId,
uint8_t *  output,
size_t *  written 
)

Format HashAlgorithm structure.

Parameters
[in]certIdPointer to the CertID structure
[out]outputBuffer where to format the ASN.1 structure
[out]writtenLength of the resulting ASN.1 structure
Returns
Error code

Definition at line 417 of file ocsp_req_format.c.

◆ ocspFormatNonceExtension()

error_t ocspFormatNonceExtension ( const X509OctetString nonce,
uint8_t *  output,
size_t *  written 
)

Format Nonce extension.

Parameters
[in]noncePointer to the Nonce extension
[out]outputBuffer where to store the ASN.1 structure
[out]writtenLength of the resulting ASN.1 structure
Returns
Error code

Definition at line 568 of file ocsp_req_format.c.

◆ ocspFormatRequest()

error_t ocspFormatRequest ( const OcspRequest request,
uint8_t *  output,
size_t *  written 
)

Format OCSPRequest structure.

Parameters
[in]requestPointer to the OCSPRequest structure
[out]outputBuffer where to store the ASN.1 structure
[out]writtenLength of the resulting ASN.1 structure
Returns
Error code

Definition at line 51 of file ocsp_req_format.c.

◆ ocspFormatRequestExtensions()

error_t ocspFormatRequestExtensions ( const OcspExtensions extensions,
uint8_t *  output,
size_t *  written 
)

Format RequestExtensions structure.

Parameters
[in]extensionsPointer to the RequestExtensions structure
[out]outputBuffer where to store the ASN.1 structure
[out]writtenLength of the resulting ASN.1 structure
Returns
Error code

Definition at line 497 of file ocsp_req_format.c.

◆ ocspFormatRequestList()

error_t ocspFormatRequestList ( const OcspSingleRequest requestList,
uint_t  numRequests,
uint8_t *  output,
size_t *  written 
)

Format RequestList structure.

Parameters
[in]requestListList of requests
[in]numRequestsNumber of requests in the list
[out]outputBuffer where to store the ASN.1 structure
[out]writtenLength of the resulting ASN.1 structure
Returns
Error code

Definition at line 210 of file ocsp_req_format.c.

◆ ocspFormatSingleRequest()

error_t ocspFormatSingleRequest ( const OcspSingleRequest singleRequest,
uint8_t *  output,
size_t *  written 
)

Format Request structure.

Parameters
[in]singleRequestPointer to the Request structure
[out]outputBuffer where to store the ASN.1 structure
[out]writtenLength of the resulting ASN.1 structure
Returns
Error code

Definition at line 269 of file ocsp_req_format.c.

◆ ocspFormatTbsRequest()

error_t ocspFormatTbsRequest ( const OcspTbsRequest tbsRequest,
uint8_t *  output,
size_t *  written 
)

Format TBSRequest structure.

Parameters
[in]tbsRequestPointer to the TBSRequest structure
[out]outputBuffer where to store the ASN.1 structure
[out]writtenLength of the resulting ASN.1 structure
Returns
Error code

Definition at line 93 of file ocsp_req_format.c.

◆ ocspFormatVersion()

error_t ocspFormatVersion ( OcspVersion  version,
uint8_t *  output,
size_t *  written 
)

Format Version field.

Parameters
[in]versionVersion number
[out]outputBuffer where to format the ASN.1 structure
[out]writtenLength of the resulting ASN.1 structure
Returns
Error code

Definition at line 167 of file ocsp_req_format.c.