*/
#include <openssl/crypto.h>
-#include <openssl/core_numbers.h>
+#include <openssl/core_dispatch.h>
#include <openssl/core_names.h>
#include <openssl/err.h>
#include <openssl/params.h>
#include <openssl/err.h>
#include "internal/nelem.h"
#include "internal/sizes.h"
-#include "prov/providercommonerr.h"
+#include "prov/providercommon.h"
#include "prov/implementations.h"
#include "prov/providercommonerr.h"
#include "prov/provider_ctx.h"
#include "crypto/ecx.h"
-static OSSL_OP_signature_newctx_fn eddsa_newctx;
-static OSSL_OP_signature_digest_sign_init_fn eddsa_digest_signverify_init;
-static OSSL_OP_signature_digest_sign_fn ed25519_digest_sign;
-static OSSL_OP_signature_digest_sign_fn ed448_digest_sign;
-static OSSL_OP_signature_digest_verify_fn ed25519_digest_verify;
-static OSSL_OP_signature_digest_verify_fn ed448_digest_verify;
-static OSSL_OP_signature_freectx_fn eddsa_freectx;
-static OSSL_OP_signature_dupctx_fn eddsa_dupctx;
+static OSSL_FUNC_signature_newctx_fn eddsa_newctx;
+static OSSL_FUNC_signature_digest_sign_init_fn eddsa_digest_signverify_init;
+static OSSL_FUNC_signature_digest_sign_fn ed25519_digest_sign;
+static OSSL_FUNC_signature_digest_sign_fn ed448_digest_sign;
+static OSSL_FUNC_signature_digest_verify_fn ed25519_digest_verify;
+static OSSL_FUNC_signature_digest_verify_fn ed448_digest_verify;
+static OSSL_FUNC_signature_freectx_fn eddsa_freectx;
+static OSSL_FUNC_signature_dupctx_fn eddsa_dupctx;
typedef struct {
OPENSSL_CTX *libctx;
static void *eddsa_newctx(void *provctx, const char *propq_unused)
{
- PROV_EDDSA_CTX *peddsactx = OPENSSL_zalloc(sizeof(PROV_EDDSA_CTX));
+ PROV_EDDSA_CTX *peddsactx;
+
+ if (!ossl_prov_is_running())
+ return NULL;
+ peddsactx = OPENSSL_zalloc(sizeof(PROV_EDDSA_CTX));
if (peddsactx == NULL) {
PROVerr(0, ERR_R_MALLOC_FAILURE);
return NULL;
PROV_EDDSA_CTX *peddsactx = (PROV_EDDSA_CTX *)vpeddsactx;
ECX_KEY *edkey = (ECX_KEY *)vedkey;
- if (mdname != NULL) {
+ if (!ossl_prov_is_running())
+ return 0;
+
+ if (mdname != NULL && mdname[0] != '\0') {
PROVerr(0, PROV_R_INVALID_DIGEST);
return 0;
}
PROV_EDDSA_CTX *peddsactx = (PROV_EDDSA_CTX *)vpeddsactx;
const ECX_KEY *edkey = peddsactx->key;
+ if (!ossl_prov_is_running())
+ return 0;
+
if (sigret == NULL) {
*siglen = ED25519_SIGSIZE;
return 1;
PROV_EDDSA_CTX *peddsactx = (PROV_EDDSA_CTX *)vpeddsactx;
const ECX_KEY *edkey = peddsactx->key;
+ if (!ossl_prov_is_running())
+ return 0;
+
if (sigret == NULL) {
*siglen = ED448_SIGSIZE;
return 1;
PROV_EDDSA_CTX *peddsactx = (PROV_EDDSA_CTX *)vpeddsactx;
const ECX_KEY *edkey = peddsactx->key;
- if (siglen != ED25519_SIGSIZE)
+ if (!ossl_prov_is_running() || siglen != ED25519_SIGSIZE)
return 0;
return ED25519_verify(tbs, tbslen, sig, edkey->pubkey, peddsactx->libctx,
PROV_EDDSA_CTX *peddsactx = (PROV_EDDSA_CTX *)vpeddsactx;
const ECX_KEY *edkey = peddsactx->key;
- if (siglen != ED448_SIGSIZE)
+ if (!ossl_prov_is_running() || siglen != ED448_SIGSIZE)
return 0;
return ED448_verify(peddsactx->libctx, tbs, tbslen, sig, edkey->pubkey,
PROV_EDDSA_CTX *srcctx = (PROV_EDDSA_CTX *)vpeddsactx;
PROV_EDDSA_CTX *dstctx;
+ if (!ossl_prov_is_running())
+ return NULL;
+
dstctx = OPENSSL_zalloc(sizeof(*srcctx));
if (dstctx == NULL)
return NULL;