Lines Matching refs:signature
23 EVP_SIGNATURE *signature = OPENSSL_zalloc(sizeof(EVP_SIGNATURE));
25 if (signature == NULL) {
30 signature->lock = CRYPTO_THREAD_lock_new();
31 if (signature->lock == NULL) {
33 OPENSSL_free(signature);
36 signature->prov = prov;
38 signature->refcnt = 1;
40 return signature;
48 EVP_SIGNATURE *signature = NULL;
53 if ((signature = evp_signature_new(prov)) == NULL) {
58 signature->name_id = name_id;
59 if ((signature->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
61 signature->description = algodef->algorithm_description;
66 if (signature->newctx != NULL)
68 signature->newctx = OSSL_FUNC_signature_newctx(fns);
72 if (signature->sign_init != NULL)
74 signature->sign_init = OSSL_FUNC_signature_sign_init(fns);
78 if (signature->sign != NULL)
80 signature->sign = OSSL_FUNC_signature_sign(fns);
84 if (signature->verify_init != NULL)
86 signature->verify_init = OSSL_FUNC_signature_verify_init(fns);
90 if (signature->verify != NULL)
92 signature->verify = OSSL_FUNC_signature_verify(fns);
96 if (signature->verify_recover_init != NULL)
98 signature->verify_recover_init
103 if (signature->verify_recover != NULL)
105 signature->verify_recover
110 if (signature->digest_sign_init != NULL)
112 signature->digest_sign_init
116 if (signature->digest_sign_update != NULL)
118 signature->digest_sign_update
123 if (signature->digest_sign_final != NULL)
125 signature->digest_sign_final
130 if (signature->digest_sign != NULL)
132 signature->digest_sign
136 if (signature->digest_verify_init != NULL)
138 signature->digest_verify_init
142 if (signature->digest_verify_update != NULL)
144 signature->digest_verify_update
149 if (signature->digest_verify_final != NULL)
151 signature->digest_verify_final
156 if (signature->digest_verify != NULL)
158 signature->digest_verify
162 if (signature->freectx != NULL)
164 signature->freectx = OSSL_FUNC_signature_freectx(fns);
168 if (signature->dupctx != NULL)
170 signature->dupctx = OSSL_FUNC_signature_dupctx(fns);
173 if (signature->get_ctx_params != NULL)
175 signature->get_ctx_params
180 if (signature->gettable_ctx_params != NULL)
182 signature->gettable_ctx_params
187 if (signature->set_ctx_params != NULL)
189 signature->set_ctx_params
194 if (signature->settable_ctx_params != NULL)
196 signature->settable_ctx_params
201 if (signature->get_ctx_md_params != NULL)
203 signature->get_ctx_md_params
208 if (signature->gettable_ctx_md_params != NULL)
210 signature->gettable_ctx_md_params
215 if (signature->set_ctx_md_params != NULL)
217 signature->set_ctx_md_params
222 if (signature->settable_ctx_md_params != NULL)
224 signature->settable_ctx_md_params
236 && signature->digest_sign == NULL
237 && signature->digest_verify == NULL)
242 || (digsignfncnt == 2 && signature->digest_sign_init == NULL)
244 || (digverifyfncnt == 2 && signature->digest_verify_init == NULL)
245 || (signature->digest_sign != NULL
246 && signature->digest_sign_init == NULL)
247 || (signature->digest_verify != NULL
248 && signature->digest_verify_init == NULL)
256 * "signature" functions:
274 return signature;
276 EVP_SIGNATURE_free(signature);
280 void EVP_SIGNATURE_free(EVP_SIGNATURE *signature)
284 if (signature == NULL)
286 CRYPTO_DOWN_REF(&signature->refcnt, &i, signature->lock);
289 OPENSSL_free(signature->type_name);
290 ossl_provider_free(signature->prov);
291 CRYPTO_THREAD_lock_free(signature->lock);
292 OPENSSL_free(signature);
295 int EVP_SIGNATURE_up_ref(EVP_SIGNATURE *signature)
299 CRYPTO_UP_REF(&signature->refcnt, &ref, signature->lock);
303 OSSL_PROVIDER *EVP_SIGNATURE_get0_provider(const EVP_SIGNATURE *signature)
305 return signature->prov;
328 int EVP_SIGNATURE_is_a(const EVP_SIGNATURE *signature, const char *name)
330 return signature != NULL
331 && evp_is_a(signature->prov, signature->name_id, NULL, name);
334 int evp_signature_get_number(const EVP_SIGNATURE *signature)
336 return signature->name_id;
339 const char *EVP_SIGNATURE_get0_name(const EVP_SIGNATURE *signature)
341 return signature->type_name;
344 const char *EVP_SIGNATURE_get0_description(const EVP_SIGNATURE *signature)
346 return signature->description;
350 void (*fn)(EVP_SIGNATURE *signature,
362 int EVP_SIGNATURE_names_do_all(const EVP_SIGNATURE *signature,
366 if (signature->prov != NULL)
367 return evp_names_do_all(signature->prov, signature->name_id, fn, data);
399 EVP_SIGNATURE *signature = NULL;
425 * Try to derive the supported signature from |ctx->keymgmt|.
444 * 1. Do the normal signature fetch, using the fetching data given by
446 * 2. Do the provider specific signature fetch, from the same provider
450 * signature, and try to export |ctx->pkey| to that keymgmt (when
466 EVP_SIGNATURE_free(signature);
471 signature =
473 if (signature != NULL)
474 tmp_prov = EVP_SIGNATURE_get0_provider(signature);
478 signature =
481 if (signature == NULL)
485 if (signature == NULL)
491 * |ctx->pkey|, but from the provider of the signature method, using
492 * the same property query as when fetching the signature method.
510 EVP_SIGNATURE_free(signature);
518 ctx->op.sig.signature = signature;
520 signature->newctx(ossl_provider_ctx(signature->prov), ctx->propquery);
529 if (signature->sign_init == NULL) {
534 ret = signature->sign_init(ctx->op.sig.algctx, provkey, params);
537 if (signature->verify_init == NULL) {
542 ret = signature->verify_init(ctx->op.sig.algctx, provkey, params);
545 if (signature->verify_recover_init == NULL) {
550 ret = signature->verify_recover_init(ctx->op.sig.algctx, provkey,
559 signature->freectx(ctx->op.sig.algctx);
649 if (ctx->op.sig.signature->sign == NULL) {
654 ret = ctx->op.sig.signature->sign(ctx->op.sig.algctx, sig, siglen,
698 if (ctx->op.sig.signature->verify == NULL) {
703 ret = ctx->op.sig.signature->verify(ctx->op.sig.algctx, sig, siglen,
746 if (ctx->op.sig.signature->verify_recover == NULL) {
751 ret = ctx->op.sig.signature->verify_recover(ctx->op.sig.algctx, rout,