@@ -89,12 +89,11 @@ else of_mutex_unlock(&ssl_mutexes[n]); } @interface SSLSocket () -- (void)SSL_startTLSWithExpectedHost: (OFString *)host - port: (uint16_t)port; +- (void)SSL_startTLSWithExpectedHost: (OFString *)host port: (uint16_t)port; - (void)SSL_super_close; @end @interface SSLSocket_ConnectDelegate: OFObject { @@ -252,12 +251,11 @@ if (SSL_ != NULL) SSL_free(SSL_); } -- (void)SSL_startTLSWithExpectedHost: (OFString *)host - port: (uint16_t)port +- (void)SSL_startTLSWithExpectedHost: (OFString *)host port: (uint16_t)port { of_string_encoding_t encoding; if ((_SSL = SSL_new(ctx)) == NULL || SSL_set_fd(_SSL, _socket) != 1) { unsigned long error = ERR_get_error(); @@ -346,12 +344,11 @@ } } - (void)startTLSWithExpectedHost: (OFString *)host { - [self SSL_startTLSWithExpectedHost: host - port: 0]; + [self SSL_startTLSWithExpectedHost: host port: 0]; } - (void)asyncConnectToHost: (OFString *)host port: (uint16_t)port runLoopMode: (of_run_loop_mode_t)runLoopMode @@ -361,13 +358,11 @@ [[[SSLSocket_ConnectDelegate alloc] initWithSocket: self host: host port: port delegate: _delegate] autorelease]; - [super asyncConnectToHost: host - port: port - runLoopMode: runLoopMode]; + [super asyncConnectToHost: host port: port runLoopMode: runLoopMode]; objc_autoreleasePoolPop(pool); } #ifdef OF_HAVE_BLOCKS @@ -440,12 +435,11 @@ - (void)SSL_super_close { [super close]; } -- (size_t)lowlevelReadIntoBuffer: (void *)buffer - length: (size_t)length +- (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { ssize_t ret; /* * There is no SSL session yet. However, it might be necessary to read @@ -452,12 +446,11 @@ * from and write to the socket before negotiating an SSL session: For * example, the socket might be connected to a SOCKS5 proxy and needs * to establish a SOCKS5 connection before negotiating an SSL session. */ if (_SSL == NULL) - return [super lowlevelReadIntoBuffer: buffer - length: length]; + return [super lowlevelReadIntoBuffer: buffer length: length]; if (length > INT_MAX) @throw [OFOutOfRangeException exception]; if (_socket == INVALID_SOCKET) @@ -481,12 +474,11 @@ _atEndOfStream = true; return ret; } -- (size_t)lowlevelWriteBuffer: (const void *)buffer - length: (size_t)length +- (size_t)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length { int bytesWritten; /* * There is no SSL session yet. However, it might be necessary to read @@ -497,12 +489,11 @@ * TODO: Think of a way to make this safer, so that it's impossible to * forget to establish an SSL session and then send unencrypted data by * accident. */ if (_SSL == NULL) - return [super lowlevelWriteBuffer: buffer - length: length]; + return [super lowlevelWriteBuffer: buffer length: length]; if (_socket == INVALID_SOCKET) @throw [OFNotOpenException exceptionWithObject: self]; if (length > INT_MAX) @@ -581,12 +572,11 @@ } else { /* peer sent the finished message */ length = SSL_get_peer_finished(_SSL, buffer, 64); } - return [OFData dataWithItems: buffer - count: length]; + return [OFData dataWithItems: buffer count: length]; } - (X509Certificate *)peerCertificate { X509 *certificate = SSL_get_peer_certificate(_SSL);