Index: src/SSLInvalidCertificateException.h ================================================================== --- src/SSLInvalidCertificateException.h +++ src/SSLInvalidCertificateException.h @@ -27,13 +27,10 @@ @interface SSLInvalidCertificateException: OFException { OFString *_reason; } -#ifdef OF_HAVE_PROPERTIES @property (readonly, copy) OFString *reason; -#endif + exceptionWithReason: (OFString*)reason; - initWithReason: (OFString*)reason; -- (OFString*)reason; @end Index: src/SSLInvalidCertificateException.m ================================================================== --- src/SSLInvalidCertificateException.m +++ src/SSLInvalidCertificateException.m @@ -26,10 +26,12 @@ #import "SSLInvalidCertificateException.h" #import @implementation SSLInvalidCertificateException +@synthesize reason = _reason; + + exceptionWithReason: (OFString*)reason { return [[[self alloc] initWithReason: reason] autorelease]; } @@ -69,11 +71,6 @@ - (OFString*)description { return [OFString stringWithFormat: @"Invalid certificate! Reason: %@", _reason]; } - -- (OFString*)reason -{ - OF_GETTER(_reason, true) -} @end Index: src/SSLSocket.h ================================================================== --- src/SSLSocket.h +++ src/SSLSocket.h @@ -35,18 +35,14 @@ const char *_privateKeyPassphrase; bool _certificateVerificationEnabled; bool _requestClientCertificatesEnabled; } -#ifdef OF_HAVE_PROPERTIES @property (getter=isRequestClientCertificatesEnabled) bool requestClientCertificatesEnabled; -#endif - initWithSocket: (OFTCPSocket*)socket; - (void)SSL_super_close; -- (void)setRequestClientCertificatesEnabled: (bool)enabled; -- (bool)isRequestClientCertificatesEnabled; - (OFDataArray*)channelBindingDataWithType: (OFString*)type; - (X509Certificate*)peerCertificate; - (void)verifyPeerCertificate; @end Index: src/SSLSocket.m ================================================================== --- src/SSLSocket.m +++ src/SSLSocket.m @@ -87,10 +87,17 @@ else of_mutex_unlock(&ssl_mutexes[n]); } @implementation SSLSocket +@synthesize delegate = _delegate, certificateFile = _certificateFile; +@synthesize privateKeyFile = _privateKeyFile; +@synthesize privateKeyPassphrase = privateKeyPassphrase; +@synthesize certificateVerificationEnabled = _certificateVerificationEnabled; +@synthesize requestClientCertificatesEnabled = + _requestClientCertificatesEnabled; + + (void)load { of_tls_socket_class = self; } @@ -328,70 +335,32 @@ return true; return [super hasDataInReadBuffer]; } -- (void)setDelegate: (id )delegate -{ - /* TODO */ - OF_UNRECOGNIZED_SELECTOR -} - -- (id )delegate -{ - /* TODO */ - OF_UNRECOGNIZED_SELECTOR -} - -- (void)setCertificateFile: (OFString*)certificateFile -{ - OF_SETTER(_certificateFile, certificateFile, true, 1) -} - - (void)setCertificateFile: (OFString*)certificateFile forSNIHost: (OFString*)SNIHost { /* TODO */ OF_UNRECOGNIZED_SELECTOR } -- (OFString*)certificateFile -{ - OF_GETTER(_certificateFile, true) -} - - (OFString*)certificateFileForSNIHost: (OFString*)SNIHost { /* TODO */ OF_UNRECOGNIZED_SELECTOR } -- (void)setPrivateKeyFile: (OFString*)privateKeyFile -{ - OF_SETTER(_privateKeyFile, privateKeyFile, true, 1) -} - - (void)setPrivateKeyFile: (OFString*)privateKeyFile forSNIHost: (OFString*)SNIHost { /* TODO */ OF_UNRECOGNIZED_SELECTOR } -- (OFString*)privateKeyFile -{ - OF_GETTER(_privateKeyFile, true) -} - - (OFString*)privateKeyFileForSNIHost: (OFString*)SNIHost { - /* TODO */ - OF_UNRECOGNIZED_SELECTOR -} - -- (void)setPrivateKeyPassphrase: (const char*)privateKeyPassphrase -{ /* TODO */ OF_UNRECOGNIZED_SELECTOR } - (void)setPrivateKeyPassphrase: (const char*)privateKeyPassphrase @@ -399,42 +368,16 @@ { /* TODO */ OF_UNRECOGNIZED_SELECTOR } -- (const char*)privateKeyPassphrase -{ - /* TODO */ - OF_UNRECOGNIZED_SELECTOR -} - - (const char*)privateKeyPassphraseForSNIHost: (OFString*)SNIHost { /* TODO */ OF_UNRECOGNIZED_SELECTOR } -- (void)setCertificateVerificationEnabled: (bool)enabled -{ - _certificateVerificationEnabled = enabled; -} - -- (bool)isCertificateVerificationEnabled -{ - return _certificateVerificationEnabled; -} - -- (void)setRequestClientCertificatesEnabled: (bool)enabled -{ - _requestClientCertificatesEnabled = enabled; -} - -- (bool)isRequestClientCertificatesEnabled -{ - return _requestClientCertificatesEnabled; -} - - (OFDataArray*)channelBindingDataWithType: (OFString*)type { size_t length; char buffer[64]; OFDataArray *data; Index: src/X509Certificate.h ================================================================== --- src/X509Certificate.h +++ src/X509Certificate.h @@ -55,14 +55,10 @@ OFDictionary *_issuer; OFDictionary *_subject; OFDictionary *_subjectAlternativeName; } -#ifdef OF_HAVE_PROPERTIES -@property (readonly) OFDictionary *issuer, *subject, *subjectAlternativeName; -#endif - - initWithFile: (OFString*)file; - initWithX509Struct: (X509*)cert; - (OFDictionary*)issuer; - (OFDictionary*)subject; - (OFDictionary*)subjectAlternativeName;