1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00
Werner Koch 382ba4b137 gpg: Limit the size of key packets to a sensible value.
* g10/parse-packet.c (MAX_KEY_PACKET_LENGTH): New.
(MAX_UID_PACKET_LENGTH): New.
(MAX_COMMENT_PACKET_LENGTH): New.
(MAX_ATTR_PACKET_LENGTH): New.
(parse_key): Limit the size of a key packet to 256k.
(parse_user_id): Use macro for the packet size limit.
(parse_attribute): Ditto.
(parse_comment): Ditto.
--

Without that it is possible to force gpg to allocate large amounts of
memory by using a bad encoded MPI.  This would be an too easy DoS.
Another way to mitigate would be to change the MPI read function to
allocate memory dynamically while reading the MPI.  However, that
complicates and possibly slows down the code.  A too large key packet
is in any case a sign for broken data and thus gpg should not use it.

Reported-by: Hanno Böck
GnuPG-bug-id: 1823
Signed-off-by: Werner Koch <wk@gnupg.org>
2015-01-28 20:32:28 +01:00
..
2014-11-28 09:44:19 +01:00
2014-07-23 14:35:22 +02:00
2014-10-31 14:21:34 +01:00
2007-07-04 19:49:40 +00:00
2014-11-13 12:01:42 +01:00
2015-01-22 16:36:28 +01:00
2015-01-22 16:36:28 +01:00
2015-01-22 16:36:28 +01:00
2014-11-11 10:13:10 +01:00
2014-11-19 10:47:57 +01:00
2008-12-12 08:54:50 +00:00
2015-01-22 16:36:28 +01:00
2014-01-29 17:45:05 +01:00