espprint_decode_encalgo(netdissect_options *ndo,
char *decode, struct sa_list *sa)
{
- int len;
size_t i;
const EVP_CIPHER *evp;
int authlen = 0;
}
*colon = '\0';
- len = colon - decode;
if (strlen(decode) > strlen("-hmac96") &&
!strcmp(decode + strlen(decode) - strlen("-hmac96"),
"-hmac96")) {
#ifdef HAVE_LIBCRYPTO
struct ip *ip;
struct sa_list *sa = NULL;
- int espsecret_keylen;
#ifdef INET6
struct ip6_hdr *ip6 = NULL;
#endif
u_char *ivoff;
u_char *p;
EVP_CIPHER_CTX ctx;
- int blocksz;
#endif
esp = (struct newesp *)bp;
ivoff = (u_char *)(esp + 1) + 0;
ivlen = sa->ivlen;
secret = sa->secret;
- espsecret_keylen = sa->secretlen;
ep = ep - sa->authlen;
if (sa->evp) {
if (EVP_CipherInit(&ctx, sa->evp, secret, NULL, 0) < 0)
(*ndo->ndo_warning)(ndo, "espkey init failed");
- blocksz = EVP_CIPHER_CTX_block_size(&ctx);
-
p = ivoff;
EVP_CipherInit(&ctx, NULL, NULL, p, 0);
EVP_Cipher(&ctx, p + ivlen, p + ivlen, ep - (p + ivlen));
icmp6_opt_print(const u_char *bp, int resid)
{
const struct nd_opt_hdr *op;
- const struct nd_opt_hdr *opl; /* why there's no struct? */
const struct nd_opt_prefix_info *opp;
- const struct icmp6_opts_redirect *opr;
const struct nd_opt_mtu *opm;
const struct nd_opt_rdnss *oprd;
const struct nd_opt_dnssl *opds;
switch (op->nd_opt_type) {
case ND_OPT_SOURCE_LINKADDR:
- opl = (struct nd_opt_hdr *)op;
l = (op->nd_opt_len << 3) - 2;
print_lladdr(cp + 2, l);
break;
case ND_OPT_TARGET_LINKADDR:
- opl = (struct nd_opt_hdr *)op;
l = (op->nd_opt_len << 3) - 2;
print_lladdr(cp + 2, l);
break;
printf(", pref. time %s", get_lifetime(EXTRACT_32BITS(&opp->nd_opt_pi_preferred_time)));
break;
case ND_OPT_REDIRECTED_HEADER:
- opr = (struct icmp6_opts_redirect *)op;
print_unknown_data(bp,"\n\t ",op->nd_opt_len<<3);
/* xxx */
break;
#else
char nla_buf[INET_ADDRSTRLEN];
#endif
- u_int8_t opt_type, opt_len, flags1, flags2;
+ u_int8_t opt_type, opt_len;
u_int32_t seq, opts_len, len, offset;
pgm = (struct pgm_header *)bp;
(void)printf("[Bad OPT_FRAGMENT option, length %u != 16]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
seq = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
offset = EXTRACT_32BITS(bp);
break;
case PGM_OPT_NAK_LIST:
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
opt_len -= sizeof(u_int32_t); /* option header */
(void)printf(" NAK LIST");
while (opt_len) {
(void)printf("[Bad OPT_JOIN option, length %u != 8]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
seq = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
(void)printf(" JOIN %u", seq);
(void)printf("[Bad OPT_NAK_BO_IVL option, length %u != 12]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
offset = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
seq = EXTRACT_32BITS(bp);
(void)printf("[Bad OPT_NAK_BO_RNG option, length %u != 12]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
offset = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
seq = EXTRACT_32BITS(bp);
break;
case PGM_OPT_REDIRECT:
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
switch (EXTRACT_16BITS(bp)) {
case AFI_IP:
addr_size = sizeof(struct in_addr);
(void)printf("[Bad OPT_PARITY_PRM option, length %u != 8]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
len = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
(void)printf(" PARITY MAXTGS %u", len);
(void)printf("[Bad OPT_PARITY_GRP option, length %u != 8]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
seq = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
(void)printf(" PARITY GROUP %u", seq);
(void)printf("[Bad OPT_CURR_TGSIZE option, length %u != 8]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
len = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
(void)printf(" PARITY ATGS %u", len);
(void)printf("[Bad OPT_NBR_UNREACH option, length %u != 4]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
(void)printf(" NBR_UNREACH");
opts_len -= 4;
break;
(void)printf("[Bad OPT_SYN option, length %u != 4]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
(void)printf(" SYN");
opts_len -= 4;
break;
(void)printf("[Bad OPT_FIN option, length %u != 4]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
(void)printf(" FIN");
opts_len -= 4;
break;
(void)printf("[Bad OPT_RST option, length %u != 4]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
(void)printf(" RST");
opts_len -= 4;
break;
(void)printf("[Bad OPT_CRQST option, length %u != 4]", opt_len);
return;
}
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
(void)printf(" CRQST");
opts_len -= 4;
break;
case PGM_OPT_PGMCC_DATA:
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
offset = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
switch (EXTRACT_16BITS(bp)) {
break;
case PGM_OPT_PGMCC_FEEDBACK:
- flags1 = *bp++;
- flags2 = *bp++;
+ bp += 2;
offset = EXTRACT_32BITS(bp);
bp += sizeof(u_int32_t);
switch (EXTRACT_16BITS(bp)) {