Browse Source

made header encryption indicator 8-bit type

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

2
header_encryption.c

@ -44,7 +44,7 @@ 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,
int8_t packet_header_decrypt_if_required (uint8_t packet[], uint16_t packet_len,
struct sn_community *communities) {
struct sn_community *c, *tmp;

2
header_encryption.h

@ -23,7 +23,7 @@ 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,
int8_t packet_header_decrypt_if_required (uint8_t packet[], uint16_t packet_len,
struct sn_community * communities);

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