Lines Matching refs:ssl
105 static int dtls_read_buffer_next_packet(SSL *ssl) { in dtls_read_buffer_next_packet() argument
106 SSLBuffer *buf = &ssl->s3->read_buffer; in dtls_read_buffer_next_packet()
117 BIO_read(ssl->rbio.get(), buf->data(), static_cast<int>(buf->cap())); in dtls_read_buffer_next_packet()
119 ssl->s3->rwstate = SSL_READING; in dtls_read_buffer_next_packet()
126 static int tls_read_buffer_extend_to(SSL *ssl, size_t len) { in tls_read_buffer_extend_to() argument
127 SSLBuffer *buf = &ssl->s3->read_buffer; in tls_read_buffer_extend_to()
138 int ret = BIO_read(ssl->rbio.get(), buf->data() + buf->size(), in tls_read_buffer_extend_to()
141 ssl->s3->rwstate = SSL_READING; in tls_read_buffer_extend_to()
150 int ssl_read_buffer_extend_to(SSL *ssl, size_t len) { in ssl_read_buffer_extend_to() argument
152 ssl->s3->read_buffer.DiscardConsumed(); in ssl_read_buffer_extend_to()
154 if (SSL_is_dtls(ssl)) { in ssl_read_buffer_extend_to()
163 if (!ssl->s3->read_buffer.EnsureCap(ssl_record_prefix_len(ssl), len)) { in ssl_read_buffer_extend_to()
167 if (ssl->rbio == nullptr) { in ssl_read_buffer_extend_to()
173 if (SSL_is_dtls(ssl)) { in ssl_read_buffer_extend_to()
175 ret = dtls_read_buffer_next_packet(ssl); in ssl_read_buffer_extend_to()
177 ret = tls_read_buffer_extend_to(ssl, len); in ssl_read_buffer_extend_to()
183 ssl->s3->read_buffer.DiscardConsumed(); in ssl_read_buffer_extend_to()
188 int ssl_handle_open_record(SSL *ssl, bool *out_retry, ssl_open_record_t ret, in ssl_handle_open_record() argument
192 ssl->s3->read_buffer.Consume(consumed); in ssl_handle_open_record()
196 ssl->s3->read_buffer.DiscardConsumed(); in ssl_handle_open_record()
203 int read_ret = ssl_read_buffer_extend_to(ssl, consumed); in ssl_handle_open_record()
220 ssl_send_alert(ssl, SSL3_AL_FATAL, alert); in ssl_handle_open_record()
240 static int tls_write_buffer_flush(SSL *ssl) { in tls_write_buffer_flush() argument
241 SSLBuffer *buf = &ssl->s3->write_buffer; in tls_write_buffer_flush()
244 int ret = BIO_write(ssl->wbio.get(), buf->data(), buf->size()); in tls_write_buffer_flush()
246 ssl->s3->rwstate = SSL_WRITING; in tls_write_buffer_flush()
255 static int dtls_write_buffer_flush(SSL *ssl) { in dtls_write_buffer_flush() argument
256 SSLBuffer *buf = &ssl->s3->write_buffer; in dtls_write_buffer_flush()
261 int ret = BIO_write(ssl->wbio.get(), buf->data(), buf->size()); in dtls_write_buffer_flush()
263 ssl->s3->rwstate = SSL_WRITING; in dtls_write_buffer_flush()
274 int ssl_write_buffer_flush(SSL *ssl) { in ssl_write_buffer_flush() argument
275 if (ssl->wbio == nullptr) { in ssl_write_buffer_flush()
280 if (SSL_is_dtls(ssl)) { in ssl_write_buffer_flush()
281 return dtls_write_buffer_flush(ssl); in ssl_write_buffer_flush()
283 return tls_write_buffer_flush(ssl); in ssl_write_buffer_flush()