I'm unsure currently what the relation between the input data length (input_len) and the returned length (ssl_state->curr_connp->message_length) is. This ssl_state->curr_connp->message_length is not passed to this function as input length and is not modified/set in this function.