Fix CVE-2017-6891 in minitasn1 code
[platform/upstream/gnutls.git] / lib / gnutls_sig.h
1 /*
2  * Copyright (C) 2000-2012 Free Software Foundation, Inc.
3  *
4  * Author: Nikos Mavrogiannopoulos
5  *
6  * This file is part of GnuTLS.
7  *
8  * The GnuTLS is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; either version 2.1 of
11  * the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this program.  If not, see <http://www.gnu.org/licenses/>
20  *
21  */
22
23 #ifndef GNUTLS_SIG_H
24 #define GNUTLS_SIG_H
25
26 #include <gnutls/abstract.h>
27
28 int _gnutls_handshake_sign_crt_vrfy(gnutls_session_t session,
29                                     gnutls_pcert_st * cert,
30                                     gnutls_privkey_t pkey,
31                                     gnutls_datum_t * signature);
32
33 int _gnutls_handshake_sign_data(gnutls_session_t session,
34                                 gnutls_pcert_st * cert,
35                                 gnutls_privkey_t pkey,
36                                 gnutls_datum_t * params,
37                                 gnutls_datum_t * signature,
38                                 gnutls_sign_algorithm_t * algo);
39
40 int _gnutls_handshake_verify_crt_vrfy(gnutls_session_t session,
41                                       gnutls_pcert_st * cert,
42                                       gnutls_datum_t * signature,
43                                       gnutls_sign_algorithm_t);
44
45 int _gnutls_handshake_verify_data(gnutls_session_t session,
46                                   gnutls_pcert_st * cert,
47                                   const gnutls_datum_t * params,
48                                   gnutls_datum_t * signature,
49                                   gnutls_sign_algorithm_t algo);
50
51 int pk_prepare_hash(gnutls_pk_algorithm_t pk, const mac_entry_st * hash,
52                     gnutls_datum_t * output);
53 int pk_hash_data(gnutls_pk_algorithm_t pk, const mac_entry_st * hash,
54                  gnutls_pk_params_st * params, const gnutls_datum_t * data,
55                  gnutls_datum_t * digest);
56
57 #endif