Lines Matching +full:dsa +full:- +full:specific
2 * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
29 #include "crypto/dsa.h"
54 * The EVP_PKEY_xxx type macro. Should be zero for type specific
55 * structures, non-zero when the outermost structure is PKCS#8 or
64 /* For type specific decoders, we use the corresponding d2i */
65 d2i_of_void *d2i_private_key; /* From type-specific DER */
66 d2i_of_void *d2i_public_key; /* From type-specific DER */
67 d2i_of_void *d2i_key_params; /* From type-specific DER */
79 * For any key, we may need to make provider specific adjustments, such
111 && (OBJ_obj2nid(alg->algorithm) == ctx->desc->evp_type
113 || (OBJ_obj2nid(alg->algorithm) == NID_X9_62_id_ecPublicKey
114 && ctx->desc->evp_type == NID_sm2)))
115 key = key_from_pkcs8(p8inf, PROV_LIBCTX_OF(ctx->provctx), NULL);
121 /* ---------------------------------------------------------------------- */
133 ctx->provctx = provctx;
134 ctx->desc = desc;
166 int check2 = (desc->selection_mask & checks[i]) != 0;
191 ctx->selection = selection;
194 * structure and key type guessed. For type-specific structures, this
201 selection = ctx->desc->selection_mask;
202 if ((selection & ctx->desc->selection_mask) == 0) {
207 ok = ossl_read_der(ctx->provctx, cin, &der, &der_len);
216 if (ctx->desc->d2i_PKCS8 != NULL) {
217 key = ctx->desc->d2i_PKCS8(NULL, &derp, der_len, ctx);
218 if (ctx->flag_fatal) {
222 } else if (ctx->desc->d2i_private_key != NULL) {
223 key = ctx->desc->d2i_private_key(NULL, &derp, der_len);
225 if (key == NULL && ctx->selection != 0) {
232 if (ctx->desc->d2i_PUBKEY != NULL)
233 key = ctx->desc->d2i_PUBKEY(NULL, &derp, der_len);
234 else if (ctx->desc->d2i_public_key != NULL)
235 key = ctx->desc->d2i_public_key(NULL, &derp, der_len);
236 if (key == NULL && ctx->selection != 0) {
243 if (ctx->desc->d2i_key_params != NULL)
244 key = ctx->desc->d2i_key_params(NULL, &derp, der_len);
245 if (key == NULL && ctx->selection != 0) {
259 * classes of key types that have subtle variants, like RSA-PSS keys as
263 && ctx->desc->check_key != NULL
264 && !ctx->desc->check_key(key, ctx)) {
265 ctx->desc->free_key(key);
269 if (key != NULL && ctx->desc->adjust_key != NULL)
270 ctx->desc->adjust_key(key, ctx);
295 if (strcmp(ctx->desc->keytype_name, "EC") == 0
304 (char *)ctx->desc->keytype_name,
316 ctx->desc->free_key(key);
328 ossl_prov_get_keymgmt_export(ctx->desc->fns);
332 int selection = ctx->selection;
344 /* ---------------------------------------------------------------------- */
365 ossl_dh_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
379 /* ---------------------------------------------------------------------- */
400 ossl_dsa_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
404 /* ---------------------------------------------------------------------- */
429 ret = ctx->desc->evp_type == EVP_PKEY_SM2
430 || ctx->desc->evp_type == NID_X9_62_id_ecPublicKey;
432 ret = ctx->desc->evp_type != EVP_PKEY_SM2;
439 ossl_ec_key_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
456 ossl_ecx_key_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
519 /* ---------------------------------------------------------------------- */
540 return ctx->desc->evp_type == EVP_PKEY_RSA;
542 return ctx->desc->evp_type == EVP_PKEY_RSA_PSS;
551 ossl_rsa_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
564 /* ---------------------------------------------------------------------- */
571 "type-specific", keytype##_evp_type, \
583 "type-specific", keytype##_evp_type, \
595 "type-specific", keytype##_evp_type, \
607 "type-specific", keytype##_evp_type, \
619 "type-specific", keytype##_evp_type, \
631 "type-specific", keytype##_evp_type, \
692 "DSA", keytype##_evp_type, \
788 MAKE_DECODER("DSA", dsa, dsa, PrivateKeyInfo);
789 MAKE_DECODER("DSA", dsa, dsa, SubjectPublicKeyInfo);
790 MAKE_DECODER("DSA", dsa, dsa, type_specific);
791 MAKE_DECODER("DSA", dsa, dsa, DSA);
815 MAKE_DECODER("RSA-PSS", rsapss, rsapss, PrivateKeyInfo);
816 MAKE_DECODER("RSA-PSS", rsapss, rsapss, SubjectPublicKeyInfo);