Adjust to ObjFW changes

This commit is contained in:
Jonathan Schleifer 2016-03-06 18:48:01 +01:00
parent eed791dff1
commit 24e8ee8a50
No known key found for this signature in database
GPG key ID: 338C3541DB54E169
5 changed files with 9 additions and 80 deletions

View file

@ -29,11 +29,8 @@
OFString *_reason;
}
#ifdef OF_HAVE_PROPERTIES
@property (readonly, copy) OFString *reason;
#endif
+ exceptionWithReason: (OFString*)reason;
- initWithReason: (OFString*)reason;
- (OFString*)reason;
@end

View file

@ -28,6 +28,8 @@
#import <ObjFW/macros.h>
@implementation SSLInvalidCertificateException
@synthesize reason = _reason;
+ exceptionWithReason: (OFString*)reason
{
return [[[self alloc] initWithReason: reason] autorelease];
@ -71,9 +73,4 @@
return [OFString stringWithFormat:
@"Invalid certificate! Reason: %@", _reason];
}
- (OFString*)reason
{
OF_GETTER(_reason, true)
}
@end

View file

@ -37,15 +37,11 @@
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;

View file

@ -89,6 +89,13 @@ locking_callback(int mode, int n, const char *file, int line)
}
@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;
@ -330,23 +337,6 @@ locking_callback(int mode, int n, const char *file, int line)
return [super hasDataInReadBuffer];
}
- (void)setDelegate: (id <OFTLSSocketDelegate>)delegate
{
/* TODO */
OF_UNRECOGNIZED_SELECTOR
}
- (id <OFTLSSocketDelegate>)delegate
{
/* TODO */
OF_UNRECOGNIZED_SELECTOR
}
- (void)setCertificateFile: (OFString*)certificateFile
{
OF_SETTER(_certificateFile, certificateFile, true, 1)
}
- (void)setCertificateFile: (OFString*)certificateFile
forSNIHost: (OFString*)SNIHost
{
@ -354,22 +344,12 @@ locking_callback(int mode, int n, const char *file, int line)
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
{
@ -377,23 +357,12 @@ locking_callback(int mode, int n, const char *file, int line)
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
forSNIHost: (OFString*)SNIHost
{
@ -401,38 +370,12 @@ locking_callback(int mode, int n, const char *file, int line)
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;

View file

@ -57,10 +57,6 @@
OFDictionary *_subjectAlternativeName;
}
#ifdef OF_HAVE_PROPERTIES
@property (readonly) OFDictionary *issuer, *subject, *subjectAlternativeName;
#endif
- initWithFile: (OFString*)file;
- initWithX509Struct: (X509*)cert;
- (OFDictionary*)issuer;