Bump buildroot to 2019.02

This commit is contained in:
2019-03-28 22:49:48 +01:00
parent 5598b1b762
commit 920d307141
5121 changed files with 78550 additions and 46132 deletions

View File

@@ -1,31 +0,0 @@
From b56deda7c13c257050fdbdd71c1a5a47b78aa63e Mon Sep 17 00:00:00 2001
From: Stephan Mueller <smueller@chronox.de>
Date: Thu, 3 Aug 2017 17:50:51 +0200
Subject: [PATCH] Have sufficient memory size for message
With GCC 7, the size of the buffer in snprintf is checked. The
occurrence here is found to be too small.
Signed-off-by: Stephan Mueller <smueller@chronox.de>
[Upstream commit: https://github.com/smuellerDD/libkcapi/commit/b56deda7c13c257050fdbdd71c1a5a47b78aa63e]
Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
---
speed-test/cryptoperf-base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/speed-test/cryptoperf-base.c b/speed-test/cryptoperf-base.c
index 8766ca7..07384ae 100644
--- a/speed-test/cryptoperf-base.c
+++ b/speed-test/cryptoperf-base.c
@@ -172,7 +172,7 @@ char *cp_print_status(struct cp_test *test, int raw)
(unsigned long)(processed_bytes/totaltime),
(unsigned long)ops);
} else {
- #define VALLEN 10
+ #define VALLEN 23
char byteseconds[VALLEN + 1];
memset(byteseconds, 0, sizeof(byteseconds));
--
2.7.4

View File

@@ -0,0 +1,54 @@
From dcb02c1639c2ff05938c01eaa41286a2e2f8d698 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Sun, 20 Jan 2019 20:04:13 +0100
Subject: [PATCH] apps/kcapi-hasher.c: fix build with gcc 8.2.x
Fixes:
- http://autobuild.buildroot.org/results/8355bc42238e885f7f11ed3d9d37fc55ebdead2b
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Upstream status: https://github.com/smuellerDD/libkcapi/pull/76]
---
apps/kcapi-hasher.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/apps/kcapi-hasher.c b/apps/kcapi-hasher.c
index d6be685..7172b12 100644
--- a/apps/kcapi-hasher.c
+++ b/apps/kcapi-hasher.c
@@ -357,16 +357,20 @@ out:
}
/*
- * GCC v8.1.0 introduced -Wstringop-truncation but it is not smart enough to
- * find that cursor string will be NULL-terminated after all paste() calls and
- * warns with:
+ * GCC v8.1.0 introduced -Wstringop-truncation and GCC v8.2.0 introduced
+ * -Wstringop-overflow but it is not smart enough to find that cursor string
+ * will be NULL-terminated after all paste() calls and warns with:
* error: 'strncpy' destination unchanged after copying no bytes [-Werror=stringop-truncation]
* error: 'strncpy' output truncated before terminating nul copying 5 bytes from a string of the same length [-Werror=stringop-truncation]
+ * error: 'strncpy' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
*/
#pragma GCC diagnostic push
#if GCC_VERSION >= 80100
#pragma GCC diagnostic ignored "-Wstringop-truncation"
#endif
+#if GCC_VERSION >= 80200
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#endif
static char *paste(char *dst, const char *src, size_t size)
{
strncpy(dst, src, size);
@@ -417,7 +421,7 @@ static char *get_hmac_file(const char *filename, const char *checkdir)
strncpy(cursor, "\0", 1);
return checkfile;
}
-#pragma GCC diagnostic pop /* -Wstringop-truncation */
+#pragma GCC diagnostic pop /* -Wstringop-truncation -Wstringop-overflow */
static int hash_files(const struct hash_params *params,
char *filenames[], uint32_t files,
--
2.14.1

View File

@@ -1,35 +0,0 @@
From 217b154a5f65d46064ceb69ce69664105e703a74 Mon Sep 17 00:00:00 2001
From: Stephan Mueller <smueller@chronox.de>
Date: Thu, 3 Aug 2017 17:52:48 +0200
Subject: [PATCH] Do not compile unused functions
GCC 7 now rightfully complains about unused functions.
Signed-off-by: Stephan Mueller <smueller@chronox.de>
[Upstream commit: https://github.com/smuellerDD/libkcapi/commit/217b154a5f65d46064ceb69ce69664105e703a74]
Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
---
apps/kcapi-rng.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/apps/kcapi-rng.c b/apps/kcapi-rng.c
index df7decf..e15edf9 100644
--- a/apps/kcapi-rng.c
+++ b/apps/kcapi-rng.c
@@ -45,6 +45,7 @@ struct kcapi_handle *rng = NULL;
unsigned int Verbosity = 0;
char *rng_name = NULL;
+#ifndef HAVE_GETRANDOM
static int read_complete(int fd, uint8_t *buf, uint32_t buflen)
{
ssize_t ret;
@@ -76,6 +77,7 @@ static int read_random(uint8_t *buf, uint32_t buflen)
close(fd);
return ret;
}
+#endif
static int get_random(uint8_t *buf, uint32_t buflen)
{

View File

@@ -1,132 +0,0 @@
From 450dfb09ee72ffedea8f2a25fdce17295f01f62f Mon Sep 17 00:00:00 2001
From: Stephan Mueller <smueller@chronox.de>
Date: Tue, 8 Aug 2017 10:04:06 +0200
Subject: [PATCH] Unify code to read from seed sources
Remove the code duplication for FD reads and syscall reads.
This patch also fixes the use of __NR_getrandom resolution.
[Upstream commit: https://github.com/smuellerDD/libkcapi/commit/450dfb09ee72ffedea8f2a25fdce17295f01f62f]
Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
---
apps/kcapi-rng.c | 71 +++++++++++++++++++++++++-------------------------------
1 file changed, 32 insertions(+), 39 deletions(-)
diff --git a/apps/kcapi-rng.c b/apps/kcapi-rng.c
index e15edf9..96da111 100644
--- a/apps/kcapi-rng.c
+++ b/apps/kcapi-rng.c
@@ -17,7 +17,9 @@
* DAMAGE.
*/
+#define _GNU_SOURCE
#include <unistd.h>
+#include <sys/syscall.h>
#include <errno.h>
#include <limits.h>
#include <stdint.h>
@@ -41,56 +43,48 @@
/* Minimum seed is 256 bits. */
#define KCAPI_RNG_MINSEEDSIZE 32
-struct kcapi_handle *rng = NULL;
-unsigned int Verbosity = 0;
-char *rng_name = NULL;
+static struct kcapi_handle *rng = NULL;
+static unsigned int Verbosity = 0;
+static char *rng_name = NULL;
-#ifndef HAVE_GETRANDOM
-static int read_complete(int fd, uint8_t *buf, uint32_t buflen)
+#if !defined(HAVE_GETRANDOM) && !defined(__NR_getrandom)
+static int random_fd = -1;
+static int open_random(void)
{
- ssize_t ret;
+ random_fd = open("/dev/urandom", O_RDONLY|O_CLOEXEC);
+ if (0 > random_fd)
+ return random_fd;
- do {
- ret = read(fd, buf, buflen);
- if (0 < ret) {
- buflen -= ret;
- buf += ret;
- }
- } while ((0 < ret || EINTR == errno || ERESTART == errno)
- && buflen > 0);
-
- if (buflen == 0)
- return 0;
- return 1;
+ return 0;
}
-static int read_random(uint8_t *buf, uint32_t buflen)
+static void close_random(void)
{
- int fd;
- int ret = 0;
-
- fd = open("/dev/urandom", O_RDONLY|O_CLOEXEC);
- if (0 > fd)
- return fd;
-
- ret = read_complete(fd, buf, buflen);
- close(fd);
- return ret;
+ close(random_fd);
}
#endif
static int get_random(uint8_t *buf, uint32_t buflen)
{
+ ssize_t ret;
+
if (buflen > INT_MAX)
return 1;
+#if (!defined(HAVE_GETRANDOM) && !defined(__NR_getrandom))
+ ret = open_random();
+ if (ret)
+ return ret;
+#endif
+
+ do {
#ifdef HAVE_GETRANDOM
- return getrandom(buf, buflen, 0);
+ ret = getrandom(buf, buflen, 0);
+#elif defined __NR_getrandom
+ ret = syscall(__NR_getrandom, buf, buflen, 0);
#else
-# ifdef __NR_getrandom
- do {
- int ret = syscall(__NR_getrandom, buf, buflen, 0);
-
+ ret = read(random_fd, buf, buflen);
+#endif
if (0 < ret) {
buflen -= ret;
buf += ret;
@@ -98,14 +92,13 @@ static int get_random(uint8_t *buf, uint32_t buflen)
} while ((0 < ret || EINTR == errno || ERESTART == errno)
&& buflen > 0);
+#if (!defined(HAVE_GETRANDOM) && !defined(__NR_getrandom))
+ close_random();
+#endif
+
if (buflen == 0)
return 0;
-
return 1;
-# else
- return read_random(buf, buflen);
-# endif
-#endif
}
static void usage(void)

View File

@@ -1,103 +0,0 @@
From 2b9e01ee31c1b7596b19f0c89954e93e217b0479 Mon Sep 17 00:00:00 2001
From: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Date: Thu, 21 Sep 2017 10:16:33 +0200
Subject: [PATCH] internal.h: make inline functions static
With some GCC configurations/build options it is possible for gcc to
ignore the inline hint. As the methods are not declared static, gcc
expects a definition to be provided elsewhere, which is not the case
here resulting in the following linker error:
libtool: link: /home/marcin/br-test-pkg/br-arm-cortex-a9-glibc/host/bin/arm-linux-gcc
-fstack-protector-strong -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64 -Os -Wl,-z -Wl,relro -Wl,-z -Wl,now -o bin/kcapi
test/bin_kcapi-kcapi-main.o ./.libs/libkcapi.so -Wl,-rpath
-Wl,/home/marcin/br-test-pkg/br-arm-cortex-a9-glibc/build/libkcapi-0.14.0/.libs
./.libs/libkcapi.so: undefined reference to `_kcapi_common_vmsplice_iov'
./.libs/libkcapi.so: undefined reference to `_kcapi_common_read_data'
./.libs/libkcapi.so: undefined reference to `_kcapi_aio_read_iov'
./.libs/libkcapi.so: undefined reference to `_kcapi_common_recv_data'
./.libs/libkcapi.so: undefined reference to `_kcapi_common_send_data'
./.libs/libkcapi.so: undefined reference to `_kcapi_common_vmsplice_chunk'
./.libs/libkcapi.so: undefined reference to `_kcapi_common_send_meta'
collect2: error: ld returned 1 exit status
$ arm-linux-gcc --version
arm-linux-gcc.br_real (Buildroot 2017.08-git-01078-g95b1dae) 7.1.0
Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Signed-off-by: Stephan Mueller <smueller@chronox.de>
[Upstream commit: https://github.com/smuellerDD/libkcapi/commit/2b9e01ee31c1b7596b19f0c89954e93e217b0479]
Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
---
lib/internal.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/lib/internal.h b/lib/internal.h
index 0d98f24..addf450 100644
--- a/lib/internal.h
+++ b/lib/internal.h
@@ -233,7 +233,7 @@ void kcapi_dolog(int severity, const char *fmt, ...);
int32_t _kcapi_common_send_meta_fd(struct kcapi_handle *handle, int *fdptr,
struct iovec *iov, uint32_t iovlen,
uint32_t enc, uint32_t flags);
-inline int32_t _kcapi_common_send_meta(struct kcapi_handle *handle,
+static inline int32_t _kcapi_common_send_meta(struct kcapi_handle *handle,
struct iovec *iov, uint32_t iovlen,
uint32_t enc, uint32_t flags)
{
@@ -244,7 +244,7 @@ inline int32_t _kcapi_common_send_meta(struct kcapi_handle *handle,
int32_t _kcapi_common_vmsplice_iov_fd(struct kcapi_handle *handle, int *fdptr,
struct iovec *iov, unsigned long iovlen,
uint32_t flags);
-inline int32_t _kcapi_common_vmsplice_iov(struct kcapi_handle *handle,
+static inline int32_t _kcapi_common_vmsplice_iov(struct kcapi_handle *handle,
struct iovec *iov, unsigned long iovlen,
uint32_t flags)
{
@@ -255,7 +255,7 @@ inline int32_t _kcapi_common_vmsplice_iov(struct kcapi_handle *handle,
int32_t _kcapi_common_send_data_fd(struct kcapi_handle *handle, int *fdprt,
struct iovec *iov, uint32_t iovlen,
uint32_t flags);
-inline int32_t _kcapi_common_send_data(struct kcapi_handle *handle,
+static inline int32_t _kcapi_common_send_data(struct kcapi_handle *handle,
struct iovec *iov, uint32_t iovlen,
uint32_t flags)
{
@@ -265,7 +265,7 @@ inline int32_t _kcapi_common_send_data(struct kcapi_handle *handle,
int32_t _kcapi_common_recv_data_fd(struct kcapi_handle *handle, int *fdptr,
struct iovec *iov, uint32_t iovlen);
-inline int32_t _kcapi_common_recv_data(struct kcapi_handle *handle,
+static inline int32_t _kcapi_common_recv_data(struct kcapi_handle *handle,
struct iovec *iov, uint32_t iovlen)
{
return _kcapi_common_recv_data_fd(handle, &handle->opfd, iov, iovlen);
@@ -273,7 +273,7 @@ inline int32_t _kcapi_common_recv_data(struct kcapi_handle *handle,
int32_t _kcapi_common_read_data_fd(struct kcapi_handle *handle, int *fdptr,
uint8_t *out, uint32_t outlen);
-inline int32_t _kcapi_common_read_data(struct kcapi_handle *handle,
+static inline int32_t _kcapi_common_read_data(struct kcapi_handle *handle,
uint8_t *out, uint32_t outlen)
{
return _kcapi_common_read_data_fd(handle, &handle->opfd, out, outlen);
@@ -285,7 +285,7 @@ int _kcapi_common_close(struct kcapi_handle *handle, int fdptr);
int32_t _kcapi_common_vmsplice_chunk_fd(struct kcapi_handle *handle, int *fdptr,
const uint8_t *in, uint32_t inlen,
uint32_t flags);
-inline int32_t _kcapi_common_vmsplice_chunk(struct kcapi_handle *handle,
+static inline int32_t _kcapi_common_vmsplice_chunk(struct kcapi_handle *handle,
const uint8_t *in, uint32_t inlen,
uint32_t flags)
{
@@ -315,7 +315,7 @@ int _kcapi_aio_send_iov(struct kcapi_handle *handle, struct iovec *iov,
int32_t _kcapi_aio_read_iov_fd(struct kcapi_handle *handle, int *fdptr,
struct iovec *iov, uint32_t iovlen);
-inline int32_t _kcapi_aio_read_iov(struct kcapi_handle *handle,
+static inline int32_t _kcapi_aio_read_iov(struct kcapi_handle *handle,
struct iovec *iov, uint32_t iovlen)
{
return _kcapi_aio_read_iov_fd(handle, &handle->opfd, iov, iovlen);

View File

@@ -1,5 +1,6 @@
config BR2_PACKAGE_LIBKCAPI
bool "libkcapi"
depends on BR2_TOOLCHAIN_HAS_SYNC_4
help
Linux Kernel Crypto API userspace interface library
@@ -7,11 +8,21 @@ config BR2_PACKAGE_LIBKCAPI
if BR2_PACKAGE_LIBKCAPI
config BR2_PACKAGE_LIBKCAPI_APPS
bool "build test applications"
config BR2_PACKAGE_LIBKCAPI_HASHER
bool "build hasher application"
depends on !BR2_STATIC_LIBS # dlfcn.h
comment "hasher application needs a toolchain w/ dynamic library"
depends on BR2_STATIC_LIBS
config BR2_PACKAGE_LIBKCAPI_RNGAPP
bool "build rng read application"
config BR2_PACKAGE_LIBKCAPI_SPEED
bool "build speed-test program"
config BR2_PACKAGE_LIBKCAPI_TEST
bool "build test program"
depends on BR2_USE_MMU # fork()
help
Build additional test applications that can provide
performance or algorithm tests.
endif

View File

@@ -1,2 +1,5 @@
# Locally calculated
sha256 411fc32b3e36ac0268837a8d4538eb8aef487b3a3e9b21a2b88b8ed2f926edf3 libkcapi-0.14.0.tar.xz
sha256 9197f35aca270f97c544fe94dab379b44a2879a07eb78acd5d02c55924902763 libkcapi-1.1.4.tar.xz
sha256 c6b8402a68999b0f84560ab43cdf60f9ff33c4a9a8ced6a40db9d3b787ba5b4a COPYING
sha256 e6d6a009505e345fe949e1310334fcb0747f28dae2856759de102ab66b722cb4 COPYING.gplv2
sha256 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.bsd

View File

@@ -4,7 +4,7 @@
#
################################################################################
LIBKCAPI_VERSION = 0.14.0
LIBKCAPI_VERSION = 1.1.4
LIBKCAPI_SOURCE = libkcapi-$(LIBKCAPI_VERSION).tar.xz
LIBKCAPI_SITE = http://www.chronox.de/libkcapi
LIBKCAPI_AUTORECONF = YES
@@ -16,18 +16,28 @@ LIBKCAPI_CONF_ENV = \
ac_cv_path_DB2PS="" \
ac_cv_path_XMLTO=""
ifeq ($(BR2_PACKAGE_LIBKCAPI_APPS),y)
LIBKCAPI_CONF_OPTS += \
--enable-kcapi-speed \
--enable-kcapi-test \
--enable-kcapi-hasher \
--enable-kcapi-rngapp
ifeq ($(BR2_PACKAGE_LIBKCAPI_HASHER),y)
LIBKCAPI_CONF_OPTS += --enable-kcapi-hasher
else
LIBKCAPI_CONF_OPTS += \
--disable-kcapi-speed \
--disable-kcapi-test \
--disable-kcapi-hasher \
--disable-kcapi-rngapp
LIBKCAPI_CONF_OPTS += --disable-kcapi-hasher
endif
ifeq ($(BR2_PACKAGE_LIBKCAPI_RNGAPP),y)
LIBKCAPI_CONF_OPTS += --enable-kcapi-rngapp
else
LIBKCAPI_CONF_OPTS += --disable-kcapi-rngapp
endif
ifeq ($(BR2_PACKAGE_LIBKCAPI_SPEED),y)
LIBKCAPI_CONF_OPTS += --enable-kcapi-speed
else
LIBKCAPI_CONF_OPTS += --disable-kcapi-speed
endif
ifeq ($(BR2_PACKAGE_LIBKCAPI_TEST),y)
LIBKCAPI_CONF_OPTS += --enable-kcapi-test
else
LIBKCAPI_CONF_OPTS += --disable-kcapi-test
endif
$(eval $(autotools-package))