[gnutls-devel] Documentation/examples/ex-serv-anon.c does not set priority correctly

Sowmini Varadhan sowmini.varadhan at oracle.com
Wed Aug 26 02:01:39 CEST 2015



When I run the ex-serv-anon example, it errors out in
gnulls_priority_set_direct because it passes in a bad string.

The correct string is:

diff --git a/doc/examples/ex-serv-anon.c b/doc/examples/ex-serv-anon.c
index 5c164e3..abb4af5 100644
--- a/doc/examples/ex-serv-anon.c
+++ b/doc/examples/ex-serv-anon.c
@@ -93,7 +93,7 @@ int main(void)
          for (;;) {
                  gnutls_init(&session, GNUTLS_SERVER);
                  gnutls_priority_set_direct(session,
-                                           "NORMAL::+ANON-ECDH:+ANON-DH",
+                                           "NORMAL:+ANON-ECDH:+ANON-DH",
                                             NULL);
                  gnutls_credentials_set(session, GNUTLS_CRD_ANON, 
anoncred);


A separate error i sthat the example does not check if
gnutls_priority_set_direct() succeeded. It should probably do so.

--Sowmini



More information about the Gnutls-devel mailing list