Quick fix to at least decode slightly larger hidden AVPs correctly
This commit is contained in:
parent
690e09ba57
commit
702ed1ec72
1 changed files with 5 additions and 1 deletions
6
l2tpns.c
6
l2tpns.c
|
|
@ -8620,6 +8620,10 @@ static void unhide_value(uint8_t *value, size_t len, uint16_t type, uint8_t *vec
|
||||||
size_t d = 0;
|
size_t d = 0;
|
||||||
uint16_t m = htons(type);
|
uint16_t m = htons(type);
|
||||||
|
|
||||||
|
// remember first block
|
||||||
|
uint8_t firstcipher[16];
|
||||||
|
memcpy(firstcipher, value, 16);
|
||||||
|
|
||||||
// Compute initial pad
|
// Compute initial pad
|
||||||
MD5_Init(&ctx);
|
MD5_Init(&ctx);
|
||||||
MD5_Update(&ctx, (unsigned char *) &m, 2);
|
MD5_Update(&ctx, (unsigned char *) &m, 2);
|
||||||
|
|
@ -8637,7 +8641,7 @@ static void unhide_value(uint8_t *value, size_t len, uint16_t type, uint8_t *vec
|
||||||
{
|
{
|
||||||
MD5_Init(&ctx);
|
MD5_Init(&ctx);
|
||||||
MD5_Update(&ctx, config->l2tp_secret, strlen(config->l2tp_secret));
|
MD5_Update(&ctx, config->l2tp_secret, strlen(config->l2tp_secret));
|
||||||
MD5_Update(&ctx, last, sizeof(digest));
|
MD5_Update(&ctx, firstcipher, sizeof(digest));
|
||||||
MD5_Final(digest, &ctx);
|
MD5_Final(digest, &ctx);
|
||||||
|
|
||||||
d = 0;
|
d = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue