Line | Count | Source (jump to first uncovered line) |
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 <https://www.gnu.org/licenses/> |
20 | | * |
21 | | */ |
22 | | |
23 | | #ifndef GNUTLS_LIB_AUTH_H |
24 | | # define GNUTLS_LIB_AUTH_H |
25 | | |
26 | | # include "str.h" |
27 | | |
28 | | typedef struct mod_auth_st_int { |
29 | | const char *name; /* null terminated */ |
30 | | int (*gnutls_generate_server_certificate)(gnutls_session_t, |
31 | | gnutls_buffer_st *); |
32 | | int (*gnutls_generate_client_certificate)(gnutls_session_t, |
33 | | gnutls_buffer_st *); |
34 | | int (*gnutls_generate_server_kx)(gnutls_session_t, gnutls_buffer_st *); |
35 | | int (*gnutls_generate_client_kx)(gnutls_session_t, gnutls_buffer_st *); /* used in SRP */ |
36 | | int (*gnutls_generate_client_crt_vrfy)(gnutls_session_t, |
37 | | gnutls_buffer_st *); |
38 | | int (*gnutls_generate_server_crt_request)(gnutls_session_t, |
39 | | gnutls_buffer_st *); |
40 | | |
41 | | int (*gnutls_process_server_certificate)(gnutls_session_t, |
42 | | uint8_t *, size_t); |
43 | | int (*gnutls_process_client_certificate)(gnutls_session_t, |
44 | | uint8_t *, size_t); |
45 | | int (*gnutls_process_server_kx)(gnutls_session_t, uint8_t *, size_t); |
46 | | int (*gnutls_process_client_kx)(gnutls_session_t, uint8_t *, size_t); |
47 | | int (*gnutls_process_client_crt_vrfy)(gnutls_session_t, uint8_t *, |
48 | | size_t); |
49 | | int (*gnutls_process_server_crt_request)(gnutls_session_t, |
50 | | uint8_t *, size_t); |
51 | | } mod_auth_st; |
52 | | |
53 | | const void *_gnutls_get_cred(gnutls_session_t session, |
54 | | gnutls_credentials_type_t type); |
55 | | const void *_gnutls_get_kx_cred(gnutls_session_t session, |
56 | | gnutls_kx_algorithm_t algo); |
57 | | int _gnutls_auth_info_init(gnutls_session_t session, |
58 | | gnutls_credentials_type_t type, int size, |
59 | | int allow_change); |
60 | | |
61 | | /*- |
62 | | * _gnutls_get_auth_info - Returns a pointer to authentication information. |
63 | | * @session: is a #gnutls_session_t structure. |
64 | | * |
65 | | * This function must be called after a successful gnutls_handshake(). |
66 | | * Returns a pointer to authentication information. That information |
67 | | * is data obtained by the handshake protocol, the key exchange algorithm, |
68 | | * and the TLS extensions messages. |
69 | | * |
70 | | * In case of GNUTLS_CRD_ANON returns a type of &anon_(server/client)_auth_info_t; |
71 | | * In case of GNUTLS_CRD_CERTIFICATE returns a type of &cert_auth_info_t; |
72 | | * In case of GNUTLS_CRD_SRP returns a type of &srp_(server/client)_auth_info_t; |
73 | | -*/ |
74 | | inline static |
75 | | void *_gnutls_get_auth_info(gnutls_session_t session, |
76 | | gnutls_credentials_type_t type) |
77 | 0 | { |
78 | 0 | if (type == session->key.auth_info_type) |
79 | 0 | return session->key.auth_info; |
80 | 0 | else |
81 | 0 | return NULL; |
82 | 0 | } Unexecuted instantiation: common.c:_gnutls_get_auth_info Unexecuted instantiation: crl.c:_gnutls_get_auth_info Unexecuted instantiation: crq.c:_gnutls_get_auth_info Unexecuted instantiation: dn.c:_gnutls_get_auth_info Unexecuted instantiation: extensions.c:_gnutls_get_auth_info Unexecuted instantiation: hostname-verify.c:_gnutls_get_auth_info Unexecuted instantiation: key_decode.c:_gnutls_get_auth_info Unexecuted instantiation: key_encode.c:_gnutls_get_auth_info Unexecuted instantiation: mpi.c:_gnutls_get_auth_info Unexecuted instantiation: ocsp.c:_gnutls_get_auth_info Unexecuted instantiation: output.c:_gnutls_get_auth_info Unexecuted instantiation: pkcs12.c:_gnutls_get_auth_info Unexecuted instantiation: pkcs12_bag.c:_gnutls_get_auth_info Unexecuted instantiation: pkcs12_encr.c:_gnutls_get_auth_info Unexecuted instantiation: pkcs7-crypt.c:_gnutls_get_auth_info Unexecuted instantiation: privkey_openssl.c:_gnutls_get_auth_info Unexecuted instantiation: privkey_pkcs8.c:_gnutls_get_auth_info Unexecuted instantiation: privkey_pkcs8_pbes1.c:_gnutls_get_auth_info Unexecuted instantiation: prov-seed.c:_gnutls_get_auth_info Unexecuted instantiation: sign.c:_gnutls_get_auth_info Unexecuted instantiation: time.c:_gnutls_get_auth_info Unexecuted instantiation: tls_features.c:_gnutls_get_auth_info Unexecuted instantiation: verify-high.c:_gnutls_get_auth_info Unexecuted instantiation: verify-high2.c:_gnutls_get_auth_info Unexecuted instantiation: verify.c:_gnutls_get_auth_info Unexecuted instantiation: virt-san.c:_gnutls_get_auth_info Unexecuted instantiation: x509.c:_gnutls_get_auth_info Unexecuted instantiation: x509_dn.c:_gnutls_get_auth_info Unexecuted instantiation: x509_ext.c:_gnutls_get_auth_info Unexecuted instantiation: x509_write.c:_gnutls_get_auth_info Unexecuted instantiation: attributes.c:_gnutls_get_auth_info Unexecuted instantiation: email-verify.c:_gnutls_get_auth_info Unexecuted instantiation: ip.c:_gnutls_get_auth_info Unexecuted instantiation: krb5.c:_gnutls_get_auth_info Unexecuted instantiation: name_constraints.c:_gnutls_get_auth_info |
83 | | |
84 | | #endif /* GNUTLS_LIB_AUTH_H */ |