/* This function reassembles TLS fragments. Caller must not free the returned data buffer since an internal pointer to it is maintained.  */
static const struct wpabuf* eap_peer_tls_data_reassemble(struct eap_ssl_data *data, const struct wpabuf *in_data, int *need_more_input)
/* This function reassembles TLS fragments. Caller must not free the returned data buffer since an internal pointer to it is maintained.  */
static const struct wpabuf* eap_peer_tls_data_reassemble(struct eap_ssl_data *data, const struct wpabuf *in_data, int *need_more_input)
{
	*need_more_input = 0;
	if (data->tls_in_left > wpabuf_len(in_data) || data->tls_in) {
		int res = eap_peer_tls_reassemble_fragment(data, in_data);
		if (res) {
			if (res == 1)
				*need_more_input = 1;
			return NULL;
		}
	} else {
		data->tls_in_left = 0;
		data->tls_in = wpabuf_dup(in_data);
		if (data->tls_in == NULL)
			return NULL;
	}
	return data->tls_in;
}