ocsp_common.h File Reference

OCSP common definitions. More...

#include "core/crypto.h"
#include "pkix/x509_common.h"

Go to the source code of this file.

Data Structures

struct  OcspCertId
 CertID structure. More...
 
struct  OcspSingleExtensions
 Single request/response extensions. More...
 
struct  OcspSingleRequest
 SingleRequest structure. More...
 
struct  OcspExtensions
 OCSP extensions. More...
 
struct  OcspTbsRequest
 TBSRequest structure. More...
 
struct  OcspRequest
 OCSPRequest structure. More...
 
struct  OcspRevokedInfo
 RevokedInfo structure. More...
 
struct  OcspSingleResponse
 SingleResponse structure. More...
 
struct  OcspResponderId
 ResponderID structure. More...
 
struct  OcspTbsResponseData
 TbsResponseData structure. More...
 
struct  OcspCerts
 OcspCerts structure. More...
 
struct  OcspBasicResponse
 BasicOCSPResponse structure. More...
 
struct  OcspResponse
 OCSPResponse structure. More...
 

Macros

#define OCSP_SUPPORT   DISABLED
 
#define OCSP_SIGN_DELEGATION_SUPPORT   ENABLED
 
#define OCSP_MAX_REQUESTS   2
 
#define OCSP_MAX_RESPONSES   2
 
#define OCSP_SHA1_SUPPORT   ENABLED
 
#define OCSP_SHA256_SUPPORT   ENABLED
 
#define OCSP_SHA384_SUPPORT   DISABLED
 
#define OCSP_SHA512_SUPPORT   DISABLED
 

Enumerations

enum  OcspVersion { OCSP_VERSION_1 = 0 }
 OCSP versions. More...
 
enum  OcspResponseStatus {
  OCSP_RESP_STATUS_SUCCESSFUL = 0, OCSP_RESP_STATUS_MALFORMED_REQUEST = 1, OCSP_RESP_STATUS_INTERNAL_ERROR = 2, OCSP_RESP_STATUS_TRY_LATER = 3,
  OCSP_RESP_STATUS_SIG_REQUIRED = 5, OCSP_RESP_STATUS_UNAUTHORIZED = 6
}
 OCSP response status. More...
 
enum  OcspCertStatus { OCSP_CERT_STATUS_GOOD = 0, OCSP_CERT_STATUS_REVOKED = 1, OCSP_CERT_STATUS_UNKNOWN = 2 }
 Certificate status. More...
 

Functions

const HashAlgoocspSelectHashAlgo (void)
 Hash algorithm selection. More...
 
const HashAlgoocspGetHashAlgo (const uint8_t *oid, size_t length)
 Get the hash algorithm that matches the specified identifier. More...
 

Variables

const uint8_t PKIX_OCSP_BASIC_OID [9]
 
const uint8_t PKIX_OCSP_NONCE_OID [9]
 

Detailed Description

OCSP common definitions.

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_common.h.

Macro Definition Documentation

◆ OCSP_MAX_REQUESTS

#define OCSP_MAX_REQUESTS   2

Definition at line 54 of file ocsp_common.h.

◆ OCSP_MAX_RESPONSES

#define OCSP_MAX_RESPONSES   2

Definition at line 61 of file ocsp_common.h.

◆ OCSP_SHA1_SUPPORT

#define OCSP_SHA1_SUPPORT   ENABLED

Definition at line 68 of file ocsp_common.h.

◆ OCSP_SHA256_SUPPORT

#define OCSP_SHA256_SUPPORT   ENABLED

Definition at line 75 of file ocsp_common.h.

◆ OCSP_SHA384_SUPPORT

#define OCSP_SHA384_SUPPORT   DISABLED

Definition at line 82 of file ocsp_common.h.

◆ OCSP_SHA512_SUPPORT

#define OCSP_SHA512_SUPPORT   DISABLED

Definition at line 89 of file ocsp_common.h.

◆ OCSP_SIGN_DELEGATION_SUPPORT

#define OCSP_SIGN_DELEGATION_SUPPORT   ENABLED

Definition at line 47 of file ocsp_common.h.

◆ OCSP_SUPPORT

#define OCSP_SUPPORT   DISABLED

Definition at line 40 of file ocsp_common.h.

Enumeration Type Documentation

◆ OcspCertStatus

Certificate status.

Enumerator
OCSP_CERT_STATUS_GOOD 
OCSP_CERT_STATUS_REVOKED 
OCSP_CERT_STATUS_UNKNOWN 

Definition at line 129 of file ocsp_common.h.

◆ OcspResponseStatus

OCSP response status.

Enumerator
OCSP_RESP_STATUS_SUCCESSFUL 

Response has valid confirmations.

OCSP_RESP_STATUS_MALFORMED_REQUEST 

Illegal confirmation request.

OCSP_RESP_STATUS_INTERNAL_ERROR 

Internal error in issuer.

OCSP_RESP_STATUS_TRY_LATER 

Try again later.

OCSP_RESP_STATUS_SIG_REQUIRED 

Must sign the request.

OCSP_RESP_STATUS_UNAUTHORIZED 

Request unauthorized.

Definition at line 114 of file ocsp_common.h.

◆ OcspVersion

OCSP versions.

Enumerator
OCSP_VERSION_1 

Definition at line 104 of file ocsp_common.h.

Function Documentation

◆ ocspGetHashAlgo()

const HashAlgo* ocspGetHashAlgo ( const uint8_t *  oid,
size_t  length 
)

Get the hash algorithm that matches the specified identifier.

Parameters
[in]oidHash algorithm OID
[in]lengthLength of the hash algorithm OID, in bytes
Returns
Pointer to the hash algorithm

Definition at line 85 of file ocsp_common.c.

◆ ocspSelectHashAlgo()

const HashAlgo* ocspSelectHashAlgo ( void  )

Hash algorithm selection.

Returns
Pointer to the preferred hash algorithm

Definition at line 52 of file ocsp_common.c.

Variable Documentation

◆ PKIX_OCSP_BASIC_OID

const uint8_t PKIX_OCSP_BASIC_OID[9]
extern

Definition at line 42 of file ocsp_common.c.

◆ PKIX_OCSP_NONCE_OID

const uint8_t PKIX_OCSP_NONCE_OID[9]
extern

Definition at line 44 of file ocsp_common.c.