diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2001-12-06 10:37:23 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2001-12-06 10:37:23 +0000 |
commit | 8a1d4c3c4db78f679e628679c0449f49a0d00a4c (patch) | |
tree | 0483bc1d15a7f8c1e0481f8d5d3a14d604b14dac /doc | |
parent | c393fd8a48c256b7d7cd087190a66dbc87c048e6 (diff) | |
download | gnutls-8a1d4c3c4db78f679e628679c0449f49a0d00a4c.tar.gz |
Several cleanups.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/tex/ex1.tex | 10 | ||||
-rw-r--r-- | doc/tex/ex2.tex | 12 | ||||
-rw-r--r-- | doc/tex/ex3.tex | 12 | ||||
-rw-r--r-- | doc/tex/serv1.tex | 32 | ||||
-rw-r--r-- | doc/tex/srp1.tex | 18 |
5 files changed, 42 insertions, 42 deletions
diff --git a/doc/tex/ex1.tex b/doc/tex/ex1.tex index 8757114919..3ac9d3ebf1 100644 --- a/doc/tex/ex1.tex +++ b/doc/tex/ex1.tex @@ -60,11 +60,11 @@ int main() exit(1); } gnutls_init(&state, GNUTLS_CLIENT); - gnutls_set_protocol_priority(state, GNUTLS_TLS1, GNUTLS_SSL3, 0); - gnutls_set_cipher_priority(state, GNUTLS_3DES_CBC, GNUTLS_ARCFOUR, 0); - gnutls_set_compression_priority(state, GNUTLS_NULL_COMPRESSION, 0); - gnutls_set_kx_priority(state, GNUTLS_KX_RSA, 0); - gnutls_set_mac_priority(state, GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, 0); + gnutls_protocol_set_priority(state, GNUTLS_TLS1, GNUTLS_SSL3, 0); + gnutls_cipher_set_priority(state, GNUTLS_3DES_CBC, GNUTLS_ARCFOUR, 0); + gnutls_compression_set_priority(state, GNUTLS_NULL_COMPRESSION, 0); + gnutls_kx_set_priority(state, GNUTLS_KX_RSA, 0); + gnutls_mac_set_priority(state, GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, 0); gnutls_set_cred(state, GNUTLS_X509PKI, xcred); diff --git a/doc/tex/ex2.tex b/doc/tex/ex2.tex index d68d49f758..e136e0b19c 100644 --- a/doc/tex/ex2.tex +++ b/doc/tex/ex2.tex @@ -58,24 +58,24 @@ int main() /* allow both SSL3 and TLS1 */ - gnutls_set_protocol_priority(state, GNUTLS_TLS1, GNUTLS_SSL3, 0); + gnutls_protocol_set_priority(state, GNUTLS_TLS1, GNUTLS_SSL3, 0); /* allow only ARCFOUR and 3DES ciphers * (3DES has the highest priority) */ - gnutls_set_cipher_priority(state, GNUTLS_3DES_CBC, GNUTLS_ARCFOUR, 0); + gnutls_cipher_set_priority(state, GNUTLS_3DES_CBC, GNUTLS_ARCFOUR, 0); /* only allow null compression */ - gnutls_set_compression_priority(state, GNUTLS_NULL_COMPRESSION, 0); + gnutls_compression_set_priority(state, GNUTLS_NULL_COMPRESSION, 0); /* use GNUTLS_KX_RSA */ - gnutls_set_kx_priority(state, GNUTLS_KX_RSA, 0); + gnutls_kx_set_priority(state, GNUTLS_KX_RSA, 0); /* allow the usage of both SHA and MD5 */ - gnutls_set_mac_priority(state, GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, 0); + gnutls_mac_set_priority(state, GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, 0); /* put the x509 credentials to the current state @@ -83,7 +83,7 @@ int main() gnutls_set_cred(state, GNUTLS_X509PKI, xcred); - gnutls_set_transport_ptr( state, sd); + gnutls_transport_set_ptr( state, sd); /* Perform the TLS handshake */ ret = gnutls_handshake( state); diff --git a/doc/tex/ex3.tex b/doc/tex/ex3.tex index 939fe55f5f..01a3caf008 100644 --- a/doc/tex/ex3.tex +++ b/doc/tex/ex3.tex @@ -15,7 +15,7 @@ int print_info(GNUTLS_STATE state) /* print the key exchange's algorithm name */ - tmp = gnutls_kx_get_name(gnutls_get_current_kx(state)); + tmp = gnutls_kx_get_name( gnutls_kx_get_algo( state)); printf("- Key Exchange: %s\n", tmp); /* in case of X509 PKI @@ -27,7 +27,7 @@ int print_info(GNUTLS_STATE state) CertificateStatus status; KXAlgorithm kx; - kx = gnutls_get_current_kx(state); + kx = gnutls_kx_get_algo(state); /* Check if we have been using ephemeral Diffie Hellman. */ @@ -72,16 +72,16 @@ int print_info(GNUTLS_STATE state) } } - tmp = gnutls_version_get_name(gnutls_get_current_version( state)); + tmp = gnutls_protocol_get_name( gnutls_protocol_get_version( state)); printf("- Version: %s\n", tmp); - tmp = gnutls_compression_get_name(gnutls_get_current_compression_method( state)); + tmp = gnutls_compression_get_name( gnutls_compression_get_algo( state)); printf("- Compression: %s\n", tmp); - tmp = gnutls_cipher_get_name(gnutls_get_current_cipher( state)); + tmp = gnutls_cipher_get_name( gnutls_cipher_get_algo( state)); printf("- Cipher: %s\n", tmp); - tmp = gnutls_mac_get_name(gnutls_get_current_mac_algorithm( state)); + tmp = gnutls_mac_get_name(gnutls_mac_get_algo( state)); printf("- MAC: %s\n", tmp); return 0; diff --git a/doc/tex/serv1.tex b/doc/tex/serv1.tex index fc20046606..8a36d7a159 100644 --- a/doc/tex/serv1.tex +++ b/doc/tex/serv1.tex @@ -45,11 +45,11 @@ GNUTLS_STATE initialize_state() if ((ret = gnutls_db_set_name(state, "gnutls-rsm.db")) < 0) fprintf(stderr, "*** DB error (%d)\n\n", ret); - gnutls_set_cipher_priority(state, GNUTLS_RIJNDAEL_CBC, GNUTLS_3DES_CBC, 0); - gnutls_set_compression_priority(state, GNUTLS_ZLIB, GNUTLS_NULL_COMPRESSION, 0); - gnutls_set_kx_priority(state, GNUTLS_KX_RSA, GNUTLS_KX_SRP, 0); - gnutls_set_protocol_priority(state, GNUTLS_TLS1, GNUTLS_SSL3, 0); - gnutls_set_mac_priority(state, GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, 0); + gnutls_cipher_set_priority(state, GNUTLS_RIJNDAEL_CBC, GNUTLS_3DES_CBC, 0); + gnutls_compression_set_priority(state, GNUTLS_ZLIB, GNUTLS_NULL_COMPRESSION, 0); + gnutls_kx_set_priority(state, GNUTLS_KX_RSA, GNUTLS_KX_SRP, 0); + gnutls_protocol_set_priority(state, GNUTLS_TLS1, GNUTLS_SSL3, 0); + gnutls_mac_set_priority(state, GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, 0); gnutls_set_cred(state, GNUTLS_SRP, srp_cred); gnutls_set_cred(state, GNUTLS_X509PKI, x509_cred); @@ -68,7 +68,7 @@ void print_info(GNUTLS_STATE state) int sesid_size, i; /* print session_id specific data */ - gnutls_get_session_get_id(state, sesid, &sesid_size); + gnutls_session_get_id(state, sesid, &sesid_size); printf("\n- Session ID: "); for (i = 0; i < sesid_size; i++) printf("%.2X", sesid[i]); @@ -81,21 +81,21 @@ void print_info(GNUTLS_STATE state) } /* print state information */ - tmp = gnutls_version_get_name(gnutls_get_current_version(state)); + tmp = gnutls_protocol_get_name(gnutls_protocol_get_version(state)); printf("- Version: %s\n", tmp); - tmp = gnutls_kx_get_name(gnutls_get_current_kx(state)); + tmp = gnutls_kx_get_name(gnutls_kx_get_algo(state)); printf("- Key Exchange: %s\n", tmp); tmp = gnutls_compression_get_name - (gnutls_get_current_compression_method(state)); + (gnutls_compression_get_algo(state)); printf("- Compression: %s\n", tmp); - tmp = gnutls_cipher_get_name(gnutls_get_current_cipher(state)); + tmp = gnutls_cipher_get_name(gnutls_cipher_get_algo(state)); printf("- Cipher: %s\n", tmp); - tmp = gnutls_mac_get_name(gnutls_get_current_mac_algorithm(state)); + tmp = gnutls_mac_get_name(gnutls_mac_get_algo(state)); printf("- MAC: %s\n", tmp); } @@ -172,8 +172,8 @@ int main() inet_ntop(AF_INET, &sa_cli.sin_addr, topbuf, sizeof(topbuf)), ntohs(sa_cli.sin_port)); - - ret = gnutls_handshake(sd, state); + gnutls_transport_set_ptr( state, sd); + ret = gnutls_handshake( state); if (ret < 0) { close(sd); gnutls_deinit(state); @@ -188,7 +188,7 @@ int main() i = 0; for (;;) { bzero(buffer, MAX_BUF + 1); - ret = gnutls_read(sd, state, buffer, MAX_BUF); + ret = gnutls_read( state, buffer, MAX_BUF); if (gnutls_is_fatal_error(ret) == 1 || ret == 0) { if (ret == 0) { @@ -206,7 +206,7 @@ int main() if (ret > 0) { /* echo data back to the client */ - gnutls_write(sd, state, buffer, + gnutls_write( state, buffer, strlen(buffer)); } if (ret == GNUTLS_E_WARNING_ALERT_RECEIVED || ret == GNUTLS_E_FATAL_ALERT_RECEIVED) { @@ -215,7 +215,7 @@ int main() } } printf("\n"); - gnutls_bye(sd, state, 1); /* do not wait for + gnutls_bye( state, 1); /* do not wait for * the peer to close the connection. */ diff --git a/doc/tex/srp1.tex b/doc/tex/srp1.tex index 365581652a..cbbcf5d779 100644 --- a/doc/tex/srp1.tex +++ b/doc/tex/srp1.tex @@ -29,11 +29,11 @@ int main() fprintf(stderr, "global state initialization error\n"); exit(1); } - if (gnutls_allocate_srp_client_sc(&xcred) < 0) { + if (gnutls_srp_allocate_client_sc(&xcred) < 0) { fprintf(stderr, "memory error\n"); exit(1); } - gnutls_set_srp_client_cred(xcred, USERNAME, PASSWORD); + gnutls_srp_set_client_cred(xcred, USERNAME, PASSWORD); /* connects to server */ @@ -55,31 +55,31 @@ int main() /* allow both SSL3 and TLS1 */ - gnutls_set_protocol_priority(state, GNUTLS_TLS1, GNUTLS_SSL3, 0); + gnutls_protocol_set_priority(state, GNUTLS_TLS1, GNUTLS_SSL3, 0); /* allow only ARCFOUR and 3DES ciphers * (3DES has the highest priority) */ - gnutls_set_cipher_priority(state, GNUTLS_3DES_CBC, GNUTLS_ARCFOUR, 0); + gnutls_cipher_set_priority(state, GNUTLS_3DES_CBC, GNUTLS_ARCFOUR, 0); /* only allow null compression */ - gnutls_set_compression_priority(state, GNUTLS_NULL_COMPRESSION, 0); + gnutls_compression_set_priority(state, GNUTLS_NULL_COMPRESSION, 0); /* use GNUTLS_KX_RSA */ - gnutls_set_kx_priority(state, GNUTLS_KX_SRP, 0); + gnutls_kx_set_priority(state, GNUTLS_KX_SRP, 0); /* allow the usage of both SHA and MD5 */ - gnutls_set_mac_priority(state, GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, 0); + gnutls_mac_set_priority(state, GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, 0); /* put the SRP credentials to the current state */ gnutls_set_cred(state, GNUTLS_SRP, xcred); - gnutls_set_transport_ptr( state, sd); + gnutls_transport_set_ptr( state, sd); /* Perform the TLS handshake */ @@ -128,7 +128,7 @@ int main() gnutls_deinit(state); - gnutls_free_srp_client_sc(xcred); + gnutls_srp_free_client_sc(xcred); gnutls_global_deinit(); |