Compare commits

4 Commits
main ... 1.1

16 changed files with 979 additions and 279 deletions

BIN
gnupg-2.4.4.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
gnupg-2.4.4.tar.bz2.sig Normal file

Binary file not shown.

BIN
gnupg-2.5.5.tar.bz2 (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

View File

@@ -3,11 +3,11 @@
g10/gpg.c | 9 +++++++++ g10/gpg.c | 9 +++++++++
2 files changed, 27 insertions(+) 2 files changed, 27 insertions(+)
Index: gnupg-2.5.4/doc/gpg.texi Index: gnupg-2.4.2/doc/gpg.texi
=================================================================== ===================================================================
--- gnupg-2.5.4.orig/doc/gpg.texi --- gnupg-2.4.2.orig/doc/gpg.texi
+++ gnupg-2.5.4/doc/gpg.texi +++ gnupg-2.4.2/doc/gpg.texi
@@ -2340,6 +2340,24 @@ implies, this option is for experts only @@ -2285,6 +2285,24 @@ implies, this option is for experts only
understand the implications of what it allows you to do, leave this understand the implications of what it allows you to do, leave this
off. @option{--no-expert} disables this option. off. @option{--no-expert} disables this option.
@@ -32,11 +32,11 @@ Index: gnupg-2.5.4/doc/gpg.texi
@end table @end table
Index: gnupg-2.5.4/g10/gpg.c Index: gnupg-2.4.2/g10/gpg.c
=================================================================== ===================================================================
--- gnupg-2.5.4.orig/g10/gpg.c --- gnupg-2.4.2.orig/g10/gpg.c
+++ gnupg-2.5.4/g10/gpg.c +++ gnupg-2.4.2/g10/gpg.c
@@ -455,6 +455,7 @@ enum cmd_and_opt_values @@ -446,6 +446,7 @@ enum cmd_and_opt_values
oForceSignKey, oForceSignKey,
oForbidGenKey, oForbidGenKey,
oRequireCompliance, oRequireCompliance,
@@ -44,15 +44,15 @@ Index: gnupg-2.5.4/g10/gpg.c
oCompatibilityFlags, oCompatibilityFlags,
oAddDesigRevoker, oAddDesigRevoker,
oAssertSigner, oAssertSigner,
@@ -907,6 +908,7 @@ static gpgrt_opt_t opts[] = { @@ -886,6 +887,7 @@ static gpgrt_opt_t opts[] = {
ARGPARSE_s_s (oCipherAlgo, "cipher-algo", "@"), ARGPARSE_s_s (oCipherAlgo, "cipher-algo", "@"),
ARGPARSE_s_s (oDigestAlgo, "digest-algo", "@"), ARGPARSE_s_s (oDigestAlgo, "digest-algo", "@"),
ARGPARSE_s_s (oCertDigestAlgo, "cert-digest-algo", "@"), ARGPARSE_s_s (oCertDigestAlgo, "cert-digest-algo", "@"),
+ ARGPARSE_s_n (oSetLegacyFips, "set-legacy-fips", "@"), + ARGPARSE_s_n (oSetLegacyFips, "set-legacy-fips", "@"),
ARGPARSE_s_n (oRequirePQCEncryption, "require-pqc-encryption", "@"),
ARGPARSE_s_n (oDisablePQCEncryption, "disable-pqc-encryption", "@"),
@@ -3865,6 +3867,14 @@ main (int argc, char **argv)
ARGPARSE_header (NULL, N_("Options for unattended use")),
@@ -3756,6 +3758,14 @@ main (int argc, char **argv)
keybox_set_buffersize (pargs.r.ret_ulong, 0); keybox_set_buffersize (pargs.r.ret_ulong, 0);
break; break;

View File

@@ -17,19 +17,19 @@ Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
g10/import.c | 49 +++++++++++-------------------------------------- g10/import.c | 49 +++++++++++--------------------------------------
1 file changed, 11 insertions(+), 38 deletions(-) 1 file changed, 11 insertions(+), 38 deletions(-)
Index: gnupg-2.5.4/g10/import.c Index: gnupg-2.4.0/g10/import.c
=================================================================== ===================================================================
--- gnupg-2.5.4.orig/g10/import.c --- gnupg-2.4.0.orig/g10/import.c
+++ gnupg-2.5.4/g10/import.c +++ gnupg-2.4.0/g10/import.c
@@ -1996,7 +1996,6 @@ import_one_real (ctrl_t ctrl, @@ -1954,7 +1954,6 @@ import_one_real (ctrl_t ctrl,
int non_self_or_utk = 0; size_t an;
char pkstrbuf[PUBKEY_STRING_SIZE]; char pkstrbuf[PUBKEY_STRING_SIZE];
int merge_keys_done = 0; int merge_keys_done = 0;
- int any_filter = 0; - int any_filter = 0;
KEYDB_HANDLE hd = NULL; KEYDB_HANDLE hd = NULL;
if (r_valid) if (r_valid)
@@ -2033,14 +2032,6 @@ import_one_real (ctrl_t ctrl, @@ -1991,14 +1990,6 @@ import_one_real (ctrl_t ctrl,
log_printf ("\n"); log_printf ("\n");
} }
@@ -44,7 +44,7 @@ Index: gnupg-2.5.4/g10/import.c
if (screener && screener (keyblock, screener_arg)) if (screener && screener (keyblock, screener_arg))
{ {
log_error (_("key %s: %s\n"), keystr_from_pk (pk), log_error (_("key %s: %s\n"), keystr_from_pk (pk),
@@ -2134,18 +2125,10 @@ import_one_real (ctrl_t ctrl, @@ -2078,18 +2069,10 @@ import_one_real (ctrl_t ctrl,
} }
} }
@@ -67,7 +67,7 @@ Index: gnupg-2.5.4/g10/import.c
/* Get rid of deleted nodes. */ /* Get rid of deleted nodes. */
commit_kbnode (&keyblock); commit_kbnode (&keyblock);
@@ -2155,24 +2138,11 @@ import_one_real (ctrl_t ctrl, @@ -2099,24 +2082,11 @@ import_one_real (ctrl_t ctrl,
{ {
apply_keep_uid_filter (ctrl, keyblock, import_filter.keep_uid); apply_keep_uid_filter (ctrl, keyblock, import_filter.keep_uid);
commit_kbnode (&keyblock); commit_kbnode (&keyblock);
@@ -92,7 +92,7 @@ Index: gnupg-2.5.4/g10/import.c
} }
/* The keyblock is valid and ready for real import. */ /* The keyblock is valid and ready for real import. */
@@ -2234,6 +2204,13 @@ import_one_real (ctrl_t ctrl, @@ -2174,6 +2144,13 @@ import_one_real (ctrl_t ctrl,
err = 0; err = 0;
stats->skipped_new_keys++; stats->skipped_new_keys++;
} }

View File

@@ -11,10 +11,10 @@ Signed-off-by: Lucas Mulling <lucas.mulling@suse.com>
dirmngr/Makefile.am | 2 +- dirmngr/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
Index: gnupg-2.5.5/dirmngr/Makefile.am Index: gnupg-2.4.4/dirmngr/Makefile.am
=================================================================== ===================================================================
--- gnupg-2.5.5.orig/dirmngr/Makefile.am --- gnupg-2.4.4.orig/dirmngr/Makefile.am
+++ gnupg-2.5.5/dirmngr/Makefile.am +++ gnupg-2.4.4/dirmngr/Makefile.am
@@ -29,7 +29,7 @@ EXTRA_DIST = OAUTHORS ONEWS ChangeLog-20 @@ -29,7 +29,7 @@ EXTRA_DIST = OAUTHORS ONEWS ChangeLog-20
@@ -24,10 +24,10 @@ Index: gnupg-2.5.5/dirmngr/Makefile.am
bin_PROGRAMS = dirmngr dirmngr-client bin_PROGRAMS = dirmngr dirmngr-client
Index: gnupg-2.5.5/dirmngr/Makefile.in Index: gnupg-2.4.4/dirmngr/Makefile.in
=================================================================== ===================================================================
--- gnupg-2.5.5.orig/dirmngr/Makefile.in --- gnupg-2.4.4.orig/dirmngr/Makefile.in
+++ gnupg-2.5.5/dirmngr/Makefile.in +++ gnupg-2.4.4/dirmngr/Makefile.in
@@ -682,7 +682,7 @@ EXTRA_DIST = OAUTHORS ONEWS ChangeLog-20 @@ -682,7 +682,7 @@ EXTRA_DIST = OAUTHORS ONEWS ChangeLog-20
dirmngr_ldap-w32info.rc dirmngr_ldap.w32-manifest.in \ dirmngr_ldap-w32info.rc dirmngr_ldap.w32-manifest.in \
dirmngr-client-w32info.rc dirmngr-client.w32-manifest.in dirmngr-client-w32info.rc dirmngr-client.w32-manifest.in

View File

@@ -0,0 +1,51 @@
From d30e345692440b9c6677118c1d20b9d17d80f873 Mon Sep 17 00:00:00 2001
From: Werner Koch <wk@gnupg.org>
Date: Thu, 31 Oct 2024 15:11:55 +0100
Subject: [PATCH GnuPG] gpg: Allow the use of an ADSK subkey as ADSK subkey.
* g10/packet.h (PKT_public_key): Increased size of req_usage to 16.
* g10/getkey.c (key_byname): Set allow_adsk in the context if ir was
requested via req_usage.
(finish_lookup): Allow RENC usage matching.
* g10/keyedit.c (append_adsk_to_key): Adjust the assert.
* g10/keygen.c (prepare_adsk): Also allow to find an RENC subkey.
--
If an ADSK is to be added it may happen that an ADSK subkey is found
first and this should then be used even that it does not have the E
usage. However, it used to have that E usage when it was added.
While testing this I found another pecularity: If you do
gpg -k ADSK_SUBKEY_FPR
without the '!' suffix and no corresponding encryption subkey is dound,
you will get an unusabe key error. I hesitate to fix that due to
possible side-effects.
GnuPG-bug-id: 6882
Signed-off-by: Lucas Mulling <lucas.mulling@suse.com>
---
g10/packet.h | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/g10/packet.h b/g10/packet.h
index 5cef17543..375392807 100644
--- a/g10/packet.h
+++ b/g10/packet.h
@@ -400,11 +400,10 @@ typedef struct
when serializing. (Serialized.) */
byte version;
byte selfsigversion; /* highest version of all of the self-sigs */
- /* The public key algorithm. (Serialized.) */
- byte pubkey_algo;
- u16 pubkey_usage; /* carries the usage info. */
- byte req_usage; /* hack to pass a request to getkey() */
byte fprlen; /* 0 or length of FPR. */
+ byte pubkey_algo; /* The public key algorithm. (PGP format) */
+ u16 pubkey_usage; /* carries the usage info. */
+ u16 req_usage; /* hack to pass a request to getkey() */
u32 has_expired; /* set to the expiration date if expired */
/* keyid of the primary key. Never access this value directly.
Instead, use pk_main_keyid(). */
--
2.50.0

View File

@@ -0,0 +1,634 @@
From 48978ccb4e20866472ef18436a32744350a65158 Mon Sep 17 00:00:00 2001
From: Werner Koch <wk@gnupg.org>
Date: Fri, 21 Feb 2025 12:16:17 +0100
Subject: [PATCH GnuPG] gpg: Fix a verification DoS due to a malicious subkey
in the keyring.
* g10/getkey.c (get_pubkey): Factor code out to ...
(get_pubkey_bykid): new. Add feature to return the keyblock.
(get_pubkey_for_sig): Add arg r_keyblock to return the used keyblock.
Request a signing usage.
(get_pubkeyblock_for_sig): Remove.
(finish_lookup): Improve debug output.
* g10/sig-check.c (check_signature): Add arg r_keyblock and pass it
down.
* g10/mainproc.c (do_check_sig): Ditto.
(check_sig_and_print): Use the keyblock returned by do_check_sig to
show further information instead of looking it up again with
get_pubkeyblock_for_sig. Also re-check the signature after the import
of an included keyblock.
--
The problem here is that it is possible to import a key from someone
who added a signature subkey from another public key and thus inhibits
that a good signature good be verified.
Such a malicious key signature subkey must have been created w/o the
mandatory backsig which bind a signature subkey to its primary key.
For encryption subkeys this is not an issue because the existence of a
decryption private key is all you need to decrypt something and then
it does not matter if the public subkey or its binding signature has
been put below another primary key; in fact we do the latter for
ADSKs.
GnuPG-bug-id: 7527
Signed-off-by: Lucas Mulling <lucas.mulling@suse.com>
---
NEWS | 2 +
g10/getkey.c | 108 ++++++++++++++++++++++++++++++------------------
g10/gpg.h | 3 +-
g10/keydb.h | 10 ++++-
g10/mainproc.c | 92 ++++++++++++++++++++++++++---------------
g10/packet.h | 2 +-
g10/sig-check.c | 23 +++++++----
7 files changed, 154 insertions(+), 86 deletions(-)
Index: gnupg-2.4.4/NEWS
===================================================================
--- gnupg-2.4.4.orig/NEWS
+++ gnupg-2.4.4/NEWS
@@ -99,6 +99,8 @@ Noteworthy changes in version 2.4.4 (202
* Improve the speedo build system for Unix. [T6710]
+ * gpg: Fix a verification DoS due to a malicious subkey in the
+ keyring. [T7527]
Release-info: https://dev.gnupg.org/T6578
Index: gnupg-2.4.4/g10/getkey.c
===================================================================
--- gnupg-2.4.4.orig/g10/getkey.c
+++ gnupg-2.4.4/g10/getkey.c
@@ -310,27 +310,51 @@ pk_from_block (PKT_public_key *pk, kbnod
/* Specialized version of get_pubkey which retrieves the key based on
* information in SIG. In contrast to get_pubkey PK is required. IF
- * FORCED_PK is not NULL, this public key is used and copied to PK. */
+ * FORCED_PK is not NULL, this public key is used and copied to PK.
+ * If R_KEYBLOCK is not NULL the entire keyblock is stored there if
+ * found and FORCED_PK is not used; if not used or on error NULL is
+ * stored there. */
gpg_error_t
get_pubkey_for_sig (ctrl_t ctrl, PKT_public_key *pk, PKT_signature *sig,
- PKT_public_key *forced_pk)
+ PKT_public_key *forced_pk, kbnode_t *r_keyblock)
{
+ gpg_error_t err;
const byte *fpr;
size_t fprlen;
+ if (r_keyblock)
+ *r_keyblock = NULL;
+
if (forced_pk)
{
copy_public_key (pk, forced_pk);
return 0;
}
+ /* Make sure to request only keys cabable of signing. This makes
+ * sure that a subkey w/o a valid backsig or with bad usage flags
+ * will be skipped. */
+ pk->req_usage = PUBKEY_USAGE_SIG;
+
/* First try the ISSUER_FPR info. */
fpr = issuer_fpr_raw (sig, &fprlen);
- if (fpr && !get_pubkey_byfprint (ctrl, pk, NULL, fpr, fprlen))
+ if (fpr && !get_pubkey_byfprint (ctrl, pk, r_keyblock, fpr, fprlen))
return 0;
+ if (r_keyblock)
+ {
+ release_kbnode (*r_keyblock);
+ *r_keyblock = NULL;
+ }
+
/* Fallback to use the ISSUER_KEYID. */
- return get_pubkey (ctrl, pk, sig->keyid);
+ err = get_pubkey_bykid (ctrl, pk, r_keyblock, sig->keyid);
+ if (err && r_keyblock)
+ {
+ release_kbnode (*r_keyblock);
+ *r_keyblock = NULL;
+ }
+ return err;
}
@@ -348,6 +372,10 @@ get_pubkey_for_sig (ctrl_t ctrl, PKT_pub
* usage will be returned. As such, it is essential that
* PK->REQ_USAGE be correctly initialized!
*
+ * If R_KEYBLOCK is not NULL, then the first result's keyblock is
+ * returned in *R_KEYBLOCK. This should be freed using
+ * release_kbnode().
+ *
* Returns 0 on success, GPG_ERR_NO_PUBKEY if there is no public key
* with the specified key id, or another error code if an error
* occurs.
@@ -355,24 +383,30 @@ get_pubkey_for_sig (ctrl_t ctrl, PKT_pub
* If the data was not read from the cache, then the self-signed data
* has definitely been merged into the public key using
* merge_selfsigs. */
-int
-get_pubkey (ctrl_t ctrl, PKT_public_key * pk, u32 * keyid)
+gpg_error_t
+get_pubkey_bykid (ctrl_t ctrl, PKT_public_key *pk, kbnode_t *r_keyblock,
+ u32 *keyid)
{
int internal = 0;
- int rc = 0;
+ gpg_error_t rc = 0;
+
+ if (r_keyblock)
+ *r_keyblock = NULL;
#if MAX_PK_CACHE_ENTRIES
- if (pk)
+ if (pk && !r_keyblock)
{
/* Try to get it from the cache. We don't do this when pk is
- NULL as it does not guarantee that the user IDs are
- cached. */
+ * NULL as it does not guarantee that the user IDs are cached.
+ * The old get_pubkey_function did not check PK->REQ_USAGE when
+ * reading form the caceh. This is probably a bug. Note that
+ * the cache is not used when the caller asked to return the
+ * entire keyblock. This is because the cache does not
+ * associate the public key wit its primary key. */
pk_cache_entry_t ce;
for (ce = pk_cache; ce; ce = ce->next)
{
if (ce->keyid[0] == keyid[0] && ce->keyid[1] == keyid[1])
- /* XXX: We don't check PK->REQ_USAGE here, but if we don't
- read from the cache, we do check it! */
{
copy_public_key (pk, ce->pk);
return 0;
@@ -380,6 +414,7 @@ get_pubkey (ctrl_t ctrl, PKT_public_key
}
}
#endif
+
/* More init stuff. */
if (!pk)
{
@@ -425,16 +460,18 @@ get_pubkey (ctrl_t ctrl, PKT_public_key
ctx.req_usage = pk->req_usage;
rc = lookup (ctrl, &ctx, 0, &kb, &found_key);
if (!rc)
+ pk_from_block (pk, kb, found_key);
+ getkey_end (ctrl, &ctx);
+ if (!rc && r_keyblock)
{
- pk_from_block (pk, kb, found_key);
+ *r_keyblock = kb;
+ kb = NULL;
}
- getkey_end (ctrl, &ctx);
release_kbnode (kb);
}
- if (!rc)
- goto leave;
- rc = GPG_ERR_NO_PUBKEY;
+ if (rc) /* Return a more useful error code. */
+ rc = gpg_error (GPG_ERR_NO_PUBKEY);
leave:
if (!rc)
@@ -445,6 +482,14 @@ leave:
}
+/* Wrapper for get_pubkey_bykid w/o keyblock return feature. */
+int
+get_pubkey (ctrl_t ctrl, PKT_public_key *pk, u32 *keyid)
+{
+ return get_pubkey_bykid (ctrl, pk, NULL, keyid);
+}
+
+
/* Same as get_pubkey but if the key was not found the function tries
* to import it from LDAP. FIXME: We should not need this but swicth
* to a fingerprint lookup. */
@@ -557,28 +602,6 @@ get_pubkey_fast (ctrl_t ctrl, PKT_public
}
-/* Return the entire keyblock used to create SIG. This is a
- * specialized version of get_pubkeyblock.
- *
- * FIXME: This is a hack because get_pubkey_for_sig was already called
- * and it could have used a cache to hold the key. */
-kbnode_t
-get_pubkeyblock_for_sig (ctrl_t ctrl, PKT_signature *sig)
-{
- const byte *fpr;
- size_t fprlen;
- kbnode_t keyblock;
-
- /* First try the ISSUER_FPR info. */
- fpr = issuer_fpr_raw (sig, &fprlen);
- if (fpr && !get_pubkey_byfprint (ctrl, NULL, &keyblock, fpr, fprlen))
- return keyblock;
-
- /* Fallback to use the ISSUER_KEYID. */
- return get_pubkeyblock (ctrl, sig->keyid);
-}
-
-
/* Return the key block for the key with key id KEYID or NULL, if an
* error occurs. Use release_kbnode() to release the key block.
*
@@ -3640,6 +3663,7 @@ finish_lookup (kbnode_t keyblock, unsign
kbnode_t latest_key;
PKT_public_key *pk;
int req_prim;
+ int diag_exactfound = 0;
u32 curtime = make_timestamp ();
if (r_flags)
@@ -3667,11 +3691,10 @@ finish_lookup (kbnode_t keyblock, unsign
{
if (want_exact)
{
- if (DBG_LOOKUP)
- log_debug ("finish_lookup: exact search requested and found\n");
foundk = k;
pk = k->pkt->pkt.public_key;
pk->flags.exact = 1;
+ diag_exactfound = 1;
break;
}
else if ((k->pkt->pkt.public_key->pubkey_usage == PUBKEY_USAGE_RENC))
@@ -3700,10 +3723,14 @@ finish_lookup (kbnode_t keyblock, unsign
log_debug ("finish_lookup: checking key %08lX (%s)(req_usage=%x)\n",
(ulong) keyid_from_pk (keyblock->pkt->pkt.public_key, NULL),
foundk ? "one" : "all", req_usage);
+ if (diag_exactfound && DBG_LOOKUP)
+ log_debug ("\texact search requested and found\n");
if (!req_usage)
{
latest_key = foundk ? foundk : keyblock;
+ if (DBG_LOOKUP)
+ log_debug ("\tno usage requested - accepting key\n");
goto found;
}
Index: gnupg-2.4.4/g10/gpg.h
===================================================================
--- gnupg-2.4.4.orig/g10/gpg.h
+++ gnupg-2.4.4/g10/gpg.h
@@ -69,7 +69,8 @@ struct dirmngr_local_s;
typedef struct dirmngr_local_s *dirmngr_local_t;
/* Object used to describe a keyblock node. */
-typedef struct kbnode_struct *KBNODE; /* Deprecated use kbnode_t. */typedef struct kbnode_struct *kbnode_t;
+typedef struct kbnode_struct *KBNODE; /* Deprecated use kbnode_t. */
+typedef struct kbnode_struct *kbnode_t;
/* The handle for keydb operations. */
typedef struct keydb_handle_s *KEYDB_HANDLE;
Index: gnupg-2.4.4/g10/keydb.h
===================================================================
--- gnupg-2.4.4.orig/g10/keydb.h
+++ gnupg-2.4.4/g10/keydb.h
@@ -332,9 +332,15 @@ void getkey_disable_caches(void);
/* Return the public key used for signature SIG and store it at PK. */
gpg_error_t get_pubkey_for_sig (ctrl_t ctrl,
PKT_public_key *pk, PKT_signature *sig,
- PKT_public_key *forced_pk);
+ PKT_public_key *forced_pk,
+ kbnode_t *r_keyblock);
-/* Return the public key with the key id KEYID and store it at PK. */
+/* Return the public key with the key id KEYID and store it at PK.
+ * Optionally return the entire keyblock. */
+gpg_error_t get_pubkey_bykid (ctrl_t ctrl, PKT_public_key *pk,
+ kbnode_t *r_keyblock, u32 *keyid);
+
+/* Same as get_pubkey_bykid but w/o r_keyblock. */
int get_pubkey (ctrl_t ctrl, PKT_public_key *pk, u32 *keyid);
/* Same as get_pubkey but with auto LDAP fetch. */
Index: gnupg-2.4.4/g10/mainproc.c
===================================================================
--- gnupg-2.4.4.orig/g10/mainproc.c
+++ gnupg-2.4.4/g10/mainproc.c
@@ -1155,12 +1155,15 @@ proc_compressed (CTX c, PACKET *pkt)
* used to verify the signature will be stored there, or NULL if not
* found. If FORCED_PK is not NULL, this public key is used to verify
* _data signatures_ and no key lookup is done. Returns: 0 = valid
- * signature or an error code
+ * signature or an error code. If R_KEYBLOCK is not NULL the keyblock
+ * carries the used PK is stored there. The caller should always free
+ * the return value using release_kbnode.
*/
static int
do_check_sig (CTX c, kbnode_t node, const void *extrahash, size_t extrahashlen,
PKT_public_key *forced_pk, int *is_selfsig,
- int *is_expkey, int *is_revkey, PKT_public_key **r_pk)
+ int *is_expkey, int *is_revkey,
+ PKT_public_key **r_pk, kbnode_t *r_keyblock)
{
PKT_signature *sig;
gcry_md_hd_t md = NULL;
@@ -1170,6 +1173,8 @@ do_check_sig (CTX c, kbnode_t node, cons
if (r_pk)
*r_pk = NULL;
+ if (r_keyblock)
+ *r_keyblock = NULL;
log_assert (node->pkt->pkttype == PKT_SIGNATURE);
if (is_selfsig)
@@ -1247,17 +1252,19 @@ do_check_sig (CTX c, kbnode_t node, cons
(0x00) or text document (0x01). */
rc = check_signature2 (c->ctrl, sig, md, extrahash, extrahashlen,
forced_pk,
- NULL, is_expkey, is_revkey, r_pk);
+ NULL, is_expkey, is_revkey, r_pk, r_keyblock);
if (! rc)
md_good = md;
else if (gpg_err_code (rc) == GPG_ERR_BAD_SIGNATURE && md2)
{
PKT_public_key *pk2;
+ if (r_keyblock)
+ release_kbnode (*r_keyblock);
rc = check_signature2 (c->ctrl, sig, md2, extrahash, extrahashlen,
forced_pk,
NULL, is_expkey, is_revkey,
- r_pk? &pk2 : NULL);
+ r_pk? &pk2 : NULL, r_keyblock);
if (!rc)
{
md_good = md2;
@@ -1420,7 +1427,7 @@ list_node (CTX c, kbnode_t node)
{
fflush (stdout);
rc2 = do_check_sig (c, node, NULL, 0, NULL,
- &is_selfsig, NULL, NULL, NULL);
+ &is_selfsig, NULL, NULL, NULL, NULL);
switch (gpg_err_code (rc2))
{
case 0: sigrc = '!'; break;
@@ -1880,7 +1887,7 @@ check_sig_and_print (CTX c, kbnode_t nod
PKT_public_key *pk = NULL; /* The public key for the signature or NULL. */
const void *extrahash = NULL;
size_t extrahashlen = 0;
- kbnode_t included_keyblock = NULL;
+ kbnode_t keyblock = NULL;
if (opt.skip_verify)
{
@@ -1999,7 +2006,8 @@ check_sig_and_print (CTX c, kbnode_t nod
{
ambiguous:
log_error(_("can't handle this ambiguous signature data\n"));
- return 0;
+ rc = 0;
+ goto leave;
}
} /* End checking signature packet composition. */
@@ -2035,7 +2043,7 @@ check_sig_and_print (CTX c, kbnode_t nod
log_info (_(" issuer \"%s\"\n"), sig->signers_uid);
rc = do_check_sig (c, node, extrahash, extrahashlen, NULL,
- NULL, &is_expkey, &is_revkey, &pk);
+ NULL, &is_expkey, &is_revkey, &pk, &keyblock);
/* If the key is not found but the signature includes a key block we
* use that key block for verification and on success import it. */
@@ -2043,6 +2051,7 @@ check_sig_and_print (CTX c, kbnode_t nod
&& sig->flags.key_block
&& opt.flags.auto_key_import)
{
+ kbnode_t included_keyblock = NULL;
PKT_public_key *included_pk;
const byte *kblock;
size_t kblock_len;
@@ -2054,10 +2063,12 @@ check_sig_and_print (CTX c, kbnode_t nod
kblock+1, kblock_len-1,
sig->keyid, &included_keyblock))
{
+ /* Note: This is the only place where we use the forced_pk
+ * arg (ie. included_pk) with do_check_sig. */
rc = do_check_sig (c, node, extrahash, extrahashlen, included_pk,
- NULL, &is_expkey, &is_revkey, &pk);
+ NULL, &is_expkey, &is_revkey, &pk, NULL);
if (opt.verbose)
- log_debug ("checked signature using included key block: %s\n",
+ log_info ("checked signature using included key block: %s\n",
gpg_strerror (rc));
if (!rc)
{
@@ -2067,6 +2078,18 @@ check_sig_and_print (CTX c, kbnode_t nod
}
free_public_key (included_pk);
+ release_kbnode (included_keyblock);
+
+ /* To make sure that nothing strange happened we check the
+ * signature again now using our own key store. This also
+ * returns the keyblock which we use later on. */
+ if (!rc)
+ {
+ release_kbnode (keyblock);
+ keyblock = NULL;
+ rc = do_check_sig (c, node, extrahash, extrahashlen, NULL,
+ NULL, &is_expkey, &is_revkey, &pk, &keyblock);
+ }
}
/* If the key isn't found, check for a preferred keyserver. Note
@@ -2113,8 +2136,13 @@ check_sig_and_print (CTX c, kbnode_t nod
KEYSERVER_IMPORT_FLAG_QUICK);
glo_ctrl.in_auto_key_retrieve--;
if (!res)
- rc = do_check_sig (c, node, extrahash, extrahashlen, NULL,
- NULL, &is_expkey, &is_revkey, &pk);
+ {
+ release_kbnode (keyblock);
+ keyblock = NULL;
+ rc = do_check_sig (c, node, extrahash, extrahashlen, NULL,
+ NULL, &is_expkey, &is_revkey, &pk,
+ &keyblock);
+ }
else if (DBG_LOOKUP)
log_debug ("lookup via %s failed: %s\n", "Pref-KS",
gpg_strerror (res));
@@ -2155,8 +2183,12 @@ check_sig_and_print (CTX c, kbnode_t nod
/* Fixme: If the fingerprint is embedded in the signature,
* compare it to the fingerprint of the returned key. */
if (!res)
- rc = do_check_sig (c, node, extrahash, extrahashlen, NULL,
- NULL, &is_expkey, &is_revkey, &pk);
+ {
+ release_kbnode (keyblock);
+ keyblock = NULL;
+ rc = do_check_sig (c, node, extrahash, extrahashlen, NULL,
+ NULL, &is_expkey, &is_revkey, &pk, &keyblock);
+ }
else if (DBG_LOOKUP)
log_debug ("lookup via %s failed: %s\n", "WKD", gpg_strerror (res));
}
@@ -2186,8 +2218,13 @@ check_sig_and_print (CTX c, kbnode_t nod
KEYSERVER_IMPORT_FLAG_QUICK);
glo_ctrl.in_auto_key_retrieve--;
if (!res)
- rc = do_check_sig (c, node, extrahash, extrahashlen, NULL,
- NULL, &is_expkey, &is_revkey, &pk);
+ {
+ release_kbnode (keyblock);
+ keyblock = NULL;
+ rc = do_check_sig (c, node, extrahash, extrahashlen, NULL,
+ NULL, &is_expkey, &is_revkey, &pk,
+ &keyblock);
+ }
else if (DBG_LOOKUP)
log_debug ("lookup via %s failed: %s\n", "KS", gpg_strerror (res));
}
@@ -2198,7 +2235,7 @@ check_sig_and_print (CTX c, kbnode_t nod
{
/* We have checked the signature and the result is either a good
* signature or a bad signature. Further examination follows. */
- kbnode_t un, keyblock;
+ kbnode_t un;
int count = 0;
int keyblock_has_pk = 0; /* For failsafe check. */
int statno;
@@ -2216,18 +2253,6 @@ check_sig_and_print (CTX c, kbnode_t nod
else
statno = STATUS_GOODSIG;
- /* FIXME: We should have the public key in PK and thus the
- * keyblock has already been fetched. Thus we could use the
- * fingerprint or PK itself to lookup the entire keyblock. That
- * would best be done with a cache. */
- if (included_keyblock)
- {
- keyblock = included_keyblock;
- included_keyblock = NULL;
- }
- else
- keyblock = get_pubkeyblock_for_sig (c->ctrl, sig);
-
snprintf (keyid_str, sizeof keyid_str, "%08lX%08lX [uncertain] ",
(ulong)sig->keyid[0], (ulong)sig->keyid[1]);
@@ -2293,10 +2318,10 @@ check_sig_and_print (CTX c, kbnode_t nod
* contained in the keyring.*/
}
- log_assert (mainpk);
- if (!keyblock_has_pk)
+ if (!mainpk || !keyblock_has_pk)
{
- log_error ("signature key lost from keyblock\n");
+ log_error ("signature key lost from keyblock (%p,%p,%d)\n",
+ keyblock, mainpk, keyblock_has_pk);
rc = gpg_error (GPG_ERR_INTERNAL);
}
@@ -2567,8 +2592,8 @@ check_sig_and_print (CTX c, kbnode_t nod
log_error (_("Can't check signature: %s\n"), gpg_strerror (rc));
}
+ leave:
free_public_key (pk);
- release_kbnode (included_keyblock);
xfree (issuer_fpr);
return rc;
}
Index: gnupg-2.4.4/g10/packet.h
===================================================================
--- gnupg-2.4.4.orig/g10/packet.h
+++ gnupg-2.4.4/g10/packet.h
@@ -914,7 +914,7 @@ gpg_error_t check_signature2 (ctrl_t ctr
const void *extrahash, size_t extrahashlen,
PKT_public_key *forced_pk,
u32 *r_expiredate, int *r_expired, int *r_revoked,
- PKT_public_key **r_pk);
+ PKT_public_key **r_pk, kbnode_t *r_keyblock);
/*-- pubkey-enc.c --*/
Index: gnupg-2.4.4/g10/sig-check.c
===================================================================
--- gnupg-2.4.4.orig/g10/sig-check.c
+++ gnupg-2.4.4/g10/sig-check.c
@@ -95,7 +95,7 @@ int
check_signature (ctrl_t ctrl, PKT_signature *sig, gcry_md_hd_t digest)
{
return check_signature2 (ctrl, sig, digest, NULL, 0, NULL,
- NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL);
}
@@ -142,6 +142,11 @@ check_signature (ctrl_t ctrl, PKT_signat
* If R_PK is not NULL, the public key is stored at that address if it
* was found; other wise NULL is stored.
*
+ * If R_KEYBLOCK is not NULL, the entire keyblock used to verify the
+ * signature is stored at that address. If no key was found or on
+ * some other errors NULL is stored there. The callers needs to
+ * release the keyblock using release_kbnode (kb).
+ *
* Returns 0 on success. An error code otherwise. */
gpg_error_t
check_signature2 (ctrl_t ctrl,
@@ -149,7 +154,7 @@ check_signature2 (ctrl_t ctrl,
const void *extrahash, size_t extrahashlen,
PKT_public_key *forced_pk,
u32 *r_expiredate,
- int *r_expired, int *r_revoked, PKT_public_key **r_pk)
+ int *r_expired, int *r_revoked, PKT_public_key **r_pk, kbnode_t *r_keyblock)
{
int rc=0;
PKT_public_key *pk;
@@ -162,6 +167,8 @@ check_signature2 (ctrl_t ctrl,
*r_revoked = 0;
if (r_pk)
*r_pk = NULL;
+ if (r_keyblock)
+ *r_keyblock = NULL;
pk = xtrycalloc (1, sizeof *pk);
if (!pk)
@@ -192,7 +199,7 @@ check_signature2 (ctrl_t ctrl,
log_info(_("WARNING: signature digest conflict in message\n"));
rc = gpg_error (GPG_ERR_GENERAL);
}
- else if (get_pubkey_for_sig (ctrl, pk, sig, forced_pk))
+ else if (get_pubkey_for_sig (ctrl, pk, sig, forced_pk, r_keyblock))
rc = gpg_error (GPG_ERR_NO_PUBKEY);
else if ((rc = check_key_verify_compliance (pk)))
;/* Compliance failure. */
@@ -791,9 +798,9 @@ check_revocation_keys (ctrl_t ctrl, PKT_
keyid_from_fingerprint (ctrl, pk->revkey[i].fpr, pk->revkey[i].fprlen,
keyid);
- if(keyid[0]==sig->keyid[0] && keyid[1]==sig->keyid[1])
- /* The signature was generated by a designated revoker.
- Verify the signature. */
+ /* If the signature was generated by a designated revoker
+ * verify the signature. */
+ if (keyid[0] == sig->keyid[0] && keyid[1] == sig->keyid[1])
{
gcry_md_hd_t md;
@@ -1007,7 +1014,7 @@ check_signature_over_key_or_uid (ctrl_t
if (IS_CERT (sig))
signer->req_usage = PUBKEY_USAGE_CERT;
- rc = get_pubkey_for_sig (ctrl, signer, sig, NULL);
+ rc = get_pubkey_for_sig (ctrl, signer, sig, NULL, NULL);
if (rc)
{
xfree (signer);

View File

@@ -14,24 +14,24 @@ export-clean.
GnuPG-bug-id: 7583 GnuPG-bug-id: 7583
diff --git a/g10/getkey.c b/g10/getkey.c Index: gnupg-2.4.4/g10/getkey.c
index e93c0a904..0fe17d054 100644 ===================================================================
--- a/g10/getkey.c --- gnupg-2.4.4.orig/g10/getkey.c
+++ b/g10/getkey.c +++ gnupg-2.4.4/g10/getkey.c
@@ -341,8 +341,10 @@ get_pubkey_for_sig (ctrl_t ctrl, PKT_public_key *pk, PKT_signature *sig, @@ -336,8 +336,10 @@ get_pubkey_for_sig (ctrl_t ctrl, PKT_pub
/* Make sure to request only keys cabable of signing. This makes /* Make sure to request only keys cabable of signing. This makes
* sure that a subkey w/o a valid backsig or with bad usage flags * sure that a subkey w/o a valid backsig or with bad usage flags
* will be skipped. We also request the verification mode so that * will be skipped. We also request the verification mode so that
- * expired and reoked keys are returned. */ - * expired and revoked keys are returned. */
- pk->req_usage = (PUBKEY_USAGE_SIG | PUBKEY_USAGE_VERIFY); - pk->req_usage = (PUBKEY_USAGE_SIG | PUBKEY_USAGE_VERIFY);
+ * expired and revoked keys are returned. We keep only a requested + * expired and revoked keys are returned. We keep only a requested
+ * CERT usage in PK for the sake of key signatures. */ + * CERT usage in PK for the sake of key signatures. */
+ pk->req_usage = (PUBKEY_USAGE_SIG | PUBKEY_USAGE_VERIFY + pk->req_usage = (PUBKEY_USAGE_SIG | PUBKEY_USAGE_VERIFY
+ | (pk->req_usage & PUBKEY_USAGE_CERT)); + | (pk->req_usage & PUBKEY_USAGE_CERT));
/* First try the ISSUER_FPR info. */ /* First try the ISSUER_FPR info. */
fpr = issuer_fpr_raw (sig, &fprlen); fpr = issuer_fpr_raw (sig, &fprlen);
@@ -3735,7 +3737,7 @@ finish_lookup (kbnode_t keyblock, unsigned int req_usage, int want_exact, @@ -3675,7 +3677,7 @@ finish_lookup (kbnode_t keyblock, unsign
/* The verify mode is used to change the behaviour so that we can /* The verify mode is used to change the behaviour so that we can
* return an expired or revoked key for signature verification. */ * return an expired or revoked key for signature verification. */
verify_mode = ((req_usage & PUBKEY_USAGE_VERIFY) verify_mode = ((req_usage & PUBKEY_USAGE_VERIFY)
@@ -40,6 +40,3 @@ index e93c0a904..0fe17d054 100644
#define USAGE_MASK (PUBKEY_USAGE_SIG|PUBKEY_USAGE_ENC|PUBKEY_USAGE_CERT) #define USAGE_MASK (PUBKEY_USAGE_SIG|PUBKEY_USAGE_ENC|PUBKEY_USAGE_CERT)
req_usage &= USAGE_MASK; req_usage &= USAGE_MASK;
--
2.50.0

View File

@@ -0,0 +1,170 @@
From d3d7713c1799754160260cb350309dd183b397f5 Mon Sep 17 00:00:00 2001
From: Werner Koch <wk@gnupg.org>
Date: Thu, 6 Mar 2025 17:17:17 +0100
Subject: [PATCH 0901/1000] gpg: Fix regression for the recent malicious subkey
DoS fix.
* g10/packet.h (PUBKEY_USAGE_VERIFY): New.
* g10/getkey.c (get_pubkey_for_sig): Pass new flag also to requested
usage.
(finish_lookup): Introduce a verify_mode.
--
Fixes-commit: 48978ccb4e20866472ef18436a32744350a65158
GnuPG-bug-id: 7547
Index: gnupg-2.4.4/g10/getkey.c
===================================================================
--- gnupg-2.4.4.orig/g10/getkey.c
+++ gnupg-2.4.4/g10/getkey.c
@@ -309,11 +309,12 @@ pk_from_block (PKT_public_key *pk, kbnod
/* Specialized version of get_pubkey which retrieves the key based on
- * information in SIG. In contrast to get_pubkey PK is required. IF
+ * information in SIG. In contrast to get_pubkey PK is required. If
* FORCED_PK is not NULL, this public key is used and copied to PK.
* If R_KEYBLOCK is not NULL the entire keyblock is stored there if
* found and FORCED_PK is not used; if not used or on error NULL is
- * stored there. */
+ * stored there. Use this function only to find the key for
+ * verification; it can't be used to select a key for signing. */
gpg_error_t
get_pubkey_for_sig (ctrl_t ctrl, PKT_public_key *pk, PKT_signature *sig,
PKT_public_key *forced_pk, kbnode_t *r_keyblock)
@@ -333,8 +334,9 @@ get_pubkey_for_sig (ctrl_t ctrl, PKT_pub
/* Make sure to request only keys cabable of signing. This makes
* sure that a subkey w/o a valid backsig or with bad usage flags
- * will be skipped. */
- pk->req_usage = PUBKEY_USAGE_SIG;
+ * will be skipped. We also request the verification mode so that
+ * expired and revoked keys are returned. */
+ pk->req_usage = (PUBKEY_USAGE_SIG | PUBKEY_USAGE_VERIFY);
/* First try the ISSUER_FPR info. */
fpr = issuer_fpr_raw (sig, &fprlen);
@@ -399,10 +401,10 @@ get_pubkey_bykid (ctrl_t ctrl, PKT_publi
/* Try to get it from the cache. We don't do this when pk is
* NULL as it does not guarantee that the user IDs are cached.
* The old get_pubkey_function did not check PK->REQ_USAGE when
- * reading form the caceh. This is probably a bug. Note that
+ * reading from the cache. This is probably a bug. Note that
* the cache is not used when the caller asked to return the
* entire keyblock. This is because the cache does not
- * associate the public key wit its primary key. */
+ * associate the public key with its primary key. */
pk_cache_entry_t ce;
for (ce = pk_cache; ce; ce = ce->next)
{
@@ -3664,11 +3666,18 @@ finish_lookup (kbnode_t keyblock, unsign
PKT_public_key *pk;
int req_prim;
int diag_exactfound = 0;
+ int verify_mode = 0;
u32 curtime = make_timestamp ();
if (r_flags)
*r_flags = 0;
+
+ /* The verify mode is used to change the behaviour so that we can
+ * return an expired or revoked key for signature verification. */
+ verify_mode = ((req_usage & PUBKEY_USAGE_VERIFY)
+ && (req_usage & PUBKEY_USAGE_SIG));
+
#define USAGE_MASK (PUBKEY_USAGE_SIG|PUBKEY_USAGE_ENC|PUBKEY_USAGE_CERT)
req_usage &= USAGE_MASK;
@@ -3720,9 +3729,9 @@ finish_lookup (kbnode_t keyblock, unsign
}
if (DBG_LOOKUP)
- log_debug ("finish_lookup: checking key %08lX (%s)(req_usage=%x)\n",
+ log_debug ("finish_lookup: checking key %08lX (%s)(req_usage=%x%s)\n",
(ulong) keyid_from_pk (keyblock->pkt->pkt.public_key, NULL),
- foundk ? "one" : "all", req_usage);
+ foundk ? "one" : "all", req_usage, verify_mode? ",verify":"");
if (diag_exactfound && DBG_LOOKUP)
log_debug ("\texact search requested and found\n");
@@ -3785,28 +3794,28 @@ finish_lookup (kbnode_t keyblock, unsign
}
n_subkeys++;
- if (pk->flags.revoked)
+ if (!verify_mode && pk->flags.revoked)
{
if (DBG_LOOKUP)
log_debug ("\tsubkey has been revoked\n");
n_revoked_or_expired++;
continue;
}
- if (pk->has_expired && !opt.ignore_expiration)
+ if (!verify_mode && pk->has_expired && !opt.ignore_expiration)
{
if (DBG_LOOKUP)
log_debug ("\tsubkey has expired\n");
n_revoked_or_expired++;
continue;
}
- if (pk->timestamp > curtime && !opt.ignore_valid_from)
+ if (!verify_mode && pk->timestamp > curtime && !opt.ignore_valid_from)
{
if (DBG_LOOKUP)
log_debug ("\tsubkey not yet valid\n");
continue;
}
- if (want_secret)
+ if (!verify_mode && want_secret)
{
int secret_key_avail = agent_probe_secret_key (NULL, pk);
@@ -3833,7 +3842,8 @@ finish_lookup (kbnode_t keyblock, unsign
}
if (DBG_LOOKUP)
- log_debug ("\tsubkey might be fine\n");
+ log_debug ("\tsubkey might be fine%s\n",
+ verify_mode? " for verification":"");
/* In case a key has a timestamp of 0 set, we make sure
that it is used. A better change would be to compare
">=" but that might also change the selected keys and
@@ -3874,12 +3884,12 @@ finish_lookup (kbnode_t keyblock, unsign
log_debug ("\tprimary key usage does not match: "
"want=%x have=%x\n", req_usage, pk->pubkey_usage);
}
- else if (pk->flags.revoked)
+ else if (!verify_mode && pk->flags.revoked)
{
if (DBG_LOOKUP)
log_debug ("\tprimary key has been revoked\n");
}
- else if (pk->has_expired)
+ else if (!verify_mode && pk->has_expired)
{
if (DBG_LOOKUP)
log_debug ("\tprimary key has expired\n");
@@ -3887,7 +3897,8 @@ finish_lookup (kbnode_t keyblock, unsign
else /* Okay. */
{
if (DBG_LOOKUP)
- log_debug ("\tprimary key may be used\n");
+ log_debug ("\tprimary key may be used%s\n",
+ verify_mode? " for verification":"");
latest_key = keyblock;
}
}
Index: gnupg-2.4.4/g10/packet.h
===================================================================
--- gnupg-2.4.4.orig/g10/packet.h
+++ gnupg-2.4.4/g10/packet.h
@@ -65,6 +65,7 @@
#define SIGNHINT_SELFSIG 2
#define SIGNHINT_ADSK 4
+#define PUBKEY_USAGE_VERIFY 16384 /* Verify only modifier. */
/* Helper macros. */
#define is_RSA(a) ((a)==PUBKEY_ALGO_RSA || (a)==PUBKEY_ALGO_RSA_E \

View File

@@ -1,17 +1,17 @@
Index: gnupg-2.5.1/autogen.sh Index: gnupg-2.4.3/autogen.sh
=================================================================== ===================================================================
--- gnupg-2.5.1.orig/autogen.sh --- gnupg-2.4.3.orig/autogen.sh
+++ gnupg-2.5.1/autogen.sh +++ gnupg-2.4.3/autogen.sh
@@ -244,7 +244,7 @@ if [ "$myhost" = "find-version" ]; then @@ -221,7 +221,7 @@ if [ "$myhost" = "find-version" ]; then
fi esac
beta=no beta=no
- if [ -e .git ]; then - if [ -e .git ]; then
+ if false; then + if false; then
ingit=yes ingit=yes
tmp=$(git describe --match "${matchstr1}" --long 2>/dev/null) tmp=$(git describe --match "${matchstr1}" --long 2>/dev/null)
if [ -n "$tmp" ]; then tmp=$(echo "$tmp" | sed s/^"$package"//)
@@ -270,8 +270,8 @@ if [ "$myhost" = "find-version" ]; then @@ -237,8 +237,8 @@ if [ "$myhost" = "find-version" ]; then
rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null))) rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null)))
else else
ingit=no ingit=no
@@ -19,6 +19,6 @@ Index: gnupg-2.5.1/autogen.sh
- tmp="-unknown" - tmp="-unknown"
+ beta=no + beta=no
+ tmp="" + tmp=""
cid="0000000"
rev="0000000" rev="0000000"
rvd="0" rvd="0"
fi

View File

@@ -13,11 +13,11 @@ Subject: [PATCH GnuPG] gpg: Merge --rfc4880bis features into --gnupg
(read_parameter_file): Activate the v4 and v5 keywords. (read_parameter_file): Activate the v4 and v5 keywords.
-- --
Index: gnupg-2.5.4/g10/gpg.c Index: gnupg-2.4.1/g10/gpg.c
=================================================================== ===================================================================
--- gnupg-2.5.4.orig/g10/gpg.c --- gnupg-2.4.1.orig/g10/gpg.c
+++ gnupg-2.5.4/g10/gpg.c +++ gnupg-2.4.1/g10/gpg.c
@@ -254,6 +254,7 @@ enum cmd_and_opt_values @@ -247,6 +247,7 @@ enum cmd_and_opt_values
oGnuPG, oGnuPG,
oRFC2440, oRFC2440,
oRFC4880, oRFC4880,
@@ -25,7 +25,7 @@ Index: gnupg-2.5.4/g10/gpg.c
oOpenPGP, oOpenPGP,
oPGP7, oPGP7,
oPGP8, oPGP8,
@@ -654,6 +655,7 @@ static gpgrt_opt_t opts[] = { @@ -636,6 +637,7 @@ static gpgrt_opt_t opts[] = {
ARGPARSE_s_n (oGnuPG, "no-pgp8", "@"), ARGPARSE_s_n (oGnuPG, "no-pgp8", "@"),
ARGPARSE_s_n (oRFC2440, "rfc2440", "@"), ARGPARSE_s_n (oRFC2440, "rfc2440", "@"),
ARGPARSE_s_n (oRFC4880, "rfc4880", "@"), ARGPARSE_s_n (oRFC4880, "rfc4880", "@"),
@@ -33,7 +33,7 @@ Index: gnupg-2.5.4/g10/gpg.c
ARGPARSE_s_n (oOpenPGP, "openpgp", N_("use strict OpenPGP behavior")), ARGPARSE_s_n (oOpenPGP, "openpgp", N_("use strict OpenPGP behavior")),
ARGPARSE_s_n (oPGP7, "pgp6", "@"), ARGPARSE_s_n (oPGP7, "pgp6", "@"),
ARGPARSE_s_n (oPGP7, "pgp7", "@"), ARGPARSE_s_n (oPGP7, "pgp7", "@"),
@@ -1008,7 +1010,6 @@ static gpgrt_opt_t opts[] = { @@ -978,7 +980,6 @@ static gpgrt_opt_t opts[] = {
ARGPARSE_s_n (oNoop, "no-allow-multiple-messages", "@"), ARGPARSE_s_n (oNoop, "no-allow-multiple-messages", "@"),
ARGPARSE_s_s (oNoop, "aead-algo", "@"), ARGPARSE_s_s (oNoop, "aead-algo", "@"),
ARGPARSE_s_s (oNoop, "personal-aead-preferences","@"), ARGPARSE_s_s (oNoop, "personal-aead-preferences","@"),
@@ -41,7 +41,7 @@ Index: gnupg-2.5.4/g10/gpg.c
ARGPARSE_s_n (oNoop, "override-compliance-check", "@"), ARGPARSE_s_n (oNoop, "override-compliance-check", "@"),
@@ -2263,7 +2264,7 @@ static struct gnupg_compliance_option co @@ -2227,7 +2228,7 @@ static struct gnupg_compliance_option co
{ {
{ "gnupg", oGnuPG }, { "gnupg", oGnuPG },
{ "openpgp", oOpenPGP }, { "openpgp", oOpenPGP },
@@ -50,7 +50,7 @@ Index: gnupg-2.5.4/g10/gpg.c
{ "rfc4880", oRFC4880 }, { "rfc4880", oRFC4880 },
{ "rfc2440", oRFC2440 }, { "rfc2440", oRFC2440 },
{ "pgp6", oPGP7 }, { "pgp6", oPGP7 },
@@ -2279,8 +2280,29 @@ static struct gnupg_compliance_option co @@ -2243,8 +2244,28 @@ static struct gnupg_compliance_option co
static void static void
set_compliance_option (enum cmd_and_opt_values option) set_compliance_option (enum cmd_and_opt_values option)
{ {
@@ -76,19 +76,26 @@ Index: gnupg-2.5.4/g10/gpg.c
+ opt.s2k_digest_algo = DIGEST_ALGO_SHA256; + opt.s2k_digest_algo = DIGEST_ALGO_SHA256;
+ opt.s2k_cipher_algo = CIPHER_ALGO_AES256; + opt.s2k_cipher_algo = CIPHER_ALGO_AES256;
+ break; + break;
+ case oOpenPGP:
case oRFC4880:
/* This is effectively the same as RFC2440, but with
@@ -2288,6 +2309,7 @@ set_compliance_option (enum cmd_and_opt_
case oPGP8: opt.compliance = CO_PGP8; break;
case oGnuPG: case oGnuPG:
/* set up default options affected by policy compliance: */
opt.compliance = CO_GNUPG; opt.compliance = CO_GNUPG;
@@ -2299,6 +2321,7 @@ set_compliance_option (enum cmd_and_opt_
opt.s2k_digest_algo = 0;
opt.s2k_cipher_algo = DEFAULT_CIPHER_ALGO;
opt.flags.allow_old_cipher_algos = 0;
+ opt.flags.rfc4880bis = 1; + opt.flags.rfc4880bis = 1;
break; break;
case oOpenPGP: case oDE_VS:
@@ -3090,6 +3113,7 @@ main (int argc, char **argv) @@ -2490,6 +2512,7 @@ main (int argc, char **argv)
opt.emit_version = 0;
opt.weak_digests = NULL;
opt.compliance = CO_GNUPG;
+ opt.flags.rfc4880bis = 1;
/* Check special options given on the command line. */
orig_argc = argc;
@@ -3032,6 +3055,7 @@ main (int argc, char **argv)
case oOpenPGP: case oOpenPGP:
case oRFC2440: case oRFC2440:
case oRFC4880: case oRFC4880:
@@ -96,7 +103,7 @@ Index: gnupg-2.5.4/g10/gpg.c
case oPGP7: case oPGP7:
case oPGP8: case oPGP8:
case oGnuPG: case oGnuPG:
@@ -4000,6 +4024,11 @@ main (int argc, char **argv) @@ -3868,6 +3892,11 @@ main (int argc, char **argv)
if( may_coredump && !opt.quiet ) if( may_coredump && !opt.quiet )
log_info(_("WARNING: program may create a core file!\n")); log_info(_("WARNING: program may create a core file!\n"));
@@ -108,7 +115,7 @@ Index: gnupg-2.5.4/g10/gpg.c
if (eyes_only) { if (eyes_only) {
if (opt.set_filename) if (opt.set_filename)
log_info(_("WARNING: %s overrides %s\n"), log_info(_("WARNING: %s overrides %s\n"),
@@ -4222,7 +4251,7 @@ main (int argc, char **argv) @@ -4084,7 +4113,7 @@ main (int argc, char **argv)
/* Check our chosen algorithms against the list of legal /* Check our chosen algorithms against the list of legal
algorithms. */ algorithms. */
@@ -117,20 +124,20 @@ Index: gnupg-2.5.4/g10/gpg.c
{ {
const char *badalg=NULL; const char *badalg=NULL;
preftype_t badtype=PREFTYPE_NONE; preftype_t badtype=PREFTYPE_NONE;
Index: gnupg-2.5.4/g10/keygen.c Index: gnupg-2.4.1/g10/keygen.c
=================================================================== ===================================================================
--- gnupg-2.5.4.orig/g10/keygen.c --- gnupg-2.4.1.orig/g10/keygen.c
+++ gnupg-2.5.4/g10/keygen.c +++ gnupg-2.4.1/g10/keygen.c
@@ -489,7 +489,7 @@ keygen_set_std_prefs (const char *string @@ -404,7 +404,7 @@ keygen_set_std_prefs (const char *string
strcat(dummy_string,"S7 "); strcat(dummy_string,"S7 ");
strcat(dummy_string,"S2 "); /* 3DES */ strcat(dummy_string,"S2 "); /* 3DES */
- if (!openpgp_aead_test_algo (AEAD_ALGO_OCB)) - if (!openpgp_aead_test_algo (AEAD_ALGO_OCB))
+ if (opt.flags.rfc4880bis && !openpgp_aead_test_algo (AEAD_ALGO_OCB)) + if (opt.flags.rfc4880bis && !openpgp_aead_test_algo (AEAD_ALGO_OCB))
strcat(dummy_string,"A2 "); strcat(dummy_string,"A2 ");
if (personal) if (personal)
@@ -974,7 +974,7 @@ keygen_upd_std_prefs (PKT_signature *sig @@ -889,7 +889,7 @@ keygen_upd_std_prefs (PKT_signature *sig
/* Make sure that the MDC feature flag is set if needed. */ /* Make sure that the MDC feature flag is set if needed. */
add_feature_mdc (sig,mdc_available); add_feature_mdc (sig,mdc_available);
add_feature_aead (sig, aead_available); add_feature_aead (sig, aead_available);
@@ -139,7 +146,7 @@ Index: gnupg-2.5.4/g10/keygen.c
add_keyserver_modify (sig,ks_modify); add_keyserver_modify (sig,ks_modify);
keygen_add_keyserver_url(sig,NULL); keygen_add_keyserver_url(sig,NULL);
@@ -4118,7 +4118,10 @@ parse_key_parameter_part (ctrl_t ctrl, @@ -3382,7 +3382,10 @@ parse_key_parameter_part (ctrl_t ctrl,
} }
} }
else if (!ascii_strcasecmp (s, "v5")) else if (!ascii_strcasecmp (s, "v5"))
@@ -151,7 +158,7 @@ Index: gnupg-2.5.4/g10/keygen.c
else if (!ascii_strcasecmp (s, "v4")) else if (!ascii_strcasecmp (s, "v4"))
keyversion = 4; keyversion = 4;
else else
@@ -4379,7 +4382,7 @@ parse_key_parameter_part (ctrl_t ctrl, @@ -3641,7 +3644,7 @@ parse_key_parameter_part (ctrl_t ctrl,
* ecdsa := Use algorithm ECDSA. * ecdsa := Use algorithm ECDSA.
* eddsa := Use algorithm EdDSA. * eddsa := Use algorithm EdDSA.
* ecdh := Use algorithm ECDH. * ecdh := Use algorithm ECDH.
@@ -160,7 +167,7 @@ Index: gnupg-2.5.4/g10/keygen.c
* *
* There are several defaults and fallbacks depending on the * There are several defaults and fallbacks depending on the
* algorithm. PART can be used to select which part of STRING is * algorithm. PART can be used to select which part of STRING is
@@ -5353,9 +5356,9 @@ read_parameter_file (ctrl_t ctrl, const @@ -4513,9 +4516,9 @@ read_parameter_file (ctrl_t ctrl, const
} }
} }
@@ -173,9 +180,9 @@ Index: gnupg-2.5.4/g10/keygen.c
else else
{ {
r = xmalloc_clear( sizeof *r + strlen( value ) ); r = xmalloc_clear( sizeof *r + strlen( value ) );
@@ -5450,11 +5453,14 @@ quickgen_set_para (struct para_data_s *p @@ -4610,11 +4613,14 @@ quickgen_set_para (struct para_data_s *p
r->next = para; para = r;
para = r; }
- r = xmalloc_clear (sizeof *r + 20); - r = xmalloc_clear (sizeof *r + 20);
- r->key = for_subkey? pSUBVERSION : pVERSION; - r->key = for_subkey? pSUBVERSION : pVERSION;

BIN
gpg2-systemd-user.tar.xz (Stored with Git LFS)

Binary file not shown.

View File

@@ -2,188 +2,25 @@
Thu Jun 26 11:26:15 UTC 2025 - Pedro Monreal <pmonreal@suse.com> Thu Jun 26 11:26:15 UTC 2025 - Pedro Monreal <pmonreal@suse.com>
- Security fix: [bsc#1236931, bsc#1239119, CVE-2025-30258] - Security fix: [bsc#1236931, bsc#1239119, CVE-2025-30258]
* gpg: Fix regression for the recent malicious subkey DoS fix.
* gpg: Fix another regression due to the T7547 fix. * gpg: Fix another regression due to the T7547 fix.
* The fix for CVE-2025-30258 was introduced in 2.5.5 * gpg: Allow the use of an ADSK subkey as ADSK subkey.
* Add gnupg-gpg-Fix-another-regression-due-to-the-T7547-fix.patch * Add patches:
- gnupg-gpg-Fix-regression-for-the-recent-malicious-subkey-D.patch
- gnupg-gpg-Fix-another-regression-due-to-the-T7547-fix.patch
- gnupg-gpg-Allow-the-use-of-an-ADSK-subkey-as-ADSK-subkey.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Jun 17 13:11:07 UTC 2025 - Lucas Mulling <lucas.mulling@suse.com> Tue Jun 3 11:31:57 UTC 2025 - Lucas Mulling <lucas.mulling@suse.com>
- Don't install expired sks certificate [bsc#1243069] - Don't install expired sks certificate [bsc#1243069]
* Add patch gnupg-dirmngr-Don-t-install-expired-sks-certificate.patch * Add patch gnupg-dirmngr-Don-t-install-expired-sks-certificate.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Mar 7 17:13:14 UTC 2025 - Lucas Mulling <lucas.mulling@suse.com> Mon Mar 17 17:36:17 UTC 2025 - Lucas Mulling <lucas.mulling@suse.com>
- Update to 2.5.5: [bsc#1236931, bsc#1239119] - Fix a verification DoS due to a malicious subkey in the keyring: [bsc#1239119]
* gpg: Fix a verification DoS due to a malicious subkey in the * Add patch gnupg-gpg-Fix-a-verification-DoS-due-to-a-malicious-subkey-in-the-keyring.patch
keyring. [T7527]
* dirmngr: Fix possible hangs due to blocking connection requests.
[T6606, T7434]
Release-info: https://dev.gnupg.org/T7530
-------------------------------------------------------------------
Wed Feb 26 14:13:02 UTC 2025 - Adrian Schröter <adrian@suse.de>
- Fixing gpg-agent integration by changing --supervised to
--deprecated-supervised in service files.
-------------------------------------------------------------------
Wed Feb 19 10:41:27 UTC 2025 - Pedro Monreal <pmonreal@suse.com>
- Update to 2.5.4:
* gpg: New option --disable-pqc-encryption. [rG00c31f8b04]
* gpg: Fix --quick-add-key for Weierstrass ECC with usage given. [T7506]
* gpg: Fix handling with no CRC armor. [T7071]
* gpg: New private Kyber keys are now cross-referenced using a new
Link attribute. [T6638]
* gpg: Fix an import problem with keys having another primary key as
a subkey. [T7527]
* gpgsm: Allow unattended PKCS#12 export without passphrase. [rG159e801043]
* gpgsm: Allow CSR generation with an unprotected key. [rG89055f24f4]
* agent: New option --change-std-env-name. [T7522]
* agent: Fix ssh-agent's request_identities for skipped Brainpool
keys. [rG2469dc5aae]
* Do not package zlib and bzip2 object files in a speedo release build. [T7442]
* Rebase patches:
- gnupg-add_legacy_FIPS_mode_option.patch
- gnupg-allow-import-of-previously-known-keys-even-without-UIDs.patch
- gnupg-revert-rfc4880bis.patch
-------------------------------------------------------------------
Tue Jan 14 14:09:10 UTC 2025 - Lucas Mulling <lucas.mulling@suse.com>
- Update to 2.5.3
* gpg: Allow for signature subpackets of up to 30000 octets.
[rG36dbca3e69]
* gpg: Silence expired trusted-key diagnostics in quiet mode. [T7351]
* gpg: Allow smaller session keys with Kyber and enforce the use of
AES-256 if useful. [T7472]
* gpg: Fix regression in key generation from existing card key.
[T7309,T7457]
* gpg: Print a warning if the card backup key could not be written.
[T2169]
* The --supervised options of gpg-agent and dirmngr have been
renamed to --deprecated-supervised as preparation for their removal.
[rGa019a0fcd8]
* There is no more default for a keyserver.
-------------------------------------------------------------------
Mon Jan 6 21:41:40 UTC 2025 - Andreas Stieger <andreas.stieger@gmx.de>
- note updated 2.5.x build dependencies
-------------------------------------------------------------------
Wed Dec 11 12:12:50 UTC 2024 - Lucas Mulling <lucas.mulling@suse.com>
- Update to 2.5.2:
* gpg: Add option 16 to --full-gen-key to create ECC+Kyber. [T6638]
* gpg: For composite algos add the algo string to the colons
listings. [T6638]
* gpg: Validate the trustdb after the import of a trusted key.
[T7200]
* gpg: Exclude expired trusted keys from the key validation process.
[T7200]
* gpg: Fix a wrong decryption failed status for signed and OCB
encrypted messages without a signature verification key. [T7042]
* gpg: Retain binary representation for import->export with Ed25519
key signatures. [T7426]
* gpg: Fix comparing ed448 to ed25519 with --assert-pubkey-algo.
[T7425]
* gpg: Avoid a failure exit code for expired ultimately trusted
keys. [T7351]
* gpg: Emit status error for an invalid ADSK. [T7322]
* gpg: Allow the use of an ADSK subkey as ADSK subkey. [T6882]
* gpg: Fix --quick-set-expire for V5 subkey fingerprints. [T7298]
* gpg: Robust error handling for SCD READKEY. [T7309]
* gpg: Fix cv25519 v5 export regression. [T7316]
* gpgsm: Nearly fourfold speedup of validated certificate listings.
[T7308]
* gpgsm: Improvement for some rare P12 files. [rGf50dde6269]
* gpgsm: Terminate key listing on output write error. [T6185]
* agent: Add option --status to the LISTRUSTED command.
[rG4275d5fa7a]
* agent: Fix detection of the yet unused trustflag de-vs. [T5079]
* agent: Allow ssh to sign data larger than the Assuan line length.
[T7436]
* keyboxd: Fix a race condition on the database handle. [T7294]
* dirmngr: A list of used URLs for loaded CRLs is printed first in
the output of the LISTCRL command. [T7337]
* scd: More mitigations against lock ups with multiple cards or
apps. [T7323, T7402]
* gpgtar: Use log-file from common.conf only in --batch mode.
[rGb389e04ef5]
* gpgtar: Fix directory creation during extraction. [T7380]
* gpg-mail-tube: Minor fixes.
* gpgconf: Add list flag to trusted-key et al. [T7313]
* Implement GNUPG_ASSUME_COMPLIANCE envvar and registry key for
testing de-vs compliance mode. [rGb287fb5775,rG7b0be541a9]
* Fix a race condition in creating the socket directory. [T7332]
-------------------------------------------------------------------
Thu Dec 5 18:47:10 UTC 2024 - Adrian Schröter <adrian@suse.de>
- Disable ibmswtpm2 on LoongArch64
-------------------------------------------------------------------
Mon Oct 21 18:52:37 UTC 2024 - Pedro Monreal <pmonreal@suse.com>
- Update to 2.5.1:
* gpg: The support for composite Kyber+ECC public key algorithms
does now use the final FIPS-203 and LibrePGP specifications. The
experimental keys from 2.5.0 are no longer supported. [T6815]
* gpg: New commands --add-recipients and --change-recipients. [T1825]
* gpg: New option --proc-all-sigs. [T7261]
* gpg: Fix a regression in 2.5.0 in gpgme's tests. [T7195]
* gpg: Make --no-literal work again for -c and --store. [T5852]
* gpg: Improve detection of input data read errors. [T6528]
* gpg: Fix getting key by IPGP record (rfc-4398). [T7288]
* gpgsm: New option --assert-signer. [T7286]
* gpgsm: More improvements to PKCS#12 parsing to cope with latest
IVBB changes. [T7213]
* agent: Fix KEYTOCARD command when used with a loopback pinentry. [T7283]
* gpg-mail-tube: Make sure GNUPGHOME is set in vsd mode. New option
--as-attach. [rG4511997e9e1b]
* Now uses the process spawn API from libgpg-error. [T7192,T7194]
* Removed the --enable-gpg-is-gpg2 configure time option.
[rG2125f228d36c]
* Rebase patches:
- gnupg-add_legacy_FIPS_mode_option.patch
- gnupg-revert-rfc4880bis.patch
- gnupg-nobetasuffix.patch
-------------------------------------------------------------------
Mon Aug 12 04:30:42 UTC 2024 - Andreas Stieger <andreas.stieger@gmx.de>
- Remove explicit runtime library dependency, pick ease of
maintenance in Tumbleweed over mixed project use runtime bugs.
-------------------------------------------------------------------
Fri Mar 8 13:14:00 UTC 2024 - Pedro Monreal <pmonreal@suse.com>
- Update to 2.4.5:
* gpg,gpgv: New option --assert-pubkey-algo. [T6946]
* gpg: Emit status lines for errors in the compression layer. [T6977]
* gpg: Fix invocation with --trusted-keys and --no-options. [T7025]
* gpgsm: Allow for a longer salt in PKCS#12 files. [T6757]
* gpgtar: Make --status-fd=2 work on Windows. [T6961]
* scd: Support for the ACR-122U NFC reader. [rG1682ca9f01]
* scd: Suport D-TRUST ECC cards. [T7000,T7001]
* scd: Allow auto detaching of kernel drivers; can be disabled with
the new compatibility-flag ccid-no-auto-detach. [rGa1ea3b13e0]
* scd: Allow setting a PIN length of 6 also with a reset code for
openpgp cards. [T6843]
* agent: Allow GET_PASSPHRASE in restricted mode. [rGadf4db6e20]
* dirmngr: Trust system's root CAs for checking CRL issuers. [T6963]
* dirmngr: Fix regression in 2.4.4 in fetching keys via hkps. [T6997]
* gpg-wks-client: Make option --mirror work properly w/o specifying
domains. [rG37cc255e49]
* g13,gpg-wks-client: Allow command style options as in "g13 mount
foo". [rGa09157ccb2]
* Allow tilde expansion for the foo-program options. [T7017]
* Make the getswdb.sh tool usable outside the GnuPG tree.
* Release-info: https://dev.gnupg.org/T6960
* Update the required versions for the dependencies.
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Jan 25 18:51:03 UTC 2024 - Pedro Monreal <pmonreal@suse.com> Thu Jan 25 18:51:03 UTC 2024 - Pedro Monreal <pmonreal@suse.com>

View File

@@ -1,8 +1,7 @@
# #
# spec file for package gpg2 # spec file for package gpg2
# #
# Copyright (c) 2025 SUSE LLC # Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 Andreas Stieger <Andreas.Stieger@gmx.de>
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +17,7 @@
Name: gpg2 Name: gpg2
Version: 2.5.5 Version: 2.4.4
Release: 0 Release: 0
Summary: File encryption, decryption, signature creation and verification utility Summary: File encryption, decryption, signature creation and verification utility
License: GPL-3.0-or-later License: GPL-3.0-or-later
@@ -47,15 +46,21 @@ Patch11: gnupg-allow-large-rsa.patch
Patch12: gnupg-revert-rfc4880bis.patch Patch12: gnupg-revert-rfc4880bis.patch
#PATCH-FIX-OPENSUSE Do not pull revision info from GIT when autoconf is run #PATCH-FIX-OPENSUSE Do not pull revision info from GIT when autoconf is run
Patch13: gnupg-nobetasuffix.patch Patch13: gnupg-nobetasuffix.patch
#PATCH-FIX-UPSTREAM Don't install exipred sks certificate #PATCH-FIX-UPSTREAM: bsc#1239119 - VUL-0: gpg2: verification DoS due to a malicious subkey in the keyring
Patch14: gnupg-dirmngr-Don-t-install-expired-sks-certificate.patch Patch14: gnupg-gpg-Fix-a-verification-DoS-due-to-a-malicious-subkey-in-the-keyring.patch
#PATCH-FIX-UPSTREAM gpg: Fix another regression due to the T7547 fix. #PATCH-FIX-UPSTREAM: bsc#1243069 - remove expired and insecure key /usr/share/gnupg/sks-keyservers.netCA.pem
Patch15: gnupg-gpg-Fix-another-regression-due-to-the-T7547-fix.patch Patch15: gnupg-dirmngr-Don-t-install-expired-sks-certificate.patch
#PATCH-FIX-UPSTREAM Fix regressions introduced in the fix for CVE-2025-30258
Patch16: gnupg-gpg-Fix-regression-for-the-recent-malicious-subkey-D.patch
Patch17: gnupg-gpg-Fix-another-regression-due-to-the-T7547-fix.patch
Patch18: gnupg-gpg-Allow-the-use-of-an-ADSK-subkey-as-ADSK-subkey.patch
BuildRequires: expect BuildRequires: expect
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: libassuan-devel >= 3.0.0 BuildRequires: ibmswtpm2
BuildRequires: libgcrypt-devel >= 1.11.0 BuildRequires: ibmtss-devel
BuildRequires: libgpg-error-devel >= 1.51 BuildRequires: libassuan-devel >= 2.5.0
BuildRequires: libgcrypt-devel >= 1.9.1
BuildRequires: libgpg-error-devel >= 1.46
BuildRequires: libksba-devel >= 1.6.3 BuildRequires: libksba-devel >= 1.6.3
BuildRequires: makeinfo BuildRequires: makeinfo
BuildRequires: npth-devel >= 1.2 BuildRequires: npth-devel >= 1.2
@@ -63,20 +68,21 @@ BuildRequires: openldap2-devel
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: readline-devel BuildRequires: readline-devel
BuildRequires: pkgconfig(bzip2) BuildRequires: pkgconfig(bzip2)
BuildRequires: pkgconfig(gnutls) >= 3.2 BuildRequires: pkgconfig(gnutls) >= 3.0
BuildRequires: pkgconfig(libusb-1.0) BuildRequires: pkgconfig(libusb-1.0)
BuildRequires: pkgconfig(sqlite3) >= 3.27 BuildRequires: pkgconfig(sqlite3) >= 3.27
BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(zlib)
# runtime dependency to support devel repository users - boo#955982
Requires: libassuan0 >= 2.5.0
Requires: libgcrypt20 >= 1.9.1
Requires: libgpg-error >= 1.46
Requires: libksba >= 1.3.4
Requires: pinentry Requires: pinentry
Recommends: dirmngr = %{version} Recommends: dirmngr = %{version}
Provides: gnupg = %{version} Provides: gnupg = %{version}
Provides: gpg = 1.4.9 Provides: gpg = 1.4.9
Provides: newpg Provides: newpg
Obsoletes: gpg < 1.4.9 Obsoletes: gpg < 1.4.9
%ifnarch loongarch64
BuildRequires: ibmswtpm2
BuildRequires: ibmtss-devel
%endif
%description %description
GnuPG is a hybrid-encryption software program; it uses a combination GnuPG is a hybrid-encryption software program; it uses a combination
@@ -124,7 +130,8 @@ date=$(date -u +%%Y-%%m-%%dT%%H:%%M+0000 -r %{SOURCE99})
--enable-large-secmem \ --enable-large-secmem \
--with-gnu-ld \ --with-gnu-ld \
--with-default-trust-store-file=%{_sysconfdir}/ssl/ca-bundle.pem \ --with-default-trust-store-file=%{_sysconfdir}/ssl/ca-bundle.pem \
--enable-build-timestamp=$date --enable-build-timestamp=$date \
--enable-gpg-is-gpg2
%make_build %make_build
@@ -141,11 +148,10 @@ rm -rf %{buildroot}%{_docdir}/gpg2/examples/gpgconf.conf
rm %{buildroot}%{_infodir}/dir rm %{buildroot}%{_infodir}/dir
# compat symlinks # compat symlinks
ln -sf gpg %{buildroot}%{_bindir}/gpg2 ln -sf gpg2 %{buildroot}%{_bindir}/gpg
ln -sf gpgv %{buildroot}%{_bindir}/gpgv2 ln -sf gpgv2 %{buildroot}%{_bindir}/gpgv
ln -sf gpg.1 %{buildroot}%{_mandir}/man1/gpg2.1 ln -sf gpg2.1 %{buildroot}%{_mandir}/man1/gpg.1
ln -sf gpgv.1 %{buildroot}%{_mandir}/man1/gpgv2.1 ln -sf gpgv2.1 %{buildroot}%{_mandir}/man1/gpgv.1
ln -sf gnupg.7 %{buildroot}%{_mandir}/man7/gnupg2.7
# install udev rules for scdaemon # install udev rules for scdaemon
install -Dm 0644 %{SOURCE4} %{buildroot}%{_udevrulesdir}/60-scdaemon.rules install -Dm 0644 %{SOURCE4} %{buildroot}%{_udevrulesdir}/60-scdaemon.rules
@@ -171,7 +177,7 @@ cp systemd-user/README.systemd %{buildroot}%{_docdir}/gpg2/
%license COPYING* %license COPYING*
%doc AUTHORS NEWS THANKS TODO ChangeLog %doc AUTHORS NEWS THANKS TODO ChangeLog
%{_infodir}/gnupg* %{_infodir}/gnupg*
%{_mandir}/*/[aghsw]*%{ext_man} %{_mandir}/*/[agsw]*%{ext_man}
%doc %{_docdir}/%{name} %doc %{_docdir}/%{name}
%{_bindir}/[gkw]* %{_bindir}/[gkw]*
%{_libexecdir}/[gks]* %{_libexecdir}/[gks]*
@@ -194,10 +200,8 @@ cp systemd-user/README.systemd %{buildroot}%{_docdir}/gpg2/
%{_libexecdir}/dirmngr_ldap %{_libexecdir}/dirmngr_ldap
%{_userunitdir}/dirmngr.* %{_userunitdir}/dirmngr.*
%ifnarch loongarch64
%files tpm %files tpm
%license COPYING* %license COPYING*
%{_libexecdir}/tpm2daemon* %{_libexecdir}/tpm2daemon*
%endif
%changelog %changelog