1c5dd9
Summary: Signing utility for UEFI binaries
1c5dd9
Name: pesign
1c5dd9
Version: 0.109
b8b9f4
Release: 11%{?dist}
1c5dd9
Group: Development/System
1c5dd9
License: GPLv2
1c5dd9
URL: https://github.com/vathpela/pesign
1c5dd9
BuildRequires: git gnu-efi gnu-efi-devel nspr nss nss-util popt-devel
1c5dd9
BuildRequires: coolkey opensc nss-tools
1c5dd9
BuildRequires: nspr-devel >= 4.9.2-1
1c5dd9
BuildRequires: nss-devel >= 3.13.6-1
1c5dd9
Requires: nspr nss nss-util nss-tools popt rpm coolkey opensc
1c5dd9
Requires(pre): shadow-utils
a8c91d
ExclusiveArch: x86_64 aarch64
1c5dd9
1c5dd9
# there is no tarball at github, of course.  To get this version do:
1c5dd9
# git clone https://github.com/vathpela/pesign.git
1c5dd9
# git checkout %%{version}
1c5dd9
Source0: pesign-%{version}.tar.bz2
1c5dd9
Source1: rh-test-certs.tar.bz2
b8b9f4
Source3: pesign.patches
b8b9f4
b8b9f4
%include %{SOURCE3}
1c5dd9
1c5dd9
%description
1c5dd9
This package contains the pesign utility for signing UEFI binaries as
1c5dd9
well as other associated tools.
1c5dd9
1c5dd9
%prep
1c5dd9
%setup -q -a 1
1c5dd9
git init
1c5dd9
git config user.email "pesign-owner@fedoraproject.org"
1c5dd9
git config user.name "Fedora Ninjas"
1c5dd9
git add .
1c5dd9
git commit -a -q -m "%{version} baseline."
1c5dd9
git am %{patches} 
1c5dd9
1c5dd9
%build
691814
make CFLAGS="%{optflags}" PREFIX=%{_prefix} LIBDIR=%{_libdir}
1c5dd9
1c5dd9
%install
1c5dd9
rm -rf %{buildroot}
1c5dd9
mkdir -p %{buildroot}/%{_libdir}
1c5dd9
make PREFIX=%{_prefix} LIBDIR=%{_libdir} INSTALLROOT=%{buildroot} \
1c5dd9
	install
1c5dd9
rm -f %{buildroot}/usr/share/doc/pesign/COPYING
1c5dd9
%if 0%{?rhel} >= 7 || 0%{?fedora} >= 17
1c5dd9
make PREFIX=%{_prefix} LIBDIR=%{_libdir} INSTALLROOT=%{buildroot} \
1c5dd9
	install_systemd
