}
/*
- * Find an implementation of an ASN1 algorithm. If 'pe' is not NULL also
- * search through engines and set *pe to a functional reference to the engine
- * implementing 'type' or NULL if no engine implements it.
+ * Return ASN1 method for desired `type`, returns NULL if no method is found for
+ * `type`. If pe is not NULL, the function will set *pe to NULL to indicate no
+ * engine is used.
*/
-
const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type)
{
const EVP_PKEY_ASN1_METHOD *t;
#include <openssl/cmac.h>
#include <openssl/err.h>
#include "crypto/cmac.h"
+#include "internal/common.h"
#define LOCAL_BUF_SIZE 2048
struct CMAC_CTX_st {
}
int ossl_cmac_init(CMAC_CTX *ctx, const void *key, size_t keylen,
- const EVP_CIPHER *cipher, ENGINE *impl,
- const OSSL_PARAM param[])
+ const EVP_CIPHER *cipher, const OSSL_PARAM param[])
{
static const unsigned char zero_iv[EVP_MAX_BLOCK_LENGTH] = { 0 };
int block_len;
/* All zeros means restart */
- if (!key && !cipher && !impl && keylen == 0) {
+ if (key == NULL && cipher == NULL && keylen == 0) {
/* Not initialised */
if (ctx->nlast_block == -1)
return 0;
if (cipher != NULL) {
/* Ensure we can't use this ctx until we also have a key */
ctx->nlast_block = -1;
- if (impl != NULL) {
- if (!EVP_EncryptInit_ex(ctx->cctx, cipher, impl, NULL, NULL))
- return 0;
- } else {
- if (!EVP_EncryptInit_ex2(ctx->cctx, cipher, NULL, NULL, param))
- return 0;
- }
+ if (!EVP_EncryptInit_ex2(ctx->cctx, cipher, NULL, NULL, param))
+ return 0;
}
/* Non-NULL key means initialisation complete */
if (key != NULL) {
int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen,
const EVP_CIPHER *cipher, ENGINE *impl)
{
- return ossl_cmac_init(ctx, key, keylen, cipher, impl, NULL);
+ if (!ossl_assert(impl == NULL))
+ return 0;
+ return ossl_cmac_init(ctx, key, keylen, cipher, NULL);
}
int CMAC_Update(CMAC_CTX *ctx, const void *in, size_t dlen)
#include <openssl/core_names.h>
#include "internal/cryptlib.h"
#include "internal/refcount.h"
+#include "internal/common.h"
#include "crypto/evp.h"
#include "crypto/dh.h"
#include "dh_local.h"
-static DH *dh_new_intern(ENGINE *engine, OSSL_LIB_CTX *libctx);
+static DH *dh_new_intern(OSSL_LIB_CTX *libctx);
#ifndef FIPS_MODULE
int DH_set_method(DH *dh, const DH_METHOD *meth)
# ifndef OPENSSL_NO_DEPRECATED_3_0
DH *DH_new(void)
{
- return dh_new_intern(NULL, NULL);
+ return dh_new_intern(NULL);
}
# endif
DH *DH_new_method(ENGINE *engine)
{
- return dh_new_intern(engine, NULL);
+ if (!ossl_assert(engine == NULL))
+ return NULL;
+ return dh_new_intern(NULL);
}
#endif /* !FIPS_MODULE */
DH *ossl_dh_new_ex(OSSL_LIB_CTX *libctx)
{
- return dh_new_intern(NULL, libctx);
+ return dh_new_intern(libctx);
}
-static DH *dh_new_intern(ENGINE *engine, OSSL_LIB_CTX *libctx)
+static DH *dh_new_intern(OSSL_LIB_CTX *libctx)
{
DH *ret = OPENSSL_zalloc(sizeof(*ret));
#include <openssl/bn.h>
#include "internal/cryptlib.h"
#include "internal/refcount.h"
+#include "internal/common.h"
#include "crypto/dsa.h"
#include "crypto/dh.h" /* required by DSA_dup_DH() */
#include "dsa_local.h"
return NULL;
}
-DSA *DSA_new_method(ossl_unused ENGINE *engine)
+DSA *DSA_new_method(ENGINE *engine)
{
- if (engine != NULL)
+ if (!ossl_assert(engine == NULL))
return NULL;
return dsa_new_intern(NULL);
}
#include "internal/nelem.h"
#include "internal/provider.h"
#include "internal/core.h"
+#include "internal/common.h"
#include "crypto/evp.h"
#include "evp_local.h"
int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl)
{
- /* make the compiler happy */
- (void)impl;
+ if (!ossl_assert(impl == NULL))
+ return 0;
return evp_md_init_internal(ctx, type, NULL);
}
unsigned char *md, unsigned int *size, const EVP_MD *type,
ENGINE *impl)
{
- EVP_MD_CTX *ctx = EVP_MD_CTX_new();
+ EVP_MD_CTX *ctx;
int ret;
+ if (!ossl_assert(impl == NULL))
+ return 0;
+
+ ctx = EVP_MD_CTX_new();
if (ctx == NULL)
return 0;
EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT);
- ret = EVP_DigestInit_ex(ctx, type, impl)
+ ret = EVP_DigestInit_ex(ctx, type, NULL)
&& EVP_DigestUpdate(ctx, data, count)
&& EVP_DigestFinal_ex(ctx, md, size);
EVP_MD_CTX_free(ctx);
#include "internal/cryptlib.h"
#include "internal/provider.h"
#include "internal/core.h"
+#include "internal/common.h"
#include "internal/safe_math.h"
#include "crypto/evp.h"
#include "evp_local.h"
ENGINE *impl, const unsigned char *key,
const unsigned char *iv, int enc)
{
- /* to make the compilers happy */
- (void)impl;
+ if (!ossl_assert(impl == NULL))
+ return 0;
return evp_cipher_init_internal(ctx, cipher, key, iv, enc, 0, NULL);
}
ENGINE *impl, const unsigned char *key,
const unsigned char *iv)
{
- return EVP_CipherInit_ex(ctx, cipher, impl, key, iv, 1);
+ if (!ossl_assert(impl == NULL))
+ return 0;
+ return EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, 1);
}
int EVP_EncryptInit_ex2(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
ENGINE *impl, const unsigned char *key,
const unsigned char *iv)
{
- return EVP_CipherInit_ex(ctx, cipher, impl, key, iv, 0);
+ if (!ossl_assert(impl == NULL))
+ return 0;
+ return EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, 0);
}
int EVP_DecryptInit_ex2(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
#ifndef OPENSSL_NO_DEPRECATED_3_6
int ret;
const EVP_PKEY_ASN1_METHOD *ameth;
- ENGINE *e;
- ameth = EVP_PKEY_asn1_find(&e, type);
+ ameth = EVP_PKEY_asn1_find(NULL, type);
if (ameth)
ret = ameth->pkey_id;
else
#include "crypto/evp.h"
#include "internal/provider.h"
#include "internal/numbers.h" /* includes SIZE_MAX */
+#include "internal/common.h"
#include "evp_local.h"
static int update(EVP_MD_CTX *ctx, const void *data, size_t datalen)
static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
const EVP_MD *type, const char *mdname,
OSSL_LIB_CTX *libctx, const char *props,
- ENGINE *e, EVP_PKEY *pkey, int ver,
+ EVP_PKEY *pkey, int ver,
const OSSL_PARAM params[])
{
EVP_PKEY_CTX *locpctx = NULL;
if (ctx->pctx == NULL) {
reinit = 0;
- if (e == NULL)
- ctx->pctx = EVP_PKEY_CTX_new_from_pkey(libctx, pkey, props);
- else
- ctx->pctx = EVP_PKEY_CTX_new(pkey, e);
+ ctx->pctx = EVP_PKEY_CTX_new_from_pkey(libctx, pkey, props);
}
if (ctx->pctx == NULL)
return 0;
*pctx = ctx->pctx;
if (ctx->pctx->pmeth->flags & EVP_PKEY_FLAG_SIGCTX_CUSTOM)
return 1;
- if (!EVP_DigestInit_ex(ctx, type, e))
+ if (!EVP_DigestInit_ex(ctx, type, NULL))
return 0;
/*
* This indicates the current algorithm requires
const char *props, EVP_PKEY *pkey,
const OSSL_PARAM params[])
{
- return do_sigver_init(ctx, pctx, NULL, mdname, libctx, props, NULL, pkey, 0,
+ return do_sigver_init(ctx, pctx, NULL, mdname, libctx, props, pkey, 0,
params);
}
int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey)
{
- return do_sigver_init(ctx, pctx, type, NULL, NULL, NULL, e, pkey, 0,
+ if (!ossl_assert(e == NULL))
+ return 0;
+ return do_sigver_init(ctx, pctx, type, NULL, NULL, NULL, pkey, 0,
NULL);
}
const char *props, EVP_PKEY *pkey,
const OSSL_PARAM params[])
{
- return do_sigver_init(ctx, pctx, NULL, mdname, libctx, props, NULL, pkey, 1,
+ return do_sigver_init(ctx, pctx, NULL, mdname, libctx, props, pkey, 1,
params);
}
int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey)
{
- return do_sigver_init(ctx, pctx, type, NULL, NULL, NULL, e, pkey, 1,
+ if (!ossl_assert(e == NULL))
+ return 0;
+ return do_sigver_init(ctx, pctx, type, NULL, NULL, NULL, pkey, 1,
NULL);
}
# include "crypto/x509.h"
#endif
#include "internal/provider.h"
+#include "internal/common.h"
#include "evp_local.h"
static int pkey_set_type(EVP_PKEY *pkey, int type, const char *str,
const unsigned char *priv,
size_t len)
{
- /* make the compiler happy */
- (void)e;
+ if (!ossl_assert(e == NULL))
+ return NULL;
return new_raw_key_int(NULL, NULL, NULL, type, priv, len, 1);
}
const unsigned char *pub,
size_t len)
{
- /* make the compiler happy */
- (void)e;
+ if (!ossl_assert(e == NULL))
+ return NULL;
return new_raw_key_int(NULL, NULL, NULL, type, pub, len, 0);
}
EVP_PKEY *EVP_PKEY_new_CMAC_key(ENGINE *e, const unsigned char *priv,
size_t len, const EVP_CIPHER *cipher)
{
+ if (!ossl_assert(e == NULL))
+ return NULL;
return new_cmac_key_int(priv, len, NULL, cipher, NULL, NULL);
}
void evp_pkey_free_legacy(EVP_PKEY *x)
{
const EVP_PKEY_ASN1_METHOD *ameth = x->ameth;
- ENGINE *tmpe = NULL;
if (ameth == NULL && x->legacy_cache_pkey.ptr != NULL)
- ameth = EVP_PKEY_asn1_find(&tmpe, x->type);
+ ameth = EVP_PKEY_asn1_find(NULL, x->type);
if (ameth != NULL) {
if (x->legacy_cache_pkey.ptr != NULL) {
#include <openssl/core_names.h>
#include "internal/cryptlib.h"
#include "internal/core.h"
+#include "internal/common.h"
#include <openssl/objects.h>
#include <openssl/evp.h>
#include "crypto/bn.h"
{
EVP_PKEY_CTX *mac_ctx = NULL;
EVP_PKEY *mac_key = NULL;
- mac_ctx = EVP_PKEY_CTX_new_id(type, e);
+
+ if (!ossl_assert(e == NULL))
+ return NULL;
+ mac_ctx = EVP_PKEY_CTX_new_id(type, NULL);
if (!mac_ctx)
return NULL;
if (EVP_PKEY_keygen_init(mac_ctx) <= 0)
#include "internal/ffc.h"
#include "internal/numbers.h"
#include "internal/provider.h"
+#include "internal/common.h"
#include "evp_local.h"
#ifndef FIPS_MODULE
return EVP_PKEY_STATE_LEGACY;
}
-static EVP_PKEY_CTX *int_ctx_new(OSSL_LIB_CTX *libctx,
- EVP_PKEY *pkey, ENGINE *e,
+static EVP_PKEY_CTX *int_ctx_new(OSSL_LIB_CTX *libctx, EVP_PKEY *pkey,
const char *keytype, const char *propquery,
int id)
}
}
/* If no ID was found here, we can only resort to find a keymgmt */
- if (id == -1) {
-#ifndef FIPS_MODULE
- /* Using engine with a key without id will not work */
- if (e != NULL) {
- ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM);
- return NULL;
- }
-#endif
+ if (id == -1)
goto common;
- }
#ifndef FIPS_MODULE
/*
* Here, we extract what information we can for the purpose of
* supporting usage with implementations from providers, to make
* for a smooth transition from legacy stuff to provider based stuff.
- *
- * If an engine is given, this is entirely legacy, and we should not
- * pretend anything else, so we clear the name.
*/
- if (e != NULL)
- keytype = NULL;
- if (e == NULL && (pkey == NULL || pkey->foreign == 0))
+ if (pkey == NULL || pkey->foreign == 0)
keytype = OBJ_nid2sn(id);
if (pkey != NULL && pkey->foreign)
#endif /* FIPS_MODULE */
common:
/*
- * If there's no engine and no app supplied pmeth and there's a name, we try
+ * If there's no app supplied pmeth and there's a name, we try
* fetching a provider implementation.
*/
- if (e == NULL && app_pmeth == NULL && keytype != NULL) {
+ if (app_pmeth == NULL && keytype != NULL) {
/*
* If |pkey| is given and is provided, we take a reference to its
* keymgmt. Otherwise, we fetch one for the keytype we got. This
const char *name,
const char *propquery)
{
- return int_ctx_new(libctx, NULL, NULL, name, propquery, -1);
+ return int_ctx_new(libctx, NULL, name, propquery, -1);
}
EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_pkey(OSSL_LIB_CTX *libctx, EVP_PKEY *pkey,
const char *propquery)
{
- return int_ctx_new(libctx, pkey, NULL, NULL, propquery, -1);
+ return int_ctx_new(libctx, pkey, NULL, propquery, -1);
}
void evp_pkey_ctx_free_old_ops(EVP_PKEY_CTX *ctx)
EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e)
{
- return int_ctx_new(NULL, pkey, e, NULL, NULL, -1);
+ if (!ossl_assert(e == NULL))
+ return NULL;
+ return int_ctx_new(NULL, pkey, NULL, NULL, -1);
}
EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e)
{
- return int_ctx_new(NULL, NULL, e, NULL, NULL, id);
+ if (!ossl_assert(e == NULL))
+ return NULL;
+ return int_ctx_new(NULL, NULL, NULL, NULL, id);
}
EVP_PKEY_CTX *EVP_PKEY_CTX_dup(const EVP_PKEY_CTX *pctx)
if (md != NULL && md != ctx->md && (key == NULL || len < 0))
return 0;
+ if (impl != NULL)
+ return 0;
+
if (md != NULL)
ctx->md = md;
else if (ctx->md != NULL)
return 0;
#ifdef OPENSSL_HMAC_S390X
- rv = s390x_HMAC_init(ctx, key, len, impl);
+ rv = s390x_HMAC_init(ctx, key, len);
if (rv >= 1)
return rv;
#endif
if (j < 0)
return 0;
if (j < len) {
- if (!EVP_DigestInit_ex(ctx->md_ctx, md, impl)
+ if (!EVP_DigestInit_ex(ctx->md_ctx, md, NULL)
|| !EVP_DigestUpdate(ctx->md_ctx, key, len)
|| !EVP_DigestFinal_ex(ctx->md_ctx, keytmp,
&keytmp_length))
for (i = 0; i < HMAC_MAX_MD_CBLOCK_SIZE; i++)
pad[i] = 0x36 ^ keytmp[i];
- if (!EVP_DigestInit_ex(ctx->i_ctx, md, impl)
+ if (!EVP_DigestInit_ex(ctx->i_ctx, md, NULL)
|| !EVP_DigestUpdate(ctx->i_ctx, pad,
EVP_MD_get_block_size(md)))
goto err;
for (i = 0; i < HMAC_MAX_MD_CBLOCK_SIZE; i++)
pad[i] = 0x5c ^ keytmp[i];
- if (!EVP_DigestInit_ex(ctx->o_ctx, md, impl)
+ if (!EVP_DigestInit_ex(ctx->o_ctx, md, NULL)
|| !EVP_DigestUpdate(ctx->o_ctx, pad,
EVP_MD_get_block_size(md)))
goto err;
# ifdef OPENSSL_HMAC_S390X
# define HMAC_S390X_BUF_NUM_BLOCKS 64
-int s390x_HMAC_init(HMAC_CTX *ctx, const void *key, int key_len, ENGINE *impl);
+int s390x_HMAC_init(HMAC_CTX *ctx, const void *key, int key_len);
int s390x_HMAC_update(HMAC_CTX *ctx, const unsigned char *data, size_t len);
int s390x_HMAC_final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);
int s390x_HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
ctx->plat.s390x.ikp = 1;
}
-int s390x_HMAC_init(HMAC_CTX *ctx, const void *key, int key_len, ENGINE *impl)
+int s390x_HMAC_init(HMAC_CTX *ctx, const void *key, int key_len)
{
unsigned char *key_param;
unsigned int key_param_len;
return 0;
if (key_len > ctx->plat.s390x.blk_size) {
- if (!EVP_DigestInit_ex(ctx->md_ctx, ctx->md, impl)
+ if (!EVP_DigestInit_ex(ctx->md_ctx, ctx->md, NULL)
|| !EVP_DigestUpdate(ctx->md_ctx, key, key_len)
|| !EVP_DigestFinal_ex(ctx->md_ctx, key_param,
&key_param_len))
const EVP_PKEY_ASN1_METHOD *ameth;
slen = ossl_pem_check_suffix(nm, "PARAMETERS");
if (slen > 0) {
- ENGINE *e;
- ameth = EVP_PKEY_asn1_find_str(&e, nm, slen);
+ ameth = EVP_PKEY_asn1_find_str(NULL, nm, slen);
if (ameth) {
int r;
if (ameth->param_decode)
#include "rand_local.h"
#include "crypto/context.h"
#include "internal/provider.h"
+#include "internal/common.h"
#ifndef OPENSSL_DEFAULT_SEED_SRC
# define OPENSSL_DEFAULT_SEED_SRC SEED-SRC
# ifndef OPENSSL_NO_DEPRECATED_3_0
static int rand_set_rand_method_internal(const RAND_METHOD *meth,
- ossl_unused ENGINE *e)
+ ENGINE *e)
{
+ if (!ossl_assert(e == NULL))
+ return 0;
if (!RUN_ONCE(&rand_init, do_rand_init))
return 0;
#include <openssl/param_build.h>
#include "internal/cryptlib.h"
#include "internal/refcount.h"
+#include "internal/common.h"
#include "crypto/bn.h"
#include "crypto/evp.h"
#include "crypto/rsa.h"
#include "crypto/security_bits.h"
#include "rsa_local.h"
-static RSA *rsa_new_intern(ENGINE *engine, OSSL_LIB_CTX *libctx);
+static RSA *rsa_new_intern(OSSL_LIB_CTX *libctx);
#ifndef FIPS_MODULE
RSA *RSA_new(void)
{
- return rsa_new_intern(NULL, NULL);
+ return rsa_new_intern(NULL);
}
const RSA_METHOD *RSA_get_method(const RSA *rsa)
RSA *RSA_new_method(ENGINE *engine)
{
- return rsa_new_intern(engine, NULL);
+ if (!ossl_assert(engine == NULL))
+ return NULL;
+ return rsa_new_intern(NULL);
}
#endif
RSA *ossl_rsa_new_with_ctx(OSSL_LIB_CTX *libctx)
{
- return rsa_new_intern(NULL, libctx);
+ return rsa_new_intern(libctx);
}
-static RSA *rsa_new_intern(ENGINE *engine, OSSL_LIB_CTX *libctx)
+static RSA *rsa_new_intern(OSSL_LIB_CTX *libctx)
{
RSA *ret = OPENSSL_zalloc(sizeof(*ret));
#include <openssl/err.h>
#include <openssl/lhash.h>
+#include "internal/common.h"
#include "store_local.h"
static CRYPTO_RWLOCK *registry_lock;
{
OSSL_STORE_LOADER *res = NULL;
+ if (!ossl_assert(e == NULL))
+ return NULL;
/*
* We usually don't check NULL arguments. For loaders, though, the
* scheme is crucial and must never be NULL, or the user will get
# include <openssl/params.h>
int ossl_cmac_init(CMAC_CTX *ctx, const void *key, size_t keylen,
- const EVP_CIPHER *cipher, ENGINE *impl,
- const OSSL_PARAM param[]);
+ const EVP_CIPHER *cipher, const OSSL_PARAM param[]);
#endif /* OSSL_CRYPTO_CMAC_H */
OSSL_DEPRECATEDIN_3_0 int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in);
OSSL_DEPRECATEDIN_3_0 int CMAC_Init(CMAC_CTX *ctx,
const void *key, size_t keylen,
- const EVP_CIPHER *cipher, ENGINE *impl);
+ const EVP_CIPHER *cipher,
+ ENGINE *impl /* must be NULL */);
OSSL_DEPRECATEDIN_3_0 int CMAC_Update(CMAC_CTX *ctx,
const void *data, size_t dlen);
OSSL_DEPRECATEDIN_3_0 int CMAC_Final(CMAC_CTX *ctx,
OSSL_DEPRECATEDIN_3_0 void DH_set_default_method(const DH_METHOD *meth);
OSSL_DEPRECATEDIN_3_0 const DH_METHOD *DH_get_default_method(void);
OSSL_DEPRECATEDIN_3_0 int DH_set_method(DH *dh, const DH_METHOD *meth);
-OSSL_DEPRECATEDIN_3_0 DH *DH_new_method(ENGINE *engine);
+OSSL_DEPRECATEDIN_3_0 DH *DH_new_method(ENGINE *engine /* must be NULL */);
OSSL_DEPRECATEDIN_3_0 DH *DH_new(void);
OSSL_DEPRECATEDIN_3_0 void DH_free(DH *dh);
OSSL_DEPRECATEDIN_3_0 const DSA_METHOD *DSA_get_method(DSA *d);
OSSL_DEPRECATEDIN_3_0 DSA *DSA_new(void);
-OSSL_DEPRECATEDIN_3_0 DSA *DSA_new_method(ENGINE *engine);
+OSSL_DEPRECATEDIN_3_0 DSA *DSA_new_method(ENGINE *engine /* must be NULL */);
OSSL_DEPRECATEDIN_3_0 void DSA_free(DSA *r);
/* "up" the DSA object's reference count */
OSSL_DEPRECATEDIN_3_0 int DSA_up_ref(DSA *r);
__owur int EVP_DigestInit_ex2(EVP_MD_CTX *ctx, const EVP_MD *type,
const OSSL_PARAM params[]);
__owur int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type,
- ENGINE *impl);
+ ENGINE *impl /* must be NULL */);
__owur int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d,
size_t cnt);
__owur int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md,
__owur int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
const unsigned char *key, const unsigned char *iv);
__owur int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx,
- const EVP_CIPHER *cipher, ENGINE *impl,
- const unsigned char *key,
- const unsigned char *iv);
+ const EVP_CIPHER *cipher,
+ ENGINE *impl /* must be NULL */,
+ const unsigned char *key,
+ const unsigned char *iv);
__owur int EVP_EncryptInit_ex2(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
const unsigned char *key,
const unsigned char *iv,
__owur int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
const unsigned char *key, const unsigned char *iv);
__owur int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx,
- const EVP_CIPHER *cipher, ENGINE *impl,
- const unsigned char *key,
- const unsigned char *iv);
+ const EVP_CIPHER *cipher,
+ ENGINE *impl /* must be NULL */,
+ const unsigned char *key,
+ const unsigned char *iv);
__owur int EVP_DecryptInit_ex2(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
const unsigned char *key,
const unsigned char *iv,
const unsigned char *key, const unsigned char *iv,
int enc);
__owur int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx,
- const EVP_CIPHER *cipher, ENGINE *impl,
- const unsigned char *key,
- const unsigned char *iv, int enc);
+ const EVP_CIPHER *cipher,
+ ENGINE *impl /* must be NULL */,
+ const unsigned char *key,
+ const unsigned char *iv, int enc);
__owur int EVP_CipherInit_SKEY(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
EVP_SKEY *skey, const unsigned char *iv, size_t iv_len,
int enc, const OSSL_PARAM params[]);
const char *props, EVP_PKEY *pkey,
const OSSL_PARAM params[]);
__owur int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
- const EVP_MD *type, ENGINE *e,
- EVP_PKEY *pkey);
+ const EVP_MD *type,
+ ENGINE *e /* must be NULL */,
+ EVP_PKEY *pkey);
__owur int EVP_DigestSignUpdate(EVP_MD_CTX *ctx, const void *data, size_t dsize);
__owur int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
size_t *siglen);
const char *props, EVP_PKEY *pkey,
const OSSL_PARAM params[]);
__owur int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
- const EVP_MD *type, ENGINE *e,
+ const EVP_MD *type,
+ ENGINE *e /* must be NULL */,
EVP_PKEY *pkey);
int EVP_DigestVerifyUpdate(EVP_MD_CTX *ctx, const void *data, size_t dsize);
__owur int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig,
const OSSL_PARAM *EVP_SKEYMGMT_get0_gen_settable_params(const EVP_SKEYMGMT *skeymgmt);
const OSSL_PARAM *EVP_SKEYMGMT_get0_imp_settable_params(const EVP_SKEYMGMT *skeymgmt);
-EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e);
-EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e);
+EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e /* must be NULL */);
+EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e /* must be NULL */);
EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_name(OSSL_LIB_CTX *libctx,
const char *name,
const char *propquery);
int EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx);
void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen);
-EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e,
+EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e /* must be NULL */,
const unsigned char *key, int keylen);
EVP_PKEY *EVP_PKEY_new_raw_private_key_ex(OSSL_LIB_CTX *libctx,
const char *keytype,
const char *propq,
const unsigned char *priv, size_t len);
-EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *e,
+EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *e /* must be NULL */,
const unsigned char *priv,
size_t len);
EVP_PKEY *EVP_PKEY_new_raw_public_key_ex(OSSL_LIB_CTX *libctx,
const char *keytype, const char *propq,
const unsigned char *pub, size_t len);
-EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *e,
+EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *e /* must be NULL */,
const unsigned char *pub,
size_t len);
int EVP_PKEY_get_raw_private_key(const EVP_PKEY *pkey, unsigned char *priv,
# ifndef OPENSSL_NO_DEPRECATED_3_0
OSSL_DEPRECATEDIN_3_0
-EVP_PKEY *EVP_PKEY_new_CMAC_key(ENGINE *e, const unsigned char *priv,
+EVP_PKEY *EVP_PKEY_new_CMAC_key(ENGINE *e /* must be NULL */,
+ const unsigned char *priv,
size_t len, const EVP_CIPHER *cipher);
# endif
# endif
# ifndef OPENSSL_NO_DEPRECATED_3_0
OSSL_DEPRECATEDIN_3_0 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
- const EVP_MD *md, ENGINE *impl);
+ const EVP_MD *md,
+ ENGINE *impl /* must be NULL */);
OSSL_DEPRECATEDIN_3_0 int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data,
size_t len);
OSSL_DEPRECATEDIN_3_0 int HMAC_Final(HMAC_CTX *ctx, unsigned char *md,
# ifndef OPENSSL_NO_DEPRECATED_3_0
OSSL_DEPRECATEDIN_3_0 RSA *RSA_new(void);
-OSSL_DEPRECATEDIN_3_0 RSA *RSA_new_method(ENGINE *engine);
+OSSL_DEPRECATEDIN_3_0 RSA *RSA_new_method(ENGINE *engine /* must be NULL */);
OSSL_DEPRECATEDIN_3_0 int RSA_bits(const RSA *rsa);
OSSL_DEPRECATEDIN_3_0 int RSA_size(const RSA *rsa);
OSSL_DEPRECATEDIN_3_0 int RSA_security_bits(const RSA *rsa);
# endif
# ifndef OPENSSL_NO_DEPRECATED_3_0
OSSL_DEPRECATEDIN_3_0
-OSSL_STORE_LOADER *OSSL_STORE_LOADER_new(ENGINE *e, const char *scheme);
+OSSL_STORE_LOADER *OSSL_STORE_LOADER_new(ENGINE *e /* must be NULL */,
+ const char *scheme);
OSSL_DEPRECATEDIN_3_0
int OSSL_STORE_LOADER_set_open(OSSL_STORE_LOADER *loader,
OSSL_STORE_open_fn open_function);
p = prms;
#endif
rv = ossl_cmac_init(macctx->ctx, key, keylen,
- ossl_prov_cipher_cipher(&macctx->cipher),
- NULL, p);
+ ossl_prov_cipher_cipher(&macctx->cipher), p);
ossl_prov_cipher_reset(&macctx->cipher);
return rv;
}