1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

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 <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2024-04-09 09:24:11 +09:00
parent f7a26aa8ad
commit 3a344d6236
No known key found for this signature in database
GPG Key ID: 640114AF89DE6054

View File

@ -1031,10 +1031,10 @@ radix64_read( armor_filter_context_t *afx, IOBUF a, size_t *retn,
checkcrc++; checkcrc++;
break; break;
} }
else if (afx->dearmor_state && c == '-' else if (c == '-'
&& afx->buffer_pos + 8 < afx->buffer_len && afx->buffer_pos + 8 < afx->buffer_len
&& !strncmp (afx->buffer, "-----END ", 8)) { && !strncmp (afx->buffer, "-----END ", 8)) {
break; /* End in --dearmor mode. */ break; /* End in --dearmor mode or No CRC. */
} }
else { else {
log_error(_("invalid radix64 character %02X skipped\n"), c); log_error(_("invalid radix64 character %02X skipped\n"), c);