1c5dd9
%endif
1c5dd9
1c5dd9
# there's some stuff that's not really meant to be shipped yet
1c5dd9
rm -rf %{buildroot}/boot %{buildroot}/usr/include
1c5dd9
rm -rf %{buildroot}%{_libdir}/libdpe*
1c5dd9
mv rh-test-certs/etc/pki/pesign/* %{buildroot}/etc/pki/pesign/
1c5dd9
1c5dd9
#modutil -force -dbdir %{buildroot}/etc/pki/pesign -add coolkey \
1c5dd9
#	-libfile %{_libdir}/pkcs11/libcoolkeypk11.so
1c5dd9
#modutil -force -dbdir %{buildroot}/etc/pki/pesign -add opensc \
1c5dd9
#	-libfile %{_libdir}/pkcs11/opensc-pkcs11.so
1c5dd9
1c5dd9
%clean
1c5dd9
rm -rf %{buildroot}
1c5dd9
1c5dd9
%pre
1c5dd9
getent group pesign >/dev/null || groupadd -r pesign
1c5dd9
getent passwd pesign >/dev/null || \
1c5dd9
	useradd -r -g pesign -d /var/run/pesign -s /sbin/nologin \
1c5dd9
		-c "Group for the pesign signing daemon" pesign
1c5dd9
exit 0
1c5dd9
1c5dd9
%if 0%{?rhel} >= 7 || 0%{?fedora} >= 17
1c5dd9
%post
1c5dd9
%systemd_post pesign.service
1c5dd9
1c5dd9
%preun
1c5dd9
%systemd_preun pesign.service
1c5dd9
1c5dd9
%postun
1c5dd9
%systemd_postun_with_restart pesign.service
1c5dd9
%endif
1c5dd9
1c5dd9
%files
1c5dd9
%defattr(-,root,root,-)
1c5dd9
%doc README TODO COPYING
1c5dd9
%{_bindir}/pesign
1c5dd9
%{_bindir}/pesign-client
1c5dd9
%{_bindir}/efikeygen
1c5dd9
%{_sysconfdir}/popt.d/pesign.popt
1c5dd9
%{_sysconfdir}/rpm/macros.pesign
b8b9f4
%{_libexecdir}/pesign/pesign-authorize
664c67
%config(noreplace)/%{_sysconfdir}/pesign/users
664c67
%config(noreplace)/%{_sysconfdir}/pesign/groups
1c5dd9
%{_mandir}/man*/*
1c5dd9
%dir %attr(0775,pesign,pesign) /etc/pki/pesign
1c5dd9
%attr(0664,pesign,pesign) /etc/pki/pesign/*
1c5dd9
%dir %attr(0770, pesign, pesign) %{_localstatedir}/run/%{name}
1c5dd9
%ghost %attr(0660, -, -) %{_localstatedir}/run/%{name}/socket
1c5dd9
%ghost %attr(0660, -, -) %{_localstatedir}/run/%{name}/pesign.pid
1c5dd9
%if 0%{?rhel} >= 7 || 0%{?fedora} >= 17
1c5dd9
%{_prefix}/lib/tmpfiles.d/pesign.conf
1c5dd9
%{_unitdir}/pesign.service
1c5dd9
%endif
1c5dd9
1c5dd9
%changelog
b8b9f4
* Wed Jan 18 2023 Robbie Harwood <rharwood@redhat.com> - 0.109-11
b8b9f4
- Backport newer, deprecated pesign-authorize
b8b9f4
- Resolves: CVE-2022-3560
b8b9f4
664c67
* Mon May 16 2016 Peter Jones <pjones@redhat.com> - - 0.109-10
664c67
- Add support for /etc/pesign/users and /etc/pesign/groups
664c67
  Resolves: rhbz#1141263
664c67
a8c91d
* Tue Sep 02 2014 Peter Jones <pjones@redhat.com> - 0.109-9
a8c91d
- Fix man page errors.
a8c91d
  Resolves: rhbz#948850
a8c91d
a8c91d
* Tue Sep 02 2014 Peter Jones <pjones@redhat.com> - 0.109-9
a8c91d
- Build as PIE+RELRO binaries.
a8c91d
  Resolves: rhbz#1092542
a8c91d
a8c91d
* Wed Aug 27 2014 Peter Jones <pjones@redhat.com> - 0.109-8
a8c91d
- Include aarch64 in the rpm macro
a8c91d
  Related: rhbz#1100042
a8c91d
a8c91d
* Wed Aug 27 2014 Peter Jones <pjones@redhat.com> - 0.109-7
a8c91d
- Add aarch64.
a8c91d
  Resolves: rhbz#1100042
a8c91d
691814
* Thu Mar 20 2014 Peter Jones <pjones@redhat.com> - 0.109-6
691814
- Make sure CFLAGS is inherited properly for -fstack-protector-strong.
691814
  Resolves: rhbz#1070782
691814
691814
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 0.109-5
691814
- Mass rebuild 2013-12-27
691814
1c5dd9
* Tue Oct 29 2013 Peter Jones <pjones@redhat.com> - 0.109-4
1c5dd9
- Tweak the signing rules just a bit more.
1c5dd9
  Related: rhbz1017857
1c5dd9
1c5dd9
* Fri Oct 25 2013 Peter Jones <pjones@redhat.com> - 0.109-3
1c5dd9
- Update to fix a bug coverity found.
1c5dd9
  Related: rhbz1017857
1c5dd9
1c5dd9
* Fri Oct 25 2013 Peter Jones <pjones@redhat.com> - 0.109-2
1c5dd9
- Fix the pesign macro for RHEL packages.
1c5dd9
  Related: rhbz1017857
1c5dd9
1c5dd9
* Wed Oct 09 2013 Peter Jones <pjones@redhat.com> - 0.109-1
1c5dd9
- Update to 0.109
1c5dd9
  Related: rhbz#893260
1c5dd9
1c5dd9
* Tue Oct 08 2013 Peter Jones <pjones@redhat.com> - 0.106-6
1c5dd9
- Don't create a new certificate database when signing on RHEL.
1c5dd9
1c5dd9
* Wed Aug 07 2013 Peter Jones <pjones@redhat.com> - 0.106-5
1c5dd9
- Use --force with sattrs blob from mktemp()
1c5dd9
- Error if we get a zero-sized signed file result
1c5dd9
1c5dd9
* Wed Aug 07 2013 Peter Jones <pjones@redhat.com> - 0.106-4
1c5dd9
- Don't require ascii mode for RHEL CA/signer cert import.
1c5dd9
1c5dd9
* Tue Aug 06 2013 Peter Jones <pjones@redhat.com> - 0.106-3
1c5dd9
- More work on the RHEL %%pesign macro
1c5dd9
1c5dd9
* Tue Aug 06 2013 Peter Jones <pjones@redhat.com> - 0.106-2
1c5dd9
- Add rhel %%pesign macro definitions.
1c5dd9
1c5dd9
* Tue May 21 2013 Peter Jones <pjones@redhat.com> - 0.106-1
1c5dd9
- Update to 0.106
1c5dd9
- Hopefully fix the segfault dgilmore was seeing.
1c5dd9
1c5dd9
* Mon May 20 2013 Peter Jones <pjones@redhat.com> - 0.105-1
1c5dd9
- Various bug fixes.
1c5dd9
1c5dd9
* Wed May 15 2013 Peter Jones <pjones@redhat.com> - 0.104-1
1c5dd9
- Make sure alignment is correct on signature list entries
1c5dd9
  Resolves: rhbz#963361
1c5dd9
- Make sure section alignment is correct if we have to extend the file
1c5dd9
1c5dd9
* Wed Feb 06 2013 Peter Jones <pjones@redhat.com> - 0.103-2
1c5dd9
- Conditionalize systemd bits so they don't show up in RHEL 6 builds
1c5dd9
1c5dd9
* Tue Feb 05 2013 Peter Jones <pjones@redhat.com> - 0.103-1
1c5dd9
- One more compiler problem.  Let's expect a few more, shall we?
1c5dd9
1c5dd9
* Tue Feb 05 2013 Peter Jones <pjones@redhat.com> - 0.102-1
1c5dd9
- Don't use --std=gnu11 because we have to work on RHEL 6 builders.
1c5dd9
1c5dd9
* Mon Feb 04 2013 Peter Jones <pjones@redhat.com> - 0.101-1
1c5dd9
- Update to 0.101 to fix more "pesign -E" issues.
1c5dd9
1c5dd9
* Fri Nov 30 2012 Peter Jones <pjones@redhat.com> - 0.100-1
1c5dd9
- Fix insertion of signatures from a file.
1c5dd9
1c5dd9
* Mon Nov 26 2012 Matthew Garrett <mjg59@srcf.ucam.org> - 0.99-9
1c5dd9
- Add a patch needed for new shim builds
1c5dd9
1c5dd9
* Fri Oct 19 2012 Peter Jones <pjones@redhat.com> - 0.99-8
1c5dd9
- Get the Fedora signing token name right.
1c5dd9
1c5dd9
* Fri Oct 19 2012 Peter Jones <pjones@redhat.com>
1c5dd9
- Add coolkey and opensc modules to pki database during %%install.
1c5dd9
1c5dd9
* Fri Oct 19 2012 Peter Jones <pjones@redhat.com> - 0.99-7
1c5dd9
- setfacl u:kojibuilder:rw /var/run/pesign/socket
1c5dd9
- Fix command line checking in client
1c5dd9
- Add client stdin pin reading.
1c5dd9
1c5dd9
* Thu Oct 18 2012 Peter Jones <pjones@redhat.com> - 0.99-6
1c5dd9
- Automatically select daemon as signer when using rpm macros.
1c5dd9
1c5dd9
* Thu Oct 18 2012 Peter Jones <pjones@redhat.com> - 0.99-5
1c5dd9
- Make it work on the -el6 branch as well.
1c5dd9
1c5dd9
* Wed Oct 17 2012 Peter Jones <pjones@redhat.com> - 0.99-4
1c5dd9
- Fix some more bugs found by valgrind and coverity.
1c5dd9
- Don't build utils/ ; we're not using them and they're not ready anyway. 
1c5dd9
1c5dd9
* Wed Oct 17 2012 Peter Jones <pjones@redhat.com> - 0.99-3
1c5dd9
- Fix daemon startup bug from 0.99-2
1c5dd9
1c5dd9
* Wed Oct 17 2012 Peter Jones <pjones@redhat.com> - 0.99-2
1c5dd9
- Fix various bugs from 0.99-1
1c5dd9
- Don't make the database unreadable just yet.
1c5dd9
1c5dd9
* Mon Oct 15 2012 Peter Jones <pjones@redhat.com> - 0.99-1
1c5dd9
- Update to 0.99
1c5dd9
- Add documentation for client/server mode.
1c5dd9
- Add --pinfd and --pinfile to server mode.
1c5dd9
1c5dd9
* Fri Oct 12 2012 Peter Jones <pjones@redhat.com> - 0.98-1
1c5dd9
- Update to 0.98
1c5dd9
- Add client/server mode.
1c5dd9
1c5dd9
* Mon Oct 01 2012 Peter Jones <pjones@redhat.com> - 0.10-5
1c5dd9
- Fix missing section address fixup.
1c5dd9
1c5dd9
* Wed Aug 15 2012 Peter Jones <pjones@redhat.com> - 0.10-4
1c5dd9
- Make macros.pesign even better (and make it work right for i686 packages)
1c5dd9
1c5dd9
* Tue Aug 14 2012 Peter Jones <pjones@redhat.com> - 0.10-3
1c5dd9
- Only sign things on x86_64; all else ignore gracefully.
1c5dd9
1c5dd9
* Tue Aug 14 2012 Peter Jones <pjones@redhat.com> - 0.10-2
1c5dd9
- Make macros.pesign more reliable
1c5dd9
1c5dd9
* Mon Aug 13 2012 Peter Jones <pjones@redhat.com> - 0.10-1
1c5dd9
- Update to 0.10
1c5dd9
- Include rpm macros to support easy custom signing of signed packages.
1c5dd9
1c5dd9
* Fri Aug 10 2012 Peter Jones <pjones@redhat.com> - 0.9-1
1c5dd9
- Update to 0.9
1c5dd9
- Bug fix from Gary Ching-Pang Lin
1c5dd9
- Support NSS Token selection for use with smart cards.
1c5dd9
1c5dd9
* Wed Aug 08 2012 Peter Jones <pjones@redhat.com> - 0.8-1
1c5dd9
- Update to 0.8
1c5dd9
- Don't open the db read-write
1c5dd9
- Fix permissions on keystore (everybody can sign with test keys)
1c5dd9
1c5dd9
* Wed Aug 08 2012 Peter Jones <pjones@redhat.com> - 0.7-2
1c5dd9
- Include test keys.
1c5dd9
1c5dd9
* Mon Jul 30 2012 Peter Jones <pjones@redhat.com> - 0.7-1
1c5dd9
- Update to 0.7
1c5dd9
- Better fix for MS compatibility.
1c5dd9
1c5dd9
* Mon Jul 30 2012 Peter Jones <pjones@redhat.com> - 0.6-1
1c5dd9
- Update to 0.6
1c5dd9
- Bug-for-bug compatibility with signtool.exe .
1c5dd9
1c5dd9
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-2
1c5dd9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
1c5dd9
1c5dd9
* Wed Jul 11 2012 Peter Jones <pjones@redhat.com> - 0.5-1
1c5dd9
- Rebase to 0.5
1c5dd9
- Do more rigorous bounds checking when hashing a new binary.
1c5dd9
1c5dd9
* Tue Jul 10 2012 Peter Jones <pjones@redhat.com> - 0.3-2
1c5dd9
- Rebase to 0.4
1c5dd9
1c5dd9
* Fri Jun 22 2012 Peter Jones <pjones@redhat.com> - 0.3-2
1c5dd9
- Move man page to a more reasonable place.
1c5dd9
1c5dd9
* Fri Jun 22 2012 Peter Jones <pjones@redhat.com> - 0.3-1
1c5dd9
- Update to upstream's 0.3 .
1c5dd9
1c5dd9
* Thu Jun 21 2012 Peter Jones <pjones@redhat.com> - 0.2-4
1c5dd9
- Do not build with smp flags.
1c5dd9
1c5dd9
* Thu Jun 21 2012 Peter Jones <pjones@redhat.com> - 0.2-3
1c5dd9
- Make it build on i686, though it's unclear it'll ever be necessary.
1c5dd9
1c5dd9
* Thu Jun 21 2012 Peter Jones <pjones@redhat.com> - 0.2-2
1c5dd9
- Fix compile problem with f18's compiler.
1c5dd9
1c5dd9
* Thu Jun 21 2012 Peter Jones <pjones@redhat.com> - 0.2-1
1c5dd9
- Fix some rpmlint complaints nirik pointed out
1c5dd9
- Add popt-devel build dep
1c5dd9
1c5dd9
* Fri Jun 15 2012 Peter Jones <pjones@redhat.com> - 0.1-1
1c5dd9
- First version of SRPM.