diff options
| -rw-r--r-- | meta-oe/recipes-support/opensc/opensc/0001-Fixed-gcc-8-compilation-errors-1353.patch | 73 | ||||
| -rw-r--r-- | meta-oe/recipes-support/opensc/opensc_0.18.0.bb (renamed from meta-oe/recipes-support/opensc/opensc_0.16.0.bb) | 9 |
2 files changed, 79 insertions, 3 deletions
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 new file mode 100644 index 0000000000..48d8327546 --- /dev/null +++ b/meta-oe/recipes-support/opensc/opensc/0001-Fixed-gcc-8-compilation-errors-1353.patch | |||
| @@ -0,0 +1,73 @@ | |||
| 1 | From 87857d5cae7db94fdd776904886392b1e86053bd Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Florian Bezdeka <1119693+fbezdeka@users.noreply.github.com> | ||
| 3 | Date: Fri, 18 May 2018 18:54:56 +0200 | ||
| 4 | Subject: [PATCH] Fixed gcc 8 compilation errors (#1353) | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | The following errors occured during a compilation using gcc 8: | ||
| 10 | |||
| 11 | In function »gids_create_file.constprop«, | ||
| 12 | inserted by »gids_save_certificate.isra.8« beicard-gids.c:1548:7: | ||
| 13 | card-gids.c:465:2: Error: »strncpy« output may be truncated copying 8 bytes from a string of length 8 [-Werror=stringop-truncation] | ||
| 14 | strncpy(record->filename, filename, 8); | ||
| 15 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 16 | |||
| 17 | pkcs15-oberthur.c: In function »sc_pkcs15emu_oberthur_add_prvkey«: | ||
| 18 | pkcs15-oberthur.c:741:5: Error: »strncpy« output may be truncated copying 254 bytes from a string of length 254 [-Werror=stringop-truncation] | ||
| 19 | strncpy(kobj.label, objs[ii]->label, sizeof(kobj.label) - 1); | ||
| 20 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 21 | |||
| 22 | Upstream-Status: Backport [https://github.com/OpenSC/OpenSC/pull/1353] | ||
| 23 | Signed-off-by Khem Raj <raj.khem@gmail.com> | ||
| 24 | --- | ||
| 25 | src/libopensc/card-gids.c | 3 ++- | ||
| 26 | src/libopensc/pkcs15-oberthur.c | 3 ++- | ||
| 27 | 2 files changed, 4 insertions(+), 2 deletions(-) | ||
| 28 | |||
| 29 | diff --git a/src/libopensc/card-gids.c b/src/libopensc/card-gids.c | ||
| 30 | index fc5d2a7..ac3e579 100644 | ||
| 31 | --- a/src/libopensc/card-gids.c | ||
| 32 | +++ b/src/libopensc/card-gids.c | ||
| 33 | @@ -33,6 +33,7 @@ Some features are undocumented like the format used to store certificates. They | ||
| 34 | |||
| 35 | #include <stdlib.h> | ||
| 36 | #include <string.h> | ||
| 37 | +#include "../common/compat_strlcpy.h" | ||
| 38 | |||
| 39 | #ifdef ENABLE_OPENSSL | ||
| 40 | /* openssl only needed for card administration */ | ||
| 41 | @@ -462,7 +463,7 @@ static int gids_create_file(sc_card_t *card, char* directory, char* filename) { | ||
| 42 | memset(masterfilebuffer + offset, 0, sizeof(gids_mf_record_t)); | ||
| 43 | record = (gids_mf_record_t*) (masterfilebuffer + offset); | ||
| 44 | strncpy(record->directory, directory, 8); | ||
| 45 | - strncpy(record->filename, filename, 8); | ||
| 46 | + strlcpy(record->filename, filename, sizeof(record->filename)); | ||
| 47 | record->fileIdentifier = fileIdentifier; | ||
| 48 | record->dataObjectIdentifier = dataObjectIdentifier; | ||
| 49 | |||
| 50 | diff --git a/src/libopensc/pkcs15-oberthur.c b/src/libopensc/pkcs15-oberthur.c | ||
| 51 | index 4f841ed..3415be7 100644 | ||
| 52 | --- a/src/libopensc/pkcs15-oberthur.c | ||
| 53 | +++ b/src/libopensc/pkcs15-oberthur.c | ||
| 54 | @@ -29,6 +29,7 @@ | ||
| 55 | #include <stdlib.h> | ||
| 56 | #include <string.h> | ||
| 57 | #include <stdio.h> | ||
| 58 | +#include "../common/compat_strlcpy.h" | ||
| 59 | |||
| 60 | #include "pkcs15.h" | ||
| 61 | #include "log.h" | ||
| 62 | @@ -738,7 +739,7 @@ sc_pkcs15emu_oberthur_add_prvkey(struct sc_pkcs15_card *p15card, | ||
| 63 | unsigned int id = path.value[path.len - 2] * 0x100 + path.value[path.len - 1]; | ||
| 64 | |||
| 65 | if (id == ccont.id_cert) { | ||
| 66 | - strncpy(kobj.label, objs[ii]->label, sizeof(kobj.label) - 1); | ||
| 67 | + strlcpy(kobj.label, objs[ii]->label, sizeof(kobj.label)); | ||
| 68 | break; | ||
| 69 | } | ||
| 70 | } | ||
| 71 | -- | ||
| 72 | 2.18.0 | ||
| 73 | |||
diff --git a/meta-oe/recipes-support/opensc/opensc_0.16.0.bb b/meta-oe/recipes-support/opensc/opensc_0.18.0.bb index fd67181dc2..c389e0bb58 100644 --- a/meta-oe/recipes-support/opensc/opensc_0.16.0.bb +++ b/meta-oe/recipes-support/opensc/opensc_0.18.0.bb | |||
| @@ -9,10 +9,12 @@ eID cards have also been confirmed to work." | |||
| 9 | HOMEPAGE = "http://www.opensc-project.org/opensc/" | 9 | HOMEPAGE = "http://www.opensc-project.org/opensc/" |
| 10 | SECTION = "System Environment/Libraries" | 10 | SECTION = "System Environment/Libraries" |
| 11 | 11 | ||
| 12 | SRC_URI = "${DEBIAN_MIRROR}/main/o/${BPN}/${BPN}_${PV}.orig.tar.gz" | 12 | SRC_URI = "${DEBIAN_MIRROR}/main/o/${BPN}/${BPN}_${PV}.orig.tar.gz \ |
| 13 | file://0001-Fixed-gcc-8-compilation-errors-1353.patch \ | ||
| 14 | " | ||
| 13 | 15 | ||
| 14 | SRC_URI[md5sum] = "724d128f23cd7a74b28d04300ce7bcbd" | 16 | SRC_URI[md5sum] = "bce516f752e0db5327aa06cc0136fe27" |
| 15 | SRC_URI[sha256sum] = "3ac8c29542bb48179e7086d35a1b8907a4e86aca3de3323c2f48bd74eaaf5729" | 17 | SRC_URI[sha256sum] = "6ef62b00e8fdbe3e386c3ee25c2cadb56c1931ea42f1a11dce8c947f51b45033" |
| 16 | 18 | ||
| 17 | DEPENDS = "openct pcsc-lite virtual/libiconv openssl" | 19 | DEPENDS = "openct pcsc-lite virtual/libiconv openssl" |
| 18 | 20 | ||
| @@ -21,6 +23,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34" | |||
| 21 | 23 | ||
| 22 | inherit autotools pkgconfig | 24 | inherit autotools pkgconfig |
| 23 | 25 | ||
| 26 | S = "${WORKDIR}/OpenSC-${PV}" | ||
| 24 | EXTRA_OECONF = " \ | 27 | EXTRA_OECONF = " \ |
| 25 | --disable-static \ | 28 | --disable-static \ |
| 26 | --enable-openct \ | 29 | --enable-openct \ |
