summaryrefslogtreecommitdiff
path: root/src/encrypted_packet.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/encrypted_packet.h')
-rw-r--r--src/encrypted_packet.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/encrypted_packet.h b/src/encrypted_packet.h
index 2e6c1b7..e9cdc59 100644
--- a/src/encrypted_packet.h
+++ b/src/encrypted_packet.h
@@ -36,12 +36,11 @@
#define _ENCRYPTED_PACKET_H_
#define ENCRYPTED_PACKET_SIZE_MAX 1600
-#define ENCRYPTED_PACKET_AUTHTAG_SIZE 10
#define PAYLOAD_TYPE_TAP 0x6558
#define PAYLOAD_TYPE_TUN 0x0000
#define PAYLOAD_TYPE_TUN4 0x0800
-#define PAYLOAD_TYPE_TUN6 0x86DD
+#define PAYLOAD_TYPE_TUN6 0x86DD
struct __attribute__ ((__packed__)) encrypted_packet_header_struct {
seq_nr_t seq_nr_;
@@ -52,7 +51,7 @@ typedef struct encrypted_packet_header_struct encrypted_packet_header_t;
struct encrypted_packet_struct {
u_int32_t payload_length_;
- u_int8_t* auth_tag_;
+ u_int32_t auth_tag_length_;
union __attribute__ ((__packed__)) {
u_int8_t buf_[ENCRYPTED_PACKET_SIZE_MAX];
encrypted_packet_header_t header_;
@@ -60,9 +59,9 @@ struct encrypted_packet_struct {
};
typedef struct encrypted_packet_struct encrypted_packet_t;
-void encrypted_packet_init(encrypted_packet_t* packet);
+void encrypted_packet_init(encrypted_packet_t* packet, u_int32_t auth_tag_length);
-u_int32_t encrypted_packet_get_header_length();
+u_int32_t encrypted_packet_get_minimum_length(encrypted_packet_t* packet);
u_int8_t* encrypted_packet_get_packet(encrypted_packet_t* packet);
u_int32_t encrypted_packet_get_length(encrypted_packet_t* packet);
@@ -78,9 +77,6 @@ u_int32_t encrypted_packet_get_auth_portion_length(encrypted_packet_t* packet);
u_int8_t* encrypted_packet_get_auth_tag(encrypted_packet_t* packet);
u_int32_t encrypted_packet_get_auth_tag_length(encrypted_packet_t* packet);
-void encrypted_packet_add_auth_tag(encrypted_packet_t* packet);
-void encrypted_packet_remove_auth_tag(encrypted_packet_t* packet);
-
seq_nr_t encrypted_packet_get_seq_nr(encrypted_packet_t* packet);
void encrypted_packet_set_seq_nr(encrypted_packet_t* packet, seq_nr_t seq_nr);