diff options
author | Christian Pointner <equinox@anytun.org> | 2009-01-03 00:19:31 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2009-01-03 00:19:31 +0000 |
commit | b51c4d11e1d4d09a51b004856e8854a29cddc6c7 (patch) | |
tree | 4a608a6276ddeecb19bb10b64ab1cf5772c8128f /src/encrypted_packet.h | |
parent | added define for anytun compat (diff) |
added auth algo
tested with anytun an ANYTUN_02_COMPAT set
switched defaults for kd-prf, cipher and auth algo to use crypto
Diffstat (limited to 'src/encrypted_packet.h')
-rw-r--r-- | src/encrypted_packet.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/encrypted_packet.h b/src/encrypted_packet.h index a77e663..e35ca25 100644 --- a/src/encrypted_packet.h +++ b/src/encrypted_packet.h @@ -36,6 +36,7 @@ #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 @@ -51,6 +52,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_; union __attribute__ ((__packed__)) { u_int8_t buf_[ENCRYPTED_PACKET_SIZE_MAX]; encrypted_packet_header_t header_; @@ -68,6 +70,15 @@ u_int8_t* encrypted_packet_get_payload(encrypted_packet_t* packet); u_int32_t encrypted_packet_get_payload_length(encrypted_packet_t* packet); void encrypted_packet_set_payload_length(encrypted_packet_t* packet, u_int32_t len); +u_int8_t* encrypted_packet_get_auth_portion(encrypted_packet_t* packet); +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); |