[openssl] master update
Richard Levitte
levitte at openssl.org
Mon Oct 14 15:56:18 UTC 2019
The branch master has been updated
via 3103a616dc6b3150eaec0000af767f268a647f6d (commit)
from 9f3c076b6d5b265d026ff7ed763d406a7e5a2170 (commit)
- Log -----------------------------------------------------------------
commit 3103a616dc6b3150eaec0000af767f268a647f6d
Author: Richard Levitte <levitte at openssl.org>
Date: Sun Oct 13 14:44:54 2019 +0200
Move MD2, MD4 and MD5 digests completely to the providers
This leaves minimal implementations of EVP_md2, EVP_md4, EVP_md5 and
EVP_mdc2, that are now only there to provide a name for implicit fetches.
Reviewed-by: Matt Caswell <matt at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10164)
-----------------------------------------------------------------------
Summary of changes:
crypto/evp/build.info | 17 +++++++-
crypto/evp/{legacy_md5_sha1.c => legacy_md2.c} | 22 +++++-----
crypto/evp/{legacy_md5_sha1.c => legacy_md4.c} | 22 +++++-----
crypto/evp/{legacy_md5_sha1.c => legacy_md5.c} | 18 ++++----
crypto/evp/{legacy_md5_sha1.c => legacy_mdc2.c} | 22 +++++-----
crypto/evp/m_md2.c | 56 -------------------------
crypto/evp/m_md4.c | 55 ------------------------
crypto/evp/m_md5.c | 55 ------------------------
crypto/evp/m_mdc2.c | 55 ------------------------
9 files changed, 53 insertions(+), 269 deletions(-)
copy crypto/evp/{legacy_md5_sha1.c => legacy_md2.c} (59%)
copy crypto/evp/{legacy_md5_sha1.c => legacy_md4.c} (59%)
copy crypto/evp/{legacy_md5_sha1.c => legacy_md5.c} (65%)
copy crypto/evp/{legacy_md5_sha1.c => legacy_mdc2.c} (59%)
delete mode 100644 crypto/evp/m_md2.c
delete mode 100644 crypto/evp/m_md4.c
delete mode 100644 crypto/evp/m_md5.c
delete mode 100644 crypto/evp/m_mdc2.c
diff --git a/crypto/evp/build.info b/crypto/evp/build.info
index aef0031d3d..f2c798b703 100644
--- a/crypto/evp/build.info
+++ b/crypto/evp/build.info
@@ -7,8 +7,7 @@ SOURCE[../../libcrypto]=$COMMON\
e_des.c e_bf.c e_idea.c e_des3.c e_camellia.c\
e_rc4.c e_aes.c names.c e_seed.c e_aria.c e_sm4.c \
e_xcbc_d.c e_rc2.c e_cast.c e_rc5.c \
- m_null.c m_md2.c m_md4.c m_md5.c m_wp.c \
- m_mdc2.c m_ripemd.c \
+ m_null.c m_wp.c m_ripemd.c \
p_open.c p_seal.c p_sign.c p_verify.c p_lib.c p_enc.c p_dec.c \
bio_md.c bio_b64.c bio_enc.c evp_err.c e_null.c \
c_allc.c c_alld.c bio_ok.c \
@@ -19,6 +18,20 @@ SOURCE[../../libcrypto]=$COMMON\
e_chacha20_poly1305.c \
pkey_mac.c exchange.c \
legacy_sha.c legacy_md5_sha1.c
+
+IF[{- !$disabled{md2} -}]
+ SOURCE[../../libcrypto]=legacy_md2.c
+ENDIF
+IF[{- !$disabled{md4} -}]
+ SOURCE[../../libcrypto]=legacy_md4.c
+ENDIF
+IF[{- !$disabled{md5} -}]
+ SOURCE[../../libcrypto]=legacy_md5.c
+ENDIF
+IF[{- !$disabled{mdc2} -}]
+ SOURCE[../../libcrypto]=legacy_mdc2.c
+ENDIF
+
SOURCE[../../providers/libfips.a]=$COMMON
INCLUDE[e_aes.o]=.. ../modes
diff --git a/crypto/evp/legacy_md5_sha1.c b/crypto/evp/legacy_md2.c
similarity index 59%
copy from crypto/evp/legacy_md5_sha1.c
copy to crypto/evp/legacy_md2.c
index a23febfd53..d399095f47 100644
--- a/crypto/evp/legacy_md5_sha1.c
+++ b/crypto/evp/legacy_md2.c
@@ -9,29 +9,27 @@
#include <openssl/opensslconf.h>
-#include "prov/md5_sha1.h" /* diverse MD5_SHA1 macros */
+#ifndef OPENSSL_NO_MD2
-#ifndef OPENSSL_NO_MD5
-
-# include <openssl/obj_mac.h>
+# include <openssl/md2.h>
# include "crypto/evp.h"
-static const EVP_MD md5_sha1_md = {
- NID_md5_sha1,
- NID_md5_sha1,
- MD5_SHA1_DIGEST_LENGTH,
+static const EVP_MD md2_md = {
+ NID_md2,
+ NID_md2WithRSAEncryption,
+ MD2_DIGEST_LENGTH,
0,
NULL,
NULL,
NULL,
NULL,
NULL,
- MD5_SHA1_CBLOCK,
+ MD2_BLOCK,
};
-const EVP_MD *EVP_md5_sha1(void)
+const EVP_MD *EVP_md2(void)
{
- return &md5_sha1_md;
+ return &md2_md;
}
-#endif /* OPENSSL_NO_MD5 */
+#endif /* OPENSSL_NO_MD2 */
diff --git a/crypto/evp/legacy_md5_sha1.c b/crypto/evp/legacy_md4.c
similarity index 59%
copy from crypto/evp/legacy_md5_sha1.c
copy to crypto/evp/legacy_md4.c
index a23febfd53..fa57e98b78 100644
--- a/crypto/evp/legacy_md5_sha1.c
+++ b/crypto/evp/legacy_md4.c
@@ -9,29 +9,27 @@
#include <openssl/opensslconf.h>
-#include "prov/md5_sha1.h" /* diverse MD5_SHA1 macros */
+#ifndef OPENSSL_NO_MD4
-#ifndef OPENSSL_NO_MD5
-
-# include <openssl/obj_mac.h>
+# include <openssl/md4.h>
# include "crypto/evp.h"
-static const EVP_MD md5_sha1_md = {
- NID_md5_sha1,
- NID_md5_sha1,
- MD5_SHA1_DIGEST_LENGTH,
+static const EVP_MD md4_md = {
+ NID_md4,
+ NID_md4WithRSAEncryption,
+ MD4_DIGEST_LENGTH,
0,
NULL,
NULL,
NULL,
NULL,
NULL,
- MD5_SHA1_CBLOCK,
+ MD4_CBLOCK,
};
-const EVP_MD *EVP_md5_sha1(void)
+const EVP_MD *EVP_md4(void)
{
- return &md5_sha1_md;
+ return &md4_md;
}
-#endif /* OPENSSL_NO_MD5 */
+#endif /* OPENSSL_NO_MD4 */
diff --git a/crypto/evp/legacy_md5_sha1.c b/crypto/evp/legacy_md5.c
similarity index 65%
copy from crypto/evp/legacy_md5_sha1.c
copy to crypto/evp/legacy_md5.c
index a23febfd53..f125b33f91 100644
--- a/crypto/evp/legacy_md5_sha1.c
+++ b/crypto/evp/legacy_md5.c
@@ -9,29 +9,27 @@
#include <openssl/opensslconf.h>
-#include "prov/md5_sha1.h" /* diverse MD5_SHA1 macros */
-
#ifndef OPENSSL_NO_MD5
-# include <openssl/obj_mac.h>
+# include <openssl/md5.h>
# include "crypto/evp.h"
-static const EVP_MD md5_sha1_md = {
- NID_md5_sha1,
- NID_md5_sha1,
- MD5_SHA1_DIGEST_LENGTH,
+static const EVP_MD md5_md = {
+ NID_md5,
+ NID_md5WithRSAEncryption,
+ MD5_DIGEST_LENGTH,
0,
NULL,
NULL,
NULL,
NULL,
NULL,
- MD5_SHA1_CBLOCK,
+ MD5_CBLOCK,
};
-const EVP_MD *EVP_md5_sha1(void)
+const EVP_MD *EVP_md5(void)
{
- return &md5_sha1_md;
+ return &md5_md;
}
#endif /* OPENSSL_NO_MD5 */
diff --git a/crypto/evp/legacy_md5_sha1.c b/crypto/evp/legacy_mdc2.c
similarity index 59%
copy from crypto/evp/legacy_md5_sha1.c
copy to crypto/evp/legacy_mdc2.c
index a23febfd53..5b51b015ea 100644
--- a/crypto/evp/legacy_md5_sha1.c
+++ b/crypto/evp/legacy_mdc2.c
@@ -9,29 +9,27 @@
#include <openssl/opensslconf.h>
-#include "prov/md5_sha1.h" /* diverse MD5_SHA1 macros */
+#ifndef OPENSSL_NO_MDC2
-#ifndef OPENSSL_NO_MD5
-
-# include <openssl/obj_mac.h>
+# include <openssl/mdc2.h>
# include "crypto/evp.h"
-static const EVP_MD md5_sha1_md = {
- NID_md5_sha1,
- NID_md5_sha1,
- MD5_SHA1_DIGEST_LENGTH,
+static const EVP_MD mdc2_md = {
+ NID_mdc2,
+ NID_mdc2WithRSA,
+ MDC2_DIGEST_LENGTH,
0,
NULL,
NULL,
NULL,
NULL,
NULL,
- MD5_SHA1_CBLOCK,
+ MDC2_BLOCK,
};
-const EVP_MD *EVP_md5_sha1(void)
+const EVP_MD *EVP_mdc2(void)
{
- return &md5_sha1_md;
+ return &mdc2_md;
}
-#endif /* OPENSSL_NO_MD5 */
+#endif /* OPENSSL_NO_MDC2 */
diff --git a/crypto/evp/m_md2.c b/crypto/evp/m_md2.c
deleted file mode 100644
index a8a0af96aa..0000000000
--- a/crypto/evp/m_md2.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 1995-2016 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
- */
-
-#include <stdio.h>
-#include "internal/cryptlib.h"
-
-#ifndef OPENSSL_NO_MD2
-
-# include <openssl/evp.h>
-# include <openssl/objects.h>
-# include <openssl/x509.h>
-# include <openssl/md2.h>
-# include <openssl/rsa.h>
-
-#include "crypto/evp.h"
-
-static int init(EVP_MD_CTX *ctx)
-{
- return MD2_Init(EVP_MD_CTX_md_data(ctx));
-}
-
-static int update(EVP_MD_CTX *ctx, const void *data, size_t count)
-{
- return MD2_Update(EVP_MD_CTX_md_data(ctx), data, count);
-}
-
-static int final(EVP_MD_CTX *ctx, unsigned char *md)
-{
- return MD2_Final(md, EVP_MD_CTX_md_data(ctx));
-}
-
-static const EVP_MD md2_md = {
- NID_md2,
- NID_md2WithRSAEncryption,
- MD2_DIGEST_LENGTH,
- 0,
- init,
- update,
- final,
- NULL,
- NULL,
- MD2_BLOCK,
- sizeof(EVP_MD *) + sizeof(MD2_CTX),
-};
-
-const EVP_MD *EVP_md2(void)
-{
- return &md2_md;
-}
-#endif
diff --git a/crypto/evp/m_md4.c b/crypto/evp/m_md4.c
deleted file mode 100644
index 9638213de7..0000000000
--- a/crypto/evp/m_md4.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 1995-2016 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
- */
-
-#include <stdio.h>
-#include "internal/cryptlib.h"
-
-#ifndef OPENSSL_NO_MD4
-
-# include <openssl/evp.h>
-# include <openssl/objects.h>
-# include <openssl/x509.h>
-# include <openssl/md4.h>
-# include <openssl/rsa.h>
-# include "crypto/evp.h"
-
-static int init(EVP_MD_CTX *ctx)
-{
- return MD4_Init(EVP_MD_CTX_md_data(ctx));
-}
-
-static int update(EVP_MD_CTX *ctx, const void *data, size_t count)
-{
- return MD4_Update(EVP_MD_CTX_md_data(ctx), data, count);
-}
-
-static int final(EVP_MD_CTX *ctx, unsigned char *md)
-{
- return MD4_Final(md, EVP_MD_CTX_md_data(ctx));
-}
-
-static const EVP_MD md4_md = {
- NID_md4,
- NID_md4WithRSAEncryption,
- MD4_DIGEST_LENGTH,
- 0,
- init,
- update,
- final,
- NULL,
- NULL,
- MD4_CBLOCK,
- sizeof(EVP_MD *) + sizeof(MD4_CTX),
-};
-
-const EVP_MD *EVP_md4(void)
-{
- return &md4_md;
-}
-#endif
diff --git a/crypto/evp/m_md5.c b/crypto/evp/m_md5.c
deleted file mode 100644
index d817982488..0000000000
--- a/crypto/evp/m_md5.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 1995-2016 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
- */
-
-#include <stdio.h>
-#include "internal/cryptlib.h"
-
-#ifndef OPENSSL_NO_MD5
-
-# include <openssl/evp.h>
-# include <openssl/objects.h>
-# include <openssl/x509.h>
-# include <openssl/md5.h>
-# include <openssl/rsa.h>
-# include "crypto/evp.h"
-
-static int init(EVP_MD_CTX *ctx)
-{
- return MD5_Init(EVP_MD_CTX_md_data(ctx));
-}
-
-static int update(EVP_MD_CTX *ctx, const void *data, size_t count)
-{
- return MD5_Update(EVP_MD_CTX_md_data(ctx), data, count);
-}
-
-static int final(EVP_MD_CTX *ctx, unsigned char *md)
-{
- return MD5_Final(md, EVP_MD_CTX_md_data(ctx));
-}
-
-static const EVP_MD md5_md = {
- NID_md5,
- NID_md5WithRSAEncryption,
- MD5_DIGEST_LENGTH,
- 0,
- init,
- update,
- final,
- NULL,
- NULL,
- MD5_CBLOCK,
- sizeof(EVP_MD *) + sizeof(MD5_CTX),
-};
-
-const EVP_MD *EVP_md5(void)
-{
- return &md5_md;
-}
-#endif
diff --git a/crypto/evp/m_mdc2.c b/crypto/evp/m_mdc2.c
deleted file mode 100644
index fdc689e115..0000000000
--- a/crypto/evp/m_mdc2.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 1995-2016 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
- */
-
-#include <stdio.h>
-#include "internal/cryptlib.h"
-
-#ifndef OPENSSL_NO_MDC2
-
-# include <openssl/evp.h>
-# include <openssl/objects.h>
-# include <openssl/x509.h>
-# include <openssl/mdc2.h>
-# include <openssl/rsa.h>
-# include "crypto/evp.h"
-
-static int init(EVP_MD_CTX *ctx)
-{
- return MDC2_Init(EVP_MD_CTX_md_data(ctx));
-}
-
-static int update(EVP_MD_CTX *ctx, const void *data, size_t count)
-{
- return MDC2_Update(EVP_MD_CTX_md_data(ctx), data, count);
-}
-
-static int final(EVP_MD_CTX *ctx, unsigned char *md)
-{
- return MDC2_Final(md, EVP_MD_CTX_md_data(ctx));
-}
-
-static const EVP_MD mdc2_md = {
- NID_mdc2,
- NID_mdc2WithRSA,
- MDC2_DIGEST_LENGTH,
- 0,
- init,
- update,
- final,
- NULL,
- NULL,
- MDC2_BLOCK,
- sizeof(EVP_MD *) + sizeof(MDC2_CTX),
-};
-
-const EVP_MD *EVP_mdc2(void)
-{
- return &mdc2_md;
-}
-#endif
More information about the openssl-commits
mailing list