From 40d5bf64408a0e103f8149f941ea50fbbb11dc91 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Fri, 23 Nov 2018 22:14:07 -0800 Subject: Add moxiebox as a choice for libc This required some rework of the libc selection, as moxiebox is a layer on top of another libc - newlib. Also, moxiebox'es host VM (`sandbox`) needs a libcrypto on the host. We will not have it if we're cross-compiling a canadian cross. Fortunately, all moxiebox needs from libcrypto is SHA256, and it already includes a standalone implementation of SHA256 in its runtime. Provide a little wrapper that allows moxiebox use that implementation for the host binary, too. Also, automate collecting/printing the list of all packages in a given category (e.g. LIBC or COMP_TOOLS), generate a list of all Kconfig symbols for a given category. Signed-off-by: Alexey Neyman --- packages/moxiebox/sha.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 packages/moxiebox/sha.h (limited to 'packages/moxiebox/sha.h') diff --git a/packages/moxiebox/sha.h b/packages/moxiebox/sha.h new file mode 100644 index 00000000..36b90a18 --- /dev/null +++ b/packages/moxiebox/sha.h @@ -0,0 +1,23 @@ +/* + Wrapper around moxiebox'es implementation of SHA256 digest that + mimics the API of the OpenSSL implementation. +*/ + +#ifndef __SHA_H_ +#define __SHA_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "../runtime/sandboxrt_crypto.h" +#define SHA256_DIGEST_LENGTH SHA256_BLOCK_SIZE +void SHA256_Init(SHA256_CTX *ctx); +void SHA256_Update(SHA256_CTX *ctx, const void *data, size_t len); +void SHA256_Final(unsigned char *md, SHA256_CTX *ctx); + +#ifdef __cplusplus +} +#endif + +#endif -- cgit v1.2.3