The package rpms/libp11.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s): https://src.fedoraproject.org/cgit/rpms/libp11.git/commit/?id=519cbba871d749... https://src.fedoraproject.org/cgit/rpms/libp11.git/commit/?id=d38047a2677f0d....
Change: +%ifnarch ppc ppc64 ppc64le -%ifnarch ppc ppc64 ppc64le
Thanks.
Full change: ============
commit 246461a1b09a2523c440a962b770d5db79fbff39 Author: Anderson Toshiyuki Sasaki ansasaki@redhat.com Date: Fri Feb 23 16:04:15 2018 +0100
libp11-0.4.7-3
- Add a patch to avoid an error in forking processes (commit cf5e7a3) - Removed doxygen and graphviz dependencies (commit 47ba7fe) - Make build honor applicable compiler flags (commit 2b7b845) - Spec file cleanup and alignment with Fedora Packaging Guidelines
diff --git a/libp11.spec b/libp11.spec index 6a0462a..33566f6 100644 --- a/libp11.spec +++ b/libp11.spec @@ -1,5 +1,5 @@ Version: 0.4.7 -Release: 2%{?dist} +Release: 3%{?dist}
# Define the directory where the OpenSSL engines are installed %global enginesdir %{_libdir}/engines-1.1 @@ -89,6 +89,12 @@ make check %{?_smp_mflags} %{enginesdir}/*.so
%changelog +* Mon Feb 26 2018 Anderson Sasaki ansasaki@redhat.com - 0.4.7-3 +- Add a patch to avoid an error in forking processes (commit cf5e7a3) +- Removed doxygen and graphviz dependencies (commit 47ba7fe) +- Make build honor applicable compiler flags (commit 2b7b845) +- Spec file cleanup and alignment with Fedora Packaging Guidelines + * Wed Feb 07 2018 Fedora Release Engineering releng@fedoraproject.org - 0.4.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
commit 23e0bff3f96902949ddc2da33dfaba8f41f1680b Author: Anderson Toshiyuki Sasaki ansasaki@redhat.com Date: Mon Feb 26 15:56:10 2018 +0100
Remove automatically installed documentation
In epel7, the automatically installed documentation causes an error because it is not listed in %files section.
diff --git a/libp11.spec b/libp11.spec index 70778ec..6a0462a 100644 --- a/libp11.spec +++ b/libp11.spec @@ -69,6 +69,9 @@ rm -f %{buildroot}%{_libdir}/libp11.so rm -f %{buildroot}%{_libdir}/pkgconfig/libp11.pc rm -f %{buildroot}%{_includedir}/*.h
+# Remove documentation automatically installed by make install +rm -rf %{buildroot}%{_docdir}/%{name}/ + %check make check %{?_smp_mflags}
commit b68b902bbdb53bfefd4696e8b1201841e4923ba7 Author: Anderson Toshiyuki Sasaki ansasaki@redhat.com Date: Mon Feb 26 11:57:09 2018 +0100
Fix permission for file brought by a patch
In epel7, executables files brougth by a patch have wrong permissions
diff --git a/libp11.spec b/libp11.spec index ad15b4f..70778ec 100644 --- a/libp11.spec +++ b/libp11.spec @@ -47,6 +47,8 @@ cards and software for using smart cards in PKCS#11 format, such as OpenSC.
%prep %autosetup -p 1 +# Fix permissions for file brought by a patch +chmod 755 %{_builddir}/libp11-0.4.7/tests/fork-change-slot.softhsm
%build autoreconf -fvi
commit 23895345527f09694cf74c95542840a84175deb7 Author: Anderson Toshiyuki Sasaki ansasaki@redhat.com Date: Thu Feb 22 16:06:13 2018 +0100
Add a patch to avoid an error in forking processes
Avoid a call to pkcs11_enumerate_slots() when a fork is detected. This call could lead to an error in forking processes. The test added in this patch requires the package procps-ng for the test suite.
diff --git a/libp11-0.4.7-do-not-enumerate-slots-on-fork.patch b/libp11-0.4.7-do-not-enumerate-slots-on-fork.patch new file mode 100644 index 0000000..5f91fec --- /dev/null +++ b/libp11-0.4.7-do-not-enumerate-slots-on-fork.patch @@ -0,0 +1,760 @@ +diff --git a/src/p11_load.c b/src/p11_load.c +index 58cec7c..4109083 100644 +--- a/src/p11_load.c ++++ b/src/p11_load.c +@@ -126,8 +126,7 @@ int pkcs11_CTX_reload(PKCS11_CTX *ctx) + return -1; + } + +- /* Reinitialize the PKCS11 internal slot table */ +- return pkcs11_enumerate_slots(ctx, NULL, NULL); ++ return 0; + } + + /* +diff --git a/tests/Makefile.am b/tests/Makefile.am +index b65e24a..1112078 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -9,10 +9,10 @@ AM_CPPFLAGS = \ + AM_LDFLAGS = -no-install + LDADD = ../src/libp11.la $(OPENSSL_LIBS) + +-check_PROGRAMS = openssl_version fork-test evp-sign ++check_PROGRAMS = openssl_version fork-test evp-sign fork-change-slot + dist_check_SCRIPTS = \ + rsa-testpkcs11.softhsm rsa-testfork.softhsm rsa-testlistkeys.softhsm rsa-evp-sign.softhsm \ +- ec-testfork.softhsm ++ ec-testfork.softhsm fork-change-slot.softhsm + dist_check_DATA = \ + rsa-cert.der rsa-prvkey.der rsa-pubkey.der \ + ec-cert.der ec-prvkey.der ec-pubkey.der +diff --git a/tests/ec-common.sh b/tests/ec-common.sh +index 2e6f735..a709c0d 100755 +--- a/tests/ec-common.sh ++++ b/tests/ec-common.sh +@@ -33,7 +33,7 @@ echo "Output directory: ${outdir}" + + mkdir -p $outdir + +-for i in /usr/lib64/pkcs11 /usr/lib/softhsm /usr/local/lib/softhsm /opt/local/lib/softhsm /usr/lib/x86_64-linux-gnu/softhsm /usr/lib /usr/lib64/softhsm;do ++for i in /usr/lib64/pkcs11 /usr/lib64/softhsm /usr/lib/x86_64-linux-gnu/softhsm /usr/local/lib/softhsm /opt/local/lib/softhsm /usr/lib/softhsm /usr/lib ;do + if test -f "$i/libsofthsm2.so"; then + ADDITIONAL_PARAM="$i/libsofthsm2.so" + break +@@ -53,6 +53,11 @@ init_card () { + PIN="$1" + PUK="$2" + ++ if test -x "/usr/bin/softhsm"; then ++ export SOFTHSM_CONF="$outdir/softhsm-testpkcs11.config" ++ SOFTHSM_TOOL="/usr/bin/softhsm" ++ fi ++ + if test -x "/usr/local/bin/softhsm2-util"; then + export SOFTHSM2_CONF="$outdir/softhsm-testpkcs11.config" + SOFTHSM_TOOL="/usr/local/bin/softhsm2-util" +@@ -68,17 +73,12 @@ init_card () { + SOFTHSM_TOOL="/usr/bin/softhsm2-util" + fi + +- if test -x "/usr/bin/softhsm"; then +- export SOFTHSM_CONF="$outdir/softhsm-testpkcs11.config" +- SOFTHSM_TOOL="/usr/bin/softhsm" +- fi +- + if test -z "${SOFTHSM_TOOL}"; then + echo "Could not find softhsm(2) tool" + exit 77 + fi + +- if test -z "${SOFTHSM_CONF}"; then ++ if test -n "${SOFTHSM2_CONF}"; then + rm -rf $outdir/softhsm-testpkcs11.db + mkdir -p $outdir/softhsm-testpkcs11.db + echo "objectstore.backend = file" > "${SOFTHSM2_CONF}" +diff --git a/tests/fork-change-slot.c b/tests/fork-change-slot.c +new file mode 100644 +index 0000000..8e782ce +--- /dev/null ++++ b/tests/fork-change-slot.c +@@ -0,0 +1,288 @@ ++/* libp11 test code: fork-change-slot.c ++ * ++ * This program loads a key pair using the engine pkcs11, forks to create ++ * a new process, and waits for a SIGUSR1 signal before trying to sign/verify ++ * random data in both parent and child processes. ++ * ++ * The intention of the signal waiting is to allow the user to add/remove ++ * devices before continuing to the signature/verifying test. ++ * ++ * Adding or removing devices can lead to a change in the list of slot IDs ++ * obtained from the PKCS#11 module. If the engine does not handle the ++ * slot ID referenced by the previously loaded key properly, then the key in ++ * the child process can reference to the wrong slot ID after forking. ++ * This would lead to an error, since the engine will try to sign the data ++ * using the key in the wrong slot. ++ */ ++ ++#include <sys/types.h> ++#include <sys/stat.h> ++#include <fcntl.h> ++#include <termios.h> ++#include <stdio.h> ++#include <string.h> ++#include <sys/types.h> ++#include <sys/wait.h> ++#include <unistd.h> ++#include <signal.h> ++ ++#include <execinfo.h> ++ ++#include <openssl/evp.h> ++#include <openssl/conf.h> ++#include <openssl/engine.h> ++ ++#define RANDOM_SIZE 20 ++#define MAX_SIGSIZE 1024 ++ ++#if OPENSSL_VERSION_NUMBER < 0x10100003L ++#define EVP_PKEY_get0_RSA(key) ((key)->pkey.rsa) ++#endif ++ ++static int do_wait(pid_t pids[], int num) ++{ ++ int i; ++ int status = 0; ++ ++ for (i = 0; i < num; i++) { ++ waitpid(pids[i], &status, 0); ++ if (WIFEXITED(status)) { ++ printf("child %d exited with status %d\n", pids[i], WEXITSTATUS(status)); ++ return (WEXITSTATUS(status)); ++ } ++ if (WIFSIGNALED(status)) { ++ fprintf(stderr, "Child %d terminated by signal #%d\n", pids[i], ++ WTERMSIG(status)); ++ return (WTERMSIG(status)); ++ } ++ else { ++ perror("waitpid"); ++ } ++ } ++ ++ return 0; ++} ++ ++static int spawn_processes(int num) ++{ ++ int i; ++ int chld_ret = 0; ++ pid_t *pids; ++ pid_t pid; ++ ++ sigset_t set, oldset; ++ int signal; ++ ++ sigemptyset(&set); ++ sigaddset(&set, SIGUSR1); ++ ++ /* If only 1 process was requested, no more processes are required */ ++ if (num <= 1) { ++ return 0; ++ } ++ ++ pids = (pid_t *)malloc(num * sizeof(pid_t)); ++ if (pids == NULL) { ++ exit(ENOMEM); ++ } ++ ++ /* Spawn (num - 1) new processes to get a total of num processes */ ++ for (i = 0; i < (num - 1); i++) { ++ pid = fork(); ++ switch (pid) { ++ case -1: /* failed */ ++ perror("fork"); ++ do_wait(pids, i); ++ free(pids); ++ exit(5); ++ case 0: /* child */ ++ printf("Remove or add a device to try to cause an error\n"); ++ printf("Waiting for signal SIGUSR1\n"); ++ sigprocmask(SIG_BLOCK, &set, &oldset); ++ sigwait(&set, &signal); ++ sigprocmask(SIG_SETMASK, &oldset, NULL); ++ free(pids); ++ return 0; ++ default: /* parent */ ++ pids[i] = pid; ++ printf("spawned %d\n", pid); ++ } ++ } ++ ++ /* Wait for the created processes */ ++ chld_ret = do_wait(pids, (num - 1)); ++ ++ free(pids); ++ ++ return chld_ret; ++} ++ ++static void error_queue(const char *name, int pid) ++{ ++ if (ERR_peek_last_error()) { ++ fprintf(stderr, "pid %d: %s generated errors:\n", pid, name); ++ ERR_print_errors_fp(stderr); ++ } ++} ++ ++static void usage(char *arg) ++{ ++ printf("usage: %s (Key PKCS#11 URL) [opt: PKCS#11 module path]\n", ++ arg); ++} ++ ++int main(int argc, char *argv[]) ++{ ++ const EVP_MD *digest_algo = NULL; ++ EVP_PKEY *pkey = NULL; ++ EVP_MD_CTX *md_ctx = NULL; ++ ENGINE *engine = NULL; ++ unsigned char random[RANDOM_SIZE], signature[MAX_SIGSIZE]; ++ unsigned int siglen = MAX_SIGSIZE; ++ ++ int ret, num_processes = 2; ++ pid_t pid; ++ ++ int rv = 1; ++ ++ /* Check arguments */ ++ if (argc < 2) { ++ fprintf(stderr, "Missing required arguments\n"); ++ usage(argv[0]); ++ goto failed; ++ } ++ ++ if (argc > 4) { ++ fprintf(stderr, "Too many arguments\n"); ++ usage(argv[0]); ++ goto failed; ++ } ++ ++ /* Check PKCS#11 URL */ ++ if (strncmp(argv[1], "pkcs11:", 7)) { ++ fprintf(stderr, "fatal: invalid PKCS#11 URL\n"); ++ usage(argv[0]); ++ goto failed; ++ } ++ ++ pid = getpid(); ++ printf("pid %d is the parent\n", pid); ++ ++ /* Load configuration file, if provided */ ++ if (argc >= 3) { ++ ret = CONF_modules_load_file(argv[2], "engines", 0); ++ if (ret <= 0) { ++ fprintf(stderr, "cannot load %s\n", argv[2]); ++ error_queue("CONF_modules_load_file", pid); ++ goto failed; ++ } ++ ENGINE_add_conf_module(); ++ } ++ ++ ENGINE_add_conf_module(); ++ OpenSSL_add_all_algorithms(); ++ ERR_load_crypto_strings(); ++ ERR_clear_error(); ++ ENGINE_load_builtin_engines(); ++ ++ /* Get structural reference */ ++ engine = ENGINE_by_id("pkcs11"); ++ if (engine == NULL) { ++ fprintf(stderr, "fatal: engine "pkcs11" not available\n"); ++ error_queue("ENGINE_by_id", pid); ++ goto failed; ++ } ++ ++ /* Set the used */ ++ if (argc >= 4) { ++ ENGINE_ctrl_cmd(engine, "MODULE_PATH", 0, argv[3], NULL, 1); ++ } ++ ++ /* Initialize to get the engine functional reference */ ++ if (ENGINE_init(engine)) { ++ pkey = ENGINE_load_private_key(engine, argv[1], 0, 0); ++ if (pkey == NULL) { ++ error_queue("ENGINE_load_private_key", pid); ++ goto failed; ++ } ++ ++ if (!ENGINE_set_default(engine, ENGINE_METHOD_ALL)) { ++ error_queue("ENGINE_set_default", pid); ++ goto failed; ++ } ++ ++ ENGINE_free(engine); ++ engine = NULL; ++ } ++ else { ++ error_queue("ENGINE_init", pid); ++ goto failed; ++ } ++ ++ /* Spawn processes and check child return */ ++ if (spawn_processes(num_processes)) { ++ goto failed; ++ } ++ pid = getpid(); ++ ++ /* Generate random data */ ++ if (!RAND_bytes(random, RANDOM_SIZE)){ ++ error_queue("RAND_bytes", pid); ++ goto failed; ++ } ++ ++ /* Create context to sign the random data */ ++ digest_algo = EVP_get_digestbyname("sha256"); ++ md_ctx = EVP_MD_CTX_create(); ++ if (EVP_DigestInit(md_ctx, digest_algo) <= 0) { ++ error_queue("EVP_DigestInit", pid); ++ goto failed; ++ } ++ ++ EVP_SignInit(md_ctx, digest_algo); ++ if (EVP_SignUpdate(md_ctx, random, RANDOM_SIZE) <= 0) { ++ error_queue("EVP_SignUpdate", pid); ++ goto failed; ++ } ++ ++ if (EVP_SignFinal(md_ctx, signature, &siglen, pkey) <= 0) { ++ error_queue("EVP_SignFinal", pid); ++ goto failed; ++ } ++ EVP_MD_CTX_destroy(md_ctx); ++ ++ printf("pid %d: %u-byte signature created\n", pid, siglen); ++ ++ /* Now verify the result */ ++ md_ctx = EVP_MD_CTX_create(); ++ if (EVP_DigestInit(md_ctx, digest_algo) <= 0) { ++ error_queue("EVP_DigestInit", pid); ++ goto failed; ++ } ++ ++ EVP_VerifyInit(md_ctx, digest_algo); ++ if (EVP_VerifyUpdate(md_ctx, random, RANDOM_SIZE) <= 0) { ++ error_queue("EVP_VerifyUpdate", pid); ++ goto failed; ++ } ++ ++ if (EVP_VerifyFinal(md_ctx, signature, siglen, pkey) <= 0) { ++ error_queue("EVP_VerifyFinal", pid); ++ goto failed; ++ } ++ printf("pid %d: Signature matched\n", pid); ++ ++ rv = 0; ++ ++failed: ++ if (md_ctx != NULL) ++ EVP_MD_CTX_destroy(md_ctx); ++ if (pkey != NULL) ++ EVP_PKEY_free(pkey); ++ if (engine != NULL) ++ ENGINE_free(engine); ++ CRYPTO_cleanup_all_ex_data(); ++ ERR_free_strings(); ++ ++ return rv; ++} +diff --git a/tests/fork-change-slot.softhsm b/tests/fork-change-slot.softhsm +new file mode 100755 +index 0000000..f13d2c8 +--- /dev/null ++++ b/tests/fork-change-slot.softhsm +@@ -0,0 +1,75 @@ ++#!/bin/sh ++ ++# Copyright (C) 2013 Nikos Mavrogiannopoulos ++# Copyright (C) 2015 Red Hat, Inc. ++# ++# This is free software; you can redistribute it and/or modify it ++# under the terms of the GNU General Public License as published by the ++# Free Software Foundation; either version 3 of the License, or (at ++# your option) any later version. ++# ++# GnuTLS is distributed in the hope that it will be useful, but ++# WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++# General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with GnuTLS; if not, write to the Free Software Foundation, ++# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++ ++outdir="output.$$" ++ ++# Load common test functions ++. ${srcdir}/rsa-common.sh ++ ++sed -e "s|@MODULE_PATH@|${MODULE}|g" -e \ ++ "s|@ENGINE_PATH@|../src/.libs/pkcs11.so|g" \ ++ <"${srcdir}/engines.cnf.in" >"${outdir}/engines.cnf" ++ ++# Set the used PIN and PUK ++PIN=1234 ++PUK=1234 ++ ++# Initialize SoftHSM DB ++init_db ++ ++# Create 2 different tokens ++init_card $PIN $PUK "token1" ++init_card $PIN $PUK "token2" ++ ++# Force the use of the local built engine ++export OPENSSL_ENGINES="../src/.libs/" ++ ++# Generate a key pair in the second token ++pkcs11-tool --module ${MODULE} -l --pin $PIN --keypairgen --key-type \ ++ rsa:1024 --id 01020304 --label pkey --token-label token2 ++if test $? != 0;then ++ exit 1; ++fi ++ ++# Run the test program which will stop and wait for a signal (SIGUSR1) ++./fork-change-slot \ ++ "pkcs11:token=token2;object=pkey;type=private;pin-value=$PIN" \ ++ "${outdir}/engines.cnf" ${MODULE} & ++pid=$! ++ ++# Wait the test program to reach the sigwait ++sleep 3 ++ ++# Remove the first token to change the slotID associated with token2 ++${SOFTHSM_TOOL} --delete-token --token token1 ++ ++# Send the signal to the waiting process ++kill -USR1 `pgrep -P $pid` ++ ++# Test the result ++wait $pid ++if test $? != 0;then ++ exit 1; ++fi ++ ++# Cleanup ++rm -rf "$outdir" ++ ++exit 0 ++ +diff --git a/tests/rsa-common.sh b/tests/rsa-common.sh +index ba1faf5..7db5ba0 100755 +--- a/tests/rsa-common.sh ++++ b/tests/rsa-common.sh +@@ -10,7 +10,7 @@ + # + # GnuTLS is distributed in the hope that it will be useful, but + # WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + # General Public License for more details. + # + # You should have received a copy of the GNU General Public License +@@ -23,13 +23,15 @@ echo "Output directory: ${outdir}" + + mkdir -p $outdir + +-for i in /usr/lib64/pkcs11 /usr/lib/softhsm /usr/local/lib/softhsm /opt/local/lib/softhsm /usr/lib/x86_64-linux-gnu/softhsm /usr/lib /usr/lib64/softhsm;do ++# Set the module to be used ++for i in /usr/lib64/pkcs11 /usr/lib64/softhsm /usr/lib/x86_64-linux-gnu/softhsm \ ++ /usr/local/lib/softhsm /opt/local/lib/softhsm /usr/lib/softhsm /usr/lib ;do + if test -f "$i/libsofthsm2.so"; then +- ADDITIONAL_PARAM="$i/libsofthsm2.so" ++ MODULE="$i/libsofthsm2.so" + break + else + if test -f "$i/libsofthsm.so";then +- ADDITIONAL_PARAM="$i/libsofthsm.so" ++ MODULE="$i/libsofthsm.so" + break + fi + fi +@@ -39,28 +41,30 @@ if (! test -x /usr/bin/pkcs11-tool && ! test -x /usr/local/bin/pkcs11-tool);then + exit 77 + fi + +-init_card () { +- PIN="$1" +- PUK="$2" ++# Initialize the SoftHSM DB ++init_db () { ++ if test -x "/usr/bin/softhsm"; then ++ export SOFTHSM_CONF="$outdir/softhsm-testpkcs11.config" ++ SOFTHSM_TOOL="/usr/bin/softhsm" ++ SLOT="--slot 0" ++ fi + + if test -x "/usr/local/bin/softhsm2-util"; then + export SOFTHSM2_CONF="$outdir/softhsm-testpkcs11.config" + SOFTHSM_TOOL="/usr/local/bin/softhsm2-util" ++ SLOT="--free " + fi + + if test -x "/opt/local/bin/softhsm2-util"; then + export SOFTHSM2_CONF="$outdir/softhsm-testpkcs11.config" + SOFTHSM_TOOL="/opt/local/bin/softhsm2-util" ++ SLOT="--free " + fi + + if test -x "/usr/bin/softhsm2-util"; then + export SOFTHSM2_CONF="$outdir/softhsm-testpkcs11.config" + SOFTHSM_TOOL="/usr/bin/softhsm2-util" +- fi +- +- if test -x "/usr/bin/softhsm"; then +- export SOFTHSM_CONF="$outdir/softhsm-testpkcs11.config" +- SOFTHSM_TOOL="/usr/bin/softhsm" ++ SLOT="--free " + fi + + if test -z "${SOFTHSM_TOOL}"; then +@@ -68,19 +72,27 @@ init_card () { + exit 77 + fi + +- if test -z "${SOFTHSM_CONF}"; then ++ if test -n "${SOFTHSM2_CONF}"; then + rm -rf $outdir/softhsm-testpkcs11.db + mkdir -p $outdir/softhsm-testpkcs11.db + echo "objectstore.backend = file" > "${SOFTHSM2_CONF}" +- echo "directories.tokendir = $outdir/softhsm-testpkcs11.db" >> "${SOFTHSM2_CONF}" ++ echo "directories.tokendir = $outdir/softhsm-testpkcs11.db" >> \ ++ "${SOFTHSM2_CONF}" + else + rm -rf $outdir/softhsm-testpkcs11.db + echo "0:$outdir/softhsm-testpkcs11.db" > "${SOFTHSM_CONF}" + fi ++} + ++# Create a new device ++init_card () { ++ PIN="$1" ++ PUK="$2" ++ DEV_LABEL="$3" + + echo -n "* Initializing smart card... " +- ${SOFTHSM_TOOL} --init-token --slot 0 --label "libp11-test" --so-pin "${PUK}" --pin "${PIN}" >/dev/null ++ ${SOFTHSM_TOOL} --init-token ${SLOT} --label "${DEV_LABEL}" \ ++ --so-pin "${PUK}" --pin "${PIN}" >/dev/null + if test $? = 0; then + echo ok + else +@@ -89,27 +101,55 @@ init_card () { + fi + } + +-PIN=1234 +-PUK=1234 +-init_card $PIN $PUK ++# Import objects to the token ++import_objects () { ++ ID=$1 ++ OBJ_LABEL=$2 + +-# generate key in token +-pkcs11-tool -p $PIN --module $ADDITIONAL_PARAM -d 01020304 -a server-key -l -w ${srcdir}/rsa-prvkey.der -y privkey >/dev/null +-if test $? != 0;then +- exit 1; +-fi ++ pkcs11-tool -p ${PIN} --module ${MODULE} -d ${ID} -a ${OBJ_LABEL} -l -w \ ++ ${srcdir}/rsa-prvkey.der -y privkey >/dev/null ++ if test $? != 0;then ++ exit 1; ++ fi + +-pkcs11-tool -p $PIN --module $ADDITIONAL_PARAM -d 01020304 -a server-key -l -w ${srcdir}/rsa-pubkey.der -y pubkey >/dev/null +-if test $? != 0;then +- exit 1; +-fi ++ pkcs11-tool -p ${PIN} --module ${MODULE} -d ${ID} -a ${OBJ_LABEL} -l -w \ ++ ${srcdir}/rsa-pubkey.der -y pubkey >/dev/null ++ if test $? != 0;then ++ exit 1; ++ fi + +-pkcs11-tool -p $PIN --module $ADDITIONAL_PARAM -d 01020304 -a server-key -l -w ${srcdir}/rsa-cert.der -y cert >/dev/null +-if test $? != 0;then +- exit 1; +-fi ++ pkcs11-tool -p ${PIN} --module ${MODULE} -d ${ID} -a ${OBJ_LABEL} -l -w \ ++ ${srcdir}/rsa-cert.der -y cert >/dev/null ++ if test $? != 0;then ++ exit 1; ++ fi ++ ++ echo Finished ++} + +-echo "***************" +-echo "Listing objects" +-echo "***************" +-pkcs11-tool -p $PIN --module $ADDITIONAL_PARAM -l -O ++# List the objects contained in the token ++list_objects () { ++ echo "***************" ++ echo "Listing objects" ++ echo "***************" ++ pkcs11-tool -p ${PIN} --module ${MODULE} -l -O ++} ++ ++common_init () { ++ # Set the used PIN and PUK ++ PIN=1234 ++ PUK=1234 ++ ++ # Initialize the SoftHSM DB ++ init_db ++ ++ # Initialize a new device ++ init_card $PIN $PUK "libp11-test" ++ ++ echo Importing ++ # Import the used objects (private key, public key, and certificate) ++ import_objects 01020304 "server-key" ++ ++ # List the imported objects ++ list_objects ++} +diff --git a/tests/rsa-evp-sign.softhsm b/tests/rsa-evp-sign.softhsm +index 4d60c83..7ef993d 100755 +--- a/tests/rsa-evp-sign.softhsm ++++ b/tests/rsa-evp-sign.softhsm +@@ -18,47 +18,49 @@ + + outdir="output.$$" + ++# Load common test functions + . ${srcdir}/rsa-common.sh + +-# This uses the engine for basic sign-verify operation. ++# Do the common test initialization ++common_init + +-sed -e "s|@MODULE_PATH@|${ADDITIONAL_PARAM}|g" -e "s|@ENGINE_PATH@|../src/.libs/pkcs11.so|g" <"${srcdir}/engines.cnf.in" >"${outdir}/engines.cnf" ++sed -e "s|@MODULE_PATH@|${MODULE}|g" -e "s|@ENGINE_PATH@|../src/.libs/pkcs11.so|g" <"${srcdir}/engines.cnf.in" >"${outdir}/engines.cnf" + + export OPENSSL_ENGINES="../src/.libs/" + PRIVATE_KEY="pkcs11:token=libp11-test;id=%01%02%03%04;object=server-key;type=private;pin-value=1234" + PUBLIC_KEY="pkcs11:token=libp11-test;id=%01%02%03%04;object=server-key;type=public;pin-value=1234" + +-./evp-sign ctrl false "${outdir}/engines.cnf" ${PRIVATE_KEY} ${PUBLIC_KEY} ${ADDITIONAL_PARAM} ++./evp-sign ctrl false "${outdir}/engines.cnf" ${PRIVATE_KEY} ${PUBLIC_KEY} ${MODULE} + if test $? != 0;then + echo "Basic PKCS #11 test, using ctrl failed" + exit 1; + fi + +-./evp-sign default false "${outdir}/engines.cnf" ${PRIVATE_KEY} ${PUBLIC_KEY} ${ADDITIONAL_PARAM} ++./evp-sign default false "${outdir}/engines.cnf" ${PRIVATE_KEY} ${PUBLIC_KEY} ${MODULE} + if test $? != 0;then + echo "Basic PKCS #11 test, using default failed" + exit 1; + fi + +-./evp-sign ctrl 1234 "${outdir}/engines.cnf" ${PRIVATE_KEY} ${PUBLIC_KEY} ${ADDITIONAL_PARAM} ++./evp-sign ctrl 1234 "${outdir}/engines.cnf" ${PRIVATE_KEY} ${PUBLIC_KEY} ${MODULE} + if test $? != 0;then + echo "Basic PKCS #11 test without pin-value, using ctrl failed" + exit 1; + fi + +-./evp-sign default 1234 "${outdir}/engines.cnf" ${PRIVATE_KEY} ${PUBLIC_KEY} ${ADDITIONAL_PARAM} ++./evp-sign default 1234 "${outdir}/engines.cnf" ${PRIVATE_KEY} ${PUBLIC_KEY} ${MODULE} + if test $? != 0;then + echo "Basic PKCS #11 test without pin-value, using default failed" + exit 1; + fi + +-./evp-sign ctrl 1234 "${outdir}/engines.cnf" "label_server-key" "label_server-key" ${ADDITIONAL_PARAM} ++./evp-sign ctrl 1234 "${outdir}/engines.cnf" "label_server-key" "label_server-key" ${MODULE} + if test $? != 0;then + echo "Basic PKCS #11 test with legacy name #1 failed" + exit 1; + fi + +-./evp-sign default 1234 "${outdir}/engines.cnf" "id_01020304" "id_01020304" ${ADDITIONAL_PARAM} ++./evp-sign default 1234 "${outdir}/engines.cnf" "id_01020304" "id_01020304" ${MODULE} + if test $? != 0;then + echo "Basic PKCS #11 test with legacy name #2 failed" + exit 1; +diff --git a/tests/rsa-testfork.softhsm b/tests/rsa-testfork.softhsm +index 0643e96..ba5d851 100755 +--- a/tests/rsa-testfork.softhsm ++++ b/tests/rsa-testfork.softhsm +@@ -19,13 +19,19 @@ + + outdir="output.$$" + ++# Load common test functions + . ${srcdir}/rsa-common.sh + +-./fork-test $ADDITIONAL_PARAM $PIN ++# Do the common test initialization ++common_init ++ ++# Run the test ++./fork-test ${MODULE} ${PIN} + if test $? != 0;then + exit 1; + fi + ++# Cleanup + rm -rf "$outdir" + + exit 0 +diff --git a/tests/rsa-testlistkeys.softhsm b/tests/rsa-testlistkeys.softhsm +index 9494f9d..b3696f5 100755 +--- a/tests/rsa-testlistkeys.softhsm ++++ b/tests/rsa-testlistkeys.softhsm +@@ -19,9 +19,14 @@ + + outdir="output.$$" + ++# Load common test functions + . ${srcdir}/rsa-common.sh + +-../examples/listkeys $ADDITIONAL_PARAM $PIN ++# Do the common test initialization ++common_init ++ ++# Run the test ++../examples/listkeys ${MODULE} ${PIN} + if test $? != 0;then + exit 1; + fi +diff --git a/tests/rsa-testpkcs11.softhsm b/tests/rsa-testpkcs11.softhsm +index d1e1f50..f76a8d3 100755 +--- a/tests/rsa-testpkcs11.softhsm ++++ b/tests/rsa-testpkcs11.softhsm +@@ -20,14 +20,19 @@ + + outdir="output.$$" + ++# Load common test functions + . ${srcdir}/rsa-common.sh + +-../examples/auth $ADDITIONAL_PARAM $PIN ++# Do the common test initialization ++common_init ++ ++../examples/auth ${MODULE} ${PIN} + if test $? != 0;then + echo "Basic PKCS #11 test test failed" + exit 1; + fi + ++# Cleanup + rm -rf "$outdir" + + exit 0 diff --git a/libp11.spec b/libp11.spec index b91bc17..ad15b4f 100644 --- a/libp11.spec +++ b/libp11.spec @@ -1,4 +1,3 @@ -# This spec file has been automatically updated Version: 0.4.7 Release: 2%{?dist}
@@ -12,12 +11,14 @@ License: LGPLv2+ URL: https://github.com/OpenSC/libp11 Source0: https://github.com/OpenSC/libp11/releases/download/%%7Bname%7D-%%7Bversion%7...
+Patch1: libp11-0.4.7-do-not-enumerate-slots-on-fork.patch + BuildRequires: autoconf automake libtool BuildRequires: libtool-ltdl-devel BuildRequires: openssl-devel BuildRequires: pkgconfig # needed for testsuite -BuildRequires: softhsm opensc +BuildRequires: softhsm opensc procps-ng
%description @@ -45,7 +46,7 @@ openssl to a PKCS#11 module. Engine_pkcs11 is meant to be used with smart cards and software for using smart cards in PKCS#11 format, such as OpenSC.
%prep -%autosetup +%autosetup -p 1
%build autoreconf -fvi
commit dbd07f7706ba9fb42ebe3aec6d71bab11b79c6cd Author: Anderson Toshiyuki Sasaki ansasaki@redhat.com Date: Tue Feb 20 14:20:15 2018 +0100
Use %autosetup instead of %setup -q
Using %autosetup automatically apply patches, avoiding the use of extra lines for each patch.
diff --git a/libp11.spec b/libp11.spec index fe30498..b91bc17 100644 --- a/libp11.spec +++ b/libp11.spec @@ -45,7 +45,7 @@ openssl to a PKCS#11 module. Engine_pkcs11 is meant to be used with smart cards and software for using smart cards in PKCS#11 format, such as OpenSC.
%prep -%setup -q +%autosetup
%build autoreconf -fvi
commit 2d2f528e0e4570ba08654689741f15adf6a09200 Author: Anderson Toshiyuki Sasaki ansasaki@redhat.com Date: Tue Feb 20 14:17:22 2018 +0100
Make used CFLAGS more visible
CFLAGS definition extracted from %configure line and exported in a line alone.
diff --git a/libp11.spec b/libp11.spec index c7811a9..fe30498 100644 --- a/libp11.spec +++ b/libp11.spec @@ -49,7 +49,8 @@ cards and software for using smart cards in PKCS#11 format, such as OpenSC.
%build autoreconf -fvi -%configure CFLAGS="%{optflags}" --disable-static --with-enginesdir=%{enginesdir} +export CFLAGS="%{optflags}" +%configure --disable-static --with-enginesdir=%{enginesdir} make V=1 %{?_smp_mflags}
%install
commit d38047a2677f0d347ad06ae4e06409f6fe3192a1 Author: Anderson Toshiyuki Sasaki ansasaki@redhat.com Date: Tue Feb 20 13:42:15 2018 +0100
Remove conditionals for PPC
Conditinals for PPC architecture were used in the past, but they are not needed anymore.
diff --git a/libp11.spec b/libp11.spec index b2c3f59..c7811a9 100644 --- a/libp11.spec +++ b/libp11.spec @@ -16,15 +16,8 @@ BuildRequires: autoconf automake libtool BuildRequires: libtool-ltdl-devel BuildRequires: openssl-devel BuildRequires: pkgconfig -%if 0%{?fedora} -BuildRequires: autoconf automake libtool # needed for testsuite BuildRequires: softhsm opensc -%else -%ifnarch ppc ppc64 ppc64le -BuildRequires: softhsm opensc -%endif -%endif
%description @@ -40,15 +33,8 @@ License: BSD
BuildRequires: openssl-devel pkgconfig BuildRequires: pkgconfig(p11-kit-1) -%if 0%{?fedora} -BuildRequires: softhsm opensc -Recommends: p11-kit-trust -%else -%ifnarch ppc ppc64 ppc64le BuildRequires: softhsm opensc Requires: p11-kit-trust -%endif -%endif Requires: openssl > 0.9.6 Requires: %{name}%{?_isa} = %{version}-%{release}
@@ -62,9 +48,7 @@ cards and software for using smart cards in PKCS#11 format, such as OpenSC. %setup -q
%build -%if 0%{?fedora} autoreconf -fvi -%endif %configure CFLAGS="%{optflags}" --disable-static --with-enginesdir=%{enginesdir} make V=1 %{?_smp_mflags}
@@ -82,9 +66,7 @@ rm -f %{buildroot}%{_libdir}/pkgconfig/libp11.pc rm -f %{buildroot}%{_includedir}/*.h
%check -%if 0%{?fedora} make check %{?_smp_mflags} -%endif
%post -p /sbin/ldconfig
commit 47ba7fe60434d3e747093f1b01d4dca2bdaa17e7 Author: Anderson Toshiyuki Sasaki ansasaki@redhat.com Date: Tue Feb 20 10:57:12 2018 +0100
Remove API documentation
Since the -devel package is no longer shipped, the documentation should not be generated or installed.
diff --git a/libp11.spec b/libp11.spec index b8c07a8..b2c3f59 100644 --- a/libp11.spec +++ b/libp11.spec @@ -13,7 +13,6 @@ URL: https://github.com/OpenSC/libp11 Source0: https://github.com/OpenSC/libp11/releases/download/%%7Bname%7D-%%7Bversion%7...
BuildRequires: autoconf automake libtool -BuildRequires: doxygen graphviz BuildRequires: libtool-ltdl-devel BuildRequires: openssl-devel BuildRequires: pkgconfig @@ -66,18 +65,13 @@ cards and software for using smart cards in PKCS#11 format, such as OpenSC. %if 0%{?fedora} autoreconf -fvi %endif -%configure CFLAGS="%{optflags}" --disable-static --enable-api-doc --with-enginesdir=%{enginesdir} +%configure CFLAGS="%{optflags}" --disable-static --with-enginesdir=%{enginesdir} make V=1 %{?_smp_mflags}
%install mkdir -p %{buildroot}%{enginesdir} make install DESTDIR=%{buildroot}
-# Use %%doc to install documentation in a standard location -mkdir __docdir -mv %{buildroot}%{_datadir}/doc/%{name}/api/ __docdir/ -rm -rf %{buildroot}%{_datadir}/doc/%{name}/ - # Remove libtool .la files rm -f %{buildroot}%{_libdir}/*.la rm -f %{buildroot}%{enginesdir}/*.la
commit e20bc96519a42982e5557f8524bc6f3b62f4a23a Author: Anderson Toshiyuki Sasaki ansasaki@redhat.com Date: Mon Feb 19 16:47:44 2018 +0100
Remove conditionals for old Fedora versions
Since Fedora 25 and previous versions reached EOL, these conditionals are not needed anymore.
diff --git a/libp11.spec b/libp11.spec index 9aa8b3b..b8c07a8 100644 --- a/libp11.spec +++ b/libp11.spec @@ -1,11 +1,9 @@ # This spec file has been automatically updated Version: 0.4.7 Release: 2%{?dist} -%if 0%{?fedora} >= 26 + +# Define the directory where the OpenSSL engines are installed %global enginesdir %{_libdir}/engines-1.1 -%else -%global enginesdir %{_libdir}/openssl/engines -%endif
Name: libp11 Summary: Library for using PKCS#11 modules
commit b4392231903bf281e00f090e1deeaf595cf61cf0 Author: Anderson Toshiyuki Sasaki ansasaki@redhat.com Date: Mon Feb 19 16:42:23 2018 +0100
Remove unecessary %defattr(-,root,root,-)
It was necessary in the past, but it is not anymore.
diff --git a/libp11.spec b/libp11.spec index 22b4303..9aa8b3b 100644 --- a/libp11.spec +++ b/libp11.spec @@ -99,13 +99,11 @@ make check %{?_smp_mflags} %postun -p /sbin/ldconfig
%files -%defattr(-,root,root,-) %license COPYING %doc NEWS %{_libdir}/libp11.so.*
%files -n engine_pkcs11 -%defattr(-,root,root,-) %doc NEWS %{enginesdir}/*.so
commit 90ca9983cd79ecab97f49f678c89536ab708b4e0 Author: Anderson Toshiyuki Sasaki ansasaki@redhat.com Date: Thu Feb 15 11:06:16 2018 +0100
Remove Group Tag
Following the Packaging Guidelines section: https://fedoraproject.org/wiki/Packaging:Guidelines#Tags_and_Sections
diff --git a/libp11.spec b/libp11.spec index 141d617..22b4303 100644 --- a/libp11.spec +++ b/libp11.spec @@ -10,7 +10,6 @@ Release: 2%{?dist} Name: libp11 Summary: Library for using PKCS#11 modules
-Group: System Environment/Libraries License: LGPLv2+ URL: https://github.com/OpenSC/libp11 Source0: https://github.com/OpenSC/libp11/releases/download/%%7Bname%7D-%%7Bversion%7... @@ -40,7 +39,6 @@ make using PKCS#11 implementations easier.
%package -n engine_pkcs11 Summary: A PKCS#11 engine for use with OpenSSL -Group: Development/Libraries License: BSD
BuildRequires: openssl-devel pkgconfig
commit fb2a531dcebdd48e52fda62de85dacf696046d06 Author: Anderson Toshiyuki Sasaki ansasaki@redhat.com Date: Tue Feb 13 15:56:06 2018 +0100
Remove commented line and expand tabs in spec file
The commented line containing a macro and the mix of tabs and spaces were causing warnings in rpmlint.
diff --git a/libp11.spec b/libp11.spec index f5ab2ef..141d617 100644 --- a/libp11.spec +++ b/libp11.spec @@ -1,5 +1,5 @@ # This spec file has been automatically updated -Version: 0.4.7 +Version: 0.4.7 Release: 2%{?dist} %if 0%{?fedora} >= 26 %global enginesdir %{_libdir}/engines-1.1 @@ -15,7 +15,7 @@ License: LGPLv2+ URL: https://github.com/OpenSC/libp11 Source0: https://github.com/OpenSC/libp11/releases/download/%%7Bname%7D-%%7Bversion%7...
-BuildRequires: autoconf automake libtool +BuildRequires: autoconf automake libtool BuildRequires: doxygen graphviz BuildRequires: libtool-ltdl-devel BuildRequires: openssl-devel @@ -47,15 +47,15 @@ BuildRequires: openssl-devel pkgconfig BuildRequires: pkgconfig(p11-kit-1) %if 0%{?fedora} BuildRequires: softhsm opensc -Recommends: p11-kit-trust +Recommends: p11-kit-trust %else %ifnarch ppc ppc64 ppc64le BuildRequires: softhsm opensc -Requires: p11-kit-trust +Requires: p11-kit-trust %endif %endif -Requires: openssl > 0.9.6 -Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: openssl > 0.9.6 +Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n engine_pkcs11 Engine_pkcs11 is an implementation of an engine for OpenSSL. It can be loaded @@ -75,7 +75,6 @@ make V=1 %{?_smp_mflags}
%install mkdir -p %{buildroot}%{enginesdir} -#make install DESTDIR=%{buildroot} INSTALL="install -p" make install DESTDIR=%{buildroot}
# Use %%doc to install documentation in a standard location
commit c2e3487337c721f29426426f9cb6a3d756163890 Author: Anderson Toshiyuki Sasaki ansasaki@redhat.com Date: Tue Feb 13 15:24:04 2018 +0100
Add full versioned dependency in subpackage
Following the Packaging Guidelines section: https://fedoraproject.org/wiki/Packaging:Guidelines#Requiring_Base_Package
diff --git a/libp11.spec b/libp11.spec index fc5c644..f5ab2ef 100644 --- a/libp11.spec +++ b/libp11.spec @@ -55,7 +55,7 @@ Requires: p11-kit-trust %endif %endif Requires: openssl > 0.9.6 -Requires: %{name} = %{version}-%{release} +Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n engine_pkcs11 Engine_pkcs11 is an implementation of an engine for OpenSSL. It can be loaded
commit 2b7b8452a2d57d3275ec332911397a79fe764c74 Author: Anderson Toshiyuki Sasaki ansasaki@redhat.com Date: Tue Feb 13 14:55:25 2018 +0100
Make %build to honor applicable compiler flags
Following the Package Guidelines section: https://fedoraproject.org/wiki/Packaging:Guidelines#Compiler_flags
diff --git a/libp11.spec b/libp11.spec index e99ec71..fc5c644 100644 --- a/libp11.spec +++ b/libp11.spec @@ -70,7 +70,7 @@ cards and software for using smart cards in PKCS#11 format, such as OpenSC. %if 0%{?fedora} autoreconf -fvi %endif -%configure --disable-static --enable-api-doc --with-enginesdir=%{enginesdir} +%configure CFLAGS="%{optflags}" --disable-static --enable-api-doc --with-enginesdir=%{enginesdir} make V=1 %{?_smp_mflags}
%install
commit f8c7cfab908e7da4ea8dbd2ffe2c54632622cab1 Author: Anderson Toshiyuki Sasaki ansasaki@redhat.com Date: Tue Feb 13 11:59:04 2018 +0100
Use %global instead of %define
Following the Packaging Guidelines section: https://fedoraproject.org/wiki/Packaging:Guidelines#.25global_preferred_over...
diff --git a/libp11.spec b/libp11.spec index 688f06b..e99ec71 100644 --- a/libp11.spec +++ b/libp11.spec @@ -2,9 +2,9 @@ Version: 0.4.7 Release: 2%{?dist} %if 0%{?fedora} >= 26 -%define enginesdir %{_libdir}/engines-1.1 +%global enginesdir %{_libdir}/engines-1.1 %else -%define enginesdir %{_libdir}/openssl/engines +%global enginesdir %{_libdir}/openssl/engines %endif
Name: libp11 @@ -74,23 +74,23 @@ autoreconf -fvi make V=1 %{?_smp_mflags}
%install -mkdir -p $RPM_BUILD_ROOT%{enginesdir} -#make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" -make install DESTDIR=$RPM_BUILD_ROOT +mkdir -p %{buildroot}%{enginesdir} +#make install DESTDIR=%{buildroot} INSTALL="install -p" +make install DESTDIR=%{buildroot}
# Use %%doc to install documentation in a standard location mkdir __docdir -mv $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/api/ __docdir/ -rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/ +mv %{buildroot}%{_datadir}/doc/%{name}/api/ __docdir/ +rm -rf %{buildroot}%{_datadir}/doc/%{name}/
# Remove libtool .la files -rm -f $RPM_BUILD_ROOT%{_libdir}/*.la -rm -f $RPM_BUILD_ROOT%{enginesdir}/*.la +rm -f %{buildroot}%{_libdir}/*.la +rm -f %{buildroot}%{enginesdir}/*.la
## Remove development files -rm -f $RPM_BUILD_ROOT%{_libdir}/libp11.so -rm -f $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libp11.pc -rm -f $RPM_BUILD_ROOT%{_includedir}/*.h +rm -f %{buildroot}%{_libdir}/libp11.so +rm -f %{buildroot}%{_libdir}/pkgconfig/libp11.pc +rm -f %{buildroot}%{_includedir}/*.h
%check %if 0%{?fedora}
commit 06a0780ed5e003bcbbaba42830b28ed7e1dd158e Author: Anderson Toshiyuki Sasaki ansasaki@redhat.com Date: Tue Feb 13 11:19:44 2018 +0100
Include license file COPYING in %license
Following the Licensing Guidelines section: https://fedoraproject.org/wiki/Packaging:LicensingGuidelines#License_Text
diff --git a/libp11.spec b/libp11.spec index 79a6ecd..688f06b 100644 --- a/libp11.spec +++ b/libp11.spec @@ -103,7 +103,8 @@ make check %{?_smp_mflags}
%files %defattr(-,root,root,-) -%doc COPYING NEWS +%license COPYING +%doc NEWS %{_libdir}/libp11.so.*
%files -n engine_pkcs11
commit a9b774099fb9feb78d81db58cc87f6690f1df9d1 Author: Igor Gnatenko ignatenkobrain@fedoraproject.org Date: Wed Feb 14 08:15:59 2018 +0100
Remove %clean section
None of currently supported distributions need that. Last one was EL5 which is EOL for a while.
Signed-off-by: Igor Gnatenko ignatenkobrain@fedoraproject.org
diff --git a/libp11.spec b/libp11.spec index 5697f29..79a6ecd 100644 --- a/libp11.spec +++ b/libp11.spec @@ -92,9 +92,6 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/libp11.so rm -f $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libp11.pc rm -f $RPM_BUILD_ROOT%{_includedir}/*.h
-%clean -rm -rf $RPM_BUILD_ROOT - %check %if 0%{?fedora} make check %{?_smp_mflags}
commit ae1478ea5528fab5955968b6a93c2311e046d0c7 Author: Igor Gnatenko ignatenkobrain@fedoraproject.org Date: Tue Feb 13 23:42:24 2018 +0100
Remove BuildRoot definition
None of currently supported distributions need that. It was needed last for EL5 which is EOL now
Signed-off-by: Igor Gnatenko ignatenkobrain@fedoraproject.org
diff --git a/libp11.spec b/libp11.spec index 2c0709f..5697f29 100644 --- a/libp11.spec +++ b/libp11.spec @@ -14,7 +14,6 @@ Group: System Environment/Libraries License: LGPLv2+ URL: https://github.com/OpenSC/libp11 Source0: https://github.com/OpenSC/libp11/releases/download/%%7Bname%7D-%%7Bversion%7... -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: autoconf automake libtool BuildRequires: doxygen graphviz
commit dd3190b89048495ca71e5984044a728d622c1fc6 Author: Fedora Release Engineering releng@fedoraproject.org Date: Wed Feb 7 22:59:53 2018 +0000
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering releng@fedoraproject.org
diff --git a/libp11.spec b/libp11.spec index c522446..2c0709f 100644 --- a/libp11.spec +++ b/libp11.spec @@ -1,6 +1,6 @@ # This spec file has been automatically updated Version: 0.4.7 -Release: 1%{?dist} +Release: 2%{?dist} %if 0%{?fedora} >= 26 %define enginesdir %{_libdir}/engines-1.1 %else @@ -116,6 +116,9 @@ make check %{?_smp_mflags} %{enginesdir}/*.so
%changelog +* Wed Feb 07 2018 Fedora Release Engineering releng@fedoraproject.org - 0.4.7-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Fri Oct 06 2017 Nikos Mavrogiannopoulos nmav@redhat.com - 0.4.7-1 - Update to upstream 0.4.7 release
commit 519cbba871d749950666c441cce0fbbfd87a43e0 Author: Nikos Mavrogiannopoulos nmav@redhat.com Date: Fri Oct 6 08:48:30 2017 +0200
Update to 0.4.7-1
- Update to upstream 0.4.7 release
diff --git a/.gitignore b/.gitignore index 024cc2d..b268f8e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ libp11-0.2.7.tar.gz /libp11-0.4.2.tar.gz /libp11-0.4.2.tar.gz.asc /libp11-0.4.6.tar.gz +/libp11-0.4.7.tar.gz diff --git a/libp11-0.4.0-paths.patch b/libp11-0.4.0-paths.patch deleted file mode 100644 index 325e779..0000000 --- a/libp11-0.4.0-paths.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/examples/listkeys.c b/examples/listkeys.c -index 5e4249b..38e16b9 100644 ---- a/examples/listkeys.c -+++ b/examples/listkeys.c -@@ -77,13 +77,6 @@ int main(int argc, char *argv[]) - printf("Slot token model.......: %s\n", slot->token->model); - printf("Slot token serialnr....: %s\n", slot->token->serialnr); - -- /* get public keys */ -- rc = PKCS11_enumerate_public_keys(slot->token, &keys, &nkeys); -- error_queue("PKCS11_enumerate_public_keys"); -- CHECK_ERR(rc < 0, "PKCS11_enumerate_public_keys failed", 4); -- CHECK_ERR(nkeys == 0, "No public keys found", 5); -- list_keys("Public keys", keys, nkeys); -- - if (slot->token->loginRequired && argc > 2) { - strcpy(password, argv[2]); - /* perform pkcs #11 login */ -@@ -93,6 +86,13 @@ int main(int argc, char *argv[]) - CHECK_ERR(rc < 0, "PKCS11_login failed", 6); - } - -+ /* get public keys */ -+ rc = PKCS11_enumerate_public_keys(slot->token, &keys, &nkeys); -+ error_queue("PKCS11_enumerate_public_keys"); -+ CHECK_ERR(rc < 0, "PKCS11_enumerate_public_keys failed", 4); -+ CHECK_ERR(nkeys == 0, "No public keys found", 5); -+ list_keys("Public keys", keys, nkeys); -+ - /* get private keys */ - rc = PKCS11_enumerate_keys(slot->token, &keys, &nkeys); - error_queue("PKCS11_enumerate_keys"); - diff --git a/libp11-0.4.2-openssl.patch b/libp11-0.4.2-openssl.patch deleted file mode 100644 index abaa240..0000000 --- a/libp11-0.4.2-openssl.patch +++ /dev/null @@ -1,75 +0,0 @@ -diff --git a/src/eng_front.c b/src/eng_front.c -index d170604..c4fac6d 100644 ---- a/src/eng_front.c -+++ b/src/eng_front.c -@@ -68,7 +68,9 @@ - #include <openssl/crypto.h> - #include <openssl/objects.h> - #include <openssl/engine.h> --#include <openssl/dso.h> -+#if OPENSSL_VERSION_NUMBER < 0x10100000L -+# include <openssl/dso.h> -+#endif - #ifndef ENGINE_CMD_BASE - #error did not get engine.h - #endif -diff --git a/src/p11_ec.c b/src/p11_ec.c -index dd1742e..d2966cc 100644 ---- a/src/p11_ec.c -+++ b/src/p11_ec.c -@@ -278,13 +278,19 @@ static ECDSA_SIG *pkcs11_ecdsa_sign_sig(const unsigned char *dgst, int dlen, - if (sig == NULL) - return NULL; - #if OPENSSL_VERSION_NUMBER >= 0x10100000L -- ECDSA_SIG_get0(&r, &s, sig); -+ r = BN_new(); -+ s = BN_new(); - #else - r = sig->r; - s = sig->s; - #endif -+ - BN_bin2bn(sigret, siglen/2, r); - BN_bin2bn(sigret + siglen/2, siglen/2, s); -+ -+#if OPENSSL_VERSION_NUMBER >= 0x10100000L -+ ECDSA_SIG_set0(sig, r, s); -+#endif - return sig; - } - -diff --git a/src/p11_key.c b/src/p11_key.c -index 3a38907..65667c2 100644 ---- a/src/p11_key.c -+++ b/src/p11_key.c -@@ -223,7 +223,7 @@ static int pkcs11_store_key(PKCS11_TOKEN * token, EVP_PKEY * pk, - CK_ATTRIBUTE attrs[32]; - unsigned int n = 0; - int rv; -- BIGNUM *rsa_n, *rsa_e, *rsa_d, *rsa_p, *rsa_q; -+ const BIGNUM *rsa_n, *rsa_e, *rsa_d, *rsa_p, *rsa_q; - - /* First, make sure we have a session */ - if (!spriv->haveSession && PKCS11_open_session(slot, 1)) -diff --git a/src/p11_rsa.c b/src/p11_rsa.c -index e36bc76..f0aa822 100644 ---- a/src/p11_rsa.c -+++ b/src/p11_rsa.c -@@ -271,7 +271,7 @@ static EVP_PKEY *pkcs11_get_evp_key_rsa(PKCS11_KEY *key) - int pkcs11_get_key_modulus(PKCS11_KEY *key, BIGNUM **bn) - { - RSA *rsa = pkcs11_rsa(key); -- BIGNUM *rsa_n; -+ const BIGNUM *rsa_n; - - if (rsa == NULL) - return 0; -@@ -288,7 +288,7 @@ int pkcs11_get_key_modulus(PKCS11_KEY *key, BIGNUM **bn) - int pkcs11_get_key_exponent(PKCS11_KEY *key, BIGNUM **bn) - { - RSA *rsa = pkcs11_rsa(key); -- BIGNUM *rsa_e; -+ const BIGNUM *rsa_e; - - if (rsa == NULL) - return 0; diff --git a/libp11-0.4.2-soname.patch b/libp11-0.4.2-soname.patch deleted file mode 100644 index 22e5a2e..0000000 --- a/libp11-0.4.2-soname.patch +++ /dev/null @@ -1,80 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 2f79b80..c56acf9 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2,6 +2,7 @@ dnl -*- mode: m4; -*- - - AC_PREREQ(2.60) - -+# When bumping versions see also the LT vesion numbers below. - define([PACKAGE_VERSION_MAJOR], [0]) - define([PACKAGE_VERSION_MINOR], [4]) - define([PACKAGE_VERSION_FIX], [2]) -@@ -17,15 +18,6 @@ LIBP11_VERSION_MAJOR="PACKAGE_VERSION_MAJOR" - LIBP11_VERSION_MINOR="PACKAGE_VERSION_MINOR" - LIBP11_VERSION_FIX="PACKAGE_VERSION_FIX" - --# LT Version numbers, remember to change them just *before* a release. --# (Code changed: REVISION++) --# (Oldest interface removed: OLDEST++) --# (Interfaces added: CURRENT++, REVISION=0) --LIBP11_LT_CURRENT="6" --LIBP11_LT_OLDEST="2" --LIBP11_LT_REVISION="2" --LIBP11_LT_AGE="$((${LIBP11_LT_CURRENT}-${LIBP11_LT_OLDEST}))" -- - AC_CONFIG_SRCDIR([src/libp11.h]) - - # silent build by default -@@ -36,6 +28,35 @@ AC_PROG_CC - PKG_PROG_PKG_CONFIG - AC_C_BIGENDIAN - -+# we need to set our soversion based on openssl's soversion to avoid -+# issues with applications linking to new openssl, old libp11, and vice versa -+case "`$PKG_CONFIG --modversion --silence-errors libcrypto || \ -+ $PKG_CONFIG --modversion openssl`" in -+ 1.1.*) # Predicted engines directory prefix for OpenSSL 1.1.x -+ LIBP11_LT_OLDEST="3" -+ debian_ssl_prefix="openssl-1.1.0";; -+ 1.0.*) # Engines directory prefix for OpenSSL 1.0.x -+ LIBP11_LT_OLDEST="2" -+ debian_ssl_prefix="openssl-1.0.0";; -+ *) # Engines directory prefix for OpenSSL 0.9.x -+ LIBP11_LT_OLDEST="2" -+ debian_ssl_prefix="ssl";; -+esac -+ -+ -+# LT Version numbers, remember to change them just *before* a release. -+# (Code changed: REVISION++) -+# (Oldest interface removed: OLDEST++) -+# (Interfaces added: CURRENT++, REVISION=0) -+# -+# Note that at this moment we tie the oldest (soname) version to -+# the openssl version we link to. If the ABI is broken on a later -+# release, we should either stick to supporting a single openssl ABI -+# or bump the LT_OLDEST version sufficiently to avoid clashes. -+LIBP11_LT_REVISION="2" -+LIBP11_LT_CURRENT="6" -+LIBP11_LT_AGE="$((${LIBP11_LT_CURRENT}-${LIBP11_LT_OLDEST}))" -+ - gl_LD_VERSION_SCRIPT - - AC_ARG_WITH( -@@ -108,15 +129,6 @@ AC_ARG_WITH( - if test "${enginesdir}" = ""; then - libcryptodir="`$PKG_CONFIG --variable=libdir --silence-errors libcrypto || \ - $PKG_CONFIG --variable=libdir openssl`" -- case "`$PKG_CONFIG --modversion --silence-errors libcrypto || \ -- $PKG_CONFIG --modversion openssl`" in -- 1.1.*) # Predicted engines directory prefix for OpenSSL 1.1.x -- debian_ssl_prefix="openssl-1.1.0";; -- 1.0.*) # Engines directory prefix for OpenSSL 1.0.x -- debian_ssl_prefix="openssl-1.0.0";; -- *) # Engines directory prefix for OpenSSL 0.9.x -- debian_ssl_prefix="ssl";; -- esac - if test -d "$libcryptodir/$debian_ssl_prefix/engines"; then - # Debian-based OpenSSL package (for example Ubuntu) - enginesdir="$libcryptodir/$debian_ssl_prefix/engines" diff --git a/libp11-0.4.2-versioned-symbols.patch b/libp11-0.4.2-versioned-symbols.patch deleted file mode 100644 index eb25b0d..0000000 --- a/libp11-0.4.2-versioned-symbols.patch +++ /dev/null @@ -1,106 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index a69e230..2f79b80 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -36,6 +36,8 @@ AC_PROG_CC - PKG_PROG_PKG_CONFIG - AC_C_BIGENDIAN - -+gl_LD_VERSION_SCRIPT -+ - AC_ARG_WITH( - [cygwin-native], - [AS_HELP_STRING([--with-cygwin-native],[compile native win32])], -@@ -221,6 +223,18 @@ if test "${enable_strict}" = "yes"; then - CFLAGS="${CFLAGS} -Wall -Wextra" - fi - -+rm -f src/libp11.map -+echo "LIBP11_${LIBP11_LT_OLDEST}" > src/libp11.map -+echo "{" >> src/libp11.map -+echo "global:" >> src/libp11.map -+tr '\n' ';' <src/libp11.exports >>src/libp11.map -+echo "" >> src/libp11.map -+echo "local:" >> src/libp11.map -+echo '*;' >> src/libp11.map -+echo "};" >> src/libp11.map -+ -+chmod ugo-w src/libp11.map -+ - AC_CONFIG_FILES([ - Makefile - src/Makefile -diff --git a/m4/ld-version-script.m4 b/m4/ld-version-script.m4 -new file mode 100644 -index 0000000..330c2cc ---- /dev/null -+++ b/m4/ld-version-script.m4 -@@ -0,0 +1,48 @@ -+# ld-version-script.m4 serial 4 -+dnl Copyright (C) 2008-2016 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+ -+dnl From Simon Josefsson -+ -+# FIXME: The test below returns a false positive for mingw -+# cross-compiles, 'local:' statements does not reduce number of -+# exported symbols in a DLL. Use --disable-ld-version-script to work -+# around the problem. -+ -+# gl_LD_VERSION_SCRIPT -+# -------------------- -+# Check if LD supports linker scripts, and define automake conditional -+# HAVE_LD_VERSION_SCRIPT if so. -+AC_DEFUN([gl_LD_VERSION_SCRIPT], -+[ -+ AC_ARG_ENABLE([ld-version-script], -+ [AS_HELP_STRING([--enable-ld-version-script], -+ [enable linker version script (default is enabled when possible)])], -+ [have_ld_version_script=$enableval], -+ [AC_CACHE_CHECK([if LD -Wl,--version-script works], -+ [gl_cv_sys_ld_version_script], -+ [gl_cv_sys_ld_version_script=no -+ save_LDFLAGS=$LDFLAGS -+ LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" -+ echo foo >conftest.map -+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], -+ [], -+ [cat > conftest.map <<EOF -+VERS_1 { -+ global: sym; -+}; -+ -+VERS_2 { -+ global: sym; -+} VERS_1; -+EOF -+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], -+ [gl_cv_sys_ld_version_script=yes])]) -+ rm -f conftest.map -+ LDFLAGS=$save_LDFLAGS]) -+ have_ld_version_script=$gl_cv_sys_ld_version_script]) -+ AM_CONDITIONAL([HAVE_LD_VERSION_SCRIPT], -+ [test "$have_ld_version_script" = yes]) -+]) -diff --git a/src/Makefile.am b/src/Makefile.am -index c39266b..8f6df08 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -22,8 +22,13 @@ endif - libp11_la_CFLAGS = $(AM_CFLAGS) $(OPENSSL_CFLAGS) - libp11_la_LIBADD = $(OPENSSL_LIBS) - libp11_la_LDFLAGS = $(AM_LDFLAGS) \ -- -version-info @LIBP11_LT_CURRENT@:@LIBP11_LT_REVISION@:@LIBP11_LT_AGE@ \ -- -export-symbols "$(srcdir)/libp11.exports" -+ -version-info @LIBP11_LT_CURRENT@:@LIBP11_LT_REVISION@:@LIBP11_LT_AGE@ -+ -+if HAVE_LD_VERSION_SCRIPT -+libp11_la_LDFLAGS += -Wl,--version-script="$(srcdir)/libp11.map" -+else -+libp11_la_LDFLAGS += -export-symbols "$(srcdir)/libp11.exports" -+endif - - pkcs11_la_SOURCES = eng_front.c eng_back.c eng_parse.c engine.h pkcs11.exports - if WIN32 diff --git a/libp11.spec b/libp11.spec index 2db05b9..c522446 100644 --- a/libp11.spec +++ b/libp11.spec @@ -1,10 +1,12 @@ # This spec file has been automatically updated -Version: 0.4.6 -Release: 3%{?dist} -Patch1: libp11-0.4.0-paths.patch -Patch2: libp11-0.4.2-soname.patch -Patch3: libp11-0.4.2-openssl.patch -Patch4: libp11-0.4.2-versioned-symbols.patch +Version: 0.4.7 +Release: 1%{?dist} +%if 0%{?fedora} >= 26 +%define enginesdir %{_libdir}/engines-1.1 +%else +%define enginesdir %{_libdir}/openssl/engines +%endif + Name: libp11 Summary: Library for using PKCS#11 modules
@@ -19,23 +21,23 @@ BuildRequires: doxygen graphviz BuildRequires: libtool-ltdl-devel BuildRequires: openssl-devel BuildRequires: pkgconfig +%if 0%{?fedora} BuildRequires: autoconf automake libtool # needed for testsuite BuildRequires: softhsm opensc +%else +%ifnarch ppc ppc64 ppc64le +BuildRequires: softhsm opensc +%endif +%endif +
%description Libp11 is a library implementing a small layer on top of PKCS#11 API to make using PKCS#11 implementations easier.
-%package devel -Summary: Files for developing with %{name} -Group: Development/Libraries -Requires: %{name} = %{version}-%{release} -Conflicts: compat-openssl10-devel < 1:1.1.0 - -%description devel -The %{name}-devel package contains libraries and header files for -developing applications that use %{name}. +## We no longer ship libp11-devel; we treat libp11 as an internal library. +## OpenSSL applications should use the engine instead.
%package -n engine_pkcs11 Summary: A PKCS#11 engine for use with OpenSSL @@ -44,10 +46,17 @@ License: BSD
BuildRequires: openssl-devel pkgconfig BuildRequires: pkgconfig(p11-kit-1) +%if 0%{?fedora} +BuildRequires: softhsm opensc +Recommends: p11-kit-trust +%else +%ifnarch ppc ppc64 ppc64le BuildRequires: softhsm opensc +Requires: p11-kit-trust +%endif +%endif Requires: openssl > 0.9.6 Requires: %{name} = %{version}-%{release} -Recommends: p11-kit-trust
%description -n engine_pkcs11 Engine_pkcs11 is an implementation of an engine for OpenSSL. It can be loaded @@ -59,12 +68,14 @@ cards and software for using smart cards in PKCS#11 format, such as OpenSC. %setup -q
%build +%if 0%{?fedora} autoreconf -fvi -%configure --disable-static --enable-api-doc --with-enginesdir=%{_libdir}/engines-1.1 +%endif +%configure --disable-static --enable-api-doc --with-enginesdir=%{enginesdir} make V=1 %{?_smp_mflags}
%install -mkdir -p $RPM_BUILD_ROOT%{_libdir}/engines-1.1 +mkdir -p $RPM_BUILD_ROOT%{enginesdir} #make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" make install DESTDIR=$RPM_BUILD_ROOT
@@ -75,13 +86,20 @@ rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/
# Remove libtool .la files rm -f $RPM_BUILD_ROOT%{_libdir}/*.la -rm -f $RPM_BUILD_ROOT%{_libdir}/engines-1.1/*.la +rm -f $RPM_BUILD_ROOT%{enginesdir}/*.la + +## Remove development files +rm -f $RPM_BUILD_ROOT%{_libdir}/libp11.so +rm -f $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libp11.pc +rm -f $RPM_BUILD_ROOT%{_includedir}/*.h
%clean rm -rf $RPM_BUILD_ROOT
%check +%if 0%{?fedora} make check %{?_smp_mflags} +%endif
%post -p /sbin/ldconfig
@@ -92,19 +110,15 @@ make check %{?_smp_mflags} %doc COPYING NEWS %{_libdir}/libp11.so.*
-%files devel -%defattr(-,root,root,-) -%doc examples/ __docdir/api/ -%{_libdir}/libp11.so -%{_libdir}/pkgconfig/libp11.pc -%{_includedir}/libp11.h - %files -n engine_pkcs11 %defattr(-,root,root,-) %doc NEWS -%{_libdir}/engines-1.1/*.so +%{enginesdir}/*.so
%changelog +* Fri Oct 06 2017 Nikos Mavrogiannopoulos nmav@redhat.com - 0.4.7-1 +- Update to upstream 0.4.7 release + * Thu Aug 03 2017 Fedora Release Engineering releng@fedoraproject.org - 0.4.6-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
diff --git a/sources b/sources index 57af083..51247ca 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libp11-0.4.6.tar.gz) = fe335c0670befe0f9be541f1751f96aab4ef9572ae2ba67edd73d019ffe9cfdcff110667e6ecabf3591cd7c64bf57bc1feedd2aad879e8dd16f545ebf81e2a9f +SHA512 (libp11-0.4.7.tar.gz) = 8142b32bee9e6763b506b93be788a4df2b28ae8cb3ad6e11fc53ba3db770d77bdcc0362661c2f906cab1b5afc2828019f3d0f0b9d898414c0d6266201b7e08e6
arch-excludes@lists.fedoraproject.org