From 6f2aee32522a5d88987d9fef9bb98f80231d60a5 Mon Sep 17 00:00:00 2001 From: fredkiefer Date: Mon, 2 Jan 2012 15:50:15 +0000 Subject: [PATCH] * Source/GSSocketStream.m (-initWithInput:output:): Attempt to replace deprecated GNUTLS functions with newer ones for GNUTLS >= 2.12. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34390 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/GSSocketStream.m | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/ChangeLog b/ChangeLog index f3a0ae40c..1e4f2bb7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-01-02 Fred Kiefer + + * Source/GSSocketStream.m (-initWithInput:output:): Attempt to + replace deprecated GNUTLS functions with newer ones for GNUTLS >= 2.12. + 2012-01-02 Fred Kiefer * Source/NSArray.m (-objectsAtIndexes:): Fix comparision of diff --git a/Source/GSSocketStream.m b/Source/GSSocketStream.m index a42a3a2d7..a5a2b39da 100644 --- a/Source/GSSocketStream.m +++ b/Source/GSSocketStream.m @@ -656,6 +656,7 @@ static gnutls_anon_client_credentials_t anoncred; if ([proto isEqualToString: NSStreamSocketSecurityLevelTLSv1] == YES) { +#if GNUTLS_VERSION_NUMBER < 0x020C00 const int proto_prio[4] = { #if defined(GNUTLS_TLS1_2) GNUTLS_TLS1_2, @@ -664,13 +665,20 @@ static gnutls_anon_client_credentials_t anoncred; GNUTLS_TLS1_0, 0 }; gnutls_protocol_set_priority (session, proto_prio); +#else + gnutls_priority_set_direct(session, "NORMAL:-VERS-SSL3.0:+VERS-TLS-ALL", NULL); +#endif } if ([proto isEqualToString: NSStreamSocketSecurityLevelSSLv3] == YES) { +#if GNUTLS_VERSION_NUMBER < 0x020C00 const int proto_prio[2] = { GNUTLS_SSL3, 0 }; gnutls_protocol_set_priority (session, proto_prio); +#else + gnutls_priority_set_direct(session, "NORMAL:-VERS-TLS-ALL:+VERS-SSL3.0", NULL); +#endif } /* @@ -693,7 +701,9 @@ static gnutls_anon_client_credentials_t anoncred; /* Set transport layer to use our low level stream code. */ +#if GNUTLS_VERSION_NUMBER < 0x020C00 gnutls_transport_set_lowat (session, 0); +#endif gnutls_transport_set_pull_function (session, GSTLSPull); gnutls_transport_set_push_function (session, GSTLSPush); gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t)self);