From: Dmitry Volyntsev Date: Thu, 15 Feb 2024 05:34:02 +0000 (-0800) Subject: Moving hash code out of the njs core. X-Git-Tag: 0.8.4~27 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=a26f8cc0db69bb4879b069d42b7e006ecd151dc6;p=njs.git Moving hash code out of the njs core. --- diff --git a/auto/modules b/auto/modules index 93858691..421ab2cf 100644 --- a/auto/modules +++ b/auto/modules @@ -9,7 +9,10 @@ njs_module_srcs=src/njs_buffer.c njs_module_name=njs_crypto_module njs_module_incs= -njs_module_srcs=external/njs_crypto_module.c +njs_module_srcs="external/njs_crypto_module.c \ + external/njs_md5.c \ + external/njs_sha1.c \ + external/njs_sha2.c" . auto/module diff --git a/auto/sources b/auto/sources index d97021c9..d5637a52 100644 --- a/auto/sources +++ b/auto/sources @@ -13,9 +13,6 @@ NJS_LIB_SRCS=" \ src/njs_flathsh.c \ src/njs_trace.c \ src/njs_random.c \ - src/njs_md5.c \ - src/njs_sha1.c \ - src/njs_sha2.c \ src/njs_malloc.c \ src/njs_mp.c \ src/njs_sprintf.c \ diff --git a/external/njs_crypto_module.c b/external/njs_crypto_module.c index b66501bd..2781a485 100644 --- a/external/njs_crypto_module.c +++ b/external/njs_crypto_module.c @@ -6,9 +6,9 @@ #include -#include #include #include +#include "njs_hash.h" typedef void (*njs_hash_init)(njs_hash_t *ctx); diff --git a/src/njs_hash.h b/external/njs_hash.h similarity index 100% rename from src/njs_hash.h rename to external/njs_hash.h diff --git a/src/njs_md5.c b/external/njs_md5.c similarity index 98% rename from src/njs_md5.c rename to external/njs_md5.c index a6b00803..dfd9d53e 100644 --- a/src/njs_md5.c +++ b/external/njs_md5.c @@ -6,7 +6,11 @@ */ -#include +#include +#include +#include +#include +#include "njs_hash.h" static const u_char *njs_md5_body(njs_hash_t *ctx, const u_char *data, diff --git a/src/njs_sha1.c b/external/njs_sha1.c similarity index 98% rename from src/njs_sha1.c rename to external/njs_sha1.c index 0f5f4e9b..e5ca6ee9 100644 --- a/src/njs_sha1.c +++ b/external/njs_sha1.c @@ -7,7 +7,11 @@ */ -#include +#include +#include +#include +#include +#include "njs_hash.h" static const u_char *njs_sha1_body(njs_hash_t *ctx, const u_char *data, diff --git a/src/njs_sha2.c b/external/njs_sha2.c similarity index 98% rename from src/njs_sha2.c rename to external/njs_sha2.c index 8d051e49..2e146347 100644 --- a/src/njs_sha2.c +++ b/external/njs_sha2.c @@ -7,7 +7,11 @@ */ -#include +#include +#include +#include +#include +#include "njs_hash.h" static const u_char *njs_sha2_body(njs_hash_t *ctx, const u_char *data, diff --git a/src/njs_main.h b/src/njs_main.h index f52ee9a4..563065a1 100644 --- a/src/njs_main.h +++ b/src/njs_main.h @@ -39,8 +39,6 @@ #include -#include - #include #include