Package: gnupg2 / 2.2.12-1+deb10u1

from-2.2.16/dirmngr-Better-error-code-for-http-status-413.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
From: Werner Koch <wk@gnupg.org>
Date: Fri, 29 Mar 2019 14:20:47 +0100
Subject: dirmngr: Better error code for http status 413.

* dirmngr/ks-engine-hkp.c (send_request): New case for 413.
* dirmngr/ks-engine-http.c (ks_http_fetch): Ditto.
* dirmngr/ocsp.c (do_ocsp_request): Ditto.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 0a30ce036a615bc95382e0640d185b031f8c6a63)
---
 dirmngr/ks-engine-hkp.c  | 4 ++++
 dirmngr/ks-engine-http.c | 4 ++++
 dirmngr/ocsp.c           | 4 ++++
 3 files changed, 12 insertions(+)

diff --git a/dirmngr/ks-engine-hkp.c b/dirmngr/ks-engine-hkp.c
index 68d2064..8754a6b 100644
--- a/dirmngr/ks-engine-hkp.c
+++ b/dirmngr/ks-engine-hkp.c
@@ -1266,6 +1266,10 @@ send_request (ctrl_t ctrl, const char *request, const char *hostportstr,
       err = gpg_error (GPG_ERR_NOT_IMPLEMENTED);
       goto leave;
 
+    case 413:  /* Payload too large */
+      err = gpg_error (GPG_ERR_TOO_LARGE);
+      goto leave;
+
     default:
       log_error (_("error accessing '%s': http status %u\n"),
                  request, http_get_status_code (http));
diff --git a/dirmngr/ks-engine-http.c b/dirmngr/ks-engine-http.c
index 1abb350..a9600db 100644
--- a/dirmngr/ks-engine-http.c
+++ b/dirmngr/ks-engine-http.c
@@ -174,6 +174,10 @@ ks_http_fetch (ctrl_t ctrl, const char *url, unsigned int flags,
       }
       goto once_more;
 
+    case 413:  /* Payload too large */
+      err = gpg_error (GPG_ERR_TOO_LARGE);
+      goto leave;
+
     default:
       log_error (_("error accessing '%s': http status %u\n"),
                  url, http_get_status_code (http));
diff --git a/dirmngr/ocsp.c b/dirmngr/ocsp.c
index 2067b7b..7edac80 100644
--- a/dirmngr/ocsp.c
+++ b/dirmngr/ocsp.c
@@ -238,6 +238,10 @@ do_ocsp_request (ctrl_t ctrl, ksba_ocsp_t ocsp, gcry_md_hd_t md,
               }
               break;
 
+            case 413:  /* Payload too large */
+              err = gpg_error (GPG_ERR_TOO_LARGE);
+              break;
+
             default:
               log_error (_("error accessing '%s': http status %u\n"),
                          url, http_get_status_code (http));