The legacy support stays in 3.0. The TODOs are dropped.
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14404)
EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED);
}
- /* TODO(3.0): Remove legacy code below */
+ /* Code below to be removed when legacy support is dropped. */
/*
* Don't assume ctx->md_data was cleaned in EVP_Digest_Final, because
type = ctx->digest;
}
- /* TODO(3.0): Legacy work around code below. Remove this */
+ /* Code below to be removed when legacy support is dropped. */
#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
/*
* Whether it's nice or not, "Inits" can be used on "Final"'d contexts so
ctx->md_data = NULL;
}
- /* TODO(3.0): Start of non-legacy code below */
+ /* Start of non-legacy code below */
if (type->prov == NULL) {
#ifdef FIPS_MODULE
return ctx->digest->dinit(ctx->provctx);
- /* TODO(3.0): Remove legacy code below */
+ /* Code below to be removed when legacy support is dropped. */
legacy:
#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
}
return ctx->digest->dupdate(ctx->provctx, data, count);
- /* TODO(3.0): Remove legacy code below */
+ /* Code below to be removed when legacy support is dropped. */
legacy:
return ctx->update(ctx, data, count);
}
return ret;
- /* TODO(3.0): Remove legacy code below */
+ /* Code below to be removed when legacy support is dropped. */
legacy:
OPENSSL_assert(mdsize <= EVP_MAX_MD_SIZE);
ret = ctx->digest->final(ctx, md);
return 1;
- /* TODO(3.0): Remove legacy code below */
+ /* Code below to be removed when legacy support is dropped. */
legacy:
#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
/* Make sure it's safe to copy a digest context using an ENGINE */
goto conclude;
-/* TODO(3.0): Remove legacy code below */
+ /* Code below to be removed when legacy support is dropped. */
legacy:
if (ctx->digest->md_ctrl == NULL) {
ERR_raise(ERR_LIB_EVP, EVP_R_CTRL_NOT_IMPLEMENTED);
return 1;
- /* TODO(3.0): Remove legacy code below */
+ /* Remove legacy code below when legacy support is removed. */
legacy:
if (ctx->cipher != NULL) {
return 0;
}
- /* TODO(3.0): Legacy work around code below. Remove this */
+ /* Code below to be removed when legacy support is dropped. */
#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
/*
}
- /* TODO(3.0): Start of non-legacy code below */
+ /* Start of non-legacy code below */
/* Ensure a context left lying around from last time is cleared */
if (cipher != NULL && ctx->cipher != NULL) {
iv == NULL ? 0
: EVP_CIPHER_CTX_iv_length(ctx));
- /* TODO(3.0): Remove legacy code below */
+ /* Code below to be removed when legacy support is dropped. */
legacy:
if (cipher != NULL) {
return ret;
- /* TODO(3.0): Remove legacy code below */
+ /* Code below to be removed when legacy support is dropped. */
legacy:
return evp_EncryptDecryptUpdate(ctx, out, outl, in, inl);
return ret;
- /* TODO(3.0): Remove legacy code below */
+ /* Code below to be removed when legacy support is dropped. */
legacy:
if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) {
return ret;
- /* TODO(3.0): Remove legacy code below */
+ /* Code below to be removed when legacy support is dropped. */
legacy:
b = ctx->cipher->block_size;
return ret;
- /* TODO(3.0): Remove legacy code below */
+ /* Code below to be removed when legacy support is dropped. */
legacy:
*outl = 0;
return ok > 0 ? 1 : 0;
}
- /* TODO(3.0) legacy code follows */
+ /* Code below to be removed when legacy support is dropped. */
/*
* Note there have never been any built-in ciphers that define this flag
case EVP_CTRL_INIT:
/*
- * TODO(3.0) EVP_CTRL_INIT is purely legacy, no provider counterpart
+ * EVP_CTRL_INIT is purely legacy, no provider counterpart.
* As a matter of fact, this should be dead code, but some caller
* might still do a direct control call with this command, so...
* Legacy methods return 1 except for exceptional circumstances, so
ret = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->provctx, params);
goto end;
-/* TODO(3.0): Remove legacy code below */
+ /* Code below to be removed when legacy support is dropped. */
legacy:
if (ctx->cipher->ctrl == NULL) {
ERR_raise(ERR_LIB_EVP, EVP_R_CTRL_NOT_IMPLEMENTED);
return 1;
- /* TODO(3.0): Remove legacy code below */
+ /* Code below to be removed when legacy support is dropped. */
legacy:
#if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODULE)
if (rv == EVP_CTRL_RET_UNSUPPORTED)
goto legacy;
return rv != 0 ? (int)v : -1;
- /* TODO (3.0) Remove legacy support */
+ /* Code below to be removed when legacy support is dropped. */
legacy:
if ((EVP_CIPHER_flags(ctx->cipher) & EVP_CIPH_CUSTOM_IV_LENGTH) != 0) {
rv = EVP_CIPHER_CTX_ctrl((EVP_CIPHER_CTX *)ctx, EVP_CTRL_GET_IVLEN,
}
#ifndef FIPS_MODULE
- /*
- * TODO(3.0) This legacy code section should be removed when we stop
- * supporting engines
- */
+ /* Code below to be removed when legacy support is dropped. */
/* BEGIN legacy */
if (id == -1) {
if (pkey != NULL)
return EVP_PKEY_CTX_get_params(ctx, params);
}
+/* TODO(3.0): Deprecate in favour of get_signature_md_name */
int EVP_PKEY_CTX_get_signature_md(EVP_PKEY_CTX *ctx, const EVP_MD **md)
{
OSSL_PARAM sig_md_params[2], *p = sig_md_params;
return -2;
}
- /* TODO(3.0): Remove this eventually when no more legacy */
if (ctx->op.sig.sigprovctx == NULL)
return EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG,
EVP_PKEY_CTRL_GET_MD, 0, (void *)(md));
return 1;
}
+/*
+ * TODO(3.0): Deprecate functions calling this in favour of
+ * functions setting md name.
+ */
static int evp_pkey_ctx_set_md(EVP_PKEY_CTX *ctx, const EVP_MD *md,
int fallback, const char *param, int op,
int ctrl)
return -2;
}
- /* TODO(3.0): Remove this eventually when no more legacy */
if (fallback)
return EVP_PKEY_CTX_ctrl(ctx, -1, op, ctrl, 0, (void *)(md));
return -2;
}
- /* TODO(3.0): Remove this eventually when no more legacy */
+ /* Code below to be removed when legacy support is dropped. */
if (fallback)
return EVP_PKEY_CTX_ctrl(ctx, -1, op, ctrl, datalen, (void *)(data));
+ /* end of legacy support */
if (datalen < 0) {
ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_LENGTH);
return -2;
}
- /* TODO(3.0): Remove this eventually when no more legacy */
+ /* Code below to be removed when legacy support is dropped. */
if (ctx->op.kex.exchprovctx == NULL)
return EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_DERIVE,
EVP_PKEY_CTRL_HKDF_MODE, mode, NULL);
-
+ /* end of legacy support */
if (mode < 0) {
ERR_raise(ERR_LIB_EVP, EVP_R_INVALID_VALUE);
return -2;
}
- /* TODO(3.0): Remove this eventually when no more legacy */
+ /* Code below to be removed when legacy support is dropped. */
if (ctx->op.kex.exchprovctx == NULL)
return EVP_PKEY_CTX_ctrl_uint64(ctx, -1, op, ctrl, val);
+ /* end of legacy support */
*p++ = OSSL_PARAM_construct_uint64(param, &val);
*p = OSSL_PARAM_construct_end();