mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Fixes to build again when tls is disabled
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38265 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
076f856b01
commit
401cdce4d2
3 changed files with 62 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
|||
2014-12-28 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/GSSocketStream.m: Add necessary GSTLSHandler methods when
|
||||
TLS is disabled.
|
||||
* Source/GSTLS.m (standardizedPath): Define private function only
|
||||
when TLS is enabled.
|
||||
|
||||
2014-12-23 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSTimeZone.m:
|
||||
|
|
|
@ -729,6 +729,59 @@ static NSArray *keys = nil;
|
|||
@interface GSTLSHandler : GSStreamHandler
|
||||
@end
|
||||
@implementation GSTLSHandler
|
||||
|
||||
static NSArray *keys = nil;
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
if (nil == keys)
|
||||
{
|
||||
keys = [[NSArray alloc] initWithObjects:
|
||||
GSTLSCAFile,
|
||||
GSTLSCertificateFile,
|
||||
GSTLSCertificateKeyFile,
|
||||
GSTLSCertificateKeyPassword,
|
||||
GSTLSDebug,
|
||||
GSTLSPriority,
|
||||
GSTLSRemoteHosts,
|
||||
GSTLSRevokeFile,
|
||||
GSTLSVerify,
|
||||
nil];
|
||||
[[NSObject leakAt: &keys] release];
|
||||
}
|
||||
}
|
||||
|
||||
+ (void) populateProperties: (NSMutableDictionary**)dict
|
||||
withTLSPriority: (NSString*)pri
|
||||
fromInputStream: (NSStream*)i
|
||||
orOutputStream: (NSStream*)o
|
||||
{
|
||||
NSString *str;
|
||||
NSMutableDictionary *opts = *dict;
|
||||
NSUInteger count;
|
||||
|
||||
if (NULL != dict)
|
||||
{
|
||||
if (nil != pri)
|
||||
{
|
||||
[opts setObject: pri forKey: GSTLSPriority];
|
||||
}
|
||||
count = [keys count];
|
||||
while (count-- > 0)
|
||||
{
|
||||
NSString *key = [keys objectAtIndex: count];
|
||||
|
||||
str = [o propertyForKey: key];
|
||||
if (nil == str) str = [i propertyForKey: key];
|
||||
if (nil != str) [opts setObject: str forKey: key];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NSWarnLog(@"%@ requires not nil 'dict'", NSStringFromSelector(_cmd));
|
||||
}
|
||||
}
|
||||
|
||||
+ (void) tryInput: (GSSocketInputStream*)i output: (GSSocketOutputStream*)o
|
||||
{
|
||||
NSString *tls;
|
||||
|
|
|
@ -54,6 +54,8 @@ NSString * const GSTLSRemoteHosts = @"GSTLSRemoteHosts";
|
|||
NSString * const GSTLSRevokeFile = @"GSTLSRevokeFile";
|
||||
NSString * const GSTLSVerify = @"GSTLSVerify";
|
||||
|
||||
#if defined(HAVE_GNUTLS)
|
||||
|
||||
static NSString *
|
||||
standardizedPath(NSString *path)
|
||||
{
|
||||
|
@ -69,8 +71,6 @@ standardizedPath(NSString *path)
|
|||
return [path stringByStandardizingPath];
|
||||
}
|
||||
|
||||
#if defined(HAVE_GNUTLS)
|
||||
|
||||
#if GNUTLS_VERSION_NUMBER <= 0x020b00
|
||||
/* Set up locking callbacks for gcrypt so that it will be thread-safe.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue