diff options
Diffstat (limited to 'crypto/evp')
-rw-r--r-- | crypto/evp/ctrl_params_translate.c | 11 | ||||
-rw-r--r-- | crypto/evp/p5_crpt2.c | 3 | ||||
-rw-r--r-- | crypto/evp/p_lib.c | 1 |
3 files changed, 11 insertions, 4 deletions
diff --git a/crypto/evp/ctrl_params_translate.c b/crypto/evp/ctrl_params_translate.c index ccafdfddd58f..b28875037c72 100644 --- a/crypto/evp/ctrl_params_translate.c +++ b/crypto/evp/ctrl_params_translate.c @@ -636,8 +636,8 @@ static int default_fixup_args(enum state state, ctx->p2, ctx->sz); case OSSL_PARAM_OCTET_STRING: return OSSL_PARAM_get_octet_string(ctx->params, - ctx->p2, ctx->sz, - &ctx->sz); + &ctx->p2, ctx->sz, + (size_t *)&ctx->p1); case OSSL_PARAM_OCTET_PTR: return OSSL_PARAM_get_octet_ptr(ctx->params, ctx->p2, &ctx->sz); @@ -685,7 +685,7 @@ static int default_fixup_args(enum state state, return OSSL_PARAM_set_octet_string(ctx->params, ctx->p2, size); case OSSL_PARAM_OCTET_PTR: - return OSSL_PARAM_set_octet_ptr(ctx->params, ctx->p2, + return OSSL_PARAM_set_octet_ptr(ctx->params, *(void **)ctx->p2, size); default: ERR_raise_data(ERR_LIB_EVP, ERR_R_UNSUPPORTED, @@ -695,6 +695,9 @@ static int default_fixup_args(enum state state, translation->param_data_type); return 0; } + } else if (state == PRE_PARAMS_TO_CTRL && ctx->action_type == GET) { + if (translation->param_data_type == OSSL_PARAM_OCTET_PTR) + ctx->p2 = &ctx->bufp; } } /* Any other combination is simply pass-through */ @@ -2254,7 +2257,7 @@ static const struct translation_st evp_pkey_ctx_translations[] = { OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL, OSSL_PARAM_OCTET_STRING, NULL }, { GET, EVP_PKEY_RSA, 0, EVP_PKEY_OP_TYPE_CRYPT, EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL, NULL, NULL, - OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL, OSSL_PARAM_OCTET_STRING, NULL }, + OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL, OSSL_PARAM_OCTET_PTR, NULL }, { SET, EVP_PKEY_RSA_PSS, 0, EVP_PKEY_OP_TYPE_GEN, EVP_PKEY_CTRL_MD, "rsa_pss_keygen_md", NULL, diff --git a/crypto/evp/p5_crpt2.c b/crypto/evp/p5_crpt2.c index b7455be1cf0a..356173902334 100644 --- a/crypto/evp/p5_crpt2.c +++ b/crypto/evp/p5_crpt2.c @@ -231,13 +231,16 @@ int PKCS5_v2_PBKDF2_keyivgen_ex(EVP_CIPHER_CTX *ctx, const char *pass, goto err; } + (void)ERR_set_mark(); prfmd = prfmd_fetch = EVP_MD_fetch(libctx, OBJ_nid2sn(hmac_md_nid), propq); if (prfmd == NULL) prfmd = EVP_get_digestbynid(hmac_md_nid); if (prfmd == NULL) { + (void)ERR_clear_last_mark(); ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRF); goto err; } + (void)ERR_pop_to_mark(); if (kdf->salt->type != V_ASN1_OCTET_STRING) { ERR_raise(ERR_LIB_EVP, EVP_R_UNSUPPORTED_SALT_TYPE); diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c index f6acb5b47eff..aa6ec31dab6e 100644 --- a/crypto/evp/p_lib.c +++ b/crypto/evp/p_lib.c @@ -722,6 +722,7 @@ static void detect_foreign_key(EVP_PKEY *pkey) break; # ifndef OPENSSL_NO_EC case EVP_PKEY_SM2: + break; case EVP_PKEY_EC: pkey->foreign = pkey->pkey.ec != NULL && ossl_ec_key_is_foreign(pkey->pkey.ec); |