Lines Matching refs:signature
25 EVP_SIGNATURE *signature = OPENSSL_zalloc(sizeof(EVP_SIGNATURE)); in evp_signature_new() local
27 if (signature == NULL) in evp_signature_new()
30 if (!CRYPTO_NEW_REF(&signature->refcnt, 1)) { in evp_signature_new()
31 OPENSSL_free(signature); in evp_signature_new()
35 signature->prov = prov; in evp_signature_new()
38 return signature; in evp_signature_new()
46 EVP_SIGNATURE *signature = NULL; in evp_signature_from_algorithm() local
55 if ((signature = evp_signature_new(prov)) == NULL) { in evp_signature_from_algorithm()
60 signature->name_id = name_id; in evp_signature_from_algorithm()
61 if ((signature->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL) in evp_signature_from_algorithm()
63 signature->description = algodef->algorithm_description; in evp_signature_from_algorithm()
68 if (signature->newctx != NULL) in evp_signature_from_algorithm()
70 signature->newctx = OSSL_FUNC_signature_newctx(fns); in evp_signature_from_algorithm()
74 if (signature->sign_init != NULL) in evp_signature_from_algorithm()
76 signature->sign_init = OSSL_FUNC_signature_sign_init(fns); in evp_signature_from_algorithm()
80 if (signature->sign != NULL) in evp_signature_from_algorithm()
82 signature->sign = OSSL_FUNC_signature_sign(fns); in evp_signature_from_algorithm()
85 if (signature->sign_message_init != NULL) in evp_signature_from_algorithm()
87 signature->sign_message_init in evp_signature_from_algorithm()
92 if (signature->sign_message_update != NULL) in evp_signature_from_algorithm()
94 signature->sign_message_update in evp_signature_from_algorithm()
98 if (signature->sign_message_final != NULL) in evp_signature_from_algorithm()
100 signature->sign_message_final in evp_signature_from_algorithm()
104 if (signature->verify_init != NULL) in evp_signature_from_algorithm()
106 signature->verify_init = OSSL_FUNC_signature_verify_init(fns); in evp_signature_from_algorithm()
110 if (signature->verify != NULL) in evp_signature_from_algorithm()
112 signature->verify = OSSL_FUNC_signature_verify(fns); in evp_signature_from_algorithm()
115 if (signature->verify_message_init != NULL) in evp_signature_from_algorithm()
117 signature->verify_message_init in evp_signature_from_algorithm()
122 if (signature->verify_message_update != NULL) in evp_signature_from_algorithm()
124 signature->verify_message_update in evp_signature_from_algorithm()
128 if (signature->verify_message_final != NULL) in evp_signature_from_algorithm()
130 signature->verify_message_final in evp_signature_from_algorithm()
134 if (signature->verify_recover_init != NULL) in evp_signature_from_algorithm()
136 signature->verify_recover_init in evp_signature_from_algorithm()
141 if (signature->verify_recover != NULL) in evp_signature_from_algorithm()
143 signature->verify_recover in evp_signature_from_algorithm()
147 if (signature->digest_sign_init != NULL) in evp_signature_from_algorithm()
149 signature->digest_sign_init in evp_signature_from_algorithm()
154 if (signature->digest_sign_update != NULL) in evp_signature_from_algorithm()
156 signature->digest_sign_update in evp_signature_from_algorithm()
160 if (signature->digest_sign_final != NULL) in evp_signature_from_algorithm()
162 signature->digest_sign_final in evp_signature_from_algorithm()
166 if (signature->digest_sign != NULL) in evp_signature_from_algorithm()
168 signature->digest_sign in evp_signature_from_algorithm()
172 if (signature->digest_verify_init != NULL) in evp_signature_from_algorithm()
174 signature->digest_verify_init in evp_signature_from_algorithm()
179 if (signature->digest_verify_update != NULL) in evp_signature_from_algorithm()
181 signature->digest_verify_update in evp_signature_from_algorithm()
185 if (signature->digest_verify_final != NULL) in evp_signature_from_algorithm()
187 signature->digest_verify_final in evp_signature_from_algorithm()
191 if (signature->digest_verify != NULL) in evp_signature_from_algorithm()
193 signature->digest_verify in evp_signature_from_algorithm()
197 if (signature->freectx != NULL) in evp_signature_from_algorithm()
199 signature->freectx = OSSL_FUNC_signature_freectx(fns); in evp_signature_from_algorithm()
203 if (signature->dupctx != NULL) in evp_signature_from_algorithm()
205 signature->dupctx = OSSL_FUNC_signature_dupctx(fns); in evp_signature_from_algorithm()
208 if (signature->get_ctx_params != NULL) in evp_signature_from_algorithm()
210 signature->get_ctx_params in evp_signature_from_algorithm()
215 if (signature->gettable_ctx_params != NULL) in evp_signature_from_algorithm()
217 signature->gettable_ctx_params in evp_signature_from_algorithm()
222 if (signature->set_ctx_params != NULL) in evp_signature_from_algorithm()
224 signature->set_ctx_params in evp_signature_from_algorithm()
229 if (signature->settable_ctx_params != NULL) in evp_signature_from_algorithm()
231 signature->settable_ctx_params in evp_signature_from_algorithm()
236 if (signature->get_ctx_md_params != NULL) in evp_signature_from_algorithm()
238 signature->get_ctx_md_params in evp_signature_from_algorithm()
243 if (signature->gettable_ctx_md_params != NULL) in evp_signature_from_algorithm()
245 signature->gettable_ctx_md_params in evp_signature_from_algorithm()
250 if (signature->set_ctx_md_params != NULL) in evp_signature_from_algorithm()
252 signature->set_ctx_md_params in evp_signature_from_algorithm()
257 if (signature->settable_ctx_md_params != NULL) in evp_signature_from_algorithm()
259 signature->settable_ctx_md_params in evp_signature_from_algorithm()
264 if (signature->query_key_types != NULL) in evp_signature_from_algorithm()
266 signature->query_key_types in evp_signature_from_algorithm()
302 && ((signature->sign_init != NULL in evp_signature_from_algorithm()
303 && signature->sign == NULL) in evp_signature_from_algorithm()
304 || (signature->sign_message_init != NULL in evp_signature_from_algorithm()
305 && signature->sign == NULL in evp_signature_from_algorithm()
306 && (signature->sign_message_update == NULL in evp_signature_from_algorithm()
307 || signature->sign_message_final == NULL)))) in evp_signature_from_algorithm()
311 && (signature->sign != NULL in evp_signature_from_algorithm()
312 || signature->sign_message_update != NULL in evp_signature_from_algorithm()
313 || signature->sign_message_final != NULL) in evp_signature_from_algorithm()
314 && signature->sign_init == NULL in evp_signature_from_algorithm()
315 && signature->sign_message_init == NULL) in evp_signature_from_algorithm()
320 && ((signature->verify_init != NULL in evp_signature_from_algorithm()
321 && signature->verify == NULL) in evp_signature_from_algorithm()
322 || (signature->verify_message_init != NULL in evp_signature_from_algorithm()
323 && signature->verify == NULL in evp_signature_from_algorithm()
324 && (signature->verify_message_update == NULL in evp_signature_from_algorithm()
325 || signature->verify_message_final == NULL)))) in evp_signature_from_algorithm()
329 && (signature->verify != NULL in evp_signature_from_algorithm()
330 || signature->verify_message_update != NULL in evp_signature_from_algorithm()
331 || signature->verify_message_final != NULL) in evp_signature_from_algorithm()
332 && signature->verify_init == NULL in evp_signature_from_algorithm()
333 && signature->verify_message_init == NULL) in evp_signature_from_algorithm()
338 && (signature->verify_recover_init != NULL) in evp_signature_from_algorithm()
339 && (signature->verify_recover == NULL)) in evp_signature_from_algorithm()
344 && (signature->digest_sign_init != NULL in evp_signature_from_algorithm()
345 && signature->digest_sign == NULL in evp_signature_from_algorithm()
346 && (signature->digest_sign_update == NULL in evp_signature_from_algorithm()
347 || signature->digest_sign_final == NULL))) in evp_signature_from_algorithm()
354 && ((signature->digest_verify_init != NULL in evp_signature_from_algorithm()
355 && signature->digest_verify == NULL in evp_signature_from_algorithm()
356 && (signature->digest_verify_update == NULL in evp_signature_from_algorithm()
357 || signature->digest_verify_final == NULL)))) in evp_signature_from_algorithm()
368 return signature; in evp_signature_from_algorithm()
370 EVP_SIGNATURE_free(signature); in evp_signature_from_algorithm()
374 void EVP_SIGNATURE_free(EVP_SIGNATURE *signature) in EVP_SIGNATURE_free() argument
378 if (signature == NULL) in EVP_SIGNATURE_free()
380 CRYPTO_DOWN_REF(&signature->refcnt, &i); in EVP_SIGNATURE_free()
383 OPENSSL_free(signature->type_name); in EVP_SIGNATURE_free()
384 ossl_provider_free(signature->prov); in EVP_SIGNATURE_free()
385 CRYPTO_FREE_REF(&signature->refcnt); in EVP_SIGNATURE_free()
386 OPENSSL_free(signature); in EVP_SIGNATURE_free()
389 int EVP_SIGNATURE_up_ref(EVP_SIGNATURE *signature) in EVP_SIGNATURE_up_ref() argument
393 CRYPTO_UP_REF(&signature->refcnt, &ref); in EVP_SIGNATURE_up_ref()
397 OSSL_PROVIDER *EVP_SIGNATURE_get0_provider(const EVP_SIGNATURE *signature) in EVP_SIGNATURE_get0_provider() argument
399 return signature->prov; in EVP_SIGNATURE_get0_provider()
422 int EVP_SIGNATURE_is_a(const EVP_SIGNATURE *signature, const char *name) in EVP_SIGNATURE_is_a() argument
424 return signature != NULL in EVP_SIGNATURE_is_a()
425 && evp_is_a(signature->prov, signature->name_id, NULL, name); in EVP_SIGNATURE_is_a()
428 int evp_signature_get_number(const EVP_SIGNATURE *signature) in evp_signature_get_number() argument
430 return signature->name_id; in evp_signature_get_number()
433 const char *EVP_SIGNATURE_get0_name(const EVP_SIGNATURE *signature) in EVP_SIGNATURE_get0_name() argument
435 return signature->type_name; in EVP_SIGNATURE_get0_name()
438 const char *EVP_SIGNATURE_get0_description(const EVP_SIGNATURE *signature) in EVP_SIGNATURE_get0_description() argument
440 return signature->description; in EVP_SIGNATURE_get0_description()
444 void (*fn)(EVP_SIGNATURE *signature, in EVP_SIGNATURE_do_all_provided() argument
456 int EVP_SIGNATURE_names_do_all(const EVP_SIGNATURE *signature, in EVP_SIGNATURE_names_do_all() argument
460 if (signature->prov != NULL) in EVP_SIGNATURE_names_do_all()
461 return evp_names_do_all(signature->prov, signature->name_id, fn, data); in EVP_SIGNATURE_names_do_all()
488 static int evp_pkey_signature_init(EVP_PKEY_CTX *ctx, EVP_SIGNATURE *signature, in evp_pkey_signature_init() argument
506 if (signature != NULL) { in evp_pkey_signature_init()
529 tmp_prov = EVP_SIGNATURE_get0_provider(signature); in evp_pkey_signature_init()
548 if (signature->query_key_types != NULL) { in evp_pkey_signature_init()
552 keytypes = signature->query_key_types(); in evp_pkey_signature_init()
566 int ok = EVP_SIGNATURE_is_a(signature, keytype); in evp_pkey_signature_init()
578 ok = EVP_SIGNATURE_is_a(signature, signame); in evp_pkey_signature_init()
588 if (!EVP_SIGNATURE_up_ref(signature)) in evp_pkey_signature_init()
646 EVP_SIGNATURE_free(signature); in evp_pkey_signature_init()
651 signature = in evp_pkey_signature_init()
653 if (signature != NULL) in evp_pkey_signature_init()
654 tmp_prov = EVP_SIGNATURE_get0_provider(signature); in evp_pkey_signature_init()
658 signature = in evp_pkey_signature_init()
661 if (signature == NULL) in evp_pkey_signature_init()
665 if (signature == NULL) in evp_pkey_signature_init()
690 EVP_SIGNATURE_free(signature); in evp_pkey_signature_init()
699 ctx->op.sig.signature = signature; in evp_pkey_signature_init()
701 signature->newctx(ossl_provider_ctx(signature->prov), ctx->propquery); in evp_pkey_signature_init()
710 if (signature->sign_init == NULL) { in evp_pkey_signature_init()
715 ret = signature->sign_init(ctx->op.sig.algctx, provkey, params); in evp_pkey_signature_init()
718 if (signature->sign_message_init == NULL) { in evp_pkey_signature_init()
723 ret = signature->sign_message_init(ctx->op.sig.algctx, provkey, params); in evp_pkey_signature_init()
726 if (signature->verify_init == NULL) { in evp_pkey_signature_init()
731 ret = signature->verify_init(ctx->op.sig.algctx, provkey, params); in evp_pkey_signature_init()
734 if (signature->verify_message_init == NULL) { in evp_pkey_signature_init()
739 ret = signature->verify_message_init(ctx->op.sig.algctx, provkey, params); in evp_pkey_signature_init()
742 if (signature->verify_recover_init == NULL) { in evp_pkey_signature_init()
747 ret = signature->verify_recover_init(ctx->op.sig.algctx, provkey, params); in evp_pkey_signature_init()
755 signature->freectx(ctx->op.sig.algctx); in evp_pkey_signature_init()
851 if (ctx->op.sig.signature->sign_message_update == NULL) { in EVP_PKEY_sign_message_update()
856 return ctx->op.sig.signature->sign_message_update(ctx->op.sig.algctx, in EVP_PKEY_sign_message_update()
873 if (ctx->op.sig.signature->sign_message_final == NULL) { in EVP_PKEY_sign_message_final()
878 return ctx->op.sig.signature->sign_message_final(ctx->op.sig.algctx, in EVP_PKEY_sign_message_final()
903 if (ctx->op.sig.signature->sign == NULL) { in EVP_PKEY_sign()
908 ret = ctx->op.sig.signature->sign(ctx->op.sig.algctx, sig, siglen, in EVP_PKEY_sign()
979 if (ctx->op.sig.signature->verify_message_update == NULL) { in EVP_PKEY_verify_message_update()
984 return ctx->op.sig.signature->verify_message_update(ctx->op.sig.algctx, in EVP_PKEY_verify_message_update()
1000 if (ctx->op.sig.signature->verify_message_final == NULL) { in EVP_PKEY_verify_message_final()
1006 return ctx->op.sig.signature->verify_message_final(ctx->op.sig.algctx); in EVP_PKEY_verify_message_final()
1029 if (ctx->op.sig.signature->verify == NULL) { in EVP_PKEY_verify()
1034 ret = ctx->op.sig.signature->verify(ctx->op.sig.algctx, sig, siglen, in EVP_PKEY_verify()
1083 if (ctx->op.sig.signature->verify_recover == NULL) { in EVP_PKEY_verify_recover()
1088 ret = ctx->op.sig.signature->verify_recover(ctx->op.sig.algctx, rout, in EVP_PKEY_verify_recover()