]> the.earth.li Git - onak.git/commitdiff
Relax version check on parsing signature + key packets
authorJonathan McDowell <noodles@earth.li>
Sat, 16 Sep 2023 09:27:02 +0000 (14:57 +0530)
committerJonathan McDowell <noodles@earth.li>
Sat, 16 Sep 2023 09:33:51 +0000 (15:03 +0530)
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.

parsekey.c

index ceff4292b7e4742f6f47dad412790fe6152172ec..e3fe800d9a203341d44e47993cd2da3c573d2383 100644 (file)
@@ -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;