~nutznboltz-deactivatedaccount/ubuntu/precise/gnutls26/fix-lp926350

« back to all changes in this revision

Viewing changes to doc/examples/ex-client-srp.c

  • Committer: Package Import Robot
  • Author(s): Andreas Metzler
  • Date: 2011-10-01 15:28:13 UTC
  • mfrom: (12.1.20 sid)
  • Revision ID: package-import@ubuntu.com-20111001152813-yygm1c4cxonfxhzy
Tags: 2.12.11-1
* New upstream version.
  + Allow CA importing of 0 certificates to succeed. Closes: #640639
* Add libp11-kit-dev to libgnutls-dev dependencies. (see #643811)
* [20_guiledocstring.diff] guile: Fix docstring extraction with CPP 4.5+.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* This example code is placed in the public domain. */
2
2
 
3
3
#ifdef HAVE_CONFIG_H
4
 
# include <config.h>
 
4
#include <config.h>
5
5
#endif
6
6
 
7
7
#include <stdio.h>
43
43
  gnutls_certificate_allocate_credentials (&cert_cred);
44
44
 
45
45
  gnutls_certificate_set_x509_trust_file (cert_cred, CAFILE,
46
 
                                          GNUTLS_X509_FMT_PEM);
 
46
                                          GNUTLS_X509_FMT_PEM);
47
47
  gnutls_srp_set_client_credentials (srp_cred, USERNAME, PASSWORD);
48
48
 
49
49
  /* connects to server
87
87
  if (gnutls_error_is_fatal (ret) == 1 || ret == 0)
88
88
    {
89
89
      if (ret == 0)
90
 
        {
91
 
          printf ("- Peer has closed the GnuTLS connection\n");
92
 
          goto end;
93
 
        }
 
90
        {
 
91
          printf ("- Peer has closed the GnuTLS connection\n");
 
92
          goto end;
 
93
        }
94
94
      else
95
 
        {
96
 
          fprintf (stderr, "*** Error: %s\n", gnutls_strerror (ret));
97
 
          goto end;
98
 
        }
 
95
        {
 
96
          fprintf (stderr, "*** Error: %s\n", gnutls_strerror (ret));
 
97
          goto end;
 
98
        }
99
99
    }
100
100
  else
101
101
    check_alert (session, ret);
104
104
    {
105
105
      printf ("- Received %d bytes: ", ret);
106
106
      for (ii = 0; ii < ret; ii++)
107
 
        {
108
 
          fputc (buffer[ii], stdout);
109
 
        }
 
107
        {
 
108
          fputc (buffer[ii], stdout);
 
109
        }
110
110
      fputs ("\n", stdout);
111
111
    }
112
112
  gnutls_bye (session, GNUTLS_SHUT_RDWR);