aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to 'g10')
-rw-r--r--g10/gpg.c1
-rw-r--r--g10/import.c7
-rw-r--r--g10/options.h2
3 files changed, 8 insertions, 2 deletions
diff --git a/g10/gpg.c b/g10/gpg.c
index 1a96db989..28f47f80b 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -1037,6 +1037,7 @@ static struct debug_flags_s debug_flags [] =
/* The list of compatibility flags. */
static struct compatibility_flags_s compatibility_flags [] =
{
+ { COMPAT_COMPR_KEYS, "compr-keys" },
{ 0, NULL }
};
diff --git a/g10/import.c b/g10/import.c
index 9adda3e8c..ba62d2322 100644
--- a/g10/import.c
+++ b/g10/import.c
@@ -1057,7 +1057,12 @@ read_block( IOBUF a, unsigned int options,
switch (pkt->pkttype)
{
case PKT_COMPRESSED:
- if (check_compress_algo (pkt->pkt.compressed->algorithm))
+ if (!(opt.compat_flags & COMPAT_COMPR_KEYS))
+ {
+ rc = GPG_ERR_UNEXPECTED_PACKET;
+ goto ready;
+ }
+ else if (check_compress_algo (pkt->pkt.compressed->algorithm))
{
rc = GPG_ERR_COMPR_ALGO;
goto ready;
diff --git a/g10/options.h b/g10/options.h
index 29641119d..62d667277 100644
--- a/g10/options.h
+++ b/g10/options.h
@@ -387,7 +387,7 @@ EXTERN_UNLESS_MAIN_MODULE int memory_debug_mode;
EXTERN_UNLESS_MAIN_MODULE int memory_stat_debug_mode;
/* Compatibility flags */
-/* #define COMPAT_FOO 1 */
+#define COMPAT_COMPR_KEYS 4 /* Allow import of compressed keys. (T7014) */
/* Compliance test macors. */