diff --git a/0001-cms-kill-generate_integer-it-doesn-t-build-on-i686-a.patch b/0001-cms-kill-generate_integer-it-doesn-t-build-on-i686-a.patch new file mode 100644 index 0000000..56cab61 --- /dev/null +++ b/0001-cms-kill-generate_integer-it-doesn-t-build-on-i686-a.patch @@ -0,0 +1,72 @@ +From 33bcca8303cad962606df3bfc6a031a9b0626375 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 21 Apr 2016 10:47:34 -0400 +Subject: [PATCH] cms: kill generate_integer(), it doesn't build on i686 and + it's unused. + +Signed-off-by: Peter Jones +--- + src/cms_common.c | 34 ---------------------------------- + src/cms_common.h | 1 - + 2 files changed, 35 deletions(-) + +diff --git a/src/cms_common.c b/src/cms_common.c +index b19bc62..6a4e6a7 100644 +--- a/src/cms_common.c ++++ b/src/cms_common.c +@@ -641,40 +641,6 @@ generate_string(cms_context *cms, SECItem *der, char *str) + return 0; + } + +-static SEC_ASN1Template IntegerTemplate[] = { +- {.kind = SEC_ASN1_INTEGER, +- .offset = 0, +- .sub = NULL, +- .size = sizeof(long), +- }, +- { 0 }, +-}; +- +-int +-generate_integer(cms_context *cms, SECItem *der, unsigned long integer) +-{ +- void *ret; +- +- uint32_t u32; +- +- SECItem input = { +- .data = (void *)&integer, +- .len = sizeof(integer), +- .type = siUnsignedInteger, +- }; +- +- if (integer < 0x100000000) { +- u32 = integer & 0xffffffffUL; +- input.data = (void *)&u32; +- input.len = sizeof(u32); +- } +- +- ret = SEC_ASN1EncodeItem(cms->arena, der, &input, IntegerTemplate); +- if (ret == NULL) +- cmsreterr(-1, cms, "could not encode data"); +- return 0; +-} +- + int + generate_time(cms_context *cms, SECItem *encoded, time_t when) + { +diff --git a/src/cms_common.h b/src/cms_common.h +index 7d77faf..c7d7268 100644 +--- a/src/cms_common.h ++++ b/src/cms_common.h +@@ -117,7 +117,6 @@ extern int generate_object_id(cms_context *ctx, SECItem *encoded, + SECOidTag tag); + extern int generate_empty_sequence(cms_context *ctx, SECItem *encoded); + extern int generate_time(cms_context *ctx, SECItem *encoded, time_t when); +-extern int generate_integer(cms_context *cms, SECItem *der, unsigned long integer); + extern int generate_string(cms_context *cms, SECItem *der, char *str); + extern int wrap_in_set(cms_context *cms, SECItem *der, SECItem **items); + extern int wrap_in_seq(cms_context *cms, SECItem *der, +-- +2.5.5 + diff --git a/pesign.spec b/pesign.spec index 7fb8faf..0cf41bb 100644 --- a/pesign.spec +++ b/pesign.spec @@ -25,6 +25,8 @@ BuildRequires: rh-signing-tools >= 1.20-2 Source0: https://github.com/vathpela/pesign/releases/download/%{version}/pesign-%{version}.tar.bz2 Source1: certs.tar.xz +Patch0001: 0001-cms-kill-generate_integer-it-doesn-t-build-on-i686-a.patch + %description This package contains the pesign utility for signing UEFI binaries as well as other associated tools.