From cda4789a9f7dd9356bd7ae7d3eea02ff0055773c Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 16 May 2025 12:23:05 +0200 Subject: Time for a new error code; this time GPG_ERR_UNEXPECTED_PACKET -- We already have _tag which is used for ASN.1, _MSG which is used by protocols like WKS and TLS, and the GPG_ERR_UNEXPECTED which is unrelated the former one and means just that an error was not expected. OpenPGP also has some cases where a packet is not expected. A dedicated error code thus makes sense. --- NEWS | 5 +++++ doc/errorref.txt | 5 +++++ src/err-codes.h.in | 1 + 3 files changed, 11 insertions(+) diff --git a/NEWS b/NEWS index 8bb11a9..e82db50 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,11 @@ Noteworthy changes in version 1.56 (unrelease) [C39/A39/R_] ----------------------------------------------- + + * Interface changes relative to the 1.55 release: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + GPG_ERR_UNEXPECTED_PACKET NEW. + Release-info: https://dev.gnupg.org/T7625 diff --git a/doc/errorref.txt b/doc/errorref.txt index c4b8399..84c019d 100644 --- a/doc/errorref.txt +++ b/doc/errorref.txt @@ -793,6 +793,11 @@ GPG_ERR_SEXP_ODD_HEX_NUMBERS Odd hexadecimal numbers in S-expression GPG_ERR_SEXP_BAD_OCT_CHAR Bad octal character in S-expression +GPG_ERR_UNEXPECTED_PACKET Unexpected packet + + GnuPG: - An OpenPGP packet was not expected at this place of the + parsed data. + GPG_ERR_SUBKEYS_EXP_REV All subkeys are expired or revoked GPG_ERR_DB_CORRUPTED Database is corrupted diff --git a/src/err-codes.h.in b/src/err-codes.h.in index d8b2fb0..15c543f 100644 --- a/src/err-codes.h.in +++ b/src/err-codes.h.in @@ -248,6 +248,7 @@ 213 GPG_ERR_SEXP_BAD_OCT_CHAR Bad octal character in S-expression # 214 to 216 are free to be used. +216 GPG_ERR_UNEXPECTED_PACKET Unexpected packet 217 GPG_ERR_SUBKEYS_EXP_OR_REV All subkeys are expired or revoked 218 GPG_ERR_DB_CORRUPTED Database is corrupted 219 GPG_ERR_SERVER_FAILED Server indicated a failure -- cgit v1.2.3