]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
gnutls_set_max_record_size -> gnutls_record_set_max_size
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 17 Dec 2001 15:13:22 +0000 (15:13 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 17 Dec 2001 15:13:22 +0000 (15:13 +0000)
gnutls_get_max_record_size -> gnutls_record_get_max_size
gnutls_set_cred -> gnutls_cred_set
gnutls_get_auth_type -> gnutls_auth_get_type

21 files changed:
doc/tex/ex1.tex
doc/tex/ex2.tex
doc/tex/ex3.tex
doc/tex/serv1.tex
doc/tex/srp1.tex
lib/auth_anon.c
lib/auth_dhe_rsa.c
lib/auth_srp.c
lib/auth_x509.c
lib/gnutls.h.in
lib/gnutls_auth.c
lib/gnutls_auth_int.h
lib/gnutls_handshake.c
lib/gnutls_handshake.h
lib/gnutls_int.h
lib/gnutls_record.c
lib/gnutls_session_pack.c
lib/gnutls_ui.c
lib/gnutls_ui.h
src/cli.c
src/serv.c

index 8a70920597070fd4106a3fb6a4c3645dbef6cbe9..87b9d7239434bff62a8b8607fa1062e25ee6109d 100644 (file)
@@ -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);
index e58c502f2f23ec5b9071008a45e94002e16ce6ee..ba68217f0bd14841da2ba9e3e3b67193847cbbd2 100644 (file)
@@ -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);
index 7709b399485b8782f5cc0ab21479170d14f1e78a..4af335ed077027851e8174921235eb6e98624ce9 100644 (file)
@@ -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;
index a3b6d42025b250ec56ff2b4891a4e47a355e44aa..8becfb9b6a1f5eabc7a8d41ceb77beefa24f3a8e 100644 (file)
@@ -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.
     */
index 9043be15ffdc34f7c943d44603d50bc7ab7f755b..6f4a4272bec233c5486203cca3783f960e710f8f 100644 (file)
@@ -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);
 
index dda3c275c66d0ba30fc6ae6a9883ae3cbfa5d7ca..54fee1a93e37e8730a601d5a6c09e969eba9a4b6 100644 (file)
@@ -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;
                }                                                                                       
index 66bc530eaced018d628cf4772a6dacf00f4493af..b9cb10b37381610e202f664b9b1b26db7831787d 100644 (file)
@@ -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;
index a2aa05a60bb0c2cffe07dffadfd9d02fe0bb4ca7..61f077baf9c2d3e60d4bccd41954ccc47b3acf67 100644 (file)
@@ -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;
                }                                                                                       
index 60dcf766a0ad5f9f50b94593822125cd67944e7c..e8cb2540f180b5cd24b2aa358cc7a73e25b774fa 100644 (file)
@@ -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; \
        }
index d45c54b726bd9bdf19edf8a10e17dc6cf238ffef..906d1ab611ece3f0c343e87c9b625f49145a9025 100644 (file)
@@ -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);
 
index 7356b2aefefa44305e94ec64cf71707bf72dfae8..f2004dc0fada9cade8ab32acb3d1d6ea45d6f8e8 100644 (file)
@@ -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
index 0bb10c13a15113df574f5db099fc3aa67a30965c..2e46c54d064ed6af32184f41eaf590611cadcd2d 100644 (file)
@@ -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);
index 4ba8461e884e40a262c236c601839349902720fd..ac0db46c16b105417d512e21b85827300473a83a 100644 (file)
@@ -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;
 }
index d09c7a362a65e8efafe458b25c45e9b4a57a4f25..ad8359b4178bde712685a9da9da91a3d68105a13 100644 (file)
@@ -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; \
index d97de9e3ac7cfe33e299abb7ab2557fa96de4810..926ab44ce126a600e924138ff62c5d63be80ff47 100644 (file)
@@ -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.
index 6952964a213368dcb56ab227999b9583e20d7f43..d831b13d6278fad40f71a51ccd069ba7838d0bae 100644 (file)
@@ -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)
index 18116d21c2a0ad178c387de6fabc8845a974d25b..da5cfad1d959710c4ae05b78ad51feebed107b47 100644 (file)
@@ -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;
index a2f4ae0032f61125ad2a25a2668a1823e3390198..d6391adb80af3de024db389a9711ff9ef9a79a9c 100644 (file)
@@ -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; \
        }
index 992344a31a3e23dc64b19c53dd99c93e6e363c7d..5759276b97aba8fb89c9c01ef0b6b76fc3f8218a 100644 (file)
@@ -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 */
 
index 26d38af15c198584bc3301bf7eeba78975ca54f7..7e5e4698ea9180464e801f0c1f87052f3425283d 100644 (file)
--- 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);
index 1206a83d5c7f8fa0aded8630b925ef6df76575bb..5da35b43c611843737d84c733f811816fa21318e 100644 (file)
@@ -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: