Index: src/SSLInvalidCertificateException.m ================================================================== --- src/SSLInvalidCertificateException.m +++ src/SSLInvalidCertificateException.m @@ -72,8 +72,8 @@ _reason]; } - (OFString*)reason { - OF_GETTER(_reason, NO) + OF_GETTER(_reason, false) } @end Index: src/SSLSocket.h ================================================================== --- src/SSLSocket.h +++ src/SSLSocket.h @@ -29,16 +29,16 @@ @interface SSLSocket: OFTCPSocket { SSL *_SSL; OFString *_privateKeyFile, *_certificateFile; - BOOL _requestsClientCertificates; + bool _requestsClientCertificates; } #ifdef OF_HAVE_PROPERTIES @property (copy) OFString *privateKeyFile, *certificateFile; -@property BOOL requestsClientCertificates; +@property bool requestsClientCertificates; #endif - initWithSocket: (OFTCPSocket*)socket; - initWithSocket: (OFTCPSocket*)socket privateKeyFile: (OFString*)privateKeyFile @@ -47,11 +47,11 @@ - (SSLSocket*)accept; /* Changes the return type */ - (void)setPrivateKeyFile: (OFString*)file; - (OFString*)privateKeyFile; - (void)setCertificateFile: (OFString*)file; - (OFString*)certificateFile; -- (void)setRequestsClientCertificates: (BOOL)enabled; -- (BOOL)requestsClientCertificates; +- (void)setRequestsClientCertificates: (bool)enabled; +- (bool)requestsClientCertificates; - (OFDataArray*)channelBindingDataWithType: (OFString*)type; - (X509Certificate*)peerCertificate; - (void)verifyPeerCertificate; @end Index: src/SSLSocket.m ================================================================== --- src/SSLSocket.m +++ src/SSLSocket.m @@ -286,11 +286,11 @@ stream: self requestedLength: length]; } if (ret == 0) - _atEndOfStream = YES; + _atEndOfStream = true; return ret; } - (void)lowlevelWriteBuffer: (const void*)buffer @@ -333,34 +333,34 @@ return [super numberOfBytesInReadBuffer] + SSL_pending(_SSL); } - (void)setPrivateKeyFile: (OFString*)privateKeyFile { - OF_SETTER(_privateKeyFile, privateKeyFile, YES, YES) + OF_SETTER(_privateKeyFile, privateKeyFile, true, 1) } - (OFString*)privateKeyFile { - OF_GETTER(_privateKeyFile, YES) + OF_GETTER(_privateKeyFile, true) } - (void)setCertificateFile: (OFString*)certificateFile { - OF_SETTER(_certificateFile, certificateFile, YES, YES) + OF_SETTER(_certificateFile, certificateFile, true, 1) } - (OFString*)certificateFile { - OF_GETTER(_certificateFile, YES) + OF_GETTER(_certificateFile, true) } -- (void)setRequestsClientCertificates: (BOOL)enabled +- (void)setRequestsClientCertificates: (bool)enabled { _requestsClientCertificates = enabled; } -- (BOOL)requestsClientCertificates +- (bool)requestsClientCertificates { return _requestsClientCertificates; } - (OFDataArray*)channelBindingDataWithType: (OFString*)type Index: src/X509Certificate.h ================================================================== --- src/X509Certificate.h +++ src/X509Certificate.h @@ -64,15 +64,15 @@ - initWithFile: (OFString*)file; - initWithX509Struct: (X509*)cert; - (OFDictionary*)issuer; - (OFDictionary*)subject; - (OFDictionary*)subjectAlternativeName; -- (BOOL)hasCommonNameMatchingDomain: (OFString*)domain; -- (BOOL)hasDNSNameMatchingDomain: (OFString*)domain; -- (BOOL)hasSRVNameMatchingDomain: (OFString*)domain +- (bool)hasCommonNameMatchingDomain: (OFString*)domain; +- (bool)hasDNSNameMatchingDomain: (OFString*)domain; +- (bool)hasSRVNameMatchingDomain: (OFString*)domain service: (OFString*)service; -- (BOOL)X509_isAssertedDomain: (OFString*)asserted +- (bool)X509_isAssertedDomain: (OFString*)asserted equalDomain: (OFString*)domain; - (OFDictionary*)X509_dictionaryFromX509Name: (X509_NAME*)name; - (X509OID*)X509_stringFromASN1Object: (ASN1_OBJECT*)obj; - (OFString*)X509_stringFromASN1String: (ASN1_STRING*)str; @end Index: src/X509Certificate.m ================================================================== --- src/X509Certificate.m +++ src/X509Certificate.m @@ -252,11 +252,11 @@ _subjectAlternativeName = [ret retain]; return ret; } -- (BOOL)hasCommonNameMatchingDomain: (OFString*)domain +- (bool)hasCommonNameMatchingDomain: (OFString*)domain { OFString *name; OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFList *CNs = [[self subject] objectForKey: OID_commonName]; OFEnumerator *enumerator = [CNs objectEnumerator]; @@ -263,19 +263,19 @@ while ((name = [enumerator nextObject]) != nil) { if ([self X509_isAssertedDomain: name equalDomain: domain]) { [pool release]; - return YES; + return true; } } [pool release]; - return NO; + return false; } -- (BOOL)hasDNSNameMatchingDomain: (OFString*)domain +- (bool)hasDNSNameMatchingDomain: (OFString*)domain { OFString *name; OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFDictionary *SANs = [self subjectAlternativeName]; OFList *assertedNames = [SANs objectForKey: @"dNSName"]; @@ -283,19 +283,19 @@ while ((name = [enumerator nextObject]) != nil) { if ([self X509_isAssertedDomain: name equalDomain: domain]) { [pool release]; - return YES; + return true; } } [pool release]; - return NO; + return false; } -- (BOOL)hasSRVNameMatchingDomain: (OFString*)domain +- (bool)hasSRVNameMatchingDomain: (OFString*)domain service: (OFString*)service { size_t serviceLength; OFString *name; OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; @@ -316,20 +316,20 @@ asserted = [name substringWithRange: of_range( serviceLength, [name length] - serviceLength)]; if ([self X509_isAssertedDomain: asserted equalDomain: domain]) { [pool release]; - return YES; + return true; } } } [pool release]; - return NO; + return false; } -- (BOOL)X509_isAssertedDomain: (OFString*)asserted +- (bool)X509_isAssertedDomain: (OFString*)asserted equalDomain: (OFString*)domain { /* * In accordance with RFC 6125 this only allows a wildcard as the * left-most label and matches only the left-most label with it. @@ -338,29 +338,29 @@ */ size_t firstDot; if ([asserted caseInsensitiveCompare: domain] == OF_ORDERED_SAME) - return YES; + return true; if (![asserted hasPrefix: @"*."]) - return NO; + return false; asserted = [asserted substringWithRange: of_range(2, [asserted length] - 2)]; firstDot = [domain rangeOfString: @"."].location; if (firstDot == OF_NOT_FOUND) - return NO; + return false; domain = [domain substringWithRange: of_range(firstDot + 1, [domain length] - firstDot - 1)]; if (![asserted caseInsensitiveCompare: domain]) - return YES; + return true; - return NO; + return false; } - (OFDictionary*)X509_dictionaryFromX509Name: (X509_NAME*)name { OFMutableDictionary *dict = [OFMutableDictionary dictionary]; @@ -460,11 +460,11 @@ char tmp[1024]; OBJ_obj2txt(tmp, sizeof(tmp), OBJ_txt2obj([_string UTF8String], 1), 0); return [OFString stringWithUTF8String: tmp]; } -- (BOOL)isEqual: (id)object +- (bool)isEqual: (id)object { if ([object isKindOfClass: [X509OID class]]) { X509OID *OID = object; return [OID->_string isEqual: _string]; @@ -471,11 +471,11 @@ } if ([object isKindOfClass: [OFString class]]) return [_string isEqual: object]; - return NO; + return false; } - (uint32_t)hash { return [_string hash];