Fix CVE-2017-6891 in minitasn1 code
[platform/upstream/gnutls.git] / src / ocsptool-common.h
1 /*
2  * Copyright (C) 2011-2012 Free Software Foundation, Inc.
3  *
4  * This file is part of GnuTLS.
5  *
6  * GnuTLS is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * GnuTLS is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see
18  * <http://www.gnu.org/licenses/>.
19  */
20
21 #ifndef OCSPTOOL_COMMON_H
22 #define OCSPTOOL_COMMON_H
23
24 #include <gnutls/ocsp.h>
25
26 enum {
27         ACTION_NONE,
28         ACTION_REQ_INFO,
29         ACTION_RESP_INFO,
30         ACTION_VERIFY_RESP,
31         ACTION_GEN_REQ
32 };
33
34 extern void ocsptool_version(void);
35 void
36 _generate_request(gnutls_x509_crt_t cert, gnutls_x509_crt_t issuer,
37                   gnutls_datum_t * rdata, gnutls_datum_t* nonce);
38 int send_ocsp_request(const char *server,
39                       gnutls_x509_crt_t cert, gnutls_x509_crt_t issuer,
40                       gnutls_datum_t * resp_data, gnutls_datum_t* nonce);
41 void print_ocsp_verify_res(unsigned int output);
42
43 int
44 check_ocsp_response(gnutls_x509_crt_t cert, gnutls_x509_crt_t issuer,
45                     gnutls_datum_t * data, gnutls_datum_t *nonce,
46                     int verbose);
47
48 #endif