]> 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:54:13 +0000 (20:54 +0200)
commit653d39192297880b4fbc6a53cce6f8692782e1b7
tree26b650cb1d76ebbc91f66a8c1340a0b1bf23e014
parent1935729fe6d6badd978e9dfdd3402857b3d000a0
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>
(cherry picked from commit a87e1431baccd49a9344cfc63ab7446c4317fa2f)
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]