wolfSSL SSL/TLS library, support up to TLS1.3

Dependents:   CyaSSL-Twitter-OAuth4Tw Example-client-tls-cert TwitterReader TweetTest ... more

Committer:
wolfSSL
Date:
Sat Aug 18 22:20:43 2018 +0000
Revision:
15:117db924cf7c
Child:
16:8e0d178b1d1e
wolfSSL 3.15.3

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wolfSSL 15:117db924cf7c 1 /* ocsp.h
wolfSSL 15:117db924cf7c 2 *
wolfSSL 15:117db924cf7c 3 * Copyright (C) 2006-2017 wolfSSL Inc.
wolfSSL 15:117db924cf7c 4 *
wolfSSL 15:117db924cf7c 5 * This file is part of wolfSSL.
wolfSSL 15:117db924cf7c 6 *
wolfSSL 15:117db924cf7c 7 * wolfSSL is free software; you can redistribute it and/or modify
wolfSSL 15:117db924cf7c 8 * it under the terms of the GNU General Public License as published by
wolfSSL 15:117db924cf7c 9 * the Free Software Foundation; either version 2 of the License, or
wolfSSL 15:117db924cf7c 10 * (at your option) any later version.
wolfSSL 15:117db924cf7c 11 *
wolfSSL 15:117db924cf7c 12 * wolfSSL is distributed in the hope that it will be useful,
wolfSSL 15:117db924cf7c 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
wolfSSL 15:117db924cf7c 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
wolfSSL 15:117db924cf7c 15 * GNU General Public License for more details.
wolfSSL 15:117db924cf7c 16 *
wolfSSL 15:117db924cf7c 17 * You should have received a copy of the GNU General Public License
wolfSSL 15:117db924cf7c 18 * along with this program; if not, write to the Free Software
wolfSSL 15:117db924cf7c 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
wolfSSL 15:117db924cf7c 20 */
wolfSSL 15:117db924cf7c 21
wolfSSL 15:117db924cf7c 22
wolfSSL 15:117db924cf7c 23
wolfSSL 15:117db924cf7c 24 /* wolfSSL OCSP API */
wolfSSL 15:117db924cf7c 25
wolfSSL 15:117db924cf7c 26 #ifndef WOLFSSL_OCSP_H
wolfSSL 15:117db924cf7c 27 #define WOLFSSL_OCSP_H
wolfSSL 15:117db924cf7c 28
wolfSSL 15:117db924cf7c 29 #ifdef HAVE_OCSP
wolfSSL 15:117db924cf7c 30
wolfSSL 15:117db924cf7c 31 #include <wolfssl/ssl.h>
wolfSSL 15:117db924cf7c 32 #include <wolfssl/wolfcrypt/asn.h>
wolfSSL 15:117db924cf7c 33
wolfSSL 15:117db924cf7c 34 #ifdef __cplusplus
wolfSSL 15:117db924cf7c 35 extern "C" {
wolfSSL 15:117db924cf7c 36 #endif
wolfSSL 15:117db924cf7c 37
wolfSSL 15:117db924cf7c 38 typedef struct WOLFSSL_OCSP WOLFSSL_OCSP;
wolfSSL 15:117db924cf7c 39
wolfSSL 15:117db924cf7c 40 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY)
wolfSSL 15:117db924cf7c 41 typedef struct OcspResponse WOLFSSL_OCSP_BASICRESP;
wolfSSL 15:117db924cf7c 42
wolfSSL 15:117db924cf7c 43 typedef struct OcspRequest WOLFSSL_OCSP_CERTID;
wolfSSL 15:117db924cf7c 44
wolfSSL 15:117db924cf7c 45 typedef struct OcspRequest WOLFSSL_OCSP_ONEREQ;
wolfSSL 15:117db924cf7c 46 #endif
wolfSSL 15:117db924cf7c 47
wolfSSL 15:117db924cf7c 48 WOLFSSL_LOCAL int InitOCSP(WOLFSSL_OCSP*, WOLFSSL_CERT_MANAGER*);
wolfSSL 15:117db924cf7c 49 WOLFSSL_LOCAL void FreeOCSP(WOLFSSL_OCSP*, int dynamic);
wolfSSL 15:117db924cf7c 50
wolfSSL 15:117db924cf7c 51 WOLFSSL_LOCAL int CheckCertOCSP(WOLFSSL_OCSP*, DecodedCert*,
wolfSSL 15:117db924cf7c 52 WOLFSSL_BUFFER_INFO* responseBuffer);
wolfSSL 15:117db924cf7c 53 WOLFSSL_LOCAL int CheckCertOCSP_ex(WOLFSSL_OCSP*, DecodedCert*,
wolfSSL 15:117db924cf7c 54 WOLFSSL_BUFFER_INFO* responseBuffer, WOLFSSL* ssl);
wolfSSL 15:117db924cf7c 55 WOLFSSL_LOCAL int CheckOcspRequest(WOLFSSL_OCSP* ocsp,
wolfSSL 15:117db924cf7c 56 OcspRequest* ocspRequest, WOLFSSL_BUFFER_INFO* responseBuffer);
wolfSSL 15:117db924cf7c 57
wolfSSL 15:117db924cf7c 58
wolfSSL 15:117db924cf7c 59 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY)
wolfSSL 15:117db924cf7c 60
wolfSSL 15:117db924cf7c 61 WOLFSSL_API int wolfSSL_OCSP_resp_find_status(WOLFSSL_OCSP_BASICRESP *bs,
wolfSSL 15:117db924cf7c 62 WOLFSSL_OCSP_CERTID* id, int* status, int* reason,
wolfSSL 15:117db924cf7c 63 WOLFSSL_ASN1_TIME** revtime, WOLFSSL_ASN1_TIME** thisupd,
wolfSSL 15:117db924cf7c 64 WOLFSSL_ASN1_TIME** nextupd);
wolfSSL 15:117db924cf7c 65 WOLFSSL_API const char *wolfSSL_OCSP_cert_status_str(long s);
wolfSSL 15:117db924cf7c 66 WOLFSSL_API int wolfSSL_OCSP_check_validity(WOLFSSL_ASN1_TIME* thisupd,
wolfSSL 15:117db924cf7c 67 WOLFSSL_ASN1_TIME* nextupd, long sec, long maxsec);
wolfSSL 15:117db924cf7c 68
wolfSSL 15:117db924cf7c 69 WOLFSSL_API void wolfSSL_OCSP_CERTID_free(WOLFSSL_OCSP_CERTID* certId);
wolfSSL 15:117db924cf7c 70 WOLFSSL_API WOLFSSL_OCSP_CERTID* wolfSSL_OCSP_cert_to_id(
wolfSSL 15:117db924cf7c 71 const WOLFSSL_EVP_MD *dgst, const WOLFSSL_X509 *subject,
wolfSSL 15:117db924cf7c 72 const WOLFSSL_X509 *issuer);
wolfSSL 15:117db924cf7c 73
wolfSSL 15:117db924cf7c 74 WOLFSSL_API void wolfSSL_OCSP_BASICRESP_free(WOLFSSL_OCSP_BASICRESP* basicResponse);
wolfSSL 15:117db924cf7c 75 WOLFSSL_API int wolfSSL_OCSP_basic_verify(WOLFSSL_OCSP_BASICRESP *bs,
wolfSSL 15:117db924cf7c 76 WOLF_STACK_OF(WOLFSSL_X509) *certs, WOLFSSL_X509_STORE *st, unsigned long flags);
wolfSSL 15:117db924cf7c 77
wolfSSL 15:117db924cf7c 78 WOLFSSL_API void wolfSSL_OCSP_RESPONSE_free(OcspResponse* response);
wolfSSL 15:117db924cf7c 79 WOLFSSL_API OcspResponse* wolfSSL_d2i_OCSP_RESPONSE_bio(WOLFSSL_BIO* bio,
wolfSSL 15:117db924cf7c 80 OcspResponse** response);
wolfSSL 15:117db924cf7c 81 WOLFSSL_API OcspResponse* wolfSSL_d2i_OCSP_RESPONSE(OcspResponse** response,
wolfSSL 15:117db924cf7c 82 const unsigned char** data, int len);
wolfSSL 15:117db924cf7c 83 WOLFSSL_API int wolfSSL_i2d_OCSP_RESPONSE(OcspResponse* response,
wolfSSL 15:117db924cf7c 84 unsigned char** data);
wolfSSL 15:117db924cf7c 85 WOLFSSL_API int wolfSSL_OCSP_response_status(OcspResponse *response);
wolfSSL 15:117db924cf7c 86 WOLFSSL_API const char *wolfSSL_OCSP_response_status_str(long s);
wolfSSL 15:117db924cf7c 87 WOLFSSL_API WOLFSSL_OCSP_BASICRESP* wolfSSL_OCSP_response_get1_basic(
wolfSSL 15:117db924cf7c 88 OcspResponse* response);
wolfSSL 15:117db924cf7c 89
wolfSSL 15:117db924cf7c 90 WOLFSSL_API OcspRequest* wolfSSL_OCSP_REQUEST_new(void);
wolfSSL 15:117db924cf7c 91 WOLFSSL_API void wolfSSL_OCSP_REQUEST_free(OcspRequest* request);
wolfSSL 15:117db924cf7c 92 WOLFSSL_API int wolfSSL_i2d_OCSP_REQUEST(OcspRequest* request,
wolfSSL 15:117db924cf7c 93 unsigned char** data);
wolfSSL 15:117db924cf7c 94 WOLFSSL_API WOLFSSL_OCSP_ONEREQ* wolfSSL_OCSP_request_add0_id(OcspRequest *req,
wolfSSL 15:117db924cf7c 95 WOLFSSL_OCSP_CERTID *cid);
wolfSSL 15:117db924cf7c 96
wolfSSL 15:117db924cf7c 97 #endif
wolfSSL 15:117db924cf7c 98
wolfSSL 15:117db924cf7c 99
wolfSSL 15:117db924cf7c 100 #ifdef __cplusplus
wolfSSL 15:117db924cf7c 101 } /* extern "C" */
wolfSSL 15:117db924cf7c 102 #endif
wolfSSL 15:117db924cf7c 103
wolfSSL 15:117db924cf7c 104
wolfSSL 15:117db924cf7c 105 #endif /* HAVE_OCSP */
wolfSSL 15:117db924cf7c 106 #endif /* WOLFSSL_OCSP_H */
wolfSSL 15:117db924cf7c 107
wolfSSL 15:117db924cf7c 108
wolfSSL 15:117db924cf7c 109