Browse Source

made header encryption indicator 8-bit type

pull/265/head
Logan007 4 years ago
parent
commit
5972f5ddff
  1. 4
      header_encryption.c
  2. 4
      header_encryption.h
  3. 2
      sn_utils.c

4
header_encryption.c

@ -44,8 +44,8 @@ uint32_t packet_header_decrypt (uint8_t packet[], uint8_t packet_len,
}
int32_t packet_header_decrypt_if_required (uint8_t packet[], uint16_t packet_len,
struct sn_community *communities) {
int8_t packet_header_decrypt_if_required (uint8_t packet[], uint16_t packet_len,
struct sn_community *communities) {
struct sn_community *c, *tmp;

4
header_encryption.h

@ -23,8 +23,8 @@ uint32_t packet_header_decrypt (uint8_t packet[], uint8_t packet_len,
char * community_name, he_context_t * ctx);
int32_t packet_header_decrypt_if_required (uint8_t packet[], uint16_t packet_len,
struct sn_community * communities);
int8_t packet_header_decrypt_if_required (uint8_t packet[], uint16_t packet_len,
struct sn_community * communities);
int32_t packet_header_encrypt (uint8_t packet[], uint8_t header_len, he_context_t * ctx);

2
sn_utils.c

@ -393,6 +393,8 @@ static int process_udp(n2n_sn_t *sss,
ntohs(sender_sock->sin_port));
he = packet_header_decrypt_if_required (udp_buf, udp_size, sss->communities);
if (he < 0)
return -1; /* something wrong with packet decryption */
/* Use decode_common() to determine the kind of packet then process it:
*

Loading…
Cancel
Save