aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--g10/packet.h1
-rw-r--r--g10/parse-packet.c16
2 files changed, 17 insertions, 0 deletions
diff --git a/g10/packet.h b/g10/packet.h
index 2301107b2..72c405898 100644
--- a/g10/packet.h
+++ b/g10/packet.h
@@ -264,6 +264,7 @@ typedef struct
/* First 2 bytes of the digest. (Serialized. Note: this is not
automatically filled in when serializing a signature!) */
byte digest_start[2];
+ byte v5_salt[16];
/* The signature. (Serialized.) */
gcry_mpi_t data[PUBKEY_MAX_NSIG];
/* The message digest and its length (in bytes). Note the maximum
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index 7acad4aa9..7af5e6b40 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -2273,6 +2273,22 @@ parse_signature (IOBUF inp, int pkttype, unsigned long pktlen,
sig->digest_start[1] = iobuf_get_noeof (inp);
pktlen--;
+ if (sig->version == 5)
+ {
+ if (pktlen < 16)
+ goto underflow;
+ if (iobuf_read (inp, sig->v5_salt, 16) != 16)
+ {
+ log_error ("premature eof while reading "
+ "salt\n");
+ if (list_mode)
+ es_fputs (":signature packet: [premature eof]\n", listfp);
+ rc = -1;
+ goto leave;
+ }
+ pktlen -= 16;
+ }
+
if (is_v4or5 && sig->pubkey_algo) /* Extract required information. */
{
const byte *p;