[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 217/282: sha256: Added GNU TLS Nettle implementation
From: |
gnunet |
Subject: |
[gnurl] 217/282: sha256: Added GNU TLS Nettle implementation |
Date: |
Wed, 01 Apr 2020 14:31:22 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 365f4ea53d1f52c6f7156f0115491c2f2e6fd23a
Author: Steve Holme <address@hidden>
AuthorDate: Thu Feb 20 01:25:27 2020 +0000
sha256: Added GNU TLS Nettle implementation
---
lib/sha256.c | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/lib/sha256.c b/lib/sha256.c
index 656f9894a..aa2274117 100644
--- a/lib/sha256.c
+++ b/lib/sha256.c
@@ -38,9 +38,39 @@
#endif
-#ifdef USE_OPENSSL_SHA256
+#if defined(USE_OPENSSL_SHA256)
+
/* When OpenSSL is available we use the SHA256-function from OpenSSL */
#include <openssl/sha.h>
+
+#elif defined(USE_GNUTLS_NETTLE)
+
+#include <nettle/sha.h>
+
+#include "curl_memory.h"
+
+/* The last #include file should be: */
+#include "memdebug.h"
+
+typedef struct sha256_ctx SHA256_CTX;
+
+static void SHA256_Init(SHA256_CTX *ctx)
+{
+ sha256_init(ctx);
+}
+
+static void SHA256_Update(SHA256_CTX *ctx,
+ const unsigned char *data,
+ unsigned int length)
+{
+ sha256_update(ctx, length, data);
+}
+
+static void SHA256_Final(unsigned char *digest, SHA256_CTX *ctx)
+{
+ sha256_digest(ctx, SHA256_DIGEST_SIZE, digest);
+}
+
#else
/* When no other crypto library is available we use this code segment */
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 222/282: sha256: Tidy up following recent changes, (continued)
- [gnurl] 222/282: sha256: Tidy up following recent changes, gnunet, 2020/04/01
- [gnurl] 221/282: sha256: Added WinCrypt implementation, gnunet, 2020/04/01
- [gnurl] 223/282: configure.ac: Disable metalink if mbedTLS is specified, gnunet, 2020/04/01
- [gnurl] 216/282: curl_escape.3: Add a link to curl_free, gnunet, 2020/04/01
- [gnurl] 219/282: sha256: Added mbedtls implementation, gnunet, 2020/04/01
- [gnurl] 225/282: Revert "sha256: Added SecureTransport implementation", gnunet, 2020/04/01
- [gnurl] 209/282: ci/tests: fine-tune Azure Pipeline timeouts with a small puffer, gnunet, 2020/04/01
- [gnurl] 214/282: md4: use init/update/final functions in Secure Transport, gnunet, 2020/04/01
- [gnurl] 220/282: sha256: Added SecureTransport implementation, gnunet, 2020/04/01
- [gnurl] 224/282: dist: include tests/azure.pm in the tarball, gnunet, 2020/04/01
- [gnurl] 217/282: sha256: Added GNU TLS Nettle implementation,
gnunet <=
- [gnurl] 200/282: mime: do not perform more than one read in a row, gnunet, 2020/04/01
- [gnurl] 218/282: sha256: Added GNU TLS gcrypt implementation, gnunet, 2020/04/01
- [gnurl] 215/282: curl_getenv.3: Fix the memory handling description, gnunet, 2020/04/01
- [gnurl] 211/282: http: mark POSTs with no body as "upload done" from the start, gnunet, 2020/04/01
- [gnurl] 212/282: multi_wait: stop loop when sread() returns zero, gnunet, 2020/04/01
- [gnurl] 227/282: ci/tests: Move CI test result creation above environment setup, gnunet, 2020/04/01
- [gnurl] 228/282: README.md: add Azure DevOps Pipelines build status badge, gnunet, 2020/04/01
- [gnurl] 230/282: cmake: Show HTTPS-proxy in the features output, gnunet, 2020/04/01
- [gnurl] 226/282: ci/tests: Send test results to AppVeyor for status overview, gnunet, 2020/04/01
- [gnurl] 231/282: ci/tests: fix escaping of testnames and disable proxy for CI APIs, gnunet, 2020/04/01