X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fdsa%2Fdsa_ameth.c;h=651b463235d3c4a6964bc185e2a6860cdaa82f0b;hp=d63c142fdd157c3fc3aeb9bb94aa4f281f545dd5;hb=7674e92324648b59786d86d8e9014bbaed4e6d07;hpb=76e23fc50b2dcf9b4d33824102ce5ae03f8faea3 diff --git a/crypto/dsa/dsa_ameth.c b/crypto/dsa/dsa_ameth.c index d63c142fdd..651b463235 100644 --- a/crypto/dsa/dsa_ameth.c +++ b/crypto/dsa/dsa_ameth.c @@ -1,5 +1,5 @@ /* - * Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -19,15 +19,15 @@ #include #include #include +#include #include "internal/cryptlib.h" #include "crypto/asn1.h" #include "crypto/dsa.h" #include "crypto/evp.h" -#include "openssl/param_build.h" #include "internal/ffc.h" #include "dsa_local.h" -static int dsa_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey) +static int dsa_pub_decode(EVP_PKEY *pkey, const X509_PUBKEY *pubkey) { const unsigned char *p, *pm; int pklen, pmlen; @@ -576,17 +576,18 @@ err: return rv; } -static int dsa_pkey_import_from(const OSSL_PARAM params[], void *key) +static int dsa_pkey_import_from(const OSSL_PARAM params[], void *vpctx) { - EVP_PKEY *pkey = key; - DSA *dsa = DSA_new(); + EVP_PKEY_CTX *pctx = vpctx; + EVP_PKEY *pkey = EVP_PKEY_CTX_get0_pkey(pctx); + DSA *dsa = dsa_new_with_ctx(pctx->libctx); if (dsa == NULL) { ERR_raise(ERR_LIB_DSA, ERR_R_MALLOC_FAILURE); return 0; } - if (!ffc_fromdata(dsa_get0_params(dsa), params) + if (!dsa_ffc_params_fromdata(dsa, params) || !dsa_key_fromdata(dsa, params) || !EVP_PKEY_assign_DSA(pkey, dsa)) { DSA_free(dsa);