Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
SUSE:SLE-15-SP5:GA
gpg2
gnupg-dirmngr-Suppress-error-message-on-trial-r...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File gnupg-dirmngr-Suppress-error-message-on-trial-reading-as-PEM.patch of Package gpg2
From 25d37a0a6a9c42326777c2949054a8bd6f276f8a Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka <gniibe@fsij.org> Date: Fri, 25 Mar 2022 08:38:42 +0900 Subject: [PATCH] dirmngr: Suppress error message on trial reading as PEM format. * dirmngr/dirmngr-client.c (read_pem_certificate): Add NO_ERRMSG argument to suppress the error message. (read_certificate, squid_loop_body): Follow the change. -- GnuPG-bug-id: 5531 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org> --- dirmngr/dirmngr-client.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) Index: gnupg-2.2.27/dirmngr/dirmngr-client.c =================================================================== --- gnupg-2.2.27.orig/dirmngr/dirmngr-client.c +++ gnupg-2.2.27/dirmngr/dirmngr-client.c @@ -460,7 +460,8 @@ data_cb (void *opaque, const void *buffe returned in an alloced buffer whose address will be returned in RBUF and its length in RBUFLEN. */ static gpg_error_t -read_pem_certificate (const char *fname, unsigned char **rbuf, size_t *rbuflen) +read_pem_certificate (const char *fname, unsigned char **rbuf, size_t *rbuflen, + int no_errmsg) { FILE *fp; int c; @@ -603,7 +604,8 @@ read_pem_certificate (const char *fname, } else if (state != s_waitend) { - log_error ("no certificate or invalid encoded\n"); + if (!no_errmsg) + log_error ("no certificate or invalid encoded\n"); xfree (buf); return gpg_error (GPG_ERR_INV_ARMOR); } @@ -626,13 +628,13 @@ read_certificate (const char *fname, uns size_t nread, bufsize, buflen; if (opt.pem) - return read_pem_certificate (fname, rbuf, rbuflen); + return read_pem_certificate (fname, rbuf, rbuflen, 0); else if (fname) { /* A filename has been given. Let's just assume it is in PEM format and decode it, and fall back to interpreting it as binary certificate if that fails. */ - err = read_pem_certificate (fname, rbuf, rbuflen); + err = read_pem_certificate (fname, rbuf, rbuflen, 1); if (! err) return 0; } @@ -904,7 +906,7 @@ squid_loop_body (assuan_context_t ctx) unsigned char *certbuf; size_t certbuflen = 0; - err = read_pem_certificate (NULL, &certbuf, &certbuflen); + err = read_pem_certificate (NULL, &certbuf, &certbuflen, 0); if (gpg_err_code (err) == GPG_ERR_EOF) return err; if (err)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor