Differences From Artifact [b4bbc1851d]:
- File src/tls/OFOpenSSLTLSStream.m — part of check-in [26ddd2e4e4] at 2024-01-02 17:17:25 on branch trunk — Update copyright (user: js, size: 10615) [annotate] [blame] [check-ins using]
To Artifact [41321b054b]:
- File
src/tls/OFOpenSSLTLSStream.m
— part of check-in
[11b2a17595]
at
2024-01-06 00:52:48
on branch trunk
— Initial support for Mbed TLS
Mbed TLS is never automatically picked as a TLS implementation and
always needs to be manually enabled using --with-tls=mbedtls. (user: js, size: 10574) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
90 91 92 93 94 95 96 97 98 99 100 101 102 103 | if (_handshakeDone) SSL_shutdown(_SSL); SSL_free(_SSL); _SSL = NULL; [_host release]; _host = nil; [super close]; } - (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length | > > | 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | if (_handshakeDone) SSL_shutdown(_SSL); SSL_free(_SSL); _SSL = NULL; _handshakeDone = false; [_host release]; _host = nil; [super close]; } - (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length |
︙ | ︙ | |||
283 284 285 286 287 288 289 | case SSL_ERROR_WANT_READ: [_underlyingStream asyncReadIntoBuffer: _buffer length: bufferSize runLoopMode: runLoopMode]; [_delegate retain]; return; case SSL_ERROR_WANT_WRITE: | | < | | 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 | case SSL_ERROR_WANT_READ: [_underlyingStream asyncReadIntoBuffer: _buffer length: bufferSize runLoopMode: runLoopMode]; [_delegate retain]; return; case SSL_ERROR_WANT_WRITE: [_underlyingStream asyncWriteData: [OFData data] runLoopMode: runLoopMode]; [_delegate retain]; return; default: /* FIXME: Map to better errors */ exception = [OFTLSHandshakeFailedException exceptionWithStream: self host: host |
︙ | ︙ | |||
338 339 340 341 342 343 344 | if (status == 1) _handshakeDone = true; else { switch (SSL_get_error(_SSL, status)) { case SSL_ERROR_WANT_READ: return true; case SSL_ERROR_WANT_WRITE: | < | | 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 | if (status == 1) _handshakeDone = true; else { switch (SSL_get_error(_SSL, status)) { case SSL_ERROR_WANT_READ: return true; case SSL_ERROR_WANT_WRITE: OFRunLoopMode runLoopMode = [OFRunLoop currentRunLoop].currentMode; [_underlyingStream asyncWriteData: [OFData data] runLoopMode: runLoopMode]; return false; default: exception = [OFTLSHandshakeFailedException exceptionWithStream: self host: _host errorCode: unknownErrorCode]; |
︙ | ︙ |