summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2014-07-06 18:40:57 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2014-07-06 18:41:00 +0200
commit6975e79daabd9d694713b526f3944bd4cc578263 (patch)
treeea156cdfccd88e091171e86993565411038405b8 /doc
parent5bb07af6e661e7dc48ac0ff0bc91bbb8a4a2c213 (diff)
downloadgnutls-6975e79daabd9d694713b526f3944bd4cc578263.tar.gz
examples: mention that gnutls_global_init() is optional
Diffstat (limited to 'doc')
-rw-r--r--doc/examples/ex-cert-select-pkcs11.c9
-rw-r--r--doc/examples/ex-cert-select.c3
-rw-r--r--doc/examples/ex-client-dtls.c3
-rw-r--r--doc/examples/ex-client-srp.c3
-rw-r--r--doc/examples/ex-client-x509.c3
-rw-r--r--doc/examples/ex-serv-anon.c3
-rw-r--r--doc/examples/ex-serv-pgp.c3
-rw-r--r--doc/examples/ex-serv-psk.c3
-rw-r--r--doc/examples/ex-serv-srp.c3
-rw-r--r--doc/examples/ex-serv-x509.c3
10 files changed, 22 insertions, 14 deletions
diff --git a/doc/examples/ex-cert-select-pkcs11.c b/doc/examples/ex-cert-select-pkcs11.c
index a7f4e7c5c3..dd16676e22 100644
--- a/doc/examples/ex-cert-select-pkcs11.c
+++ b/doc/examples/ex-cert-select-pkcs11.c
@@ -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 */
diff --git a/doc/examples/ex-cert-select.c b/doc/examples/ex-cert-select.c
index 7437e269c7..4c15f0b4e3 100644
--- a/doc/examples/ex-cert-select.c
+++ b/doc/examples/ex-cert-select.c
@@ -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();
diff --git a/doc/examples/ex-client-dtls.c b/doc/examples/ex-client-dtls.c
index dcb0e101db..c417c0dce7 100644
--- a/doc/examples/ex-client-dtls.c
+++ b/doc/examples/ex-client-dtls.c
@@ -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 */
diff --git a/doc/examples/ex-client-srp.c b/doc/examples/ex-client-srp.c
index 4542724651..e02328919a 100644
--- a/doc/examples/ex-client-srp.c
+++ b/doc/examples/ex-client-srp.c
@@ -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);
diff --git a/doc/examples/ex-client-x509.c b/doc/examples/ex-client-x509.c
index 01762e82ea..8ee429a1b2 100644
--- a/doc/examples/ex-client-x509.c
+++ b/doc/examples/ex-client-x509.c
@@ -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 */
diff --git a/doc/examples/ex-serv-anon.c b/doc/examples/ex-serv-anon.c
index dc0a55b90b..5c164e3531 100644
--- a/doc/examples/ex-serv-anon.c
+++ b/doc/examples/ex-serv-anon.c
@@ -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);
diff --git a/doc/examples/ex-serv-pgp.c b/doc/examples/ex-serv-pgp.c
index d68a11ca49..9cd4395d75 100644
--- a/doc/examples/ex-serv-pgp.c
+++ b/doc/examples/ex-serv-pgp.c
@@ -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);
diff --git a/doc/examples/ex-serv-psk.c b/doc/examples/ex-serv-psk.c
index c83658bc02..ed61f00d5e 100644
--- a/doc/examples/ex-serv-psk.c
+++ b/doc/examples/ex-serv-psk.c
@@ -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);
diff --git a/doc/examples/ex-serv-srp.c b/doc/examples/ex-serv-srp.c
index 9f1f58a2e3..c79ceb20c5 100644
--- a/doc/examples/ex-serv-srp.c
+++ b/doc/examples/ex-serv-srp.c
@@ -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)
diff --git a/doc/examples/ex-serv-x509.c b/doc/examples/ex-serv-x509.c
index 5380d606a4..69061e633c 100644
--- a/doc/examples/ex-serv-x509.c
+++ b/doc/examples/ex-serv-x509.c
@@ -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);