From de917923500580afbe9f7bdf5cadc7c14f768c89 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Tue, 10 Aug 2021 20:56:24 +0200 Subject: [PATCH] Unbreak build on 32 architectures --- opensc-32b-arch.patch | 33 +++++++++++++++++++++++++++++++++ opensc.spec | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 opensc-32b-arch.patch diff --git a/opensc-32b-arch.patch b/opensc-32b-arch.patch new file mode 100644 index 0000000..70213b1 --- /dev/null +++ b/opensc-32b-arch.patch @@ -0,0 +1,33 @@ +commit 6bc05d7037041e543d627248ca9df90723426ce1 +Author: Jakub Jelen +Date: Tue Aug 10 16:30:40 2021 +0200 + + p11test: Fix invalid format string on 32b architectures + +diff --git a/src/tests/p11test/p11test.c b/src/tests/p11test/p11test.c +index dbac167d..49de6a93 100644 +--- a/src/tests/p11test/p11test.c ++++ b/src/tests/p11test/p11test.c +@@ -139,7 +139,7 @@ int main(int argc, char** argv) { + return -1; + } + +- debug_print("Card info:\n\tPIN %s\n\tPIN LENGTH %lu\n\t", ++ debug_print("Card info:\n\tPIN %s\n\tPIN LENGTH %zu\n\t", + token.pin, token.pin_length); + + return cmocka_run_group_tests(readonly_tests_without_initialization, +diff --git a/src/tests/p11test/p11test_case_pss_oaep.c b/src/tests/p11test/p11test_case_pss_oaep.c +index 1d876a5b..5a6ae9d0 100644 +--- a/src/tests/p11test/p11test_case_pss_oaep.c ++++ b/src/tests/p11test/p11test_case_pss_oaep.c +@@ -402,7 +402,7 @@ int oaep_encrypt_decrypt_test(test_cert_t *o, token_info_t *info, test_mech_t *m + if (message_length < 0) { + mech->usage_flags &= ~CKF_DECRYPT; + debug_print(" [SKIP %s ] Too small modulus (%ld bits)" +- " or too large hash %s (%lu B) for OAEP", o->id_str, ++ " or too large hash %s (%zu B) for OAEP", o->id_str, + o->bits, get_mechanism_name(mech->hash), + get_hash_length(mech->hash)); + return 0; + diff --git a/opensc.spec b/opensc.spec index b95c6f1..124f588 100644 --- a/opensc.spec +++ b/opensc.spec @@ -16,6 +16,7 @@ Source2: common.sh Patch1: opensc-0.19.0-pinpad.patch # https://github.com/OpenSC/OpenSC/pull/2241/ Patch5: %{name}-gcc11.patch +Patch6: %{name}-32b-arch.patch BuildRequires: make BuildRequires: pcsc-lite-devel @@ -54,6 +55,7 @@ every software/card that does so, too. %setup -q %patch1 -p1 -b .pinpad %patch5 -p1 -b .gcc11 +%patch6 -p1 -b .32b cp %{SOURCE2} tests/