diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2021-02-18 16:30:37 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2021-02-26 10:50:30 +1000 |
commit | 5af02212a5331cc30389246bb94f97fbcdebc23a (patch) | |
tree | 9ab888f6216de22d3e3532d2e6083755401452d3 /crypto/dsa | |
parent | 19dbb742cdf68d8ada6338a025491a3b46b9ebe1 (diff) |
Fix external symbols related to dsa keys
Partial fix for #12964
This adds ossl_ names for the following symbols:
dsa_check_pairwise, dsa_check_params, dsa_check_priv_key, dsa_check_pub_key, dsa_check_pub_key_partial,
dsa_do_sign_int, dsa_ffc_params_fromdata,
dsa_generate_ffc_parameters, dsa_generate_public_key,
dsa_get0_params, dsa_key_fromdata, dsa_new_with_ctx, dsa_pkey_method, dsa_sign_int
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14231)
Diffstat (limited to 'crypto/dsa')
-rw-r--r-- | crypto/dsa/dsa_ameth.c | 6 | ||||
-rw-r--r-- | crypto/dsa/dsa_backend.c | 2 | ||||
-rw-r--r-- | crypto/dsa/dsa_check.c | 12 | ||||
-rw-r--r-- | crypto/dsa/dsa_gen.c | 12 | ||||
-rw-r--r-- | crypto/dsa/dsa_key.c | 6 | ||||
-rw-r--r-- | crypto/dsa/dsa_lib.c | 8 | ||||
-rw-r--r-- | crypto/dsa/dsa_local.h | 2 | ||||
-rw-r--r-- | crypto/dsa/dsa_ossl.c | 4 | ||||
-rw-r--r-- | crypto/dsa/dsa_pmeth.c | 2 | ||||
-rw-r--r-- | crypto/dsa/dsa_sign.c | 9 |
10 files changed, 31 insertions, 32 deletions
diff --git a/crypto/dsa/dsa_ameth.c b/crypto/dsa/dsa_ameth.c index 3b35a7005e..c073f6b799 100644 --- a/crypto/dsa/dsa_ameth.c +++ b/crypto/dsa/dsa_ameth.c @@ -539,15 +539,15 @@ static int dsa_pkey_import_from(const OSSL_PARAM params[], void *vpctx) { EVP_PKEY_CTX *pctx = vpctx; EVP_PKEY *pkey = EVP_PKEY_CTX_get0_pkey(pctx); - DSA *dsa = dsa_new_with_ctx(pctx->libctx); + DSA *dsa = ossl_dsa_new(pctx->libctx); if (dsa == NULL) { ERR_raise(ERR_LIB_DSA, ERR_R_MALLOC_FAILURE); return 0; } - if (!dsa_ffc_params_fromdata(dsa, params) - || !dsa_key_fromdata(dsa, params) + if (!ossl_dsa_ffc_params_fromdata(dsa, params) + || !ossl_dsa_key_fromdata(dsa, params) || !EVP_PKEY_assign_DSA(pkey, dsa)) { DSA_free(dsa); return 0; diff --git a/crypto/dsa/dsa_backend.c b/crypto/dsa/dsa_backend.c index d24d08eebd..e6f8f3645e 100644 --- a/crypto/dsa/dsa_backend.c +++ b/crypto/dsa/dsa_backend.c @@ -22,7 +22,7 @@ * implementations alike. */ -int dsa_key_fromdata(DSA *dsa, const OSSL_PARAM params[]) +int ossl_dsa_key_fromdata(DSA *dsa, const OSSL_PARAM params[]) { const OSSL_PARAM *param_priv_key, *param_pub_key; BIGNUM *priv_key = NULL, *pub_key = NULL; diff --git a/crypto/dsa/dsa_check.c b/crypto/dsa/dsa_check.c index 7f56a785ab..705c7d22a0 100644 --- a/crypto/dsa/dsa_check.c +++ b/crypto/dsa/dsa_check.c @@ -19,7 +19,7 @@ #include "dsa_local.h" #include "crypto/dsa.h" -int dsa_check_params(const DSA *dsa, int checktype, int *ret) +int ossl_dsa_check_params(const DSA *dsa, int checktype, int *ret) { if (checktype == OSSL_KEYMGMT_VALIDATE_QUICK_CHECK) return ossl_ffc_params_simple_validate(dsa->libctx, &dsa->params, @@ -37,7 +37,7 @@ int dsa_check_params(const DSA *dsa, int checktype, int *ret) /* * See SP800-56Ar3 Section 5.6.2.3.1 : FFC Full public key validation. */ -int dsa_check_pub_key(const DSA *dsa, const BIGNUM *pub_key, int *ret) +int ossl_dsa_check_pub_key(const DSA *dsa, const BIGNUM *pub_key, int *ret) { return ossl_ffc_validate_public_key(&dsa->params, pub_key, ret); } @@ -47,12 +47,12 @@ int dsa_check_pub_key(const DSA *dsa, const BIGNUM *pub_key, int *ret) * To only be used with ephemeral FFC public keys generated using the approved * safe-prime groups. */ -int dsa_check_pub_key_partial(const DSA *dsa, const BIGNUM *pub_key, int *ret) +int ossl_dsa_check_pub_key_partial(const DSA *dsa, const BIGNUM *pub_key, int *ret) { return ossl_ffc_validate_public_key_partial(&dsa->params, pub_key, ret); } -int dsa_check_priv_key(const DSA *dsa, const BIGNUM *priv_key, int *ret) +int ossl_dsa_check_priv_key(const DSA *dsa, const BIGNUM *priv_key, int *ret) { *ret = 0; @@ -64,7 +64,7 @@ int dsa_check_priv_key(const DSA *dsa, const BIGNUM *priv_key, int *ret) * FFC pairwise check from SP800-56A R3. * Section 5.6.2.1.4 Owner Assurance of Pair-wise Consistency */ -int dsa_check_pairwise(const DSA *dsa) +int ossl_dsa_check_pairwise(const DSA *dsa) { int ret = 0; BN_CTX *ctx = NULL; @@ -84,7 +84,7 @@ int dsa_check_pairwise(const DSA *dsa) goto err; /* recalculate the public key = (g ^ priv) mod p */ - if (!dsa_generate_public_key(ctx, dsa, dsa->priv_key, pub_key)) + if (!ossl_dsa_generate_public_key(ctx, dsa, dsa->priv_key, pub_key)) goto err; /* check it matches the existing pubic_key */ ret = BN_cmp(pub_key, dsa->pub_key) == 0; diff --git a/crypto/dsa/dsa_gen.c b/crypto/dsa/dsa_gen.c index 9d6d9a8d4a..2be9f48e27 100644 --- a/crypto/dsa/dsa_gen.c +++ b/crypto/dsa/dsa_gen.c @@ -23,8 +23,8 @@ #include "crypto/dsa.h" #include "dsa_local.h" -int dsa_generate_ffc_parameters(DSA *dsa, int type, int pbits, int qbits, - BN_GENCB *cb) +int ossl_dsa_generate_ffc_parameters(DSA *dsa, int type, int pbits, int qbits, + BN_GENCB *cb) { int ret = 0, res; @@ -59,12 +59,12 @@ int DSA_generate_parameters_ex(DSA *dsa, int bits, /* The old code used FIPS 186-2 DSA Parameter generation */ if (bits <= 1024 && seed_len == 20) { - if (!dsa_generate_ffc_parameters(dsa, DSA_PARAMGEN_TYPE_FIPS_186_2, - bits, 160, cb)) + if (!ossl_dsa_generate_ffc_parameters(dsa, DSA_PARAMGEN_TYPE_FIPS_186_2, + bits, 160, cb)) return 0; } else { - if (!dsa_generate_ffc_parameters(dsa, DSA_PARAMGEN_TYPE_FIPS_186_4, - bits, 0, cb)) + if (!ossl_dsa_generate_ffc_parameters(dsa, DSA_PARAMGEN_TYPE_FIPS_186_4, + bits, 0, cb)) return 0; } diff --git a/crypto/dsa/dsa_key.c b/crypto/dsa/dsa_key.c index 8646d01957..2b7dc4e43d 100644 --- a/crypto/dsa/dsa_key.c +++ b/crypto/dsa/dsa_key.c @@ -40,8 +40,8 @@ int DSA_generate_key(DSA *dsa) return dsa_keygen(dsa, 0); } -int dsa_generate_public_key(BN_CTX *ctx, const DSA *dsa, const BIGNUM *priv_key, - BIGNUM *pub_key) +int ossl_dsa_generate_public_key(BN_CTX *ctx, const DSA *dsa, + const BIGNUM *priv_key, BIGNUM *pub_key) { int ret = 0; BIGNUM *prk = BN_new(); @@ -97,7 +97,7 @@ static int dsa_keygen(DSA *dsa, int pairwise_test) pub_key = dsa->pub_key; } - if (!dsa_generate_public_key(ctx, dsa, priv_key, pub_key)) + if (!ossl_dsa_generate_public_key(ctx, dsa, priv_key, pub_key)) goto err; dsa->priv_key = priv_key; diff --git a/crypto/dsa/dsa_lib.c b/crypto/dsa/dsa_lib.c index 0c84a6294f..5de633e11e 100644 --- a/crypto/dsa/dsa_lib.c +++ b/crypto/dsa/dsa_lib.c @@ -190,7 +190,7 @@ DSA *DSA_new_method(ENGINE *engine) return dsa_new_intern(engine, NULL); } -DSA *dsa_new_with_ctx(OSSL_LIB_CTX *libctx) +DSA *ossl_dsa_new(OSSL_LIB_CTX *libctx) { return dsa_new_intern(NULL, libctx); } @@ -336,19 +336,19 @@ int DSA_bits(const DSA *dsa) return -1; } -FFC_PARAMS *dsa_get0_params(DSA *dsa) +FFC_PARAMS *ossl_dsa_get0_params(DSA *dsa) { return &dsa->params; } -int dsa_ffc_params_fromdata(DSA *dsa, const OSSL_PARAM params[]) +int ossl_dsa_ffc_params_fromdata(DSA *dsa, const OSSL_PARAM params[]) { int ret; FFC_PARAMS *ffc; if (dsa == NULL) return 0; - ffc = dsa_get0_params(dsa); + ffc = ossl_dsa_get0_params(dsa); if (ffc == NULL) return 0; diff --git a/crypto/dsa/dsa_local.h b/crypto/dsa/dsa_local.h index 240e84f11e..c4ed654b99 100644 --- a/crypto/dsa/dsa_local.h +++ b/crypto/dsa/dsa_local.h @@ -69,4 +69,4 @@ struct dsa_method { int (*dsa_keygen) (DSA *dsa); }; -DSA_SIG *dsa_do_sign_int(const unsigned char *dgst, int dlen, DSA *dsa); +DSA_SIG *ossl_dsa_do_sign_int(const unsigned char *dgst, int dlen, DSA *dsa); diff --git a/crypto/dsa/dsa_ossl.c b/crypto/dsa/dsa_ossl.c index bd51a2c716..2f8cbe8ad4 100644 --- a/crypto/dsa/dsa_ossl.c +++ b/crypto/dsa/dsa_ossl.c @@ -67,7 +67,7 @@ const DSA_METHOD *DSA_OpenSSL(void) return &openssl_dsa_meth; } -DSA_SIG *dsa_do_sign_int(const unsigned char *dgst, int dlen, DSA *dsa) +DSA_SIG *ossl_dsa_do_sign_int(const unsigned char *dgst, int dlen, DSA *dsa) { BIGNUM *kinv = NULL; BIGNUM *m, *blind, *blindm, *tmp; @@ -185,7 +185,7 @@ DSA_SIG *dsa_do_sign_int(const unsigned char *dgst, int dlen, DSA *dsa) static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) { - return dsa_do_sign_int(dgst, dlen, dsa); + return ossl_dsa_do_sign_int(dgst, dlen, dsa); } static int dsa_sign_setup_no_digest(DSA *dsa, BN_CTX *ctx_in, diff --git a/crypto/dsa/dsa_pmeth.c b/crypto/dsa/dsa_pmeth.c index 909be63867..e5709b62c9 100644 --- a/crypto/dsa/dsa_pmeth.c +++ b/crypto/dsa/dsa_pmeth.c @@ -281,7 +281,7 @@ static const EVP_PKEY_METHOD dsa_pkey_meth = { pkey_dsa_ctrl_str }; -const EVP_PKEY_METHOD *dsa_pkey_method(void) +const EVP_PKEY_METHOD *ossl_dsa_pkey_method(void) { return &dsa_pkey_meth; } diff --git a/crypto/dsa/dsa_sign.c b/crypto/dsa/dsa_sign.c index 0f866c12fe..84817d3009 100644 --- a/crypto/dsa/dsa_sign.c +++ b/crypto/dsa/dsa_sign.c @@ -150,8 +150,8 @@ int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s) return 1; } -int dsa_sign_int(int type, const unsigned char *dgst, - int dlen, unsigned char *sig, unsigned int *siglen, DSA *dsa) +int ossl_dsa_sign_int(int type, const unsigned char *dgst, int dlen, + unsigned char *sig, unsigned int *siglen, DSA *dsa) { DSA_SIG *s; @@ -159,7 +159,7 @@ int dsa_sign_int(int type, const unsigned char *dgst, if (dsa->libctx == NULL || dsa->meth != DSA_get_default_method()) s = DSA_do_sign(dgst, dlen, dsa); else - s = dsa_do_sign_int(dgst, dlen, dsa); + s = ossl_dsa_do_sign_int(dgst, dlen, dsa); if (s == NULL) { *siglen = 0; return 0; @@ -172,7 +172,7 @@ int dsa_sign_int(int type, const unsigned char *dgst, int DSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig, unsigned int *siglen, DSA *dsa) { - return dsa_sign_int(type, dgst, dlen, sig, siglen, dsa); + return ossl_dsa_sign_int(type, dgst, dlen, sig, siglen, dsa); } /* data has already been hashed (probably with SHA or SHA-1). */ @@ -206,4 +206,3 @@ int DSA_verify(int type, const unsigned char *dgst, int dgst_len, DSA_SIG_free(s); return ret; } - |