Update to upstream's 0.3 .

This commit is contained in:
Peter Jones 2012-06-22 11:39:18 -04:00
parent 92dbf7ed33
commit 7640155de5
6 changed files with 9 additions and 191 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/pesign-*.tar.bz2 /pesign-*.tar.bz2
clog

View File

@ -1,25 +0,0 @@
From be102289d381a1c8f2a5eccdc1bba7bdf7593baa Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 21 Jun 2012 09:45:06 -0400
Subject: [PATCH] Fix decl of pe_update off_t -> loff_t
---
libdpe/pe_update.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libdpe/pe_update.c b/libdpe/pe_update.c
index ca65bca..15678f6 100644
--- a/libdpe/pe_update.c
+++ b/libdpe/pe_update.c
@@ -75,7 +75,7 @@ write_file(Pe *pe, off_t size, size_t shnum)
return size;
}
-off_t
+loff_t
pe_update(Pe *pe, Pe_Cmd cmd)
{
if (cmd != PE_C_NULL && cmd != PE_C_WRITE && cmd != PE_C_WRITE_MMAP) {
--
1.7.10.2

View File

@ -1,78 +0,0 @@
From ec2cd81a6f275d14f8c3d13c94229a8cab0f343c Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 21 Jun 2012 09:58:29 -0400
Subject: [PATCH] Use uintptr_t instead of specificly sized types where
appropriate.
---
src/actions.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/actions.c b/src/actions.c
index 31fc66f..e60a13e 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -471,7 +471,7 @@ generate_digest(pesign_context *ctx, Pe *pe)
struct pe32_opt_hdr *pe32opthdr = NULL;
struct pe32plus_opt_hdr *pe64opthdr = NULL;
PK11Context *pk11ctx;
- uint64_t hashed_bytes = 0;
+ unsigned long hashed_bytes = 0;
int rc = -1;
if (!pe) {
@@ -512,13 +512,13 @@ generate_digest(pesign_context *ctx, Pe *pe)
case PE_K_PE_EXE: {
void *opthdr = pe_getopthdr(pe);
pe32opthdr = opthdr;
- hash_size = (uint64_t)&pe32opthdr->csum - (uint64_t)hash_base;
+ hash_size = (uintptr_t)&pe32opthdr->csum - (uintptr_t)hash_base;
break;
}
case PE_K_PE64_EXE: {
void *opthdr = pe_getopthdr(pe);
pe64opthdr = opthdr;
- hash_size = (uint64_t)&pe64opthdr->csum - (uint64_t)hash_base;
+ hash_size = (uintptr_t)&pe64opthdr->csum - (uintptr_t)hash_base;
break;
}
default:
@@ -538,7 +538,7 @@ generate_digest(pesign_context *ctx, Pe *pe)
if (rc < 0 || !dd)
goto error;
- hash_size = (uint64_t)&dd->certs - (uint64_t)hash_base;
+ hash_size = (uintptr_t)&dd->certs - (uintptr_t)hash_base;
PK11_DigestOp(pk11ctx, hash_base, hash_size);
/* 8. Skip over the crt dir
@@ -546,7 +546,7 @@ generate_digest(pesign_context *ctx, Pe *pe)
hash_base = &dd->base_relocations;
hash_size = (pe32opthdr ? pe32opthdr->header_size
: pe64opthdr->header_size) -
- ((uint64_t)&dd->base_relocations - (uint64_t)map);
+ ((uintptr_t)&dd->base_relocations - (uintptr_t)map);
PK11_DigestOp(pk11ctx, hash_base, hash_size);
/* 10. Set SUM_OF_BYTES_HASHED to the size of the header. */
@@ -566,7 +566,7 @@ generate_digest(pesign_context *ctx, Pe *pe)
sort_shdrs(shdrs, pehdr.sections - 1);
for (int i = 0; i < pehdr.sections; i++) {
- hash_base = (void *)((uint64_t)map + shdrs[i].data_addr);
+ hash_base = (void *)((uintptr_t)map + shdrs[i].data_addr);
hash_size = shdrs[i].raw_data_size;
PK11_DigestOp(pk11ctx, hash_base, hash_size);
@@ -574,7 +574,7 @@ generate_digest(pesign_context *ctx, Pe *pe)
}
if (map_size > hashed_bytes) {
- hash_base = (void *)((uint64_t)map + hashed_bytes);
+ hash_base = (void *)((uintptr_t)map + hashed_bytes);
hash_size = map_size - dd->certs.size - hashed_bytes;
PK11_DigestOp(pk11ctx, hash_base, hash_size);
}
--
1.7.10.2

View File

@ -1,79 +0,0 @@
From 020edc721159a7aee09bdaef54d22f11f40766d6 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 21 Jun 2012 10:16:25 -0400
Subject: [PATCH 3/3] Fix paths for 32-bit builds.
---
Make.defaults | 19 +++++++++----------
util/Makefile | 6 +++---
2 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/Make.defaults b/Make.defaults
index feda335..50b28b7 100644
--- a/Make.defaults
+++ b/Make.defaults
@@ -11,15 +11,14 @@ LDFLAGS = -nostdlib
CCLDFLAGS = -shared
INSTALL = install
# XXX this is broken
-LIBDIR = $(PREFIX)/lib64
-prefix = /usr/bin/
+bindir = /usr/bin/
-CC = $(prefix)gcc
-AS = $(prefix)as
-LD = $(prefix)ld.bfd
-AR = $(prefix)ar
-RANLIB = $(prefix)ranlib
-OBJCOPY = $(prefix)objcopy
+CC = $(bindir)gcc
+AS = $(bindir)as
+LD = $(bindir)ld.bfd
+AR = $(bindir)ar
+RANLIB = $(bindir)ranlib
+OBJCOPY = $(bindir)objcopy
ifeq ($(ARCH),ia64)
CFLAGS += -mfixed-range=f32-f127
@@ -27,17 +26,17 @@ ifeq ($(ARCH),ia64)
endif
ifeq ($(ARCH), ia32)
+ LIBDIR := $(PREFIX)/lib
ifeq ($(HOSTARCH), x86_64)
ARCH3264 := -m32
- LIBDIR := $(PREFIX)/lib
endif
endif
ifeq ($(ARCH), x86_64)
CFLAGS += -mno-red-zone
+ LIBDIR := $(PREFIX)/lib64
ifeq ($(HOSTARCH), ia32)
ARCH3264 := -m64
- LIBDIR := $(PREFIX)/lib64
endif
endif
diff --git a/util/Makefile b/util/Makefile
index 1dd4ca0..1cf782c 100644
--- a/util/Makefile
+++ b/util/Makefile
@@ -3,11 +3,11 @@ TOPDIR = $(SRCDIR)/..
include $(TOPDIR)/Make.defaults
-FORMAT=efi-app-x86_64
-LDFLAGS = -nostdlib -T /usr/lib64/gnuefi/elf_x86_64_efi.lds -shared -Bsymbolic /usr/lib64/gnuefi/crt0-efi-x86_64.o -L/usr/lib64/
+FORMAT=efi-app-$(HOSTARCH)
+LDFLAGS = -nostdlib -T $(LIBDIR)/gnuefi/elf_$(HOSTARCH)_efi.lds -shared -Bsymbolic $(LIBDIR)/gnuefi/crt0-efi-$(HOSTARCH).o -L$(LIBDIR)
LIBS=-lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name)
CCLDFLAGS =
-CFLAGS = -I/usr/include/efi/ -I/usr/include/efi/x86_64/ -I/usr/include/efi/protocol -fpic -fshort-wchar -fno-reorder-functions -fno-strict-aliasing -fno-merge-constants -mno-red-zone -Wimplicit-function-declaration
+CFLAGS = -I/usr/include/efi/ -I/usr/include/efi/$(HOSTARCH)/ -I/usr/include/efi/protocol -fpic -fshort-wchar -fno-reorder-functions -fno-strict-aliasing -fno-merge-constants -mno-red-zone -Wimplicit-function-declaration
TARGETS = setupsb.efi dumpsb.efi clearpk.efi
--
1.7.10.2

View File

@ -1,7 +1,7 @@
Summary: Signing utility for UEFI binaries Summary: Signing utility for UEFI binaries
Name: pesign Name: pesign
Version: 0.2 Version: 0.3
Release: 4%{?dist} Release: 1%{?dist}
Group: Development/System Group: Development/System
License: GPLv2 License: GPLv2
URL: https://github.com/vathpela/pesign URL: https://github.com/vathpela/pesign
@ -13,10 +13,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: git gnu-efi nspr nspr-devel nss nss-devel nss-util popt-devel BuildRequires: git gnu-efi nspr nspr-devel nss nss-devel nss-util popt-devel
Requires: nspr nss nss-util popt Requires: nspr nss nss-util popt
Patch0: 0001-Fix-decl-of-pe_update-off_t-loff_t.patch
Patch1: 0002-Use-intptr_t-instead-of-specificly-sized-types-where.patch
Patch2: 0003-Fix-paths-for-32-bit-builds.patch
%description %description
This package contains the pesign utility for signing UEFI binaries as This package contains the pesign utility for signing UEFI binaries as
well as other associated tools. well as other associated tools.
@ -31,7 +27,7 @@ git commit -a -q -m "%{version} baseline."
git am %{patches} </dev/null git am %{patches} </dev/null
%build %build
make PREFIX=/usr make PREFIX=%{_prefix} LIBDIR=%{_libdir}
%install %install
rm -rf %{buildroot} rm -rf %{buildroot}
@ -49,9 +45,13 @@ rm -rf %{buildroot}
%doc README TODO COPYING %doc README TODO COPYING
%{_bindir}/pesign %{_bindir}/pesign
%{_sysconfdir}/popt.d/pesign.popt %{_sysconfdir}/popt.d/pesign.popt
%{_mandir}/man8/*.8*
%attr(0700,root,root) /etc/pki/pesign %attr(0700,root,root) /etc/pki/pesign
%changelog %changelog
* Fri Jun 22 2012 Peter Jones <pjones@redhat.com> - 0.3-1
- Update to upstream's 0.3 .
* Thu Jun 21 2012 Peter Jones <pjones@redhat.com> - 0.2-4 * Thu Jun 21 2012 Peter Jones <pjones@redhat.com> - 0.2-4
- Do not build with smp flags. - Do not build with smp flags.
@ -67,4 +67,3 @@ rm -rf %{buildroot}
* Fri Jun 15 2012 Peter Jones <pjones@redhat.com> - 0.1-1 * Fri Jun 15 2012 Peter Jones <pjones@redhat.com> - 0.1-1
- First version of SRPM. - First version of SRPM.

View File

@ -1 +1 @@
38c5fd938fb1ffda1e306e035b0435e2 pesign-0.2.tar.bz2 d5b7a08e45ad0471eab94372b8744696 pesign-0.3.tar.bz2