mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
sm: Fix parsing encrypted data.
* sm/minip12.c (cram_octet_string): Finish when N==0. (parse_bag_encrypted_data): Support constructed data with multiple octet strings. -- GnuPG-bug-id: 5793 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
f8075257af
commit
6c50834c09
15
sm/minip12.c
15
sm/minip12.c
@ -362,7 +362,7 @@ cram_octet_string (const unsigned char *input, size_t *length,
|
|||||||
if (!output)
|
if (!output)
|
||||||
goto bailout;
|
goto bailout;
|
||||||
|
|
||||||
for (;;)
|
while (n)
|
||||||
{
|
{
|
||||||
if (parse_tag (&s, &n, &ti))
|
if (parse_tag (&s, &n, &ti))
|
||||||
goto bailout;
|
goto bailout;
|
||||||
@ -933,6 +933,19 @@ parse_bag_encrypted_data (const unsigned char *buffer, size_t length,
|
|||||||
r_consumed = NULL; /* Ugly hack to not update that value any further. */
|
r_consumed = NULL; /* Ugly hack to not update that value any further. */
|
||||||
ti.length = n;
|
ti.length = n;
|
||||||
}
|
}
|
||||||
|
else if (ti.class == CLASS_CONTEXT && ti.tag == 0 && ti.is_constructed)
|
||||||
|
{
|
||||||
|
where = "octets-rc2or3des-ciphertext";
|
||||||
|
n = ti.length;
|
||||||
|
cram_buffer = cram_octet_string ( p, &n, &consumed);
|
||||||
|
if (!cram_buffer)
|
||||||
|
goto bailout;
|
||||||
|
p = p_start = cram_buffer;
|
||||||
|
if (r_consumed)
|
||||||
|
*r_consumed = consumed;
|
||||||
|
r_consumed = NULL; /* Ugly hack to not update that value any further. */
|
||||||
|
ti.length = n;
|
||||||
|
}
|
||||||
else if (ti.class == CLASS_CONTEXT && ti.tag == 0 && ti.length )
|
else if (ti.class == CLASS_CONTEXT && ti.tag == 0 && ti.length )
|
||||||
;
|
;
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user