From 7640155de51cefc4a4832e3afa48ea69ce79267d Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Jun 22 2012 15:41:09 +0000 Subject: Update to upstream's 0.3 . --- diff --git a/.gitignore b/.gitignore index f53c9be..f4ceb4e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /pesign-*.tar.bz2 +clog diff --git a/0001-Fix-decl-of-pe_update-off_t-loff_t.patch b/0001-Fix-decl-of-pe_update-off_t-loff_t.patch deleted file mode 100644 index 96e07ea..0000000 --- a/0001-Fix-decl-of-pe_update-off_t-loff_t.patch +++ /dev/null @@ -1,25 +0,0 @@ -From be102289d381a1c8f2a5eccdc1bba7bdf7593baa Mon Sep 17 00:00:00 2001 -From: Peter Jones -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 - diff --git a/0002-Use-intptr_t-instead-of-specificly-sized-types-where.patch b/0002-Use-intptr_t-instead-of-specificly-sized-types-where.patch deleted file mode 100644 index 248d540..0000000 --- a/0002-Use-intptr_t-instead-of-specificly-sized-types-where.patch +++ /dev/null @@ -1,78 +0,0 @@ -From ec2cd81a6f275d14f8c3d13c94229a8cab0f343c Mon Sep 17 00:00:00 2001 -From: Peter Jones -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 - diff --git a/0003-Fix-paths-for-32-bit-builds.patch b/0003-Fix-paths-for-32-bit-builds.patch deleted file mode 100644 index d43beb3..0000000 --- a/0003-Fix-paths-for-32-bit-builds.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 020edc721159a7aee09bdaef54d22f11f40766d6 Mon Sep 17 00:00:00 2001 -From: Peter Jones -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 - diff --git a/pesign.spec b/pesign.spec index 3458eab..92a7f4e 100644 --- a/pesign.spec +++ b/pesign.spec @@ -1,7 +1,7 @@ Summary: Signing utility for UEFI binaries Name: pesign -Version: 0.2 -Release: 4%{?dist} +Version: 0.3 +Release: 1%{?dist} Group: Development/System License: GPLv2 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 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 This package contains the pesign utility for signing UEFI binaries as well as other associated tools. @@ -31,7 +27,7 @@ git commit -a -q -m "%{version} baseline." git am %{patches} - 0.3-1 +- Update to upstream's 0.3 . + * Thu Jun 21 2012 Peter Jones - 0.2-4 - Do not build with smp flags. @@ -67,4 +67,3 @@ rm -rf %{buildroot} * Fri Jun 15 2012 Peter Jones - 0.1-1 - First version of SRPM. - diff --git a/sources b/sources index ae50bad..533619b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -38c5fd938fb1ffda1e306e035b0435e2 pesign-0.2.tar.bz2 +d5b7a08e45ad0471eab94372b8744696 pesign-0.3.tar.bz2