Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnupg24: add freepg patches #368275

Merged
merged 1 commit into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

200 changes: 0 additions & 200 deletions pkgs/tools/security/gnupg/24-revert-rfc4880bis-defaults.patch

This file was deleted.

34 changes: 25 additions & 9 deletions pkgs/tools/security/gnupg/24.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
stdenv,
fetchurl,
fetchFromGitLab,
buildPackages,
pkg-config,
texinfo,
Expand Down Expand Up @@ -68,15 +69,30 @@ stdenv.mkDerivation rec {
]
++ lib.optionals withTpm2Tss [ tpm2-tss ];

patches = [
./fix-libusb-include-path.patch
./tests-add-test-cases-for-import-without-uid.patch
./accept-subkeys-with-a-good-revocation-but-no-self-sig.patch
./24-allow-import-of-previously-known-keys-even-without-UI.patch
./24-revert-rfc4880bis-defaults.patch
# Patch for DoS vuln from https://seclists.org/oss-sec/2022/q3/27
./v3-0001-Disallow-compressed-signatures-and-certificates.patch
];
freepgPatches = fetchFromGitLab {
domain = "gitlab.com";
owner = "freepg";
repo = "gnupg";
rev = "541772915dc4ec832c37f85bc629a22051f0e8f7";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upstream have tags corresponding to GnuPG releases; it would be nice if we could convince them to also tag the branch with the patch files in them in future. Or we could just source directly from their patched tags.

hash = "sha256-QOUY6EfJbTTN242BtzLojDgECGjUwbLfPJgzn/mj5L8=";
};

patches =
[
./fix-libusb-include-path.patch
./CVE-2022-3219.patch
]
++ lib.map (v: "${freepgPatches}/STABLE-BRANCH-2-4-freepg/" + v) [
"0002-gpg-accept-subkeys-with-a-good-revocation-but-no-sel.patch"
"0003-gpg-allow-import-of-previously-known-keys-even-witho.patch"
"0004-tests-add-test-cases-for-import-without-uid.patch"
"0005-gpg-drop-import-clean-from-default-keyserver-import-.patch"
"0006-Do-not-use-OCB-mode-even-if-AEAD-OCB-key-preference-.patch"
"0007-Revert-the-introduction-of-the-RFC4880bis-draft-into.patch"
"0008-avoid-systemd-deprecation-warning.patch"
"0009-Add-systemd-support-for-keyboxd.patch"
"0010-doc-Remove-profile-and-systemd-example-files.patch"
Comment on lines +86 to +94
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t know if globs work here, but if not perhaps we could do it manually in postPatch instead, to ensure that we never miss a new patch.

];

postPatch =
''
Expand Down
Loading