Quick fix to at least decode slightly larger hidden AVPs correctly

This commit is contained in:
Tassilo Schweyer 2025-05-05 03:15:52 +02:00
parent 690e09ba57
commit 702ed1ec72

View file

@ -8620,6 +8620,10 @@ static void unhide_value(uint8_t *value, size_t len, uint16_t type, uint8_t *vec
size_t d = 0;
uint16_t m = htons(type);
// remember first block
uint8_t firstcipher[16];
memcpy(firstcipher, value, 16);
// Compute initial pad
MD5_Init(&ctx);
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_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);
d = 0;