Compare commits
No commits in common. 'i8c' and 'c9' have entirely different histories.
@ -1 +1,2 @@
|
||||
SOURCES/gnupg-2.2.20.tar.bz2
|
||||
SOURCES/gnupg-2.3.3.tar.bz2
|
||||
SOURCES/gnupg-2.3.3.tar.bz2.sig
|
||||
|
@ -1 +1,2 @@
|
||||
d5290f0781df5dc83302127d6065fb59b35e53d7 SOURCES/gnupg-2.2.20.tar.bz2
|
||||
b19a407076424704f1b00e8265254de1b3061659 SOURCES/gnupg-2.3.3.tar.bz2
|
||||
38fed91a8c4b3ba09977ab06567395448b6f1242 SOURCES/gnupg-2.3.3.tar.bz2.sig
|
||||
|
@ -1,62 +0,0 @@
|
||||
diff -up gnupg-2.1.21/tools/Makefile.am.insttools gnupg-2.1.21/tools/Makefile.am
|
||||
--- gnupg-2.1.21/tools/Makefile.am.insttools 2017-04-03 17:13:56.000000000 +0200
|
||||
+++ gnupg-2.1.21/tools/Makefile.am 2017-07-18 12:10:59.431729640 +0200
|
||||
@@ -35,8 +35,8 @@ AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(GPG_ER
|
||||
sbin_SCRIPTS = addgnupghome applygnupgdefaults
|
||||
|
||||
if HAVE_USTAR
|
||||
-# bin_SCRIPTS += gpg-zip
|
||||
-noinst_SCRIPTS = gpg-zip
|
||||
+bin_PROGRAMS += gpg-zip
|
||||
+#noinst_SCRIPTS = gpg-zip
|
||||
endif
|
||||
|
||||
if BUILD_SYMCRYPTRUN
|
||||
@@ -53,7 +53,7 @@ endif
|
||||
|
||||
libexec_PROGRAMS = gpg-wks-client
|
||||
|
||||
-bin_PROGRAMS = gpgconf gpg-connect-agent ${symcryptrun}
|
||||
+bin_PROGRAMS = gpgconf gpg-connect-agent ${symcryptrun} gpgsplit
|
||||
if !HAVE_W32_SYSTEM
|
||||
bin_PROGRAMS += watchgnupg gpgparsemail ${gpg_wks_server}
|
||||
endif
|
||||
@@ -63,7 +63,7 @@ libexec_PROGRAMS += gpg-check-pattern
|
||||
endif
|
||||
|
||||
if !HAVE_W32CE_SYSTEM
|
||||
-noinst_PROGRAMS = clean-sat make-dns-cert gpgsplit
|
||||
+noinst_PROGRAMS = clean-sat make-dns-cert
|
||||
endif
|
||||
|
||||
if !HAVE_W32CE_SYSTEM
|
||||
diff -up gnupg-2.1.21/tools/Makefile.in.insttools gnupg-2.1.21/tools/Makefile.in
|
||||
--- gnupg-2.1.21/tools/Makefile.in.insttools 2017-05-15 16:15:04.000000000 +0200
|
||||
+++ gnupg-2.1.21/tools/Makefile.in 2017-07-18 12:12:17.907734745 +0200
|
||||
@@ -137,13 +137,13 @@ DIST_COMMON = $(top_srcdir)/am/cmacros.a
|
||||
@GNUPG_DIRMNGR_LDAP_PGM_TRUE@am__append_7 = -DGNUPG_DEFAULT_DIRMNGR_LDAP="\"@GNUPG_DIRMNGR_LDAP_PGM@\""
|
||||
@HAVE_W32_SYSTEM_TRUE@am__append_8 = gpg-connect-agent-w32info.o
|
||||
libexec_PROGRAMS = gpg-wks-client$(EXEEXT) $(am__EXEEXT_5)
|
||||
-bin_PROGRAMS = gpgconf$(EXEEXT) gpg-connect-agent$(EXEEXT) \
|
||||
+bin_PROGRAMS = gpgconf$(EXEEXT) gpg-connect-agent$(EXEEXT) gpgsplit$(EXEEXT) \
|
||||
$(am__EXEEXT_1) $(am__EXEEXT_3) $(am__EXEEXT_4)
|
||||
@HAVE_W32_SYSTEM_FALSE@am__append_9 = watchgnupg gpgparsemail ${gpg_wks_server}
|
||||
@DISABLE_REGEX_FALSE@am__append_10 = gpg-check-pattern
|
||||
@HAVE_W32CE_SYSTEM_FALSE@noinst_PROGRAMS = clean-sat$(EXEEXT) \
|
||||
@HAVE_W32CE_SYSTEM_FALSE@ make-dns-cert$(EXEEXT) \
|
||||
-@HAVE_W32CE_SYSTEM_FALSE@ gpgsplit$(EXEEXT) $(am__EXEEXT_6)
|
||||
+@HAVE_W32CE_SYSTEM_FALSE@ $(am__EXEEXT_6)
|
||||
@BUILD_GPGTAR_TRUE@@HAVE_W32CE_SYSTEM_FALSE@am__append_11 = gpgtar
|
||||
@BUILD_GPGTAR_FALSE@@HAVE_W32CE_SYSTEM_FALSE@am__append_12 = gpgtar
|
||||
subdir = tools
|
||||
@@ -582,8 +582,8 @@ libcommontlsnpth = ../common/libcommontl
|
||||
AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(GPG_ERROR_CFLAGS) $(LIBASSUAN_CFLAGS)
|
||||
sbin_SCRIPTS = addgnupghome applygnupgdefaults
|
||||
|
||||
-# bin_SCRIPTS += gpg-zip
|
||||
-@HAVE_USTAR_TRUE@noinst_SCRIPTS = gpg-zip
|
||||
+@HAVE_USTAR_TRUE@bin_PROGRAMS += gpg-zip
|
||||
+#@HAVE_USTAR_TRUE@noinst_SCRIPTS = gpg-zip
|
||||
@BUILD_SYMCRYPTRUN_FALSE@symcryptrun =
|
||||
@BUILD_SYMCRYPTRUN_TRUE@symcryptrun = symcryptrun
|
||||
@BUILD_WKS_TOOLS_FALSE@gpg_wks_server =
|
@ -1,12 +0,0 @@
|
||||
diff -up gnupg-2.1.21/g10/keygen.c.large-rsa gnupg-2.1.21/g10/keygen.c
|
||||
--- gnupg-2.1.21/g10/keygen.c.large-rsa 2017-05-15 14:13:22.000000000 +0200
|
||||
+++ gnupg-2.1.21/g10/keygen.c 2017-07-18 16:12:37.738895016 +0200
|
||||
@@ -2091,7 +2091,7 @@ get_keysize_range (int algo, unsigned in
|
||||
|
||||
default:
|
||||
*min = opt.compliance == CO_DE_VS ? 2048: 1024;
|
||||
- *max = 4096;
|
||||
+ *max = opt.flags.large_rsa == 1 ? 8192 : 4096;
|
||||
def = 2048;
|
||||
break;
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
diff -up gnupg-2.2.16/sm/certlist.c.keyusage gnupg-2.2.16/sm/certlist.c
|
||||
--- gnupg-2.2.16/sm/certlist.c.keyusage 2019-07-01 17:17:06.925254065 +0200
|
||||
+++ gnupg-2.2.16/sm/certlist.c 2019-07-01 17:24:15.665759322 +0200
|
||||
@@ -147,10 +147,9 @@ cert_usage_p (ksba_cert_t cert, int mode
|
||||
|
||||
if (mode == 5)
|
||||
{
|
||||
- if (use != ~0
|
||||
- && (have_ocsp_signing
|
||||
- || (use & (KSBA_KEYUSAGE_KEY_CERT_SIGN
|
||||
- |KSBA_KEYUSAGE_CRL_SIGN))))
|
||||
+ if (have_ocsp_signing
|
||||
+ || (use & (KSBA_KEYUSAGE_KEY_CERT_SIGN
|
||||
+ |KSBA_KEYUSAGE_CRL_SIGN)))
|
||||
return 0;
|
||||
if (!silent)
|
||||
log_info (_("certificate should not have "
|
@ -1,319 +0,0 @@
|
||||
diff -up gnupg-2.2.20/common/server-help.c.coverity gnupg-2.2.20/common/server-help.c
|
||||
--- gnupg-2.2.20/common/server-help.c.coverity 2019-02-11 10:59:34.000000000 +0100
|
||||
+++ gnupg-2.2.20/common/server-help.c 2020-05-04 12:00:01.085945639 +0200
|
||||
@@ -156,7 +156,7 @@ get_option_value (char *line, const char
|
||||
*pend = 0;
|
||||
*r_value = xtrystrdup (p);
|
||||
*pend = c;
|
||||
- if (!p)
|
||||
+ if (!*r_value)
|
||||
return my_error_from_syserror ();
|
||||
return 0;
|
||||
}
|
||||
diff -up gnupg-2.2.20/dirmngr/dns.c.coverity gnupg-2.2.20/dirmngr/dns.c
|
||||
--- gnupg-2.2.20/dirmngr/dns.c.coverity 2019-07-09 11:08:45.000000000 +0200
|
||||
+++ gnupg-2.2.20/dirmngr/dns.c 2020-05-04 18:04:12.285521661 +0200
|
||||
@@ -10106,9 +10106,8 @@ static const struct {
|
||||
{ "AR", DNS_S_ADDITIONAL },
|
||||
};
|
||||
|
||||
-const char *(dns_strsection)(enum dns_section section) {
|
||||
- char _dst[DNS_STRMAXLEN + 1] = { 0 };
|
||||
- struct dns_buf dst = DNS_B_INTO(_dst, sizeof _dst);
|
||||
+const char *(dns_strsection)(enum dns_section section, void *_dst, size_t lim) {
|
||||
+ struct dns_buf dst = DNS_B_INTO(_dst, lim);
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < lengthof(dns_sections); i++) {
|
||||
@@ -10156,9 +10155,8 @@ static const struct {
|
||||
{ "IN", DNS_C_IN },
|
||||
};
|
||||
|
||||
-const char *(dns_strclass)(enum dns_class type) {
|
||||
- char _dst[DNS_STRMAXLEN + 1] = { 0 };
|
||||
- struct dns_buf dst = DNS_B_INTO(_dst, sizeof _dst);
|
||||
+const char *(dns_strclass)(enum dns_class type, void *_dst, size_t lim) {
|
||||
+ struct dns_buf dst = DNS_B_INTO(_dst, lim);
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < lengthof(dns_classes); i++) {
|
||||
@@ -10193,9 +10191,8 @@ enum dns_class dns_iclass(const char *na
|
||||
} /* dns_iclass() */
|
||||
|
||||
|
||||
-const char *(dns_strtype)(enum dns_type type) {
|
||||
- char _dst[DNS_STRMAXLEN + 1] = { 0 };
|
||||
- struct dns_buf dst = DNS_B_INTO(_dst, sizeof _dst);
|
||||
+const char *(dns_strtype)(enum dns_type type, void *_dst, size_t lim) {
|
||||
+ struct dns_buf dst = DNS_B_INTO(_dst, lim);
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < lengthof(dns_rrtypes); i++) {
|
||||
diff -up gnupg-2.2.20/dirmngr/dns.h.coverity gnupg-2.2.20/dirmngr/dns.h
|
||||
--- gnupg-2.2.20/dirmngr/dns.h.coverity 2019-03-07 13:03:26.000000000 +0100
|
||||
+++ gnupg-2.2.20/dirmngr/dns.h 2020-05-04 18:04:12.287521625 +0200
|
||||
@@ -272,15 +272,25 @@ enum dns_rcode {
|
||||
*/
|
||||
#define DNS_STRMAXLEN 47 /* "QUESTION|ANSWER|AUTHORITY|ADDITIONAL" */
|
||||
|
||||
-DNS_PUBLIC const char *dns_strsection(enum dns_section);
|
||||
+DNS_PUBLIC const char *dns_strsection(enum dns_section, void *, size_t);
|
||||
+#define dns_strsection3(a, b, c) \
|
||||
+ dns_strsection((a), (b), (c))
|
||||
+#define dns_strsection1(a) dns_strsection((a), (char [DNS_STRMAXLEN + 1]){ 0 }, DNS_STRMAXLEN + 1)
|
||||
+#define dns_strsection(...) DNS_PP_CALL(DNS_PP_XPASTE(dns_strsection, DNS_PP_NARG(__VA_ARGS__)), __VA_ARGS__)
|
||||
|
||||
DNS_PUBLIC enum dns_section dns_isection(const char *);
|
||||
|
||||
-DNS_PUBLIC const char *dns_strclass(enum dns_class);
|
||||
+DNS_PUBLIC const char *dns_strclass(enum dns_class, void *, size_t);
|
||||
+#define dns_strclass3(a, b, c) dns_strclass((a), (b), (c))
|
||||
+#define dns_strclass1(a) dns_strclass((a), (char [DNS_STRMAXLEN + 1]){ 0 }, DNS_STRMAXLEN + 1)
|
||||
+#define dns_strclass(...) DNS_PP_CALL(DNS_PP_XPASTE(dns_strclass, DNS_PP_NARG(__VA_ARGS__)), __VA_ARGS__)
|
||||
|
||||
DNS_PUBLIC enum dns_class dns_iclass(const char *);
|
||||
|
||||
-DNS_PUBLIC const char *dns_strtype(enum dns_type);
|
||||
+DNS_PUBLIC const char *dns_strtype(enum dns_type, void *, size_t);
|
||||
+#define dns_strtype3(a, b, c) dns_strtype((a), (b), (c))
|
||||
+#define dns_strtype1(a) dns_strtype((a), (char [DNS_STRMAXLEN + 1]){ 0 }, DNS_STRMAXLEN + 1)
|
||||
+#define dns_strtype(...) DNS_PP_CALL(DNS_PP_XPASTE(dns_strtype, DNS_PP_NARG(__VA_ARGS__)), __VA_ARGS__)
|
||||
|
||||
DNS_PUBLIC enum dns_type dns_itype(const char *);
|
||||
|
||||
diff -up gnupg-2.2.20/dirmngr/domaininfo.c.coverity gnupg-2.2.20/dirmngr/domaininfo.c
|
||||
--- gnupg-2.2.20/dirmngr/domaininfo.c.coverity 2019-07-09 11:08:45.000000000 +0200
|
||||
+++ gnupg-2.2.20/dirmngr/domaininfo.c 2020-05-04 17:54:30.800899152 +0200
|
||||
@@ -193,6 +193,7 @@ insert_or_update (const char *domain,
|
||||
log_error ("domaininfo: error allocating helper array: %s\n",
|
||||
gpg_strerror (gpg_err_code_from_syserror ()));
|
||||
drop_extra = bucket;
|
||||
+ xfree (di_new);
|
||||
goto leave;
|
||||
}
|
||||
narray = 0;
|
||||
@@ -258,6 +259,8 @@ insert_or_update (const char *domain,
|
||||
* sensible strategy. */
|
||||
drop_extra = domainbuckets[hash];
|
||||
domainbuckets[hash] = keep;
|
||||
+
|
||||
+ xfree (array);
|
||||
}
|
||||
|
||||
/* Insert */
|
||||
diff -up gnupg-2.2.20/dirmngr/http.c.coverity gnupg-2.2.20/dirmngr/http.c
|
||||
--- gnupg-2.2.20/dirmngr/http.c.coverity 2019-11-18 18:44:33.000000000 +0100
|
||||
+++ gnupg-2.2.20/dirmngr/http.c 2020-05-04 17:00:47.826878715 +0200
|
||||
@@ -3656,7 +3656,6 @@ http_prepare_redirect (http_redir_info_t
|
||||
if (!newurl)
|
||||
{
|
||||
err = gpg_error_from_syserror ();
|
||||
- http_release_parsed_uri (locuri);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
@@ -3675,7 +3674,6 @@ http_prepare_redirect (http_redir_info_t
|
||||
if (!newurl)
|
||||
{
|
||||
err = gpg_error_from_syserror ();
|
||||
- http_release_parsed_uri (locuri);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
diff -up gnupg-2.2.20/dirmngr/ks-engine-hkp.c.coverity gnupg-2.2.20/dirmngr/ks-engine-hkp.c
|
||||
--- gnupg-2.2.20/dirmngr/ks-engine-hkp.c.coverity 2019-11-18 18:44:33.000000000 +0100
|
||||
+++ gnupg-2.2.20/dirmngr/ks-engine-hkp.c 2020-05-04 12:39:49.970920664 +0200
|
||||
@@ -1426,7 +1426,7 @@ ks_hkp_search (ctrl_t ctrl, parsed_uri_t
|
||||
int reselect;
|
||||
unsigned int httpflags;
|
||||
char *httphost = NULL;
|
||||
- unsigned int http_status;
|
||||
+ unsigned int http_status = 0;
|
||||
unsigned int tries = SEND_REQUEST_RETRIES;
|
||||
unsigned int extra_tries = SEND_REQUEST_EXTRA_RETRIES;
|
||||
|
||||
diff -up gnupg-2.2.20/g10/card-util.c.coverity gnupg-2.2.20/g10/card-util.c
|
||||
--- gnupg-2.2.20/g10/card-util.c.coverity 2020-03-03 13:33:22.000000000 +0100
|
||||
+++ gnupg-2.2.20/g10/card-util.c 2020-05-04 16:56:47.788157786 +0200
|
||||
@@ -704,7 +704,7 @@ card_status (ctrl_t ctrl, estream_t fp,
|
||||
{
|
||||
int err;
|
||||
strlist_t card_list, sl;
|
||||
- char *serialno0, *serialno1;
|
||||
+ char *serialno0, *serialno1 = NULL;
|
||||
int all_cards = 0;
|
||||
int any_card = 0;
|
||||
|
||||
@@ -749,6 +749,7 @@ card_status (ctrl_t ctrl, estream_t fp,
|
||||
|
||||
current_card_status (ctrl, fp, NULL, 0);
|
||||
xfree (serialno1);
|
||||
+ serialno1 = NULL;
|
||||
|
||||
if (!all_cards)
|
||||
goto leave;
|
||||
diff -up gnupg-2.2.20/g10/import.c.coverity gnupg-2.2.20/g10/import.c
|
||||
--- gnupg-2.2.20/g10/import.c.coverity 2020-05-04 12:34:39.820379830 +0200
|
||||
+++ gnupg-2.2.20/g10/import.c 2020-05-04 12:34:55.366106195 +0200
|
||||
@@ -1888,7 +1888,7 @@ import_one_real (ctrl_t ctrl,
|
||||
|
||||
if (opt.interactive && !silent)
|
||||
{
|
||||
- if (is_status_enabled())
|
||||
+ if (uidnode && is_status_enabled())
|
||||
print_import_check (pk, uidnode->pkt->pkt.user_id);
|
||||
merge_keys_and_selfsig (ctrl, keyblock);
|
||||
tty_printf ("\n");
|
||||
diff -up gnupg-2.2.20/g10/keygen.c.coverity gnupg-2.2.20/g10/keygen.c
|
||||
--- gnupg-2.2.20/g10/keygen.c.coverity 2020-05-04 12:23:04.852613017 +0200
|
||||
+++ gnupg-2.2.20/g10/keygen.c 2020-05-04 17:33:18.923891110 +0200
|
||||
@@ -3075,7 +3075,7 @@ parse_key_parameter_part (ctrl_t ctrl,
|
||||
char *endp;
|
||||
const char *curve = NULL;
|
||||
int ecdh_or_ecdsa = 0;
|
||||
- unsigned int size;
|
||||
+ unsigned int size = 0;
|
||||
int keyuse;
|
||||
int i;
|
||||
const char *s;
|
||||
@@ -5719,12 +5719,20 @@ gen_card_key (int keyno, int algo, int i
|
||||
the self-signatures. */
|
||||
err = agent_readkey (NULL, 1, keyid, &public);
|
||||
if (err)
|
||||
- return err;
|
||||
+ {
|
||||
+ xfree (pkt);
|
||||
+ xfree (pk);
|
||||
+ return err;
|
||||
+ }
|
||||
err = gcry_sexp_sscan (&s_key, NULL, public,
|
||||
gcry_sexp_canon_len (public, 0, NULL, NULL));
|
||||
xfree (public);
|
||||
if (err)
|
||||
- return err;
|
||||
+ {
|
||||
+ xfree (pkt);
|
||||
+ xfree (pk);
|
||||
+ return err;
|
||||
+ }
|
||||
|
||||
if (algo == PUBKEY_ALGO_RSA)
|
||||
err = key_from_sexp (pk->pkey, s_key, "public-key", "ne");
|
||||
@@ -5739,6 +5747,7 @@ gen_card_key (int keyno, int algo, int i
|
||||
if (err)
|
||||
{
|
||||
log_error ("key_from_sexp failed: %s\n", gpg_strerror (err) );
|
||||
+ xfree (pkt);
|
||||
free_public_key (pk);
|
||||
return err;
|
||||
}
|
||||
diff -up gnupg-2.2.20/g10/sig-check.c.coverity gnupg-2.2.20/g10/sig-check.c
|
||||
--- gnupg-2.2.20/g10/sig-check.c.coverity 2020-05-04 12:18:18.515653963 +0200
|
||||
+++ gnupg-2.2.20/g10/sig-check.c 2020-05-04 12:18:33.599388425 +0200
|
||||
@@ -902,6 +902,7 @@ check_signature_over_key_or_uid (ctrl_t
|
||||
{
|
||||
/* Issued by a subkey. */
|
||||
signer = subk;
|
||||
+ *is_selfsig = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
diff -up gnupg-2.2.20/g10/sign.c.coverity gnupg-2.2.20/g10/sign.c
|
||||
--- gnupg-2.2.20/g10/sign.c.coverity 2020-04-30 11:56:43.909360043 +0200
|
||||
+++ gnupg-2.2.20/g10/sign.c 2020-05-04 12:08:56.651544958 +0200
|
||||
@@ -823,7 +823,7 @@ write_signature_packets (ctrl_t ctrl,
|
||||
PKT_public_key *pk;
|
||||
PKT_signature *sig;
|
||||
gcry_md_hd_t md;
|
||||
- gpg_error_t err;
|
||||
+ gpg_error_t err = 0;
|
||||
|
||||
pk = sk_rover->pk;
|
||||
|
||||
diff -up gnupg-2.2.20/kbx/keybox-dump.c.coverity gnupg-2.2.20/kbx/keybox-dump.c
|
||||
--- gnupg-2.2.20/kbx/keybox-dump.c.coverity 2019-08-23 15:59:06.000000000 +0200
|
||||
+++ gnupg-2.2.20/kbx/keybox-dump.c 2020-05-04 17:25:53.365946213 +0200
|
||||
@@ -786,11 +786,15 @@ _keybox_dump_cut_records (const char *fi
|
||||
while ( !(rc = _keybox_read_blob (&blob, fp, NULL)) )
|
||||
{
|
||||
if (recno > to)
|
||||
- break; /* Ready. */
|
||||
+ {
|
||||
+ _keybox_release_blob (blob);
|
||||
+ break; /* Ready. */
|
||||
+ }
|
||||
if (recno >= from)
|
||||
{
|
||||
if ((rc = _keybox_write_blob (blob, outfp)))
|
||||
{
|
||||
+ _keybox_release_blob (blob);
|
||||
fprintf (stderr, "error writing output: %s\n",
|
||||
gpg_strerror (rc));
|
||||
goto leave;
|
||||
diff -up gnupg-2.2.20/tools/gpg-wks-server.c.coverity gnupg-2.2.20/tools/gpg-wks-server.c
|
||||
--- gnupg-2.2.20/tools/gpg-wks-server.c.coverity 2020-02-10 16:12:13.000000000 +0100
|
||||
+++ gnupg-2.2.20/tools/gpg-wks-server.c 2020-05-04 11:52:42.547643198 +0200
|
||||
@@ -890,15 +890,18 @@ store_key_as_pending (const char *dir, e
|
||||
}
|
||||
|
||||
leave:
|
||||
- if (err)
|
||||
+ if (fname)
|
||||
{
|
||||
- es_fclose (outfp);
|
||||
- gnupg_remove (fname);
|
||||
- }
|
||||
- else if (es_fclose (outfp))
|
||||
- {
|
||||
- err = gpg_error_from_syserror ();
|
||||
- log_error ("error closing '%s': %s\n", fname, gpg_strerror (err));
|
||||
+ if (err)
|
||||
+ {
|
||||
+ es_fclose (outfp);
|
||||
+ gnupg_remove (fname);
|
||||
+ }
|
||||
+ else if (es_fclose (outfp))
|
||||
+ {
|
||||
+ err = gpg_error_from_syserror ();
|
||||
+ log_error ("error closing '%s': %s\n", fname, gpg_strerror (err));
|
||||
+ }
|
||||
}
|
||||
|
||||
if (!err)
|
||||
diff -up gnupg-2.2.20/tools/wks-util.c.coverity gnupg-2.2.20/tools/wks-util.c
|
||||
--- gnupg-2.2.20/tools/wks-util.c.coverity 2020-05-04 12:02:21.839475031 +0200
|
||||
+++ gnupg-2.2.20/tools/wks-util.c 2020-05-04 17:23:19.552726949 +0200
|
||||
@@ -948,7 +948,7 @@ ensure_policy_file (const char *addrspec
|
||||
static gpg_error_t
|
||||
install_key_from_spec_file (const char *fname)
|
||||
{
|
||||
- gpg_error_t err;
|
||||
+ gpg_error_t err = 0;
|
||||
estream_t fp;
|
||||
char *line = NULL;
|
||||
size_t linelen = 0;
|
||||
@@ -1195,10 +1195,8 @@ wks_cmd_print_wkd_hash (const char *user
|
||||
char *addrspec, *fname;
|
||||
|
||||
err = wks_fname_from_userid (userid, 1, &fname, &addrspec);
|
||||
- if (err)
|
||||
- return err;
|
||||
-
|
||||
- es_printf ("%s %s\n", fname, addrspec);
|
||||
+ if (!err)
|
||||
+ es_printf ("%s %s\n", fname, addrspec);
|
||||
|
||||
xfree (fname);
|
||||
xfree (addrspec);
|
||||
@@ -1216,7 +1214,10 @@ wks_cmd_print_wkd_url (const char *useri
|
||||
|
||||
err = wks_fname_from_userid (userid, 1, &fname, &addrspec);
|
||||
if (err)
|
||||
- return err;
|
||||
+ {
|
||||
+ xfree (addrspec);
|
||||
+ return err;
|
||||
+ }
|
||||
|
||||
domain = strchr (addrspec, '@');
|
||||
if (domain)
|
Binary file not shown.
@ -0,0 +1,352 @@
|
||||
diff -up gnupg-2.2.21/common/server-help.c.coverity gnupg-2.2.21/common/server-help.c
|
||||
--- gnupg-2.2.21/common/server-help.c.coverity 2019-02-11 10:59:34.000000000 +0100
|
||||
+++ gnupg-2.2.21/common/server-help.c 2020-07-20 17:09:57.416148768 +0200
|
||||
@@ -156,7 +156,7 @@ get_option_value (char *line, const char
|
||||
*pend = 0;
|
||||
*r_value = xtrystrdup (p);
|
||||
*pend = c;
|
||||
- if (!p)
|
||||
+ if (!*r_value)
|
||||
return my_error_from_syserror ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
From 912e77f07d8a42d7ad001eb3df76f6932ccfa857 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Jelen <jjelen@redhat.com>
|
||||
Date: Wed, 7 Apr 2021 17:37:51 +0200
|
||||
Subject: [PATCH GnuPG 01/19] agent: Avoid memory leaks
|
||||
|
||||
* agent/command.c (cmd_genkey): use goto leave instead of return
|
||||
* agent/cvt-openpgp.c (convert_from_openpgp_main): use goto leave
|
||||
instead of return
|
||||
* agent/genkey.c (agent_ask_new_passphrase): fix typo to free correct
|
||||
pointer
|
||||
(agent_genkey): release memory
|
||||
* agent/gpg-agent.c (check_own_socket): free sockname
|
||||
* agent/protect-tool.c (read_key): free buf
|
||||
(agent_askpin): free passphrase
|
||||
* agent/protect.c (merge_lists): free newlist
|
||||
|
||||
--
|
||||
|
||||
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
|
||||
---
|
||||
agent/command.c | 2 +-
|
||||
agent/cvt-openpgp.c | 5 ++++-
|
||||
agent/genkey.c | 7 +++++--
|
||||
agent/gpg-agent.c | 10 ++++++++--
|
||||
agent/protect-tool.c | 6 +++++-
|
||||
agent/protect.c | 5 ++++-
|
||||
6 files changed, 27 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/agent/protect.c b/agent/protect.c
|
||||
index 76ead444b..50b10eb26 100644
|
||||
--- a/agent/protect.c
|
||||
+++ b/agent/protect.c
|
||||
@@ -949,7 +949,10 @@ merge_lists (const unsigned char *protectedkey,
|
||||
/* Copy the cleartext. */
|
||||
s = cleartext;
|
||||
if (*s != '(' && s[1] != '(')
|
||||
- return gpg_error (GPG_ERR_BUG); /*we already checked this */
|
||||
+ {
|
||||
+ xfree (newlist);
|
||||
+ return gpg_error (GPG_ERR_BUG); /*we already checked this */
|
||||
+ }
|
||||
s += 2;
|
||||
startpos = s;
|
||||
while ( *s == '(' )
|
||||
--
|
||||
2.30.2
|
||||
|
||||
|
||||
From 7a707a3eff1c3fbe17a74337776871f408377cee Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Jelen <jjelen@redhat.com>
|
||||
Date: Fri, 9 Apr 2021 16:13:07 +0200
|
||||
Subject: [PATCH GnuPG 03/19] g10: Fix memory leaks
|
||||
|
||||
* g10/card-util.c (change_pin): free answer on errors
|
||||
(ask_card_keyattr): free answer on error
|
||||
* g10/cpr.c (do_get_from_fd): free string
|
||||
* g10/gpg.c (check_permissions): free dir on weird error
|
||||
* g10/import.c (append_new_uid): release knode
|
||||
* g10/keyedit.c (menu_set_keyserver_url): free answer
|
||||
(menu_set_keyserver_url): free user
|
||||
* g10/keygen.c (print_status_key_not_created): move allocation after
|
||||
sanity check
|
||||
(ask_expire_interval): free answer
|
||||
(card_store_key_with_backup): goto leave instaed of return
|
||||
* g10/keyserver.c (parse_keyserver_uri): goto fail instead of return
|
||||
* g10/revoke.c (gen_desig_revoke): release kdbhd
|
||||
(gen_desig_revoke): free answer
|
||||
* g10/tofu.c (ask_about_binding): free sqerr and response
|
||||
* g10/trustdb.c (ask_ownertrust): free pk
|
||||
|
||||
--
|
||||
|
||||
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
|
||||
---
|
||||
g10/card-util.c | 14 +++++++++++---
|
||||
g10/cpr.c | 6 +++++-
|
||||
g10/gpg.c | 1 +
|
||||
g10/import.c | 5 ++++-
|
||||
g10/keyedit.c | 8 +++++++-
|
||||
g10/keygen.c | 15 +++++++++++----
|
||||
g10/keyserver.c | 2 +-
|
||||
g10/revoke.c | 6 +++++-
|
||||
g10/tofu.c | 4 ++++
|
||||
g10/trustdb.c | 1 +
|
||||
10 files changed, 50 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/g10/card-util.c b/g10/card-util.c
|
||||
index 36f096f06..c7df8380d 100644
|
||||
--- a/g10/card-util.c
|
||||
+++ b/g10/card-util.c
|
||||
@@ -127,7 +127,7 @@ change_pin (int unblock_v2, int allow_admin)
|
||||
else
|
||||
for (;;)
|
||||
{
|
||||
- char *answer;
|
||||
+ char *answer = NULL;
|
||||
|
||||
tty_printf ("\n");
|
||||
tty_printf ("1 - change PIN\n"
|
||||
diff --git a/g10/tofu.c b/g10/tofu.c
|
||||
index f49083844..83786a08d 100644
|
||||
--- a/g10/tofu.c
|
||||
+++ b/g10/tofu.c
|
||||
@@ -1687,6 +1687,8 @@ ask_about_binding (ctrl_t ctrl,
|
||||
GPGSQL_ARG_END);
|
||||
if (rc)
|
||||
{
|
||||
+ sqlite3_free (sqerr);
|
||||
+ sqerr = NULL;
|
||||
rc = gpg_error (GPG_ERR_GENERAL);
|
||||
break;
|
||||
}
|
||||
--
|
||||
2.30.2
|
||||
|
||||
From febbe77870b51e4e1158ae9efeaa0f3aad69a495 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Jelen <jjelen@redhat.com>
|
||||
Date: Mon, 12 Apr 2021 14:48:59 +0200
|
||||
Subject: [PATCH GnuPG 05/19] tools: Avoid memory leak sfrom gpgspilt
|
||||
|
||||
* tools/gpgsplit.c (write_part): free blob
|
||||
|
||||
--
|
||||
|
||||
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
|
||||
---
|
||||
tools/gpgsplit.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/tools/gpgsplit.c b/tools/gpgsplit.c
|
||||
index cc7bf8ef5..93458068c 100644
|
||||
--- a/tools/gpgsplit.c
|
||||
+++ b/tools/gpgsplit.c
|
||||
@@ -620,6 +620,7 @@ write_part (FILE *fpin, unsigned long pktlen,
|
||||
}
|
||||
}
|
||||
|
||||
+ xfree (blob);
|
||||
goto ready;
|
||||
}
|
||||
|
||||
--
|
||||
2.30.2
|
||||
|
||||
|
||||
From 7c8048b686a6e811d0b24febf3c5e2528e7881f1 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Jelen <jjelen@redhat.com>
|
||||
Date: Tue, 13 Apr 2021 16:23:31 +0200
|
||||
Subject: [PATCH GnuPG 14/19] dirmgr: Avoid memory leaks
|
||||
|
||||
* dirmngr/domaininfo.c (insert_or_update): free di_new
|
||||
|
||||
--
|
||||
|
||||
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
|
||||
---
|
||||
dirmngr/domaininfo.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/dirmngr/domaininfo.c b/dirmngr/domaininfo.c
|
||||
index b41aef366..87782b4b1 100644
|
||||
--- a/dirmngr/domaininfo.c
|
||||
+++ b/dirmngr/domaininfo.c
|
||||
@@ -193,6 +193,7 @@ insert_or_update (const char *domain,
|
||||
log_error ("domaininfo: error allocating helper array: %s\n",
|
||||
gpg_strerror (gpg_err_code_from_syserror ()));
|
||||
drop_extra = bucket;
|
||||
+ xfree (di_new);
|
||||
goto leave;
|
||||
}
|
||||
narray = 0;
|
||||
--
|
||||
2.30.2
|
||||
|
||||
|
||||
From ab3b8c53993b3305088efde756a44bac6e6492d4 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Jelen <jjelen@redhat.com>
|
||||
Date: Tue, 13 Apr 2021 16:34:40 +0200
|
||||
Subject: [PATCH GnuPG 15/19] scd: Avoid memory leaks and uninitialized memory
|
||||
|
||||
* scd/app-piv.c (do_decipher): goto leave, initialize outdatalen
|
||||
|
||||
--
|
||||
|
||||
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
|
||||
---
|
||||
scd/app-piv.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/scd/app-piv.c b/scd/app-piv.c
|
||||
index 143cc047a..94257f0ee 100644
|
||||
--- a/scd/app-piv.c
|
||||
+++ b/scd/app-piv.c
|
||||
@@ -2483,7 +2483,7 @@ do_decipher (app_t app, ctrl_t ctrl, const char *keyidstr,
|
||||
gpg_error_t err;
|
||||
data_object_t dobj;
|
||||
unsigned char *outdata = NULL;
|
||||
- size_t outdatalen;
|
||||
+ size_t outdatalen = 0;
|
||||
const unsigned char *s;
|
||||
size_t n;
|
||||
int keyref, mechanism;
|
||||
@@ -2582,7 +2582,7 @@ do_decipher (app_t app, ctrl_t ctrl, const char *keyidstr,
|
||||
/* Now verify the Application PIN. */
|
||||
err = verify_chv (app, ctrl, 0x80, 0, pincb, pincb_arg);
|
||||
if (err)
|
||||
- return err;
|
||||
+ goto leave;
|
||||
|
||||
/* Build the Dynamic Authentication Template. */
|
||||
err = concat_tlv_list (0, &apdudata, &apdudatalen,
|
||||
--
|
||||
2.30.2
|
||||
|
||||
|
||||
From f182bf91443618323e34261039045a6bde269be5 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Jelen <jjelen@redhat.com>
|
||||
Date: Tue, 13 Apr 2021 16:44:48 +0200
|
||||
Subject: [PATCH GnuPG 16/19] tools: Avoid memory leaks
|
||||
|
||||
* tools/wks-util.c (wks_cmd_print_wkd_url): Free addrspec on error
|
||||
(wks_cmd_print_wkd_hash): Free addrspec on error
|
||||
|
||||
--
|
||||
|
||||
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
|
||||
---
|
||||
tools/wks-util.c | 14 ++++++++++----
|
||||
1 file changed, 10 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/tools/wks-util.c b/tools/wks-util.c
|
||||
index 516c7fe00..38dd194ff 100644
|
||||
--- a/tools/wks-util.c
|
||||
+++ b/tools/wks-util.c
|
||||
@@ -1192,11 +1192,14 @@ gpg_error_t
|
||||
wks_cmd_print_wkd_hash (const char *userid)
|
||||
{
|
||||
gpg_error_t err;
|
||||
- char *addrspec, *fname;
|
||||
+ char *addrspec = NULL, *fname;
|
||||
|
||||
err = wks_fname_from_userid (userid, 1, &fname, &addrspec);
|
||||
if (err)
|
||||
- return err;
|
||||
+ {
|
||||
+ xfree (addrspec);
|
||||
+ return err;
|
||||
+ }
|
||||
|
||||
es_printf ("%s %s\n", fname, addrspec);
|
||||
|
||||
@@ -1211,12 +1214,15 @@ gpg_error_t
|
||||
wks_cmd_print_wkd_url (const char *userid)
|
||||
{
|
||||
gpg_error_t err;
|
||||
- char *addrspec, *fname;
|
||||
+ char *addrspec = NULL, *fname;
|
||||
char *domain;
|
||||
|
||||
err = wks_fname_from_userid (userid, 1, &fname, &addrspec);
|
||||
if (err)
|
||||
- return err;
|
||||
+ {
|
||||
+ xfree (addrspec);
|
||||
+ return err;
|
||||
+ }
|
||||
|
||||
domain = strchr (addrspec, '@');
|
||||
if (domain)
|
||||
--
|
||||
2.30.2
|
||||
|
||||
|
||||
From 600fabd8268c765d45d48873e7a8610e6dae0966 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Jelen <jjelen@redhat.com>
|
||||
Date: Wed, 14 Apr 2021 15:59:12 +0200
|
||||
Subject: [PATCH GnuPG 17/19] scd: Use the same allocator to free memory
|
||||
|
||||
* scd/command.c (cmd_getinfo): Use free instead of gcry_free to match
|
||||
the original allocator
|
||||
|
||||
--
|
||||
|
||||
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
|
||||
---
|
||||
scd/command.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/scd/command.c b/scd/command.c
|
||||
index cb0dd379a..9d85c5a41 100644
|
||||
--- a/scd/command.c
|
||||
+++ b/scd/command.c
|
||||
@@ -1832,7 +1832,8 @@ cmd_getinfo (assuan_context_t ctx, char *line)
|
||||
rc = assuan_send_data (ctx, p, strlen (p));
|
||||
else
|
||||
rc = gpg_error (GPG_ERR_NO_DATA);
|
||||
- xfree (p);
|
||||
+ /* allocated by scd/ccid-driver.c which is not using x*alloc/gcry_* */
|
||||
+ free (p);
|
||||
}
|
||||
else if (!strcmp (line, "deny_admin"))
|
||||
rc = opt.allow_admin? gpg_error (GPG_ERR_GENERAL) : 0;
|
||||
--
|
||||
2.30.2
|
||||
|
||||
|
||||
From a94b0deab7c2ece2e512f87a52142454354d77b5 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Jelen <jjelen@redhat.com>
|
||||
Date: Wed, 14 Apr 2021 18:49:03 +0200
|
||||
Subject: [PATCH GnuPG 19/19] g10: Do not allocate memory when we can't return
|
||||
it
|
||||
|
||||
* g10/keyid.c (fpr20_from_pk): Do not allocate memory when we can't
|
||||
return it
|
||||
|
||||
--
|
||||
|
||||
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
|
||||
---
|
||||
g10/keyid.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/g10/keyid.c b/g10/keyid.c
|
||||
index 522cc9cda..f1af2fd90 100644
|
||||
--- a/g10/keyid.c
|
||||
+++ b/g10/keyid.c
|
||||
@@ -899,7 +899,7 @@ fpr20_from_pk (PKT_public_key *pk, byte array[20])
|
||||
compute_fingerprint (pk);
|
||||
|
||||
if (!array)
|
||||
- array = xmalloc (pk->fprlen);
|
||||
+ return;
|
||||
|
||||
if (pk->fprlen == 32) /* v5 fingerprint */
|
||||
{
|
||||
--
|
||||
2.30.2
|
||||
|
@ -0,0 +1,12 @@
|
||||
diff -up gnupg-2.2.23/g10/keygen.c.large-rsa gnupg-2.2.23/g10/keygen.c
|
||||
--- gnupg-2.2.23/g10/keygen.c.large-rsa 2020-09-04 13:53:42.030486671 +0200
|
||||
+++ gnupg-2.2.23/g10/keygen.c 2020-09-04 13:55:52.896669542 +0200
|
||||
@@ -2262,7 +2262,7 @@ get_keysize_range (int algo, unsigned in
|
||||
|
||||
default:
|
||||
*min = opt.compliance == CO_DE_VS ? 2048: 1024;
|
||||
- *max = 4096;
|
||||
+ *max = opt.flags.large_rsa == 1 ? 8192 : 4096;
|
||||
def = 3072;
|
||||
break;
|
||||
}
|
@ -0,0 +1,162 @@
|
||||
From ff31dde456f32950f0df6c974b4c41f1d650d68f Mon Sep 17 00:00:00 2001
|
||||
From: Werner Koch <wk@gnupg.org>
|
||||
Date: Mon, 5 Oct 2020 14:21:31 +0200
|
||||
Subject: [PATCH GnuPG] gpg: Switch to ed25519+cv25519 as default algo.
|
||||
|
||||
* g10/keygen.c (DEFAULT_STD_KEY_PARAM): Change to former future
|
||||
default ago.
|
||||
(ask_algo): Change default and also the way we indicate the default
|
||||
algo in the list of algos.
|
||||
(ask_curve): Indicate the default curve.
|
||||
|
||||
Signed-off-by: Werner Koch <wk@gnupg.org>
|
||||
---
|
||||
g10/keygen.c | 57 ++++++++++++++++++++++++++--------------------------
|
||||
1 file changed, 29 insertions(+), 28 deletions(-)
|
||||
|
||||
diff --git a/g10/keygen.c b/g10/keygen.c
|
||||
index 16e4e58ea..b510525e3 100644
|
||||
--- a/g10/keygen.c
|
||||
+++ b/g10/keygen.c
|
||||
@@ -47,10 +47,11 @@
|
||||
#include "../common/mbox-util.h"
|
||||
|
||||
|
||||
-/* The default algorithms. If you change them, you should ensure the value
|
||||
- is inside the bounds enforced by ask_keysize and gen_xxx. See also
|
||||
- get_keysize_range which encodes the allowed ranges. */
|
||||
-#define DEFAULT_STD_KEY_PARAM "rsa3072/cert,sign+rsa3072/encr"
|
||||
+/* The default algorithms. If you change them, you should ensure the
|
||||
+ value is inside the bounds enforced by ask_keysize and gen_xxx.
|
||||
+ See also get_keysize_range which encodes the allowed ranges. The
|
||||
+ default answer in ask_algo also needs to be adjusted. */
|
||||
+#define DEFAULT_STD_KEY_PARAM "ed25519/cert,sign+cv25519/encr"
|
||||
#define FUTURE_STD_KEY_PARAM "ed25519/cert,sign+cv25519/encr"
|
||||
|
||||
/* When generating keys using the streamlined key generation dialog,
|
||||
@@ -2112,50 +2113,49 @@ ask_algo (ctrl_t ctrl, int addmode, int *r_subkey_algo, unsigned int *r_usage,
|
||||
|
||||
#if GPG_USE_RSA
|
||||
if (!addmode)
|
||||
- tty_printf (_(" (%d) RSA and RSA (default)\n"), 1 );
|
||||
+ tty_printf (_(" (%d) RSA and RSA%s\n"), 1, "");
|
||||
#endif
|
||||
|
||||
if (!addmode && opt.compliance != CO_DE_VS)
|
||||
- tty_printf (_(" (%d) DSA and Elgamal\n"), 2 );
|
||||
+ tty_printf (_(" (%d) DSA and Elgamal%s\n"), 2, "");
|
||||
|
||||
if (opt.compliance != CO_DE_VS)
|
||||
- tty_printf (_(" (%d) DSA (sign only)\n"), 3 );
|
||||
+ tty_printf (_(" (%d) DSA (sign only)%s\n"), 3, "");
|
||||
#if GPG_USE_RSA
|
||||
- tty_printf (_(" (%d) RSA (sign only)\n"), 4 );
|
||||
+ tty_printf (_(" (%d) RSA (sign only)%s\n"), 4, "");
|
||||
#endif
|
||||
|
||||
if (addmode)
|
||||
{
|
||||
if (opt.compliance != CO_DE_VS)
|
||||
- tty_printf (_(" (%d) Elgamal (encrypt only)\n"), 5 );
|
||||
+ tty_printf (_(" (%d) Elgamal (encrypt only)%s\n"), 5, "");
|
||||
#if GPG_USE_RSA
|
||||
- tty_printf (_(" (%d) RSA (encrypt only)\n"), 6 );
|
||||
+ tty_printf (_(" (%d) RSA (encrypt only)%s\n"), 6, "");
|
||||
#endif
|
||||
}
|
||||
if (opt.expert)
|
||||
{
|
||||
if (opt.compliance != CO_DE_VS)
|
||||
- tty_printf (_(" (%d) DSA (set your own capabilities)\n"), 7 );
|
||||
+ tty_printf (_(" (%d) DSA (set your own capabilities)%s\n"), 7, "");
|
||||
#if GPG_USE_RSA
|
||||
- tty_printf (_(" (%d) RSA (set your own capabilities)\n"), 8 );
|
||||
+ tty_printf (_(" (%d) RSA (set your own capabilities)%s\n"), 8, "");
|
||||
#endif
|
||||
}
|
||||
|
||||
#if GPG_USE_ECDSA || GPG_USE_ECDH || GPG_USE_EDDSA
|
||||
- if (opt.expert && !addmode)
|
||||
- tty_printf (_(" (%d) ECC and ECC\n"), 9 );
|
||||
- if (opt.expert)
|
||||
- tty_printf (_(" (%d) ECC (sign only)\n"), 10 );
|
||||
+ if (!addmode)
|
||||
+ tty_printf (_(" (%d) ECC (sign and encrypt)%s\n"), 9, _(" *default*") );
|
||||
+ tty_printf (_(" (%d) ECC (sign only)\n"), 10 );
|
||||
if (opt.expert)
|
||||
- tty_printf (_(" (%d) ECC (set your own capabilities)\n"), 11 );
|
||||
- if (opt.expert && addmode)
|
||||
- tty_printf (_(" (%d) ECC (encrypt only)\n"), 12 );
|
||||
+ tty_printf (_(" (%d) ECC (set your own capabilities)%s\n"), 11, "");
|
||||
+ if (addmode)
|
||||
+ tty_printf (_(" (%d) ECC (encrypt only)%s\n"), 12, "");
|
||||
#endif
|
||||
|
||||
if (opt.expert && r_keygrip)
|
||||
- tty_printf (_(" (%d) Existing key\n"), 13 );
|
||||
+ tty_printf (_(" (%d) Existing key%s\n"), 13, "");
|
||||
if (r_keygrip)
|
||||
- tty_printf (_(" (%d) Existing key from card\n"), 14 );
|
||||
+ tty_printf (_(" (%d) Existing key from card%s\n"), 14, "");
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@@ -2164,7 +2164,7 @@ ask_algo (ctrl_t ctrl, int addmode, int *r_subkey_algo, unsigned int *r_usage,
|
||||
xfree (answer);
|
||||
answer = cpr_get ("keygen.algo", _("Your selection? "));
|
||||
cpr_kill_prompt ();
|
||||
- algo = *answer? atoi (answer) : 1;
|
||||
+ algo = *answer? atoi (answer) : 9; /* Default algo is 9 */
|
||||
|
||||
if (opt.compliance == CO_DE_VS
|
||||
&& (algo == 2 || algo == 3 || algo == 5 || algo == 7))
|
||||
@@ -2220,13 +2220,13 @@ ask_algo (ctrl_t ctrl, int addmode, int *r_subkey_algo, unsigned int *r_usage,
|
||||
break;
|
||||
}
|
||||
else if ((algo == 9 || !strcmp (answer, "ecc+ecc"))
|
||||
- && opt.expert && !addmode)
|
||||
+ && !addmode)
|
||||
{
|
||||
algo = PUBKEY_ALGO_ECDSA;
|
||||
*r_subkey_algo = PUBKEY_ALGO_ECDH;
|
||||
break;
|
||||
}
|
||||
- else if ((algo == 10 || !strcmp (answer, "ecc/s")) && opt.expert)
|
||||
+ else if ((algo == 10 || !strcmp (answer, "ecc/s")))
|
||||
{
|
||||
algo = PUBKEY_ALGO_ECDSA;
|
||||
*r_usage = PUBKEY_USAGE_SIG;
|
||||
@@ -2239,7 +2239,7 @@ ask_algo (ctrl_t ctrl, int addmode, int *r_subkey_algo, unsigned int *r_usage,
|
||||
break;
|
||||
}
|
||||
else if ((algo == 12 || !strcmp (answer, "ecc/e"))
|
||||
- && opt.expert && addmode)
|
||||
+ && addmode)
|
||||
{
|
||||
algo = PUBKEY_ALGO_ECDH;
|
||||
*r_usage = PUBKEY_USAGE_ENC;
|
||||
@@ -2616,7 +2616,7 @@ ask_curve (int *algo, int *subkey_algo, const char *current)
|
||||
{ "NIST P-256", NULL, NULL, MY_USE_ECDSADH, 0, 1, 0 },
|
||||
{ "NIST P-384", NULL, NULL, MY_USE_ECDSADH, 0, 0, 0 },
|
||||
{ "NIST P-521", NULL, NULL, MY_USE_ECDSADH, 0, 1, 0 },
|
||||
- { "brainpoolP256r1", NULL, "Brainpool P-256", MY_USE_ECDSADH, 1, 1, 0 },
|
||||
+ { "brainpoolP256r1", NULL, "Brainpool P-256", MY_USE_ECDSADH, 1, 0, 0 },
|
||||
{ "brainpoolP384r1", NULL, "Brainpool P-384", MY_USE_ECDSADH, 1, 1, 0 },
|
||||
{ "brainpoolP512r1", NULL, "Brainpool P-512", MY_USE_ECDSADH, 1, 1, 0 },
|
||||
{ "secp256k1", NULL, NULL, MY_USE_ECDSADH, 0, 1, 0 },
|
||||
@@ -2672,9 +2672,10 @@ ask_curve (int *algo, int *subkey_algo, const char *current)
|
||||
}
|
||||
|
||||
curves[idx].available = 1;
|
||||
- tty_printf (" (%d) %s\n", idx + 1,
|
||||
+ tty_printf (" (%d) %s%s\n", idx + 1,
|
||||
curves[idx].pretty_name?
|
||||
- curves[idx].pretty_name:curves[idx].name);
|
||||
+ curves[idx].pretty_name:curves[idx].name,
|
||||
+ idx == 0? _(" *default*"):"");
|
||||
}
|
||||
gcry_sexp_release (keyparms);
|
||||
|
||||
--
|
||||
2.31.1
|
||||
|
@ -0,0 +1,30 @@
|
||||
commit eadf12a52c2e230174e076a0dcae68132094cefe
|
||||
Author: Jakub Jelen <jjelen@redhat.com>
|
||||
Date: Thu Feb 24 09:02:53 2022 +0100
|
||||
|
||||
sign: Construct valid AEAD packets.
|
||||
|
||||
* g10/sign.c (sign_symencrypt_file): Insert correct version and AEAD
|
||||
information into symkey packet.
|
||||
|
||||
--
|
||||
|
||||
GnuPG-bug-id: 5856
|
||||
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
|
||||
|
||||
diff --git a/g10/sign.c b/g10/sign.c
|
||||
index bbcfabdb7..2ab76c99b 100644
|
||||
--- a/g10/sign.c
|
||||
+++ b/g10/sign.c
|
||||
@@ -1660,8 +1660,9 @@ sign_symencrypt_file (ctrl_t ctrl, const char *fname, strlist_t locusr)
|
||||
{
|
||||
PKT_symkey_enc *enc = xmalloc_clear( sizeof *enc );
|
||||
|
||||
- enc->version = 4;
|
||||
+ enc->version = cfx.dek->use_aead ? 5 : 4;
|
||||
enc->cipher_algo = cfx.dek->algo;
|
||||
+ enc->aead_algo = cfx.dek->use_aead;
|
||||
enc->s2k = *s2k;
|
||||
pkt.pkttype = PKT_SYMKEY_ENC;
|
||||
pkt.pkt.symkey_enc = enc;
|
||||
|
@ -0,0 +1,42 @@
|
||||
From c4436ebfa58f219190f1244928001b4293293343 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Jelen <jjelen@redhat.com>
|
||||
Date: Tue, 12 Apr 2022 16:26:58 +0200
|
||||
Subject: [PATCH GnuPG] agent: Ignore MD5 Fingerprints for ssh keys
|
||||
|
||||
--
|
||||
* agent/command-ssh.c (add_control_entry): Ignore failure of the MD5
|
||||
digest
|
||||
|
||||
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
|
||||
---
|
||||
agent/command-ssh.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/agent/command-ssh.c b/agent/command-ssh.c
|
||||
index a7784e728..46821e3c8 100644
|
||||
--- a/agent/command-ssh.c
|
||||
+++ b/agent/command-ssh.c
|
||||
@@ -1095,8 +1095,9 @@ add_control_entry (ctrl_t ctrl, ssh_key_type_spec_t *spec,
|
||||
time_t atime = time (NULL);
|
||||
|
||||
err = ssh_get_fingerprint_string (key, GCRY_MD_MD5, &fpr_md5);
|
||||
+ /* ignore the errors as MD5 is not available in FIPS mode */
|
||||
if (err)
|
||||
- goto out;
|
||||
+ fpr_md5 = NULL;
|
||||
|
||||
err = ssh_get_fingerprint_string (key, GCRY_MD_SHA256, &fpr_sha256);
|
||||
if (err)
|
||||
@@ -1113,7 +1114,8 @@ add_control_entry (ctrl_t ctrl, ssh_key_type_spec_t *spec,
|
||||
spec->name,
|
||||
1900+tp->tm_year, tp->tm_mon+1, tp->tm_mday,
|
||||
tp->tm_hour, tp->tm_min, tp->tm_sec,
|
||||
- fpr_md5, fpr_sha256, hexgrip, ttl, confirm? " confirm":"");
|
||||
+ fpr_md5? fpr_md5:"", fpr_sha256, hexgrip, ttl,
|
||||
+ confirm? " confirm":"");
|
||||
|
||||
}
|
||||
out:
|
||||
--
|
||||
2.39.2
|
||||
|
Loading…
Reference in new issue