Adjust to ObjFW changes
This commit is contained in:
parent
eed791dff1
commit
24e8ee8a50
5 changed files with 9 additions and 80 deletions
|
@ -29,11 +29,8 @@
|
||||||
OFString *_reason;
|
OFString *_reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OF_HAVE_PROPERTIES
|
|
||||||
@property (readonly, copy) OFString *reason;
|
@property (readonly, copy) OFString *reason;
|
||||||
#endif
|
|
||||||
|
|
||||||
+ exceptionWithReason: (OFString*)reason;
|
+ exceptionWithReason: (OFString*)reason;
|
||||||
- initWithReason: (OFString*)reason;
|
- initWithReason: (OFString*)reason;
|
||||||
- (OFString*)reason;
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
#import <ObjFW/macros.h>
|
#import <ObjFW/macros.h>
|
||||||
|
|
||||||
@implementation SSLInvalidCertificateException
|
@implementation SSLInvalidCertificateException
|
||||||
|
@synthesize reason = _reason;
|
||||||
|
|
||||||
+ exceptionWithReason: (OFString*)reason
|
+ exceptionWithReason: (OFString*)reason
|
||||||
{
|
{
|
||||||
return [[[self alloc] initWithReason: reason] autorelease];
|
return [[[self alloc] initWithReason: reason] autorelease];
|
||||||
|
@ -71,9 +73,4 @@
|
||||||
return [OFString stringWithFormat:
|
return [OFString stringWithFormat:
|
||||||
@"Invalid certificate! Reason: %@", _reason];
|
@"Invalid certificate! Reason: %@", _reason];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (OFString*)reason
|
|
||||||
{
|
|
||||||
OF_GETTER(_reason, true)
|
|
||||||
}
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -37,15 +37,11 @@
|
||||||
bool _requestClientCertificatesEnabled;
|
bool _requestClientCertificatesEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OF_HAVE_PROPERTIES
|
|
||||||
@property (getter=isRequestClientCertificatesEnabled)
|
@property (getter=isRequestClientCertificatesEnabled)
|
||||||
bool requestClientCertificatesEnabled;
|
bool requestClientCertificatesEnabled;
|
||||||
#endif
|
|
||||||
|
|
||||||
- initWithSocket: (OFTCPSocket*)socket;
|
- initWithSocket: (OFTCPSocket*)socket;
|
||||||
- (void)SSL_super_close;
|
- (void)SSL_super_close;
|
||||||
- (void)setRequestClientCertificatesEnabled: (bool)enabled;
|
|
||||||
- (bool)isRequestClientCertificatesEnabled;
|
|
||||||
- (OFDataArray*)channelBindingDataWithType: (OFString*)type;
|
- (OFDataArray*)channelBindingDataWithType: (OFString*)type;
|
||||||
- (X509Certificate*)peerCertificate;
|
- (X509Certificate*)peerCertificate;
|
||||||
- (void)verifyPeerCertificate;
|
- (void)verifyPeerCertificate;
|
||||||
|
|
|
@ -89,6 +89,13 @@ locking_callback(int mode, int n, const char *file, int line)
|
||||||
}
|
}
|
||||||
|
|
||||||
@implementation SSLSocket
|
@implementation SSLSocket
|
||||||
|
@synthesize delegate = _delegate, certificateFile = _certificateFile;
|
||||||
|
@synthesize privateKeyFile = _privateKeyFile;
|
||||||
|
@synthesize privateKeyPassphrase = privateKeyPassphrase;
|
||||||
|
@synthesize certificateVerificationEnabled = _certificateVerificationEnabled;
|
||||||
|
@synthesize requestClientCertificatesEnabled =
|
||||||
|
_requestClientCertificatesEnabled;
|
||||||
|
|
||||||
+ (void)load
|
+ (void)load
|
||||||
{
|
{
|
||||||
of_tls_socket_class = self;
|
of_tls_socket_class = self;
|
||||||
|
@ -330,23 +337,6 @@ locking_callback(int mode, int n, const char *file, int line)
|
||||||
return [super hasDataInReadBuffer];
|
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
|
- (void)setCertificateFile: (OFString*)certificateFile
|
||||||
forSNIHost: (OFString*)SNIHost
|
forSNIHost: (OFString*)SNIHost
|
||||||
{
|
{
|
||||||
|
@ -354,22 +344,12 @@ locking_callback(int mode, int n, const char *file, int line)
|
||||||
OF_UNRECOGNIZED_SELECTOR
|
OF_UNRECOGNIZED_SELECTOR
|
||||||
}
|
}
|
||||||
|
|
||||||
- (OFString*)certificateFile
|
|
||||||
{
|
|
||||||
OF_GETTER(_certificateFile, true)
|
|
||||||
}
|
|
||||||
|
|
||||||
- (OFString*)certificateFileForSNIHost: (OFString*)SNIHost
|
- (OFString*)certificateFileForSNIHost: (OFString*)SNIHost
|
||||||
{
|
{
|
||||||
/* TODO */
|
/* TODO */
|
||||||
OF_UNRECOGNIZED_SELECTOR
|
OF_UNRECOGNIZED_SELECTOR
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setPrivateKeyFile: (OFString*)privateKeyFile
|
|
||||||
{
|
|
||||||
OF_SETTER(_privateKeyFile, privateKeyFile, true, 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)setPrivateKeyFile: (OFString*)privateKeyFile
|
- (void)setPrivateKeyFile: (OFString*)privateKeyFile
|
||||||
forSNIHost: (OFString*)SNIHost
|
forSNIHost: (OFString*)SNIHost
|
||||||
{
|
{
|
||||||
|
@ -377,23 +357,12 @@ locking_callback(int mode, int n, const char *file, int line)
|
||||||
OF_UNRECOGNIZED_SELECTOR
|
OF_UNRECOGNIZED_SELECTOR
|
||||||
}
|
}
|
||||||
|
|
||||||
- (OFString*)privateKeyFile
|
|
||||||
{
|
|
||||||
OF_GETTER(_privateKeyFile, true)
|
|
||||||
}
|
|
||||||
|
|
||||||
- (OFString*)privateKeyFileForSNIHost: (OFString*)SNIHost
|
- (OFString*)privateKeyFileForSNIHost: (OFString*)SNIHost
|
||||||
{
|
{
|
||||||
/* TODO */
|
/* TODO */
|
||||||
OF_UNRECOGNIZED_SELECTOR
|
OF_UNRECOGNIZED_SELECTOR
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setPrivateKeyPassphrase: (const char*)privateKeyPassphrase
|
|
||||||
{
|
|
||||||
/* TODO */
|
|
||||||
OF_UNRECOGNIZED_SELECTOR
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)setPrivateKeyPassphrase: (const char*)privateKeyPassphrase
|
- (void)setPrivateKeyPassphrase: (const char*)privateKeyPassphrase
|
||||||
forSNIHost: (OFString*)SNIHost
|
forSNIHost: (OFString*)SNIHost
|
||||||
{
|
{
|
||||||
|
@ -401,38 +370,12 @@ locking_callback(int mode, int n, const char *file, int line)
|
||||||
OF_UNRECOGNIZED_SELECTOR
|
OF_UNRECOGNIZED_SELECTOR
|
||||||
}
|
}
|
||||||
|
|
||||||
- (const char*)privateKeyPassphrase
|
|
||||||
{
|
|
||||||
/* TODO */
|
|
||||||
OF_UNRECOGNIZED_SELECTOR
|
|
||||||
}
|
|
||||||
|
|
||||||
- (const char*)privateKeyPassphraseForSNIHost: (OFString*)SNIHost
|
- (const char*)privateKeyPassphraseForSNIHost: (OFString*)SNIHost
|
||||||
{
|
{
|
||||||
/* TODO */
|
/* TODO */
|
||||||
OF_UNRECOGNIZED_SELECTOR
|
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
|
- (OFDataArray*)channelBindingDataWithType: (OFString*)type
|
||||||
{
|
{
|
||||||
size_t length;
|
size_t length;
|
||||||
|
|
|
@ -57,10 +57,6 @@
|
||||||
OFDictionary *_subjectAlternativeName;
|
OFDictionary *_subjectAlternativeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OF_HAVE_PROPERTIES
|
|
||||||
@property (readonly) OFDictionary *issuer, *subject, *subjectAlternativeName;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
- initWithFile: (OFString*)file;
|
- initWithFile: (OFString*)file;
|
||||||
- initWithX509Struct: (X509*)cert;
|
- initWithX509Struct: (X509*)cert;
|
||||||
- (OFDictionary*)issuer;
|
- (OFDictionary*)issuer;
|
||||||
|
|
Reference in a new issue