From: Jonathan McDowell Date: Sat, 16 Sep 2023 09:27:02 +0000 (+0530) Subject: Relax version check on parsing signature + key packets X-Git-Tag: onak-0.6.3~5 X-Git-Url: https://the.earth.li/gitweb/?a=commitdiff_plain;h=62965b688f906106b1cec252162da55850d31e3f;p=onak.git Relax version check on parsing signature + key packets Rather than ensuring signatures/keys are no more than v5 allow them to be anything from v2 onwards; otherwise things like armor/dearmor won't work properly. --- diff --git a/parsekey.c b/parsekey.c index ceff429..e3fe800 100644 --- a/parsekey.c +++ b/parsekey.c @@ -378,9 +378,8 @@ onak_status_t read_openpgp_stream(size_t (*getchar_func)(void *ctx, size_t count case OPENPGP_PACKET_SIGNATURE: case OPENPGP_PACKET_SECRETKEY: case OPENPGP_PACKET_PUBLICKEY: - /* Must be v2 -> v5 */ - if (curpacket->packet->data[0] < 2 || - curpacket->packet->data[0] > 5) { + /* Must be v2 onwards */ + if (curpacket->packet->data[0] < 2) { rc = ONAK_E_INVALID_PKT; } break;