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

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

Committer:
wolfSSL
Date:
Tue Aug 22 10:48:22 2017 +0000
Revision:
13:f67a6c6013ca
Parent:
11:cee25a834751
wolfSSL3.12.0 with TLS1.3

Who changed what in which revision?

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