From 3a344d6236521d768793e8b34a96a18ce13bab0e Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 9 Apr 2024 09:24:11 +0900 Subject: [PATCH] gpg: Allow no CRC24 checksum in armor. * g10/armor.c (radix64_read): Detect the end of armor when there is no CRC24 checksum. -- GnuPG-bug-id: 7071 Signed-off-by: NIIBE Yutaka --- g10/armor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/g10/armor.c b/g10/armor.c index b47c04ab3..81af15339 100644 --- a/g10/armor.c +++ b/g10/armor.c @@ -1031,10 +1031,10 @@ radix64_read( armor_filter_context_t *afx, IOBUF a, size_t *retn, checkcrc++; break; } - else if (afx->dearmor_state && c == '-' + else if (c == '-' && afx->buffer_pos + 8 < afx->buffer_len && !strncmp (afx->buffer, "-----END ", 8)) { - break; /* End in --dearmor mode. */ + break; /* End in --dearmor mode or No CRC. */ } else { log_error(_("invalid radix64 character %02X skipped\n"), c);