|
Packit Service |
4684c1 |
/*
|
|
Packit Service |
4684c1 |
* Copyright (C) 2000-2012 Free Software Foundation, Inc.
|
|
Packit Service |
4684c1 |
*
|
|
Packit Service |
4684c1 |
* Author: Nikos Mavrogiannopoulos
|
|
Packit Service |
4684c1 |
*
|
|
Packit Service |
4684c1 |
* This file is part of GnuTLS.
|
|
Packit Service |
4684c1 |
*
|
|
Packit Service |
4684c1 |
* The GnuTLS is free software; you can redistribute it and/or
|
|
Packit Service |
4684c1 |
* modify it under the terms of the GNU Lesser General Public License
|
|
Packit Service |
4684c1 |
* as published by the Free Software Foundation; either version 2.1 of
|
|
Packit Service |
4684c1 |
* the License, or (at your option) any later version.
|
|
Packit Service |
4684c1 |
*
|
|
Packit Service |
4684c1 |
* This library is distributed in the hope that it will be useful, but
|
|
Packit Service |
4684c1 |
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
4684c1 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
4684c1 |
* Lesser General Public License for more details.
|
|
Packit Service |
4684c1 |
*
|
|
Packit Service |
4684c1 |
* You should have received a copy of the GNU Lesser General Public License
|
|
Packit Service |
4684c1 |
* along with this program. If not, see <https://www.gnu.org/licenses/>
|
|
Packit Service |
4684c1 |
*
|
|
Packit Service |
4684c1 |
*/
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
#ifndef GNUTLS_LIB_AUTH_H
|
|
Packit Service |
4684c1 |
#define GNUTLS_LIB_AUTH_H
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
#include "str.h"
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
typedef struct mod_auth_st_int {
|
|
Packit Service |
4684c1 |
const char *name; /* null terminated */
|
|
Packit Service |
4684c1 |
int (*gnutls_generate_server_certificate) (gnutls_session_t,
|
|
Packit Service |
4684c1 |
gnutls_buffer_st *);
|
|
Packit Service |
4684c1 |
int (*gnutls_generate_client_certificate) (gnutls_session_t,
|
|
Packit Service |
4684c1 |
gnutls_buffer_st *);
|
|
Packit Service |
4684c1 |
int (*gnutls_generate_server_kx) (gnutls_session_t,
|
|
Packit Service |
4684c1 |
gnutls_buffer_st *);
|
|
Packit Service |
4684c1 |
int (*gnutls_generate_client_kx) (gnutls_session_t, gnutls_buffer_st *); /* used in SRP */
|
|
Packit Service |
4684c1 |
int (*gnutls_generate_client_crt_vrfy) (gnutls_session_t,
|
|
Packit Service |
4684c1 |
gnutls_buffer_st *);
|
|
Packit Service |
4684c1 |
int (*gnutls_generate_server_crt_request) (gnutls_session_t,
|
|
Packit Service |
4684c1 |
gnutls_buffer_st *);
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
int (*gnutls_process_server_certificate) (gnutls_session_t,
|
|
Packit Service |
4684c1 |
uint8_t *, size_t);
|
|
Packit Service |
4684c1 |
int (*gnutls_process_client_certificate) (gnutls_session_t,
|
|
Packit Service |
4684c1 |
uint8_t *, size_t);
|
|
Packit Service |
4684c1 |
int (*gnutls_process_server_kx) (gnutls_session_t, uint8_t *,
|
|
Packit Service |
4684c1 |
size_t);
|
|
Packit Service |
4684c1 |
int (*gnutls_process_client_kx) (gnutls_session_t, uint8_t *,
|
|
Packit Service |
4684c1 |
size_t);
|
|
Packit Service |
4684c1 |
int (*gnutls_process_client_crt_vrfy) (gnutls_session_t, uint8_t *,
|
|
Packit Service |
4684c1 |
size_t);
|
|
Packit Service |
4684c1 |
int (*gnutls_process_server_crt_request) (gnutls_session_t,
|
|
Packit Service |
4684c1 |
uint8_t *, size_t);
|
|
Packit Service |
4684c1 |
} mod_auth_st;
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
const void *_gnutls_get_cred(gnutls_session_t session,
|
|
Packit Service |
4684c1 |
gnutls_credentials_type_t type);
|
|
Packit Service |
4684c1 |
const void *_gnutls_get_kx_cred(gnutls_session_t session,
|
|
Packit Service |
4684c1 |
gnutls_kx_algorithm_t algo);
|
|
Packit Service |
4684c1 |
int _gnutls_auth_info_init(gnutls_session_t session,
|
|
Packit Service |
4684c1 |
gnutls_credentials_type_t type, int size,
|
|
Packit Service |
4684c1 |
int allow_change);
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
/*-
|
|
Packit Service |
4684c1 |
* _gnutls_get_auth_info - Returns a pointer to authentication information.
|
|
Packit Service |
4684c1 |
* @session: is a #gnutls_session_t structure.
|
|
Packit Service |
4684c1 |
*
|
|
Packit Service |
4684c1 |
* This function must be called after a successful gnutls_handshake().
|
|
Packit Service |
4684c1 |
* Returns a pointer to authentication information. That information
|
|
Packit Service |
4684c1 |
* is data obtained by the handshake protocol, the key exchange algorithm,
|
|
Packit Service |
4684c1 |
* and the TLS extensions messages.
|
|
Packit Service |
4684c1 |
*
|
|
Packit Service |
4684c1 |
* In case of GNUTLS_CRD_ANON returns a type of &anon_(server/client)_auth_info_t;
|
|
Packit Service |
4684c1 |
* In case of GNUTLS_CRD_CERTIFICATE returns a type of &cert_auth_info_t;
|
|
Packit Service |
4684c1 |
* In case of GNUTLS_CRD_SRP returns a type of &srp_(server/client)_auth_info_t;
|
|
Packit Service |
4684c1 |
-*/
|
|
Packit Service |
4684c1 |
inline static
|
|
Packit Service |
4684c1 |
void *_gnutls_get_auth_info(gnutls_session_t session, gnutls_credentials_type_t type)
|
|
Packit Service |
4684c1 |
{
|
|
Packit Service |
4684c1 |
if (type == session->key.auth_info_type)
|
|
Packit Service |
4684c1 |
return session->key.auth_info;
|
|
Packit Service |
4684c1 |
else
|
|
Packit Service |
4684c1 |
return NULL;
|
|
Packit Service |
4684c1 |
}
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
#endif /* GNUTLS_LIB_AUTH_H */
|