out->pctx = NULL;
out->flags = in->flags;
- out->update = in->update;
} else {
evp_md_ctx_reset_ex(out, 1);
digest_change = (out->fetched_digest != in->fetched_digest);
}
#endif /* !defined(FIPS_MODULE) */
+#ifndef OPENSSL_NO_DEPRECATED_4_0
void *EVP_MD_CTX_get0_md_data(const EVP_MD_CTX *ctx)
{
- return ctx->md_data;
-}
-
-int (*EVP_MD_CTX_update_fn(EVP_MD_CTX *ctx))(EVP_MD_CTX *ctx,
- const void *data, size_t count)
-{
- return ctx->update;
-}
-
-void EVP_MD_CTX_set_update_fn(EVP_MD_CTX *ctx,
- int (*update)(EVP_MD_CTX *ctx,
- const void *data, size_t count))
-{
- ctx->update = update;
+ return NULL;
}
+#endif
void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags)
{
const EVP_MD *reqdigest; /* The original requested digest */
const EVP_MD *digest;
unsigned long flags;
- void *md_data;
+
/* Public key context for sign/verify */
EVP_PKEY_CTX *pctx;
- /* Update function: usually copied from EVP_MD */
- int (*update)(EVP_MD_CTX *ctx, const void *data, size_t count);
/*
* Opaque ctx returned from a providers digest algorithm implementation
EVP_MD_get_pkey_type, EVP_MD_get_size, EVP_MD_get_block_size, EVP_MD_get_flags,
EVP_MD_CTX_get0_name, EVP_MD_CTX_md, EVP_MD_CTX_get0_md, EVP_MD_CTX_get1_md,
EVP_MD_CTX_get_type, EVP_MD_CTX_get_size_ex, EVP_MD_CTX_get_block_size,
-EVP_MD_CTX_get0_md_data, EVP_MD_CTX_update_fn, EVP_MD_CTX_set_update_fn,
+EVP_MD_CTX_get0_md_data,
EVP_md_null,
EVP_get_digestbyname, EVP_get_digestbynid, EVP_get_digestbyobj,
EVP_MD_CTX_get_pkey_ctx, EVP_MD_CTX_set_pkey_ctx,
int EVP_MD_CTX_get_size_ex(const EVP_MD_CTX *ctx);
int EVP_MD_CTX_get_block_size(const EVP_MD_CTX *ctx);
int EVP_MD_CTX_get_type(const EVP_MD_CTX *ctx);
- void *EVP_MD_CTX_get0_md_data(const EVP_MD_CTX *ctx);
const EVP_MD *EVP_md_null(void);
#define EVP_MD_CTX_block_size EVP_MD_CTX_get_block_size
#define EVP_MD_CTX_type EVP_MD_CTX_get_type
#define EVP_MD_CTX_pkey_ctx EVP_MD_CTX_get_pkey_ctx
- #define EVP_MD_CTX_md_data EVP_MD_CTX_get0_md_data
+
The following functions have been deprecated since OpenSSL 3.0, and can be
hidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value,
const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx);
- int (*EVP_MD_CTX_update_fn(EVP_MD_CTX *ctx))(EVP_MD_CTX *ctx,
- const void *data, size_t count);
+The following functions have been deprecated since OpenSSL 4.0, and can be
+hidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value,
+see L<openssl_user_macros(7)>:
+
+ void *EVP_MD_CTX_get0_md_data(const EVP_MD_CTX *ctx);
- void EVP_MD_CTX_set_update_fn(EVP_MD_CTX *ctx,
- int (*update)(EVP_MD_CTX *ctx,
- const void *data, size_t count));
+ #define EVP_MD_CTX_md_data EVP_MD_CTX_get0_md_data
=head1 DESCRIPTION
=item EVP_MD_CTX_get0_md_data()
-Return the digest method private data for the passed B<EVP_MD_CTX>. This
-function exists for legacy backward compatibility reasons and always returns
-NULL.
+This function is deprecated and exists for legacy backward compatibility reasons
+and always returns NULL.
=item EVP_MD_CTX_get0_md(), EVP_MD_CTX_get1_md()
EVP_MD_CTX_get1_md() is the same except the ownership is passed to the
caller and is from the passed B<EVP_MD_CTX>.
-=item EVP_MD_CTX_set_update_fn()
-
-Sets the update function for I<ctx> to I<update>.
-This is the function that is called by EVP_DigestUpdate(). If not set, the
-update function from the B<EVP_MD> type specified at initialization is used.
-
-=item EVP_MD_CTX_update_fn()
-
-Returns the update function for I<ctx>.
-
=item EVP_MD_get_flags()
Returns the I<md> flags. Note that these are different from the B<EVP_MD_CTX>
Some functions have been removed that were deprecated in previous
versions of OpenSSL. See L<ossl-removed-api(7)>.
+=head2 Upgrading from OpenSSL 3.x
+
+=head3 Removal of atexit() usage
+
libcrypto no longer arms OPENSSL_cleanup() function as atexit(3) handler.
Memory leak detectors may report there is allocated, but still reachable,
allocated memory at application exit. If clean report is desired, then
application must call OPENSSL_cleanup() explicitly before main() returns.
+=head3 Deprecation of EVP_MD_CTX_get0_md_data()
+
+The function EVP_MD_CTX_get0_md_data() has been deprecated in 4.0. This function
+is only useful in previous versions to obtain the data stored in an
+B<EVP_MD_CTX> by a custom EVP_MD implementation. However, the ability to create
+custom EVP_MD implementations has been removed in OpenSSL 4.0, so this function
+is no longer useful. It always returns NULL, so should simply be removed from
+applications that call it. Applications wishing to use a custom digest
+implementation should instead use the provider API.
+
=head1 OPENSSL 3.6
=head2 Main Changes from OpenSSL 3.5
EVP_PKEY_meth_get_param_check,
EVP_PKEY_meth_get_digest_custom,
BIO_f_reliable,
+EVP_MD_CTX_update_fn,
+EVP_MD_CTX_set_update_fn,
ossl-removed-api - API that has been removed from OpenSSL
=head1 SYNOPSIS
=item BIO_f_reliable (Broken since 3.0.0) - removed without replacement
+=item EVP_MD_CTX_update_fn (Deprecated in 3.0.0) - consult L<ossl-guide-migration(7)>
+
+=item EVP_MD_CTX_set_update_fn (Deprecated in 3.0.0) - consult L<ossl-guide-migration(7)>
+
=back
=head1 SEE ALSO
#ifndef OPENSSL_NO_DEPRECATED_3_0
OSSL_DEPRECATEDIN_3_0
const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx);
-OSSL_DEPRECATEDIN_3_0
-int (*EVP_MD_CTX_update_fn(EVP_MD_CTX *ctx))(EVP_MD_CTX *ctx,
- const void *data, size_t count);
-OSSL_DEPRECATEDIN_3_0
-void EVP_MD_CTX_set_update_fn(EVP_MD_CTX *ctx,
- int (*update)(EVP_MD_CTX *ctx,
- const void *data, size_t count));
+
#endif
int EVP_MD_CTX_get_size_ex(const EVP_MD_CTX *ctx);
EVP_PKEY_CTX *EVP_MD_CTX_get_pkey_ctx(const EVP_MD_CTX *ctx);
#define EVP_MD_CTX_pkey_ctx EVP_MD_CTX_get_pkey_ctx
void EVP_MD_CTX_set_pkey_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pctx);
+#ifndef OPENSSL_NO_DEPRECATED_4_0
+OSSL_DEPRECATEDIN_4_0
void *EVP_MD_CTX_get0_md_data(const EVP_MD_CTX *ctx);
#define EVP_MD_CTX_md_data EVP_MD_CTX_get0_md_data
+#endif
int EVP_CIPHER_get_nid(const EVP_CIPHER *cipher);
#define EVP_CIPHER_nid EVP_CIPHER_get_nid
EVP_MD_CTX_get0_md ? 4_0_0 EXIST::FUNCTION:
EVP_MD_CTX_get1_md ? 4_0_0 EXIST::FUNCTION:
EVP_MD_CTX_md ? 4_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_MD_CTX_update_fn ? 4_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0
-EVP_MD_CTX_set_update_fn ? 4_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0
EVP_MD_CTX_get_size_ex ? 4_0_0 EXIST::FUNCTION:
EVP_MD_CTX_get_pkey_ctx ? 4_0_0 EXIST::FUNCTION:
EVP_MD_CTX_set_pkey_ctx ? 4_0_0 EXIST::FUNCTION:
-EVP_MD_CTX_get0_md_data ? 4_0_0 EXIST::FUNCTION:
+EVP_MD_CTX_get0_md_data ? 4_0_0 EXIST::FUNCTION:DEPRECATEDIN_4_0
EVP_CIPHER_get_nid ? 4_0_0 EXIST::FUNCTION:
EVP_CIPHER_get0_name ? 4_0_0 EXIST::FUNCTION:
EVP_CIPHER_get0_description ? 4_0_0 EXIST::FUNCTION: