d6e5c96
Summary: Signing utility for UEFI binaries
d6e5c96
Name: pesign
910a59e
Version: 0.99
11a11c6
Release: 8%{?dist}
d6e5c96
Group: Development/System
d6e5c96
License: GPLv2
d6e5c96
URL: https://github.com/vathpela/pesign
b252c93
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
b252c93
BuildRequires: git gnu-efi nspr nspr-devel nss nss-devel nss-util popt-devel
b5d702b
BuildRequires: coolkey opensc nss-tools
b5d702b
Requires: nspr nss nss-util popt rpm coolkey opensc
e7f0d02
Requires(pre): shadow-utils
0f6fcf3
ExclusiveArch: i686 x86_64 ia64
b252c93
d6e5c96
# there is no tarball at github, of course.  To get this version do:
d6e5c96
# git clone https://github.com/vathpela/pesign.git
d6e5c96
# git checkout %%{version}
ca4b435
Source0: pesign-%{version}.tar.bz2
ca4b435
Source1: rh-test-certs.tar.bz2
d6e5c96
c0e5984
Patch1: 0001-Use-PK11_TraverseCertsForNicknameInSlot-after-all.patch
c0e5984
Patch2: 0002-Remove-an-unused-field.patch
c0e5984
Patch3: 0003-Free-the-certificate-list-we-make-once-we-re-done-us.patch
c0e5984
Patch4: 0004-Make-sure-we-actually-look-up-the-certificate-when-n.patch
c0e5984
Patch5: 0005-Fix-check-for-allocations-on-tokenname-certname.patch
c0e5984
Patch6: 0006-Update-valgrind.supp-for-newer-codepaths.patch
c0e5984
Patch7: 0007-Free-the-pid-string-once-we-re-done-writing-it.patch
c0e5984
Patch8: 0008-valgrind-Don-t-complain-about-unlocking-a-key-and-ke.patch
c0e5984
Patch9: 0009-Only-try-to-register-OIDs-once.patch
c0e5984
Patch10: 0010-Check-for-NSS_Shutdown-failure.patch
c0e5984
Patch11: 0011-Don-t-destroy-stdin-stdout-stderr-if-we-don-t-fork.patch
c0e5984
Patch12: 0012-valgrind-Add-SECMOD_LoadModule-codepath.patch
c0e5984
Patch13: 0013-Don-t-set-up-digests-in-cms_context_init.patch
c0e5984
Patch14: 0014-Do-register_oids-where-we-re-doing-NSS_Init.patch
c0e5984
Patch15: 0015-Make-daemon-shutdown-actually-close-the-NSS-database.patch
c0e5984
Patch16: 0016-Reformat-a-bunch-of-error-messages-to-be-vaguely-con.patch
c0e5984
Patch17: 0017-Use-PORT_ArenaStrdup-where-appropriate.patch
c0e5984
Patch18: 0018-Minor-whitespace-fixes.patch
c0e5984
Patch19: 0019-daemon-Make-sure-inpe-is-initialized-before-all-erro.patch
c0e5984
Patch20: 0020-Allocate-pesign_context-rather-than-having-it-on-the.patch
c0e5984
Patch21: 0021-pesign-initialize-nss-only-if-we-re-not-a-daemon.patch
c0e5984
Patch22: 0022-Handle-errors-on-pesign_context_init.patch
c0e5984
Patch23: 0023-Add-sanity-checking-to-make-sure-we-don-t-emit-unini.patch
c0e5984
Patch24: 0024-Make-sure-we-free-the-token-cert-we-get-from-the-com.patch
c0e5984
Patch25: 0025-pesign-Only-shut-down-nss-in-pesign.c-if-we-re-not-t.patch
c0e5984
Patch26: 0026-Rework-setup_digests-and-teardown_digests.patch
c0e5984
Patch27: 0027-We-shouldn-t-need-Environment-NSS_STRICT_NOFORK-DISA.patch
c0e5984
Patch28: 0028-Fix-errors-found-by-coverity.patch
c0e5984
Patch29: 0029-Don-t-keep-the-DEPS-list-twice.patch
18bcd8b
Patch30: 0030-Don-t-build-util-right-now.patch
c0e5984
Patch31: 0031-Make-install_systemd-and-install_sysvinit-separate-t.patch
c0e5984
Patch32: 0032-Get-rid-of-an-unnecessary-allocation.patch
9e2491c
Patch33: 0033-Allow-use-of-e-from-rpm-macro.patch
9e2491c
Patch34: 0034-Make-client-use-e-like-pesign-does-rather-than-detac.patch
9e2491c
Patch35: 0035-Fix-shutdown-by-systemd-to-remove-socket-and-pidfile.patch
9e2491c
Patch36: 0036-Make-the-macros-use-the-default-fedora-signer-if-the.patch
b58922c
Patch37: 0037-Fix-command-line-checking-for-s.patch
b58922c
Patch38: 0038-Add-support-to-read-the-pin-from-stdin-in-client.patch
b58922c
Patch39: 0039-Fix-token-auth-authentication-failure-error-reportin.patch
b58922c
Patch40: 0040-Use-setfacl-in-sysvinit-script-to-allow-kojibuilder-.patch
b58922c
Patch41: 0041-Don-t-return-quite-so-immediately-if-we-re-the-paren.patch
11a11c6
Patch42: 0042-Get-the-Fedora-signing-token-name-right.patch
70aaeb7
d6e5c96
%description
d6e5c96
This package contains the pesign utility for signing UEFI binaries as
d6e5c96
well as other associated tools.
d6e5c96
d6e5c96
%prep
ca4b435
%setup -q -a 1
d6e5c96
git init
d6e5c96
git config user.email "pesign-owner@fedoraproject.org"
d6e5c96
git config user.name "Fedora Ninjas"
d6e5c96
git add .
d6e5c96
git commit -a -q -m "%{version} baseline."
d6e5c96
git am %{patches} 
d6e5c96
d6e5c96
%build
7640155
make PREFIX=%{_prefix} LIBDIR=%{_libdir}
d6e5c96
d6e5c96
%install
d6e5c96
rm -rf %{buildroot}
d6e5c96
mkdir -p %{buildroot}/%{_libdir}
48279a4
make PREFIX=%{_prefix} LIBDIR=%{_libdir} INSTALLROOT=%{buildroot} \
48279a4
	install install_systemd
d6e5c96
d6e5c96
# there's some stuff that's not really meant to be shipped yet
27eb839
rm -rf %{buildroot}/boot %{buildroot}/usr/include
27eb839
rm -rf %{buildroot}%{_libdir}/libdpe*
ca4b435
mv rh-test-certs/etc/pki/pesign/* %{buildroot}/etc/pki/pesign/
d6e5c96
b5d702b
modutil -dbdir /etc/pki/pesign -add coolkey \
b5d702b
	-libfile %{_libdir}pkcs11/libcoolkeypk11.so
b5d702b
modutil -dbdir /etc/pki/pesign -add opensc \
b5d702b
	-libfile %{_libdir}/pkcs11/opensc-pkcs11.so
b5d702b
d6e5c96
%clean
d6e5c96
rm -rf %{buildroot}
d6e5c96
e7f0d02
%pre
e7f0d02
getent group pesign >/dev/null || groupadd -r pesign
e7f0d02
getent passwd pesign >/dev/null || \
e7f0d02
	useradd -r -g pesign -d /var/run/pesign -s /sbin/nologin \
e7f0d02
		-c "Group for the pesign signing daemon" pesign
e7f0d02
exit 0
e7f0d02
e7f0d02
%post
e7f0d02
%systemd_post pesign.service
e7f0d02
e7f0d02
%preun
e7f0d02
%systemd_preun pesign.service
e7f0d02
e7f0d02
%postun
e7f0d02
%systemd_postun_with_restart pesign.service
e7f0d02
d6e5c96
%files
d6e5c96
%defattr(-,root,root,-)
d6e5c96
%doc README TODO COPYING
d6e5c96
%{_bindir}/pesign
e7f0d02
%{_bindir}/pesign-client
d6e5c96
%{_sysconfdir}/popt.d/pesign.popt
aaf8993
%{_sysconfdir}/rpm/macros.pesign
b252c93
%{_mandir}/man*/*
e7f0d02
%{_unitdir}/pesign.service
e7f0d02
%{_prefix}/lib/tmpfiles.d/pesign.conf
70aaeb7
%dir %attr(0775,pesign,pesign) /etc/pki/pesign
70aaeb7
%attr(0664,pesign,pesign) /etc/pki/pesign/*
e7f0d02
%dir %attr(0770, pesign, pesign) %{_localstatedir}/run/%{name}
e7f0d02
%ghost %attr(0660, -, -) %{_localstatedir}/run/%{name}/socket
e7f0d02
%ghost %attr(0660, -, -) %{_localstatedir}/run/%{name}/pesign.pid
d6e5c96
d6e5c96
%changelog
11a11c6
* Fri Oct 19 2012 Peter Jones <pjones@redhat.com> - 0.99-8
11a11c6
- Get the Fedora signing token name right.
11a11c6
b5d702b
* Fri Oct 19 2012 Peter Jones <pjones@redhat.com>
b5d702b
- Add coolkey and opensc modules to pki database during %%install.
b5d702b
b58922c
* Fri Oct 19 2012 Peter Jones <pjones@redhat.com> - 0.99-7
b58922c
- setfacl u:kojibuilder:rw /var/run/pesign/socket
b58922c
- Fix command line checking in client
b58922c
- Add client stdin pin reading.
b58922c
9e2491c
* Thu Oct 18 2012 Peter Jones <pjones@redhat.com> - 0.99-6
9e2491c
- Automatically select daemon as signer when using rpm macros.
9e2491c
c0e5984
* Thu Oct 18 2012 Peter Jones <pjones@redhat.com> - 0.99-5
c0e5984
- Make it work on the -el6 branch as well.
c0e5984
18bcd8b
* Wed Oct 17 2012 Peter Jones <pjones@redhat.com> - 0.99-4
18bcd8b
- Fix some more bugs found by valgrind and coverity.
18bcd8b
- Don't build utils/ ; we're not using them and they're not ready anyway. 
18bcd8b
0d40135
* Wed Oct 17 2012 Peter Jones <pjones@redhat.com> - 0.99-3
0d40135
- Fix daemon startup bug from 0.99-2
0d40135
70aaeb7
* Wed Oct 17 2012 Peter Jones <pjones@redhat.com> - 0.99-2
70aaeb7
- Fix various bugs from 0.99-1
70aaeb7
- Don't make the database unreadable just yet.
70aaeb7
910a59e
* Mon Oct 15 2012 Peter Jones <pjones@redhat.com> - 0.99-1
910a59e
- Update to 0.99
910a59e
- Add documentation for client/server mode.
910a59e
- Add --pinfd and --pinfile to server mode.
910a59e
e7f0d02
* Fri Oct 12 2012 Peter Jones <pjones@redhat.com> - 0.98-1
e7f0d02
- Update to 0.98
e7f0d02
- Add client/server mode.
e7f0d02
60f1503
* Mon Oct 01 2012 Peter Jones <pjones@redhat.com> - 0.10-5
60f1503
- Fix missing section address fixup.
60f1503
56b5348
* Wed Aug 15 2012 Peter Jones <pjones@redhat.com> - 0.10-4
56b5348
- Make macros.pesign even better (and make it work right for i686 packages)
56b5348
cc70e86
* Tue Aug 14 2012 Peter Jones <pjones@redhat.com> - 0.10-3
cc70e86
- Only sign things on x86_64; all else ignore gracefully.
cc70e86
a28df7d
* Tue Aug 14 2012 Peter Jones <pjones@redhat.com> - 0.10-2
a28df7d
- Make macros.pesign more reliable
a28df7d
aaf8993
* Mon Aug 13 2012 Peter Jones <pjones@redhat.com> - 0.10-1
aaf8993
- Update to 0.10
aaf8993
- Include rpm macros to support easy custom signing of signed packages.
aaf8993
c813a03
* Fri Aug 10 2012 Peter Jones <pjones@redhat.com> - 0.9-1
c813a03
- Update to 0.9
c813a03
- Bug fix from Gary Ching-Pang Lin
c813a03
- Support NSS Token selection for use with smart cards.
c813a03
97454ce
* Wed Aug 08 2012 Peter Jones <pjones@redhat.com> - 0.8-1
97454ce
- Update to 0.8
97454ce
- Don't open the db read-write
97454ce
- Fix permissions on keystore (everybody can sign with test keys)
97454ce
ca4b435
* Wed Aug 08 2012 Peter Jones <pjones@redhat.com> - 0.7-2
ca4b435
- Include test keys.
ca4b435
23bf592
* Mon Jul 30 2012 Peter Jones <pjones@redhat.com> - 0.7-1
23bf592
- Update to 0.7
23bf592
- Better fix for MS compatibility.
23bf592
6ee859b
* Mon Jul 30 2012 Peter Jones <pjones@redhat.com> - 0.6-1
6ee859b
- Update to 0.6
6ee859b
- Bug-for-bug compatibility with signtool.exe .
6ee859b
636910c
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-2
636910c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
636910c
74121f1
* Wed Jul 11 2012 Peter Jones <pjones@redhat.com> - 0.5-1
74121f1
- Rebase to 0.5
74121f1
- Do more rigorous bounds checking when hashing a new binary.
74121f1
a056b55
* Tue Jul 10 2012 Peter Jones <pjones@redhat.com> - 0.3-2
a056b55
- Rebase to 0.4
a056b55
b252c93
* Fri Jun 22 2012 Peter Jones <pjones@redhat.com> - 0.3-2
b252c93
- Move man page to a more reasonable place.
b252c93
7640155
* Fri Jun 22 2012 Peter Jones <pjones@redhat.com> - 0.3-1
7640155
- Update to upstream's 0.3 .
7640155
92dbf7e
* Thu Jun 21 2012 Peter Jones <pjones@redhat.com> - 0.2-4
92dbf7e
- Do not build with smp flags.
92dbf7e
ed349fc
* Thu Jun 21 2012 Peter Jones <pjones@redhat.com> - 0.2-3
ed349fc
- Make it build on i686, though it's unclear it'll ever be necessary.
ed349fc
dccc1c9
* Thu Jun 21 2012 Peter Jones <pjones@redhat.com> - 0.2-2
dccc1c9
- Fix compile problem with f18's compiler.
dccc1c9
d6e5c96
* Thu Jun 21 2012 Peter Jones <pjones@redhat.com> - 0.2-1
d6e5c96
- Fix some rpmlint complaints nirik pointed out
d6e5c96
- Add popt-devel build dep
d6e5c96
d6e5c96
* Fri Jun 15 2012 Peter Jones <pjones@redhat.com> - 0.1-1
d6e5c96
- First version of SRPM.