diff options
Diffstat (limited to 'doc/tex')
-rw-r--r-- | doc/tex/ex1.tex | 11 | ||||
-rw-r--r-- | doc/tex/ex2.tex | 9 | ||||
-rw-r--r-- | doc/tex/srp1.tex | 9 |
3 files changed, 17 insertions, 12 deletions
diff --git a/doc/tex/ex1.tex b/doc/tex/ex1.tex index c0a15f6030..891f01f3ce 100644 --- a/doc/tex/ex1.tex +++ b/doc/tex/ex1.tex @@ -73,9 +73,12 @@ int main() gnutls_set_current_session(state, session, session_size); free(session); } + + gnutls_set_transport_ptr( state, sd); + /* Perform the TLS handshake */ - ret = gnutls_handshake(sd, state); + ret = gnutls_handshake( state); if (ret < 0) { fprintf(stderr, "*** Handshake failed\n"); @@ -121,9 +124,9 @@ int main() */ print_info(state); - gnutls_write(sd, state, MSG, strlen(MSG)); + gnutls_write( state, MSG, strlen(MSG)); - 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) { printf("- Peer has closed the GNUTLS connection\n"); @@ -147,7 +150,7 @@ int main() } fputs("\n", stdout); } - gnutls_bye(sd, state, GNUTLS_SHUT_RDWR); + gnutls_bye( state, GNUTLS_SHUT_RDWR); end: diff --git a/doc/tex/ex2.tex b/doc/tex/ex2.tex index 7871a285c9..b8c9637033 100644 --- a/doc/tex/ex2.tex +++ b/doc/tex/ex2.tex @@ -83,9 +83,10 @@ int main() gnutls_set_cred(state, GNUTLS_X509PKI, xcred); + gnutls_set_transport_ptr( state, sd); /* Perform the TLS handshake */ - ret = gnutls_handshake(sd, state); + ret = gnutls_handshake( state); if (ret < 0) { fprintf(stderr, "*** Handshake failed\n"); @@ -95,9 +96,9 @@ int main() printf("- Handshake was completed\n"); } - gnutls_write(sd, state, MSG, strlen(MSG)); + gnutls_write( state, MSG, strlen(MSG)); - 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) { printf("- Peer has closed the GNUTLS connection\n"); @@ -121,7 +122,7 @@ int main() } fputs("\n", stdout); } - gnutls_bye(sd, state, GNUTLS_SHUT_RDWR); + gnutls_bye( state, GNUTLS_SHUT_RDWR); end: diff --git a/doc/tex/srp1.tex b/doc/tex/srp1.tex index 901971df48..365581652a 100644 --- a/doc/tex/srp1.tex +++ b/doc/tex/srp1.tex @@ -79,10 +79,11 @@ int main() */ gnutls_set_cred(state, GNUTLS_SRP, xcred); + gnutls_set_transport_ptr( state, sd); /* Perform the TLS handshake */ - ret = gnutls_handshake(sd, state); + ret = gnutls_handshake( state); if (ret < 0) { fprintf(stderr, "*** Handshake failed\n"); @@ -92,9 +93,9 @@ int main() printf("- Handshake was completed\n"); } - gnutls_write(sd, state, MSG, strlen(MSG)); + gnutls_write( state, MSG, strlen(MSG)); - 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) { printf("- Peer has closed the GNUTLS connection\n"); @@ -118,7 +119,7 @@ int main() } fputs("\n", stdout); } - gnutls_bye(sd, state, 0); + gnutls_bye( state, 0); end: |