]> git.ipfire.org Git - thirdparty/openvpn.git/commit
cleanup: merge packet_id_alloc_outgoing() into packet_id_write()
authorSteffan Karger <steffan.karger@fox-it.com>
Fri, 5 May 2017 17:44:51 +0000 (19:44 +0200)
committerGert Doering <gert@greenie.muc.de>
Fri, 5 May 2017 18:53:05 +0000 (20:53 +0200)
commita87e1431baccd49a9344cfc63ab7446c4317fa2f
tree76986d49406587eccfebb17a26965277023df959
parent79ea67f77ca3afe91222f62e17df885a30409285
cleanup: merge packet_id_alloc_outgoing() into packet_id_write()

The functions packet_id_alloc_outgoing() and packet_id_write() were
always called in tandem.  Instead of forcing the caller to allocate a
packet_id_net to do so, merge the two functions.  This simplifies the API
and reduces the chance on mistakes in the future.

This patch adds unit tests to verify the behaviour of packet_id_write().
Verifying that we assert out correctly required the change to mock_msg.c.

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@openvpn.net>
Message-Id: <1494006291-3522-1-git-send-email-steffan.karger@fox-it.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14541.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/crypto.c
src/openvpn/packet_id.c
src/openvpn/packet_id.h
src/openvpn/tls_crypt.c
tests/unit_tests/openvpn/Makefile.am
tests/unit_tests/openvpn/mock_msg.c
tests/unit_tests/openvpn/test_packet_id.c [new file with mode: 0644]