diff options
author | NIIBE Yutaka <[email protected]> | 2022-04-12 06:40:19 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2022-04-12 06:40:19 +0000 |
commit | 4d8decc23c94d179be49a545e0e78a89722e857d (patch) | |
tree | 8ccb701cd7dea89d2cdf208af662dc07d94af4bc | |
parent | Parse v5 signature subpacket. (diff) | |
download | gnupg-4d8decc23c94d179be49a545e0e78a89722e857d.tar.gz gnupg-4d8decc23c94d179be49a545e0e78a89722e857d.zip |
Add v5 signature salt.
Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r-- | g10/packet.h | 1 | ||||
-rw-r--r-- | g10/parse-packet.c | 16 |
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; |