Use of the low level MD5 functions has been informally discouraged for a long
time. We now formally deprecate them.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10791)
15 files changed:
#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DEPRECATED_3_0)
{"md4", D_MD4},
#endif
#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DEPRECATED_3_0)
{"md4", D_MD4},
#endif
+#if !defined(OPENSSL_NO_MD5) && !defined(OPENSSL_NO_DEPRECATED_3_0)
{"md5", D_MD5},
{"hmac", D_HMAC},
#endif
{"md5", D_MD5},
{"hmac", D_HMAC},
#endif
+#if !defined(OPENSSL_NO_MD5) && !defined(OPENSSL_NO_DEPRECATED_3_0)
static int MD5_loop(void *args)
{
loopargs_t *tempargs = *(loopargs_t **) args;
static int MD5_loop(void *args)
{
loopargs_t *tempargs = *(loopargs_t **) args;
+#if !defined(OPENSSL_NO_MD5) && !defined(OPENSSL_NO_DEPRECATED_3_0)
if (doit[D_MD5]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_MD5], c[D_MD5][testnum], lengths[testnum],
if (doit[D_MD5]) {
for (testnum = 0; testnum < size_num; testnum++) {
print_message(names[D_MD5], c[D_MD5][testnum], lengths[testnum],
- * RC4 low level APIs are deprecated for public use, but still ok for internal
- * use.
+ * MD5 and RC4 low level APIs are deprecated for public use, but still ok for
+ * internal use.
*/
#include "internal/deprecated.h"
*/
#include "internal/deprecated.h"
* https://www.openssl.org/source/license.html
*/
* https://www.openssl.org/source/license.html
*/
+/*
+ * MD5 low level APIs are deprecated for public use, but still ok for
+ * internal use.
+ */
+#include "internal/deprecated.h"
+
#include <openssl/md5.h>
#include "crypto/evp.h"
#include "legacy_meth.h"
#include <openssl/md5.h>
#include "crypto/evp.h"
#include "legacy_meth.h"
- * SHA-1 low level APIs are deprecated for public use, but still ok for
+ * MD5 and SHA-1 low level APIs are deprecated for public use, but still ok for
* internal use. The prov/md5_sha1.h include requires this, but this must
* be the first include loaded.
*/
* internal use. The prov/md5_sha1.h include requires this, but this must
* be the first include loaded.
*/
* https://www.openssl.org/source/license.html
*/
* https://www.openssl.org/source/license.html
*/
+/*
+ * MD5 low level APIs are deprecated for public use, but still ok for
+ * internal use.
+ */
+#include "internal/deprecated.h"
+
#include <stdio.h>
#include "md5_local.h"
#include <openssl/opensslv.h>
#include <stdio.h>
#include "md5_local.h"
#include <openssl/opensslv.h>
* https://www.openssl.org/source/license.html
*/
* https://www.openssl.org/source/license.html
*/
+/*
+ * MD5 low level APIs are deprecated for public use, but still ok for
+ * internal use.
+ */
+#include "internal/deprecated.h"
+
#include <stdio.h>
#include <string.h>
#include <openssl/md5.h>
#include <stdio.h>
#include <string.h>
#include <openssl/md5.h>
- * SHA-1 low level APIs are deprecated for public use, but still ok for
+ * MD5 and SHA-1 low level APIs are deprecated for public use, but still ok for
* internal use.
*/
#include "internal/deprecated.h"
* internal use.
*/
#include "internal/deprecated.h"
+Deprecated since OpenSSL 3.0, can be hidden entirely by defining
+B<OPENSSL_API_COMPAT> with a suitable version value, see
+L<openssl_user_macros(7)>:
+
unsigned char *MD5(const unsigned char *d, unsigned long n, unsigned char *md);
int MD5_Init(MD5_CTX *c);
unsigned char *MD5(const unsigned char *d, unsigned long n, unsigned char *md);
int MD5_Init(MD5_CTX *c);
# include <openssl/opensslconf.h>
# ifndef OPENSSL_NO_MD5
# include <openssl/opensslconf.h>
# ifndef OPENSSL_NO_MD5
-# include <openssl/e_os2.h>
-# include <stddef.h>
-# ifdef __cplusplus
+# include <openssl/e_os2.h>
+# include <stddef.h>
+# ifdef __cplusplus
+# endif
+
+# define MD5_DIGEST_LENGTH 16
+# if !defined(OPENSSL_NO_DEPRECATED_3_0)
/*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* ! MD5_LONG has to be at least 32 bits wide. !
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
/*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* ! MD5_LONG has to be at least 32 bits wide. !
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
-# define MD5_LONG unsigned int
+# define MD5_LONG unsigned int
-# define MD5_CBLOCK 64
-# define MD5_LBLOCK (MD5_CBLOCK/4)
-# define MD5_DIGEST_LENGTH 16
+# define MD5_CBLOCK 64
+# define MD5_LBLOCK (MD5_CBLOCK/4)
typedef struct MD5state_st {
MD5_LONG A, B, C, D;
typedef struct MD5state_st {
MD5_LONG A, B, C, D;
MD5_LONG data[MD5_LBLOCK];
unsigned int num;
} MD5_CTX;
MD5_LONG data[MD5_LBLOCK];
unsigned int num;
} MD5_CTX;
-int MD5_Init(MD5_CTX *c);
-int MD5_Update(MD5_CTX *c, const void *data, size_t len);
-int MD5_Final(unsigned char *md, MD5_CTX *c);
-unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md);
-void MD5_Transform(MD5_CTX *c, const unsigned char *b);
-# ifdef __cplusplus
+DEPRECATEDIN_3_0(int MD5_Init(MD5_CTX *c))
+DEPRECATEDIN_3_0(int MD5_Update(MD5_CTX *c, const void *data, size_t len))
+DEPRECATEDIN_3_0(int MD5_Final(unsigned char *md, MD5_CTX *c))
+DEPRECATEDIN_3_0(unsigned char *MD5(const unsigned char *d, size_t n,
+ unsigned char *md))
+DEPRECATEDIN_3_0(void MD5_Transform(MD5_CTX *c, const unsigned char *b))
+
+# ifdef __cplusplus
/* Dispatch functions for RC4_HMAC_MD5 cipher */
/*
/* Dispatch functions for RC4_HMAC_MD5 cipher */
/*
- * RC4 low level APIs are deprecated for public use, but still ok for internal
- * use.
+ * MD5 and RC4 low level APIs are deprecated for public use, but still ok for
+ * internal use.
*/
#include "internal/deprecated.h"
*/
#include "internal/deprecated.h"
/* RC4_HMAC_MD5 cipher implementation */
/*
/* RC4_HMAC_MD5 cipher implementation */
/*
- * RC4 low level APIs are deprecated for public use, but still ok for internal
- * use.
+ * MD5 and RC4 low level APIs are deprecated for public use, but still ok for
+ * internal use.
*/
#include "internal/deprecated.h"
*/
#include "internal/deprecated.h"
* https://www.openssl.org/source/license.html
*/
* https://www.openssl.org/source/license.html
*/
+/*
+ * MD5 low level APIs are deprecated for public use, but still ok for
+ * internal use.
+ */
+#include "internal/deprecated.h"
+
#include <openssl/crypto.h>
#include <openssl/md5.h>
#include "prov/digestcommon.h"
#include <openssl/crypto.h>
#include <openssl/md5.h>
#include "prov/digestcommon.h"
- * SHA-1 low level APIs are deprecated for public use, but still ok for
+ * MD5 and SHA-1 low level APIs are deprecated for public use, but still ok for
* internal use.
*/
#include "internal/deprecated.h"
* internal use.
*/
#include "internal/deprecated.h"
- * SHA-1 low level APIs are deprecated for public use, but still ok for
+ * MD5 and SHA-1 low level APIs are deprecated for public use, but still ok for
* internal use.
*/
#include "internal/deprecated.h"
* internal use.
*/
#include "internal/deprecated.h"
ERR_put_error 1027 3_0_0 NOEXIST::FUNCTION:
ERR_add_error_data 1028 3_0_0 EXIST::FUNCTION:
X509_ALGORS_it 1029 3_0_0 EXIST::FUNCTION:
ERR_put_error 1027 3_0_0 NOEXIST::FUNCTION:
ERR_add_error_data 1028 3_0_0 EXIST::FUNCTION:
X509_ALGORS_it 1029 3_0_0 EXIST::FUNCTION:
-MD5_Update 1030 3_0_0 EXIST::FUNCTION:MD5
+MD5_Update 1030 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0,MD5
X509_policy_check 1031 3_0_0 EXIST::FUNCTION:
X509_CRL_METHOD_new 1032 3_0_0 EXIST::FUNCTION:
ASN1_ANY_it 1033 3_0_0 EXIST::FUNCTION:
X509_policy_check 1031 3_0_0 EXIST::FUNCTION:
X509_CRL_METHOD_new 1032 3_0_0 EXIST::FUNCTION:
ASN1_ANY_it 1033 3_0_0 EXIST::FUNCTION:
ASN1_TIME_free 1281 3_0_0 EXIST::FUNCTION:
i2o_SCT_LIST 1282 3_0_0 EXIST::FUNCTION:CT
AES_encrypt 1283 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0
ASN1_TIME_free 1281 3_0_0 EXIST::FUNCTION:
i2o_SCT_LIST 1282 3_0_0 EXIST::FUNCTION:CT
AES_encrypt 1283 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0
-MD5_Init 1284 3_0_0 EXIST::FUNCTION:MD5
+MD5_Init 1284 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0,MD5
UI_add_error_string 1285 3_0_0 EXIST::FUNCTION:
X509_TRUST_cleanup 1286 3_0_0 EXIST::FUNCTION:
PEM_read_X509 1287 3_0_0 EXIST::FUNCTION:STDIO
UI_add_error_string 1285 3_0_0 EXIST::FUNCTION:
X509_TRUST_cleanup 1286 3_0_0 EXIST::FUNCTION:
PEM_read_X509 1287 3_0_0 EXIST::FUNCTION:STDIO
SCT_set_log_entry_type 1878 3_0_0 EXIST::FUNCTION:CT
BN_new 1879 3_0_0 EXIST::FUNCTION:
X509_OBJECT_retrieve_by_subject 1880 3_0_0 EXIST::FUNCTION:
SCT_set_log_entry_type 1878 3_0_0 EXIST::FUNCTION:CT
BN_new 1879 3_0_0 EXIST::FUNCTION:
X509_OBJECT_retrieve_by_subject 1880 3_0_0 EXIST::FUNCTION:
-MD5_Final 1881 3_0_0 EXIST::FUNCTION:MD5
+MD5_Final 1881 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0,MD5
X509_STORE_set_verify_cb 1882 3_0_0 EXIST::FUNCTION:
OCSP_REQUEST_print 1883 3_0_0 EXIST::FUNCTION:OCSP
CMS_add1_crl 1884 3_0_0 EXIST::FUNCTION:CMS
X509_STORE_set_verify_cb 1882 3_0_0 EXIST::FUNCTION:
OCSP_REQUEST_print 1883 3_0_0 EXIST::FUNCTION:OCSP
CMS_add1_crl 1884 3_0_0 EXIST::FUNCTION:CMS
X509_REQ_free 1921 3_0_0 EXIST::FUNCTION:
ASN1_INTEGER_set 1922 3_0_0 EXIST::FUNCTION:
EVP_DecodeFinal 1923 3_0_0 EXIST::FUNCTION:
X509_REQ_free 1921 3_0_0 EXIST::FUNCTION:
ASN1_INTEGER_set 1922 3_0_0 EXIST::FUNCTION:
EVP_DecodeFinal 1923 3_0_0 EXIST::FUNCTION:
-MD5_Transform 1925 3_0_0 EXIST::FUNCTION:MD5
+MD5_Transform 1925 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0,MD5
SRP_create_verifier_BN 1926 3_0_0 EXIST::FUNCTION:SRP
ENGINE_register_all_EC 1927 3_0_0 EXIST::FUNCTION:ENGINE
EVP_camellia_128_ofb 1928 3_0_0 EXIST::FUNCTION:CAMELLIA
SRP_create_verifier_BN 1926 3_0_0 EXIST::FUNCTION:SRP
ENGINE_register_all_EC 1927 3_0_0 EXIST::FUNCTION:ENGINE
EVP_camellia_128_ofb 1928 3_0_0 EXIST::FUNCTION:CAMELLIA
d2i_RSAPrivateKey 3068 3_0_0 EXIST::FUNCTION:RSA
ERR_load_BN_strings 3069 3_0_0 EXIST::FUNCTION:
BF_encrypt 3070 3_0_0 EXIST::FUNCTION:BF,DEPRECATEDIN_3_0
d2i_RSAPrivateKey 3068 3_0_0 EXIST::FUNCTION:RSA
ERR_load_BN_strings 3069 3_0_0 EXIST::FUNCTION:
BF_encrypt 3070 3_0_0 EXIST::FUNCTION:BF,DEPRECATEDIN_3_0
-MD5 3071 3_0_0 EXIST::FUNCTION:MD5
+MD5 3071 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0,MD5
BN_GF2m_arr2poly 3072 3_0_0 EXIST::FUNCTION:EC2M
EVP_PKEY_meth_get_ctrl 3073 3_0_0 EXIST::FUNCTION:
i2d_X509_REQ_bio 3074 3_0_0 EXIST::FUNCTION:
BN_GF2m_arr2poly 3072 3_0_0 EXIST::FUNCTION:EC2M
EVP_PKEY_meth_get_ctrl 3073 3_0_0 EXIST::FUNCTION:
i2d_X509_REQ_bio 3074 3_0_0 EXIST::FUNCTION: