diff options
Diffstat (limited to 'pkg/openbsd/patch')
| -rw-r--r-- | pkg/openbsd/patch/0018-getentropy-Support-BearSSL-SHA512-implementation.patch | 107 | ||||
| -rw-r--r-- | pkg/openbsd/patch/0018-nc-Port-to-linux.patch (renamed from pkg/openbsd/patch/0019-nc-Port-to-linux.patch) | 0 | ||||
| -rw-r--r-- | pkg/openbsd/patch/0019-yacc-Remove-__unused.patch (renamed from pkg/openbsd/patch/0020-yacc-Remove-__unused.patch) | 0 | ||||
| -rw-r--r-- | pkg/openbsd/patch/0020-Add-standalone-freezero.patch (renamed from pkg/openbsd/patch/0021-Add-standalone-freezero.patch) | 0 | ||||
| -rw-r--r-- | pkg/openbsd/patch/0021-m4-Use-hand-written-lexer-to-avoid-cycle-in-bootstra.patch (renamed from pkg/openbsd/patch/0022-m4-Use-hand-written-lexer-to-avoid-cycle-in-bootstra.patch) | 0 | ||||
| -rw-r--r-- | pkg/openbsd/patch/0022-m4-Use-_Noreturn-instead-of-__dead.patch (renamed from pkg/openbsd/patch/0023-m4-Use-_Noreturn-instead-of-__dead.patch) | 0 | ||||
| -rw-r--r-- | pkg/openbsd/patch/0023-m4-Add-missing-includes.patch (renamed from pkg/openbsd/patch/0024-m4-Add-missing-includes.patch) | 0 | ||||
| -rw-r--r-- | pkg/openbsd/patch/0024-libutil-Add-missing-includes.patch (renamed from pkg/openbsd/patch/0025-libutil-Add-missing-includes.patch) | 0 |
8 files changed, 0 insertions, 107 deletions
diff --git a/pkg/openbsd/patch/0018-getentropy-Support-BearSSL-SHA512-implementation.patch b/pkg/openbsd/patch/0018-getentropy-Support-BearSSL-SHA512-implementation.patch deleted file mode 100644 index 5d4c234e..00000000 --- a/pkg/openbsd/patch/0018-getentropy-Support-BearSSL-SHA512-implementation.patch +++ /dev/null @@ -1,107 +0,0 @@ -From 37f2f6274588cad438c6fd6c7b37bd5e5ce3ae20 Mon Sep 17 00:00:00 2001 -From: Michael Forney <mforney@mforney.org> -Date: Sat, 27 May 2017 18:49:33 -0700 -Subject: [PATCH] getentropy: Support BearSSL SHA512 implementation - ---- - lib/libcrypto/arc4random/getentropy_linux.c | 33 ++++++++++++++++++++++++++++- - 1 file changed, 32 insertions(+), 1 deletion(-) - -diff --git a/lib/libcrypto/arc4random/getentropy_linux.c b/lib/libcrypto/arc4random/getentropy_linux.c -index a845239eb3e..6a7fe863abb 100644 ---- a/lib/libcrypto/arc4random/getentropy_linux.c -+++ b/lib/libcrypto/arc4random/getentropy_linux.c -@@ -47,7 +47,13 @@ - #include <errno.h> - #include <unistd.h> - #include <time.h> -+#if defined(USE_OPENSSL) - #include <openssl/sha.h> -+#elif defined(USE_BEARSSL) -+#include <bearssl.h> -+#else -+#error "missing SHA512 implementation" -+#endif - - #include <linux/types.h> - #include <linux/random.h> -@@ -67,9 +73,15 @@ - HD(b); \ - } while (0) - -+#if defined(USE_OPENSSL) - #define HR(x, l) (SHA512_Update(&ctx, (char *)(x), (l))) - #define HD(x) (SHA512_Update(&ctx, (char *)&(x), sizeof (x))) - #define HF(x) (SHA512_Update(&ctx, (char *)&(x), sizeof (void*))) -+#elif defined(USE_BEARSSL) -+#define HR(x, l) (br_sha512_update(&ctx, (char *)(x), (l))) -+#define HD(x) (br_sha512_update(&ctx, (char *)&(x), sizeof (x))) -+#define HF(x) (br_sha512_update(&ctx, (char *)&(x), sizeof (void*))) -+#endif - - int getentropy(void *buf, size_t len); - -@@ -330,16 +342,28 @@ static const int cl[] = { - static int - getentropy_phdr(struct dl_phdr_info *info, size_t size, void *data) - { -+#if defined(USE_OPENSSL) - SHA512_CTX *ctx = data; - - SHA512_Update(ctx, &info->dlpi_addr, sizeof (info->dlpi_addr)); -+#elif defined(USE_BEARSSL) -+ br_sha512_context *ctx = data; -+ -+ br_sha512_update(ctx, &info->dlpi_addr, sizeof (info->dlpi_addr)); -+#endif - return (0); - } - - static int - getentropy_fallback(void *buf, size_t len) - { -+#if defined(USE_OPENSSL) - uint8_t results[SHA512_DIGEST_LENGTH]; -+ SHA512_CTX ctx; -+#elif defined(USE_BEARSSL) -+ uint8_t results[br_sha512_SIZE]; -+ br_sha512_context ctx; -+#endif - int save_errno = errno, e, pgs = getpagesize(), faster = 0, repeat; - static int cnt; - struct timespec ts; -@@ -347,7 +371,6 @@ getentropy_fallback(void *buf, size_t len) - struct rusage ru; - sigset_t sigset; - struct stat st; -- SHA512_CTX ctx; - static pid_t lastpid; - pid_t pid; - size_t i, ii, m; -@@ -364,7 +387,11 @@ getentropy_fallback(void *buf, size_t len) - } - for (i = 0; i < len; ) { - int j; -+#if defined(USE_OPENSSL) - SHA512_Init(&ctx); -+#elif defined(USE_BEARSSL) -+ br_sha512_init(&ctx); -+#endif - for (j = 0; j < repeat; j++) { - HX((e = gettimeofday(&tv, NULL)) == -1, tv); - if (e != -1) { -@@ -535,7 +562,11 @@ getentropy_fallback(void *buf, size_t len) - #endif - #endif - -+#if defined(USE_OPENSSL) - SHA512_Final(results, &ctx); -+#elif defined(USE_BEARSSL) -+ br_sha512_out(&ctx, results); -+#endif - memcpy((char *)buf + i, results, min(sizeof(results), len - i)); - i += min(sizeof(results), len - i); - } --- -2.14.2 - diff --git a/pkg/openbsd/patch/0019-nc-Port-to-linux.patch b/pkg/openbsd/patch/0018-nc-Port-to-linux.patch index 6c9f5182..6c9f5182 100644 --- a/pkg/openbsd/patch/0019-nc-Port-to-linux.patch +++ b/pkg/openbsd/patch/0018-nc-Port-to-linux.patch diff --git a/pkg/openbsd/patch/0020-yacc-Remove-__unused.patch b/pkg/openbsd/patch/0019-yacc-Remove-__unused.patch index d8e49be7..d8e49be7 100644 --- a/pkg/openbsd/patch/0020-yacc-Remove-__unused.patch +++ b/pkg/openbsd/patch/0019-yacc-Remove-__unused.patch diff --git a/pkg/openbsd/patch/0021-Add-standalone-freezero.patch b/pkg/openbsd/patch/0020-Add-standalone-freezero.patch index 249a3e4d..249a3e4d 100644 --- a/pkg/openbsd/patch/0021-Add-standalone-freezero.patch +++ b/pkg/openbsd/patch/0020-Add-standalone-freezero.patch diff --git a/pkg/openbsd/patch/0022-m4-Use-hand-written-lexer-to-avoid-cycle-in-bootstra.patch b/pkg/openbsd/patch/0021-m4-Use-hand-written-lexer-to-avoid-cycle-in-bootstra.patch index f58f366f..f58f366f 100644 --- a/pkg/openbsd/patch/0022-m4-Use-hand-written-lexer-to-avoid-cycle-in-bootstra.patch +++ b/pkg/openbsd/patch/0021-m4-Use-hand-written-lexer-to-avoid-cycle-in-bootstra.patch diff --git a/pkg/openbsd/patch/0023-m4-Use-_Noreturn-instead-of-__dead.patch b/pkg/openbsd/patch/0022-m4-Use-_Noreturn-instead-of-__dead.patch index c78d504e..c78d504e 100644 --- a/pkg/openbsd/patch/0023-m4-Use-_Noreturn-instead-of-__dead.patch +++ b/pkg/openbsd/patch/0022-m4-Use-_Noreturn-instead-of-__dead.patch diff --git a/pkg/openbsd/patch/0024-m4-Add-missing-includes.patch b/pkg/openbsd/patch/0023-m4-Add-missing-includes.patch index de80afe9..de80afe9 100644 --- a/pkg/openbsd/patch/0024-m4-Add-missing-includes.patch +++ b/pkg/openbsd/patch/0023-m4-Add-missing-includes.patch diff --git a/pkg/openbsd/patch/0025-libutil-Add-missing-includes.patch b/pkg/openbsd/patch/0024-libutil-Add-missing-includes.patch index c441c199..c441c199 100644 --- a/pkg/openbsd/patch/0025-libutil-Add-missing-includes.patch +++ b/pkg/openbsd/patch/0024-libutil-Add-missing-includes.patch |
