]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
examples: mention that gnutls_global_init() is optional
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sun, 6 Jul 2014 16:40:57 +0000 (18:40 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sun, 6 Jul 2014 16:41:00 +0000 (18:41 +0200)
doc/examples/ex-cert-select-pkcs11.c
doc/examples/ex-cert-select.c
doc/examples/ex-client-dtls.c
doc/examples/ex-client-srp.c
doc/examples/ex-client-x509.c
doc/examples/ex-serv-anon.c
doc/examples/ex-serv-pgp.c
doc/examples/ex-serv-psk.c
doc/examples/ex-serv-srp.c
doc/examples/ex-serv-x509.c

index a7f4e7c5c37f1eb65178c00b526e91cd0332ce9a..dd16676e220a5ab1c7434bd8598974b22cba5a48 100644 (file)
@@ -80,14 +80,15 @@ int main(void)
          */
 
         if (gnutls_check_version("3.1.4") == NULL) {
-                fprintf(stderr, "GnuTLS 3.1.4 is required for this example\n");
+                fprintf(stderr, "GnuTLS 3.1.4 or later is required for this example\n");
                 exit(1);
         }
 
+        /* for backwards compatibility with gnutls < 3.3.0 */
         gnutls_global_init();
-        /* PKCS11 private key operations might require PIN.
-         * Register a callback.
-         */
+
+        /* The PKCS11 private key operations may require PIN.
+         * Register a callback. */
         gnutls_pkcs11_set_pin_function(pin_callback, NULL);
 
         /* X509 stuff */
index 7437e269c705c75f74daedc387f877a6f6ccd3fd..4c15f0b4e397b3548626e78a6d4ecaf67768bdc7 100644 (file)
@@ -94,10 +94,11 @@ int main(void)
         gnutls_certificate_credentials_t xcred;
         
         if (gnutls_check_version("3.1.4") == NULL) {
-                fprintf(stderr, "GnuTLS 3.1.4 is required for this example\n");
+                fprintf(stderr, "GnuTLS 3.1.4 or later is required for this example\n");
                 exit(1);
         }
 
+        /* for backwards compatibility with gnutls < 3.3.0 */
         gnutls_global_init();
 
         load_keys();
index dcb0e101dba0058222774abbf4d5149eef8907e3..c417c0dce7ac987ac68b109ae76d2cb41e85e531 100644 (file)
@@ -34,10 +34,11 @@ int main(void)
         gnutls_certificate_credentials_t xcred;
 
         if (gnutls_check_version("3.1.4") == NULL) {
-                fprintf(stderr, "GnuTLS 3.1.4 is required for this example\n");
+                fprintf(stderr, "GnuTLS 3.1.4 or later is required for this example\n");
                 exit(1);
         }
 
+        /* for backwards compatibility with gnutls < 3.3.0 */
         gnutls_global_init();
 
         /* X509 stuff */
index 454272465183cdfffe64436b5426149dd2042a9c..e02328919a75dcd9676fe3bae7df97fa44678115 100644 (file)
@@ -31,10 +31,11 @@ int main(void)
         gnutls_certificate_credentials_t cert_cred;
 
         if (gnutls_check_version("3.1.4") == NULL) {
-                fprintf(stderr, "GnuTLS 3.1.4 is required for this example\n");
+                fprintf(stderr, "GnuTLS 3.1.4 or later is required for this example\n");
                 exit(1);
         }
 
+        /* for backwards compatibility with gnutls < 3.3.0 */
         gnutls_global_init();
 
         gnutls_srp_allocate_client_credentials(&srp_cred);
index 01762e82eaffa34a6e860fd4f4f608af9fd2a8e8..8ee429a1b2f892ce1bee794223f498e51744f6cf 100644 (file)
@@ -33,10 +33,11 @@ int main(void)
         gnutls_certificate_credentials_t xcred;
 
         if (gnutls_check_version("3.1.4") == NULL) {
-                fprintf(stderr, "GnuTLS 3.1.4 is required for this example\n");
+                fprintf(stderr, "GnuTLS 3.1.4 or later is required for this example\n");
                 exit(1);
         }
 
+        /* for backwards compatibility with gnutls < 3.3.0 */
         gnutls_global_init();
 
         /* X509 stuff */
index dc0a55b90b448fc64366c9ce0b62e82b20bcc39c..5c164e3531c6cfc2d6e85ddfd545e3cbed556e17 100644 (file)
@@ -55,10 +55,11 @@ int main(void)
         int optval = 1;
 
         if (gnutls_check_version("3.1.4") == NULL) {
-                fprintf(stderr, "GnuTLS 3.1.4 is required for this example\n");
+                fprintf(stderr, "GnuTLS 3.1.4 or later is required for this example\n");
                 exit(1);
         }
 
+        /* for backwards compatibility with gnutls < 3.3.0 */
         gnutls_global_init();
 
         gnutls_anon_allocate_server_credentials(&anoncred);
index d68a11ca499b4ab8e5c35762595a000d34c65d60..9cd4395d7594f9694605d85eb57253016087600e 100644 (file)
@@ -64,10 +64,11 @@ int main(void)
         strcpy(name, "Echo Server");
 
         if (gnutls_check_version("3.1.4") == NULL) {
-                fprintf(stderr, "GnuTLS 3.1.4 is required for this example\n");
+                fprintf(stderr, "GnuTLS 3.1.4 or later is required for this example\n");
                 exit(1);
         }
 
+        /* for backwards compatibility with gnutls < 3.3.0 */
         gnutls_global_init();
 
         gnutls_certificate_allocate_credentials(&cred);
index c83658bc026c51fb7745979dac9f4693f115ba76..ed61f00d5e98db963ee658cdd2c3f4eea51d8ab5 100644 (file)
@@ -79,10 +79,11 @@ int main(void)
         int kx;
 
         if (gnutls_check_version("3.1.4") == NULL) {
-                fprintf(stderr, "GnuTLS 3.1.4 is required for this example\n");
+                fprintf(stderr, "GnuTLS 3.1.4 or later is required for this example\n");
                 exit(1);
         }
 
+        /* for backwards compatibility with gnutls < 3.3.0 */
         gnutls_global_init();
 
         gnutls_certificate_allocate_credentials(&x509_cred);
index 9f1f58a2e3b000e76fcea508bee50ed002696138..c79ceb20c5e297d45e95e9dd92f2bc79e647f6e0 100644 (file)
@@ -47,10 +47,11 @@ int main(void)
         strcpy(name, "Echo Server");
 
         if (gnutls_check_version("3.1.4") == NULL) {
-                fprintf(stderr, "GnuTLS 3.1.4 is required for this example\n");
+                fprintf(stderr, "GnuTLS 3.1.4 or later is required for this example\n");
                 exit(1);
         }
 
+        /* for backwards compatibility with gnutls < 3.3.0 */
         gnutls_global_init();
 
         /* SRP_PASSWD a password file (created with the included srptool utility) 
index 5380d606a4d27bb62c5e462a0b7ae8ceea2c6fab..69061e633ceb6e9d8237acfd962701739a02b9ae 100644 (file)
@@ -67,8 +67,7 @@ int main(void)
         char buffer[MAX_BUF + 1];
         int optval = 1;
 
-        /* this must be called once in the program
-         */
+        /* for backwards compatibility with gnutls < 3.3.0 */
         gnutls_global_init();
 
         gnutls_certificate_allocate_credentials(&x509_cred);