gnutls_kx_set_priority(state, kx_priority);
gnutls_mac_set_priority(state, mac_priority);
- gnutls_set_cred(state, GNUTLS_X509PKI, xcred);
+ gnutls_cred_set(state, GNUTLS_X509PKI, xcred);
if (t > 0) { /* if this is not the first time we connect */
gnutls_session_set_data(state, session, session_size);
/* put the x509 credentials to the current state
*/
- gnutls_set_cred(state, GNUTLS_X509PKI, xcred);
+ gnutls_cred_set(state, GNUTLS_X509PKI, xcred);
gnutls_transport_set_ptr( state, sd);
/* in case of X509 PKI
*/
- if (gnutls_get_auth_type(state) == GNUTLS_X509PKI) {
+ if (gnutls_auth_get_type(state) == GNUTLS_X509PKI) {
const gnutls_DN* dn;
const gnutls_datum* cert_list;
int cert_list_size = 0;
gnutls_kx_set_priority(state, kx_priority);
gnutls_mac_set_priority(state, mac_priority);
- gnutls_set_cred(state, GNUTLS_SRP, srp_cred);
- gnutls_set_cred(state, GNUTLS_X509PKI, x509_cred);
+ gnutls_cred_set(state, GNUTLS_SRP, srp_cred);
+ gnutls_cred_set(state, GNUTLS_X509PKI, x509_cred);
/* request client certificate if any.
*/
/* put the SRP credentials to the current state
*/
- gnutls_set_cred(state, GNUTLS_SRP, xcred);
+ gnutls_cred_set(state, GNUTLS_SRP, xcred);
gnutls_transport_set_ptr( state, sd);
state->gnutls_key->auth_info_type = GNUTLS_ANON;
state->gnutls_key->auth_info_size = sizeof(ANON_SERVER_AUTH_INFO_INT);
} else
- if (gnutls_get_auth_type( state) != state->gnutls_key->auth_info_type) {
+ if (gnutls_auth_get_type( state) != state->gnutls_key->auth_info_type) {
gnutls_assert();
return GNUTLS_E_INVALID_REQUEST;
}
state->gnutls_key->auth_info_type = GNUTLS_X509PKI;
} else
- if (gnutls_get_auth_type(state) !=
+ if (gnutls_auth_get_type(state) !=
state->gnutls_key->auth_info_type) {
gnutls_assert();
return GNUTLS_E_INVALID_REQUEST;
state->gnutls_key->auth_info = gnutls_calloc(1, sizeof(SRP_SERVER_AUTH_INFO_INT));
state->gnutls_key->auth_info_type = GNUTLS_SRP;
} else
- if (gnutls_get_auth_type( state) != state->gnutls_key->auth_info_type) {
+ if (gnutls_auth_get_type( state) != state->gnutls_key->auth_info_type) {
gnutls_assert();
return GNUTLS_E_INVALID_REQUEST;
}
state->gnutls_key->auth_info_type = GNUTLS_X509PKI;
} else
- if (gnutls_get_auth_type(state) !=
+ if (gnutls_auth_get_type(state) !=
state->gnutls_key->auth_info_type) {
gnutls_assert();
return GNUTLS_E_INVALID_REQUEST;
return 0;
}
-#define CHECK_AUTH(auth, ret) if (gnutls_get_auth_type(state) != auth) { \
+#define CHECK_AUTH(auth, ret) if (gnutls_auth_get_type(state) != auth) { \
gnutls_assert(); \
return ret; \
}
void* gnutls_db_get_ptr( GNUTLS_STATE);
int gnutls_db_check_entry( GNUTLS_STATE state, gnutls_datum session_entry);
-void gnutls_set_max_handshake_data_buffer_size( GNUTLS_STATE state, int max);
+void gnutls_handshake_set_max_data_buffer_size( GNUTLS_STATE state, int max);
/* returns libgnutls version */
const char* gnutls_check_version();
/* Functions for setting/clearing credentials */
int gnutls_clear_creds( GNUTLS_STATE state);
/* cred is a structure defined by the kx algorithm */
-int gnutls_set_cred( GNUTLS_STATE, CredType type, void* cred);
+int gnutls_cred_set( GNUTLS_STATE, CredType type, void* cred);
/* This will set the Common Name field in case of X509PKI
* authentication. This will be used while verifying the
void gnutls_transport_set_push_function( GNUTLS_STATE, GNUTLS_PUSH_FUNC push_func);
void gnutls_transport_set_pull_function( GNUTLS_STATE, GNUTLS_PULL_FUNC pull_func);
-size_t gnutls_get_max_record_size( GNUTLS_STATE state);
-size_t gnutls_set_max_record_size( GNUTLS_STATE state, size_t size);
+size_t gnutls_record_get_max_size( GNUTLS_STATE state);
+size_t gnutls_record_set_max_size( GNUTLS_STATE state, size_t size);
* { algorithm, credentials, pointer to next }
*/
/**
- * gnutls_set_cred - Sets the needed credentials for the specified authentication algorithm.
+ * gnutls_cred_set - Sets the needed credentials for the specified authentication algorithm.
* @state: is a &GNUTLS_STATE structure.
* @type: is the type of the credentials
* @cred: is a pointer to a structure.
* in case of a client, and X509PKI_SERVER_CREDENTIALS, in case
* of a server.
**/
-int gnutls_set_cred( GNUTLS_STATE state, CredType type, void* cred) {
+int gnutls_cred_set( GNUTLS_STATE state, CredType type, void* cred) {
AUTH_CRED * ccred, *pcred;
int exists=0;
}
/**
- * gnutls_get_auth_type - Returns the type of credentials for the current authentication schema.
+ * gnutls_auth_get_type - Returns the type of credentials for the current authentication schema.
* @state: is a &GNUTLS_STATE structure.
*
* Returns type of credentials for the current authentication schema.
* the same function are to be used to access the authentication data.
**/
-CredType gnutls_get_auth_type( GNUTLS_STATE state) {
+CredType gnutls_auth_get_type( GNUTLS_STATE state) {
return _gnutls_map_kx_get_cred(
_gnutls_cipher_suite_get_kx_algo
int gnutls_clear_creds( GNUTLS_STATE state);
-int gnutls_set_cred( GNUTLS_STATE state, CredType type, void* cred);
+int gnutls_cred_set( GNUTLS_STATE state, CredType type, void* cred);
const void *_gnutls_get_cred( GNUTLS_KEY key, CredType kx, int* err);
const void *_gnutls_get_kx_cred( GNUTLS_KEY key, KXAlgorithm algo, int *err);
int _gnutls_generate_key(GNUTLS_KEY key);
-CredType gnutls_get_auth_type( GNUTLS_STATE state);
+CredType gnutls_auth_get_type( GNUTLS_STATE state);
void* _gnutls_get_auth_info( GNUTLS_STATE state);
}
/**
- * gnutls_set_max_handshake_data_buffer_size - This function will set the maximum size of handshake message sequence
+ * gnutls_handshake_set_max_data_buffer_size - This function will set the maximum size of handshake message sequence
* @state: is a a &GNUTLS_STATE structure.
* @max: is the maximum number.
*
* to set an upper limit.
*
**/
-void gnutls_set_max_handshake_data_buffer_size(GNUTLS_STATE state, int max)
+void gnutls_handshake_set_max_data_buffer_size(GNUTLS_STATE state, int max)
{
state->gnutls_internals.max_handshake_data_buffer_size = max;
}
void _gnutls_set_client_random( GNUTLS_STATE state, uint8* random);
int _gnutls_create_random( opaque* dst);
int _gnutls_remove_unwanted_ciphersuites( GNUTLS_STATE state, GNUTLS_CipherSuite ** cipherSuites, int numCipherSuites);
-void gnutls_set_max_handshake_data_buffer_size( GNUTLS_STATE state, int max);
+void gnutls_handshake_set_max_data_buffer_size( GNUTLS_STATE state, int max);
#define set_adv_version( state, major, minor) \
state->gnutls_internals.adv_version_major = major; \
#define WRITE_DEBUG
#define READ_DEBUG
#define HANDSHAKE_DEBUG // Prints some information on handshake
-#define RECORD_DEBUG
+#define RECORD_DEBUG*/
#define DEBUG
-*/
/* It might be a good idea to replace int with void*
* here.
(*state)->gnutls_internals.expire_time = DEFAULT_EXPIRE_TIME; /* one hour default */
- gnutls_set_lowat((*state), DEFAULT_LOWAT); /* the default for tcp */
+ gnutls_transport_set_lowat((*state), DEFAULT_LOWAT); /* the default for tcp */
- gnutls_set_max_handshake_data_buffer_size( (*state), MAX_HANDSHAKE_DATA_BUFFER_SIZE);
+ gnutls_handshake_set_max_data_buffer_size( (*state), MAX_HANDSHAKE_DATA_BUFFER_SIZE);
/* Allocate a minimum size for recv_data
* This is allocated in order to avoid small messages, makeing
}
/**
- * gnutls_get_max_record_size - returns the maximum record size
+ * gnutls_record_get_max_size - returns the maximum record size
* @state: is a &GNUTLS_STATE structure.
*
* This function returns the maximum record size in this connection.
* first handshake message.
*
**/
-size_t gnutls_get_max_record_size( GNUTLS_STATE state) {
+size_t gnutls_record_get_max_size( GNUTLS_STATE state) {
return state->security_parameters.max_record_size;
}
/**
- * gnutls_set_max_record_size - sets the maximum record size
+ * gnutls_record_set_max_size - sets the maximum record size
* @state: is a &GNUTLS_STATE structure.
* @size: is the new size
*
* Not all TLS implementations use or even understand this extension.
*
**/
-size_t gnutls_set_max_record_size( GNUTLS_STATE state, size_t size) {
+size_t gnutls_record_set_max_size( GNUTLS_STATE state, size_t size) {
size_t new_size;
if (state->security_parameters.entity==GNUTLS_SERVER)
}
- switch (gnutls_get_auth_type(state)) {
+ switch (gnutls_auth_get_type(state)) {
case GNUTLS_SRP:{
SRP_SERVER_AUTH_INFO info =
_gnutls_get_auth_info(state);
pack_size = PACK_HEADER_SIZE + sizeof(uint32);
- switch ( gnutls_get_auth_type(state)) {
+ switch ( gnutls_auth_get_type(state)) {
case GNUTLS_SRP:
case GNUTLS_ANON:
pack_size += state->gnutls_key->auth_info_size;
/* SRP */
-#define CHECK_AUTH(auth, ret) if (gnutls_get_auth_type(state) != auth) { \
+#define CHECK_AUTH(auth, ret) if (gnutls_auth_get_type(state) != auth) { \
gnutls_assert(); \
return ret; \
}
/* Functions that allow AUTH_INFO structures handling
*/
-CredType gnutls_get_auth_type( GNUTLS_STATE state);
+CredType gnutls_auth_get_type( GNUTLS_STATE state);
/* SRP */
tmp = gnutls_kx_get_name(gnutls_kx_get_algo( state));
printf("- Key Exchange: %s\n", tmp);
- cred = gnutls_get_auth_type(state);
+ cred = gnutls_auth_get_type(state);
switch(cred) {
case GNUTLS_ANON:
printf("- Anonymous DH using prime of %d bits\n",
gnutls_protocol_set_priority( state, protocol_priority);
gnutls_mac_set_priority(state, mac_priority);
- gnutls_set_cred( state, GNUTLS_ANON, anon_cred);
- gnutls_set_cred( state, GNUTLS_SRP, cred);
- gnutls_set_cred( state, GNUTLS_X509PKI, xcred);
+ gnutls_cred_set( state, GNUTLS_ANON, anon_cred);
+ gnutls_cred_set( state, GNUTLS_SRP, cred);
+ gnutls_cred_set( state, GNUTLS_X509PKI, xcred);
/* This TLS extension may break old implementations.
*/
gnutls_protocol_set_priority( state, protocol_priority);
gnutls_mac_set_priority(state, mac_priority);
- gnutls_set_cred( state, GNUTLS_ANON, NULL);
- gnutls_set_cred( state, GNUTLS_SRP, cred);
- gnutls_set_cred( state, GNUTLS_X509PKI, xcred);
+ gnutls_cred_set( state, GNUTLS_ANON, NULL);
+ gnutls_cred_set( state, GNUTLS_SRP, cred);
+ gnutls_cred_set( state, GNUTLS_X509PKI, xcred);
#ifdef RESUME
gnutls_session_set_data( state, session, session_size);
gnutls_protocol_set_priority( state, protocol_priority);
gnutls_mac_set_priority(state, mac_priority);
- gnutls_set_cred(state, GNUTLS_ANON, dh_cred);
- gnutls_set_cred(state, GNUTLS_SRP, srp_cred);
- gnutls_set_cred(state, GNUTLS_X509PKI, x509_cred);
+ gnutls_cred_set(state, GNUTLS_ANON, dh_cred);
+ gnutls_cred_set(state, GNUTLS_SRP, srp_cred);
+ gnutls_cred_set(state, GNUTLS_X509PKI, x509_cred);
gnutls_mac_set_priority(state, mac_priority);
/* we could also use the KX algorithm to distinguish the functions
* to call, but this is easier.
*/
- cred = gnutls_get_auth_type(state);
+ cred = gnutls_auth_get_type(state);
switch(cred) {
case GNUTLS_SRP: