From c011beeaa666cf02f952ef53630a0c2bc80bcc04 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 17 Dec 2018 18:56:15 -0800 Subject: opensc: Upgrade to 0.19.0 Switch fetcher to use github Add patch to build with gcc9 Remove upstreamed patch Inherit bash-completion Signed-off-by: Khem Raj --- .../0001-Fixed-gcc-8-compilation-errors-1353.patch | 73 ---------------------- .../opensc/0001-Remove-redundant-logging.patch | 34 ++++++++++ meta-oe/recipes-support/opensc/opensc_0.18.0.bb | 47 -------------- meta-oe/recipes-support/opensc/opensc_0.19.0.bb | 44 +++++++++++++ 4 files changed, 78 insertions(+), 120 deletions(-) delete mode 100644 meta-oe/recipes-support/opensc/opensc/0001-Fixed-gcc-8-compilation-errors-1353.patch create mode 100644 meta-oe/recipes-support/opensc/opensc/0001-Remove-redundant-logging.patch delete mode 100644 meta-oe/recipes-support/opensc/opensc_0.18.0.bb create mode 100644 meta-oe/recipes-support/opensc/opensc_0.19.0.bb (limited to 'meta-oe/recipes-support/opensc') diff --git a/meta-oe/recipes-support/opensc/opensc/0001-Fixed-gcc-8-compilation-errors-1353.patch b/meta-oe/recipes-support/opensc/opensc/0001-Fixed-gcc-8-compilation-errors-1353.patch deleted file mode 100644 index 48d8327546..0000000000 --- a/meta-oe/recipes-support/opensc/opensc/0001-Fixed-gcc-8-compilation-errors-1353.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 87857d5cae7db94fdd776904886392b1e86053bd Mon Sep 17 00:00:00 2001 -From: Florian Bezdeka <1119693+fbezdeka@users.noreply.github.com> -Date: Fri, 18 May 2018 18:54:56 +0200 -Subject: [PATCH] Fixed gcc 8 compilation errors (#1353) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The following errors occured during a compilation using gcc 8: - -In function »gids_create_file.constprop«, - inserted by »gids_save_certificate.isra.8« beicard-gids.c:1548:7: -card-gids.c:465:2: Error: »strncpy« output may be truncated copying 8 bytes from a string of length 8 [-Werror=stringop-truncation] - strncpy(record->filename, filename, 8); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -pkcs15-oberthur.c: In function »sc_pkcs15emu_oberthur_add_prvkey«: -pkcs15-oberthur.c:741:5: Error: »strncpy« output may be truncated copying 254 bytes from a string of length 254 [-Werror=stringop-truncation] - strncpy(kobj.label, objs[ii]->label, sizeof(kobj.label) - 1); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Upstream-Status: Backport [https://github.com/OpenSC/OpenSC/pull/1353] -Signed-off-by Khem Raj ---- - src/libopensc/card-gids.c | 3 ++- - src/libopensc/pkcs15-oberthur.c | 3 ++- - 2 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/libopensc/card-gids.c b/src/libopensc/card-gids.c -index fc5d2a7..ac3e579 100644 ---- a/src/libopensc/card-gids.c -+++ b/src/libopensc/card-gids.c -@@ -33,6 +33,7 @@ Some features are undocumented like the format used to store certificates. They - - #include - #include -+#include "../common/compat_strlcpy.h" - - #ifdef ENABLE_OPENSSL - /* openssl only needed for card administration */ -@@ -462,7 +463,7 @@ static int gids_create_file(sc_card_t *card, char* directory, char* filename) { - memset(masterfilebuffer + offset, 0, sizeof(gids_mf_record_t)); - record = (gids_mf_record_t*) (masterfilebuffer + offset); - strncpy(record->directory, directory, 8); -- strncpy(record->filename, filename, 8); -+ strlcpy(record->filename, filename, sizeof(record->filename)); - record->fileIdentifier = fileIdentifier; - record->dataObjectIdentifier = dataObjectIdentifier; - -diff --git a/src/libopensc/pkcs15-oberthur.c b/src/libopensc/pkcs15-oberthur.c -index 4f841ed..3415be7 100644 ---- a/src/libopensc/pkcs15-oberthur.c -+++ b/src/libopensc/pkcs15-oberthur.c -@@ -29,6 +29,7 @@ - #include - #include - #include -+#include "../common/compat_strlcpy.h" - - #include "pkcs15.h" - #include "log.h" -@@ -738,7 +739,7 @@ sc_pkcs15emu_oberthur_add_prvkey(struct sc_pkcs15_card *p15card, - unsigned int id = path.value[path.len - 2] * 0x100 + path.value[path.len - 1]; - - if (id == ccont.id_cert) { -- strncpy(kobj.label, objs[ii]->label, sizeof(kobj.label) - 1); -+ strlcpy(kobj.label, objs[ii]->label, sizeof(kobj.label)); - break; - } - } --- -2.18.0 - diff --git a/meta-oe/recipes-support/opensc/opensc/0001-Remove-redundant-logging.patch b/meta-oe/recipes-support/opensc/opensc/0001-Remove-redundant-logging.patch new file mode 100644 index 0000000000..291f1a239a --- /dev/null +++ b/meta-oe/recipes-support/opensc/opensc/0001-Remove-redundant-logging.patch @@ -0,0 +1,34 @@ +From c012f46965b3fe24e31367796e52c2d0b14ca5d9 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 17 Dec 2018 18:44:23 -0800 +Subject: [PATCH] Remove redundant logging + +Same information is printed a few line below in same function, the only +difference is that there it takes care of case when label is NULL pointer +unlike this line + +secondly, every function call to cosm_write_tokeninfo() in this file +passes label=NULL, and then it tries to print a null pointer + +Fixes errors like +src/libopensc/log.h:48:47: error: '%s' directive argument is null +[-Werror=format-overflow=] + +Upstream-Status: Submitted [https://github.com/OpenSC/OpenSC/pull/1557] +Signed-off-by: Khem Raj +--- + src/pkcs15init/pkcs15-oberthur.c | 1 - + 1 file changed, 1 deletion(-) + +Index: git/src/pkcs15init/pkcs15-oberthur.c +=================================================================== +--- git.orig/src/pkcs15init/pkcs15-oberthur.c ++++ git/src/pkcs15init/pkcs15-oberthur.c +@@ -70,7 +70,6 @@ cosm_write_tokeninfo (struct sc_pkcs15_c + ctx = p15card->card->ctx; + + SC_FUNC_CALLED(ctx, SC_LOG_DEBUG_VERBOSE); +- sc_debug(ctx, SC_LOG_DEBUG_NORMAL, "cosm_write_tokeninfo() label '%s'; flags 0x%X", label, flags); + if (sc_profile_get_file(profile, COSM_TITLE"-token-info", &file)) { + rv = SC_ERROR_INCONSISTENT_PROFILE; + SC_TEST_GOTO_ERR(ctx, SC_LOG_DEBUG_NORMAL, rv, "Cannot find "COSM_TITLE"-token-info"); diff --git a/meta-oe/recipes-support/opensc/opensc_0.18.0.bb b/meta-oe/recipes-support/opensc/opensc_0.18.0.bb deleted file mode 100644 index 45c931e7bd..0000000000 --- a/meta-oe/recipes-support/opensc/opensc_0.18.0.bb +++ /dev/null @@ -1,47 +0,0 @@ -SUMMARY = "Smart card library and applications" -DESCRIPTION = "OpenSC is a tool for accessing smart card devices. Basic\ -functionality (e.g. SELECT FILE, READ BINARY) should work on any ISO\ -7816-4 compatible smart card. Encryption and decryption using private\ -keys on the smart card is possible with PKCS\ -such as the FINEID (Finnish Electronic IDentity) card. Swedish Posten\ -eID cards have also been confirmed to work." - -HOMEPAGE = "http://www.opensc-project.org/opensc/" -SECTION = "System Environment/Libraries" - -SRC_URI = "https://snapshot.debian.org/archive/debian/20180521T101428Z/pool/main/o/opensc/opensc_0.18.0.orig.tar.gz \ - file://0001-Fixed-gcc-8-compilation-errors-1353.patch \ - " - -SRC_URI[md5sum] = "bce516f752e0db5327aa06cc0136fe27" -SRC_URI[sha256sum] = "6ef62b00e8fdbe3e386c3ee25c2cadb56c1931ea42f1a11dce8c947f51b45033" - -DEPENDS = "openct pcsc-lite virtual/libiconv openssl" - -LICENSE = "LGPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34" - -inherit autotools pkgconfig - -S = "${WORKDIR}/OpenSC-${PV}" -EXTRA_OECONF = " \ - --disable-static \ - --enable-openct \ - --disable-pcsc \ - --disable-ctapi \ - --disable-doc \ -" -EXTRA_OEMAKE = "DESTDIR=${D}" - -RDEPENDS_${PN} = "readline" - -FILES_${PN} += "\ - ${libdir}/opensc-pkcs11.so \ - ${libdir}/onepin-opensc-pkcs11.so \ - ${libdir}/pkcs11-spy.so \ -" -FILES_${PN}-dev += "\ - ${libdir}/pkcs11/opensc-pkcs11.so \ - ${libdir}/pkcs11/onepin-opensc-pkcs11.so \ - ${libdir}/pkcs11/pkcs11-spy.so \ -" diff --git a/meta-oe/recipes-support/opensc/opensc_0.19.0.bb b/meta-oe/recipes-support/opensc/opensc_0.19.0.bb new file mode 100644 index 0000000000..bc1722e394 --- /dev/null +++ b/meta-oe/recipes-support/opensc/opensc_0.19.0.bb @@ -0,0 +1,44 @@ +SUMMARY = "Smart card library and applications" +DESCRIPTION = "OpenSC is a tool for accessing smart card devices. Basic\ +functionality (e.g. SELECT FILE, READ BINARY) should work on any ISO\ +7816-4 compatible smart card. Encryption and decryption using private\ +keys on the smart card is possible with PKCS\ +such as the FINEID (Finnish Electronic IDentity) card. Swedish Posten\ +eID cards have also been confirmed to work." + +HOMEPAGE = "http://www.opensc-project.org/opensc/" +SECTION = "System Environment/Libraries" +LICENSE = "LGPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34" + +#v0.19.0 +SRCREV = "f1691fc91fc113191c3a8aaf5facd6983334ec47" +SRC_URI = "git://github.com/OpenSC/OpenSC \ + file://0001-Remove-redundant-logging.patch \ + " +DEPENDS = "openct pcsc-lite virtual/libiconv openssl" + +S = "${WORKDIR}/git" +inherit autotools pkgconfig bash-completion + +EXTRA_OECONF = " \ + --disable-static \ + --enable-openct \ + --disable-pcsc \ + --disable-ctapi \ + --disable-doc \ +" +EXTRA_OEMAKE = "DESTDIR=${D}" + +RDEPENDS_${PN} = "readline" + +FILES_${PN} += "\ + ${libdir}/opensc-pkcs11.so \ + ${libdir}/onepin-opensc-pkcs11.so \ + ${libdir}/pkcs11-spy.so \ +" +FILES_${PN}-dev += "\ + ${libdir}/pkcs11/opensc-pkcs11.so \ + ${libdir}/pkcs11/onepin-opensc-pkcs11.so \ + ${libdir}/pkcs11/pkcs11-spy.so \ +" -- cgit 1.2.3-korg