]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
AmigaOS: add functions definitions for SHA256
authorOliver Urbann <oliver.urbann@tu-dortmund.de>
Thu, 20 May 2021 08:34:43 +0000 (10:34 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 20 May 2021 14:47:42 +0000 (16:47 +0200)
AmiSSL replaces many functions with macros. Curl requires pointer
to some of these functions. Thus, we have to encapsulate these macros:
SHA256_Init, SHA256_Update, SHA256_Final, X509_INFO_free.

Bug: https://github.com/jens-maus/amissl/issues/15
Co-authored-by: Daniel Stenberg <daniel@haxx.se>
Closes #7099

lib/amigaos.c

index d3b00d9083e90a60c2edfc174fd11a5e343255ad..b6c42136126864168a9ac778e553137e1bcb07a3 100644 (file)
@@ -90,6 +90,33 @@ void Curl_amiga_X509_free(X509 *a)
 {
   X509_free(a);
 }
+
+/* AmiSSL replaces many functions with macros. Curl requires pointer
+ * to some of these functions. Thus, we have to encapsulate these macros.
+ */
+
+#include "warnless.h"
+
+int (SHA256_Init)(SHA256_CTX *c)
+{
+  return SHA256_Init(c);
+};
+
+int (SHA256_Update)(SHA256_CTX *c, const void *data, size_t len)
+{
+  return SHA256_Update(c, data, curlx_uztoui(len));
+};
+
+int (SHA256_Final)(unsigned char *md, SHA256_CTX *c)
+{
+  return SHA256_Final(md, c);
+};
+
+void (X509_INFO_free)(X509_INFO *a)
+{
+  X509_INFO_free(a);
+};
+
 #endif /* USE_AMISSL */
 #endif /* __AMIGA__ */