summaryrefslogtreecommitdiffstats
path: root/providers/default/include/internal
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-06-04 13:58:43 +0200
committerRichard Levitte <levitte@openssl.org>2019-10-04 10:35:40 +0200
commitf50958b8c80ae267c02b2d534da8bde091010707 (patch)
tree34781fdd0ea9416f20864d9f545c9813cb24094b /providers/default/include/internal
parent29be6c8361aa1c898de6b98ad72fd2ccb6280441 (diff)
Move MD5-SHA1 digest completely to the default provider
This leaves minimal implementations of EVP_md5_sha1, which is now only there to provide a name for implicit fetches. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9076)
Diffstat (limited to 'providers/default/include/internal')
-rw-r--r--providers/default/include/internal/md5_sha1.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/providers/default/include/internal/md5_sha1.h b/providers/default/include/internal/md5_sha1.h
new file mode 100644
index 0000000000..3e80fdcf97
--- /dev/null
+++ b/providers/default/include/internal/md5_sha1.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/* TODO(3.0) Move this header into provider when dependencies are removed */
+#ifndef OSSL_INTERNAL_MD5_SHA1_H
+# define OSSL_INTERNAL_MD5_SHA1_H
+
+# include <openssl/opensslconf.h>
+
+# ifndef OPENSSL_NO_MD5
+# include <openssl/e_os2.h>
+# include <stddef.h>
+# include <openssl/md5.h>
+# include <openssl/sha.h>
+
+# define MD5_SHA1_DIGEST_LENGTH (MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH)
+# define MD5_SHA1_CBLOCK MD5_CBLOCK
+
+typedef struct md5_sha1_st {
+ MD5_CTX md5;
+ SHA_CTX sha1;
+} MD5_SHA1_CTX;
+
+int md5_sha1_init(MD5_SHA1_CTX *mctx);
+int md5_sha1_update(MD5_SHA1_CTX *mctx, const void *data, size_t count);
+int md5_sha1_final(unsigned char *md, MD5_SHA1_CTX *mctx);
+int md5_sha1_ctrl(MD5_SHA1_CTX *mctx, int cmd, int mslen, void *ms);
+
+# endif /* OPENSSL_NO_MD5 */
+
+#endif /* OSSL_INTERNAL_MD5_SHA1_H */