Overview
Comment: | OFOpenSSLTLSStream: Add server support |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | tls-server |
Files: | files | file ages | folders |
SHA3-256: |
7636fc01435d037080c19cbca48d33dc |
User & Date: | js on 2024-11-18 23:18:29 |
Other Links: | branch diff | manifest | tags |
Context
2024-11-18
| ||
23:27 | OFGnuTLSTLSStream: Restore old close behavior Leaf check-in: 716f5721f5 user: js tags: tls-server | |
23:18 | OFOpenSSLTLSStream: Add server support check-in: 7636fc0143 user: js tags: tls-server | |
20:58 | OFX509Certificate*: Rename constructors check-in: 8f1fe21441 user: js tags: tls-server | |
Changes
Modified src/tls/Makefile from [6ba02952f9] to [d454b3a231].
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | - + + + | ${USE_SRCS_OPENSSL} \ ${USE_SRCS_SECURETRANSPORT} SRCS_GNUTLS = OFGnuTLSTLSStream.m \ OFGnuTLSX509Certificate.m \ OFGnuTLSX509CertificatePrivateKey.m SRCS_MBEDTLS = OFMbedTLSTLSStream.m |
︙ |
Modified src/tls/OFGnuTLSTLSStream.m from [e559b50391] to [4722d3e575].
︙ | |||
246 247 248 249 250 251 252 | 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | - + + - + | GNUTLS_E_SUCCESS) @throw [OFTLSHandshakeFailedException exceptionWithStream: self host: host errorCode: initFailedErrorCode]; if (_verifiesCertificates) |
︙ |
Modified src/tls/OFGnuTLSX509Certificate.m from [1050c14b20] to [d29d7aa45b].
︙ | |||
74 75 76 77 78 79 80 81 82 83 84 85 86 87 | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | + + | @throw e; } @finally { [certificate release]; } } gnutls_free(certs); [chain makeImmutable]; objc_autoreleasePoolPop(pool); return chain; } - (instancetype)of_initWithGnuTLSCertificate: (gnutls_x509_crt_t)certificate |
︙ |
Modified src/tls/OFOpenSSLTLSStream.h from [117120b8e9] to [f6715b95ac].
︙ | |||
25 26 27 28 29 30 31 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | - + - + | OF_ASSUME_NONNULL_BEGIN #define OFOpenSSLTLSStreamBufferSize 512 OF_SUBCLASSING_RESTRICTED @interface OFOpenSSLTLSStream: OFTLSStream <OFStreamDelegate> { |
Modified src/tls/OFOpenSSLTLSStream.m from [eaf4116fbc] to [e3dec501da].
︙ | |||
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | 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 | + + + - + | */ #include "config.h" #include <errno.h> #import "OFOpenSSLTLSStream.h" #import "OFArray.h" #import "OFData.h" #import "OFOpenSSLX509Certificate.h" #import "OFOpenSSLX509CertificatePrivateKey.h" #include <openssl/err.h> #import "OFAlreadyOpenException.h" #import "OFInitializationFailedException.h" #import "OFNotOpenException.h" #import "OFReadFailedException.h" #import "OFTLSHandshakeFailedException.h" #import "OFWriteFailedException.h" #define bufferSize OFOpenSSLTLSStreamBufferSize int _ObjFWTLS_reference; |
︙ | |||
91 92 93 94 95 96 97 98 99 100 101 102 103 104 | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | + + + + | SSL_load_error_strings(); SSL_library_init(); if ((clientContext = SSL_CTX_new(TLS_client_method())) == NULL || SSL_CTX_set_default_verify_paths(clientContext) != 1) @throw [OFInitializationFailedException exceptionWithClass: self]; if ((serverContext = SSL_CTX_new(TLS_server_method())) == NULL) @throw [OFInitializationFailedException exceptionWithClass: self]; } - (instancetype)initWithStream: (OFStream <OFReadyForReadingObserving, OFReadyForWritingObserving> *)stream { self = [super initWithStream: stream]; |
︙ | |||
253 254 255 256 257 258 259 | 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | - - + + + | SSL_has_pending(_SSL) || BIO_ctrl_pending(_readBIO) > 0); #else return (_underlyingStream.hasDataInReadBuffer || SSL_pending(_SSL) > 0 || BIO_ctrl_pending(_readBIO) > 0); #endif } |
︙ | |||
282 283 284 285 286 287 288 | 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | - + + + + + - + + + - - - - - + + + + + - - + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | host: host errorCode: initFailedErrorCode]; } BIO_set_mem_eof_return(_readBIO, -1); BIO_set_mem_eof_return(_writeBIO, -1); |
︙ | |||
356 357 358 359 360 361 362 | 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 | + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + | exceptionWithStream: self host: host errorCode: OFTLSStreamErrorCodeUnknown]; break; } } if (server) { |
︙ | |||
419 420 421 422 423 424 425 | 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 | + - - - - - + + + + + + + + + + + | host: _host errorCode: unknownErrorCode]; break; } } } if (_server) { |
︙ | |||
492 493 494 495 496 497 498 | 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 | + - - - - - + + + + + + + + + + + | host: _host errorCode: unknownErrorCode]; break; } } } if (_server) { |
Added src/tls/OFOpenSSLX509Certificate.h version [1ef3e50fe9].
|
Added src/tls/OFOpenSSLX509Certificate.m version [c2d21fe57d].