summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2001-12-17 15:13:22 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2001-12-17 15:13:22 +0000
commit043cf8063a09b053ac71cba414c0c03438db596d (patch)
treee490ed02726b8ebafa0d61bcee74314433172529
parentc54fd6d29a583cf0827f910e4029d5a24b9ff550 (diff)
downloadgnutls-043cf8063a09b053ac71cba414c0c03438db596d.tar.gz
gnutls_set_max_record_size -> gnutls_record_set_max_size
gnutls_get_max_record_size -> gnutls_record_get_max_size gnutls_set_cred -> gnutls_cred_set gnutls_get_auth_type -> gnutls_auth_get_type
-rw-r--r--doc/tex/ex1.tex2
-rw-r--r--doc/tex/ex2.tex2
-rw-r--r--doc/tex/ex3.tex2
-rw-r--r--doc/tex/serv1.tex4
-rw-r--r--doc/tex/srp1.tex2
-rw-r--r--lib/auth_anon.c2
-rw-r--r--lib/auth_dhe_rsa.c2
-rw-r--r--lib/auth_srp.c2
-rw-r--r--lib/auth_x509.c4
-rw-r--r--lib/gnutls.h.in8
-rw-r--r--lib/gnutls_auth.c8
-rw-r--r--lib/gnutls_auth_int.h4
-rw-r--r--lib/gnutls_handshake.c4
-rw-r--r--lib/gnutls_handshake.h2
-rw-r--r--lib/gnutls_int.h3
-rw-r--r--lib/gnutls_record.c12
-rw-r--r--lib/gnutls_session_pack.c4
-rw-r--r--lib/gnutls_ui.c2
-rw-r--r--lib/gnutls_ui.h2
-rw-r--r--src/cli.c14
-rw-r--r--src/serv.c8
21 files changed, 46 insertions, 47 deletions
diff --git a/doc/tex/ex1.tex b/doc/tex/ex1.tex
index 8a70920597..87b9d72394 100644
--- a/doc/tex/ex1.tex
+++ b/doc/tex/ex1.tex
@@ -73,7 +73,7 @@ int main()
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);
diff --git a/doc/tex/ex2.tex b/doc/tex/ex2.tex
index e58c502f2f..ba68217f0b 100644
--- a/doc/tex/ex2.tex
+++ b/doc/tex/ex2.tex
@@ -86,7 +86,7 @@ int main()
/* 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);
diff --git a/doc/tex/ex3.tex b/doc/tex/ex3.tex
index 7709b39948..4af335ed07 100644
--- a/doc/tex/ex3.tex
+++ b/doc/tex/ex3.tex
@@ -20,7 +20,7 @@ int print_info(GNUTLS_STATE state)
/* 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;
diff --git a/doc/tex/serv1.tex b/doc/tex/serv1.tex
index a3b6d42025..8becfb9b6a 100644
--- a/doc/tex/serv1.tex
+++ b/doc/tex/serv1.tex
@@ -56,8 +56,8 @@ GNUTLS_STATE initialize_state()
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.
*/
diff --git a/doc/tex/srp1.tex b/doc/tex/srp1.tex
index 9043be15ff..6f4a4272be 100644
--- a/doc/tex/srp1.tex
+++ b/doc/tex/srp1.tex
@@ -83,7 +83,7 @@ int main()
/* 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);
diff --git a/lib/auth_anon.c b/lib/auth_anon.c
index dda3c275c6..54fee1a93e 100644
--- a/lib/auth_anon.c
+++ b/lib/auth_anon.c
@@ -93,7 +93,7 @@ int gen_anon_server_kx( GNUTLS_STATE state, opaque** data) {
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;
}
diff --git a/lib/auth_dhe_rsa.c b/lib/auth_dhe_rsa.c
index 66bc530eac..b9cb10b373 100644
--- a/lib/auth_dhe_rsa.c
+++ b/lib/auth_dhe_rsa.c
@@ -102,7 +102,7 @@ static int gen_dhe_rsa_server_kx(GNUTLS_STATE state, opaque ** data)
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;
diff --git a/lib/auth_srp.c b/lib/auth_srp.c
index a2aa05a60b..61f077baf9 100644
--- a/lib/auth_srp.c
+++ b/lib/auth_srp.c
@@ -80,7 +80,7 @@ int gen_srp_server_hello(GNUTLS_STATE state, opaque ** data)
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;
}
diff --git a/lib/auth_x509.c b/lib/auth_x509.c
index 60dcf766a0..e8cb2540f1 100644
--- a/lib/auth_x509.c
+++ b/lib/auth_x509.c
@@ -498,7 +498,7 @@ int _gnutls_proc_x509_server_certificate(GNUTLS_STATE state, opaque * data,
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;
@@ -926,7 +926,7 @@ int _gnutls_find_apr_cert(GNUTLS_STATE state, gnutls_cert ** apr_cert_list,
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; \
}
diff --git a/lib/gnutls.h.in b/lib/gnutls.h.in
index d45c54b726..906d1ab611 100644
--- a/lib/gnutls.h.in
+++ b/lib/gnutls.h.in
@@ -152,7 +152,7 @@ void gnutls_db_set_ptr( GNUTLS_STATE, void* db_ptr);
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();
@@ -160,7 +160,7 @@ 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
@@ -240,6 +240,6 @@ typedef void (*LOG_FUNC)( const char*);
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);
diff --git a/lib/gnutls_auth.c b/lib/gnutls_auth.c
index 7356b2aefe..f2004dc0fa 100644
--- a/lib/gnutls_auth.c
+++ b/lib/gnutls_auth.c
@@ -53,7 +53,7 @@ int gnutls_clear_creds( GNUTLS_STATE state) {
* { 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.
@@ -78,7 +78,7 @@ int gnutls_clear_creds( GNUTLS_STATE state) {
* 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;
@@ -124,7 +124,7 @@ int gnutls_set_cred( GNUTLS_STATE state, CredType type, void* cred) {
}
/**
- * 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.
@@ -135,7 +135,7 @@ int gnutls_set_cred( GNUTLS_STATE state, CredType type, void* cred) {
* 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
diff --git a/lib/gnutls_auth_int.h b/lib/gnutls_auth_int.h
index 0bb10c13a1..2e46c54d06 100644
--- a/lib/gnutls_auth_int.h
+++ b/lib/gnutls_auth_int.h
@@ -1,7 +1,7 @@
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);
diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c
index 4ba8461e88..ac0db46c16 100644
--- a/lib/gnutls_handshake.c
+++ b/lib/gnutls_handshake.c
@@ -2257,7 +2257,7 @@ int _gnutls_remove_unwanted_ciphersuites(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.
*
@@ -2268,7 +2268,7 @@ int _gnutls_remove_unwanted_ciphersuites(GNUTLS_STATE state,
* 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;
}
diff --git a/lib/gnutls_handshake.h b/lib/gnutls_handshake.h
index d09c7a362a..ad8359b417 100644
--- a/lib/gnutls_handshake.h
+++ b/lib/gnutls_handshake.h
@@ -35,7 +35,7 @@ void _gnutls_set_server_random( GNUTLS_STATE state, uint8* random);
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; \
diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h
index d97de9e3ac..926ab44ce1 100644
--- a/lib/gnutls_int.h
+++ b/lib/gnutls_int.h
@@ -31,9 +31,8 @@
#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.
diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c
index 6952964a21..d831b13d62 100644
--- a/lib/gnutls_record.c
+++ b/lib/gnutls_record.c
@@ -141,9 +141,9 @@ int default_protocol_list[] = { GNUTLS_TLS1, 0 };
(*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
@@ -1180,7 +1180,7 @@ ssize_t gnutls_read( GNUTLS_STATE state, void *data, size_t sizeofdata) {
}
/**
- * 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.
@@ -1188,13 +1188,13 @@ ssize_t gnutls_read( GNUTLS_STATE state, void *data, size_t sizeofdata) {
* 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
*
@@ -1211,7 +1211,7 @@ size_t gnutls_get_max_record_size( GNUTLS_STATE state) {
* 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)
diff --git a/lib/gnutls_session_pack.c b/lib/gnutls_session_pack.c
index 18116d21c2..da5cfad1d9 100644
--- a/lib/gnutls_session_pack.c
+++ b/lib/gnutls_session_pack.c
@@ -50,7 +50,7 @@ int _gnutls_session_pack(GNUTLS_STATE state, gnutls_datum * packed_session)
}
- 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);
@@ -141,7 +141,7 @@ int _gnutls_session_size( GNUTLS_STATE 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;
diff --git a/lib/gnutls_ui.c b/lib/gnutls_ui.c
index a2f4ae0032..d6391adb80 100644
--- a/lib/gnutls_ui.c
+++ b/lib/gnutls_ui.c
@@ -27,7 +27,7 @@
/* 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; \
}
diff --git a/lib/gnutls_ui.h b/lib/gnutls_ui.h
index 992344a31a..5759276b97 100644
--- a/lib/gnutls_ui.h
+++ b/lib/gnutls_ui.h
@@ -44,7 +44,7 @@ typedef int x509pki_server_cert_callback_func(GNUTLS_STATE, const gnutls_datum *
/* Functions that allow AUTH_INFO structures handling
*/
-CredType gnutls_get_auth_type( GNUTLS_STATE state);
+CredType gnutls_auth_get_type( GNUTLS_STATE state);
/* SRP */
diff --git a/src/cli.c b/src/cli.c
index 26d38af15c..7e5e4698ea 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -64,7 +64,7 @@ int cert_list_size = 0;
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",
@@ -242,9 +242,9 @@ int main(int argc, char** argv)
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.
*/
@@ -303,9 +303,9 @@ int main(int argc, char** argv)
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);
diff --git a/src/serv.c b/src/serv.c
index 1206a83d5c..5da35b43c6 100644
--- a/src/serv.c
+++ b/src/serv.c
@@ -94,9 +94,9 @@ GNUTLS_STATE initialize_state()
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);
@@ -127,7 +127,7 @@ void print_info(GNUTLS_STATE state)
/* 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: