Differences From Artifact [6023c3c0c6]:
- File
src/OFTLSStream.m
— part of check-in
[112eb62f7b]
at
2021-11-13 20:28:25
on branch trunk
— Add OFSecureTransportTLSStream
This implements OFTLSStream using Apple's Secure Transport. While Secure
Transport is declared deprecated by Apple, Apple so far has failed to
provide a suitable replacement. They recommend Network.framework as a
replacement, however it can neither work on arbitrary sockets, nor can
it do STARTTLS. (user: js, size: 4220) [annotate] [blame] [check-ins using]
To Artifact [ab25ba8801]:
- File
src/OFTLSStream.m
— part of check-in
[8f8af474fc]
at
2021-11-20 13:18:28
on branch trunk
— Move TLS implementations to a separate library
These implementations all depend on additional libraries that are
otherwise not needed for an ObjFW application that does not use TLS,
meaning they would add unnecessary dependencies for a lot of
applications and waste memory. (user: js, size: 4331) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
13 14 15 16 17 18 19 | * file. */ #include "config.h" #import "OFTLSStream.h" #import "OFDate.h" | < < < > > > > > > > > > > > | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
* file.
*/
#include "config.h"
#import "OFTLSStream.h"
#import "OFDate.h"
#import "OFNotImplementedException.h"
#import "OFTLSHandshakeFailedException.h"
@interface OFTLSStreamHandshakeDelegate: OFObject <OFTLSStreamDelegate>
{
@public
bool _done;
id _exception;
}
@end
Class OFTLSStreamImplementation = Nil;
static const OFRunLoopMode handshakeRunLoopMode =
@"OFTLSStreamHandshakeRunLoopMode";
/*
* References to exceptions. This is needed because they are only used by
* subclasses that are in a different library.
*/
void
_references_to_exceptions_of_OFTLSStream(void)
{
_OFTLSHandshakeFailedException_reference = 1;
}
OFString *
OFTLSStreamErrorCodeDescription(OFTLSStreamErrorCode errorCode)
{
switch (errorCode) {
case OFTLSStreamErrorCodeInitializationFailed:
return @"Initialization of TLS context failed";
|
| ︙ | ︙ | |||
70 71 72 73 74 75 76 |
+ (instancetype)alloc
{
if (self == [OFTLSStream class]) {
if (OFTLSStreamImplementation != Nil)
return [OFTLSStreamImplementation alloc];
| < < < < | 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
+ (instancetype)alloc
{
if (self == [OFTLSStream class]) {
if (OFTLSStreamImplementation != Nil)
return [OFTLSStreamImplementation alloc];
@throw [OFNotImplementedException exceptionWithSelector: _cmd
object: self];
}
return [super alloc];
}
+ (instancetype)streamWithStream: (OFStream <OFReadyForReadingObserving,
OFReadyForWritingObserving> *)stream
|
| ︙ | ︙ |