summaryrefslogtreecommitdiffstats
path: root/providers/implementations/serializers/serializer_dsa.c
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-04-15 21:02:52 +1000
committerShane Lontis <shane.lontis@oracle.com>2020-04-15 21:02:52 +1000
commitb03ec3b5d62ee26bf8437556b9040d4141d5bdd8 (patch)
tree1f27a892757c24efab70d2fb8f93110f71c0fbb3 /providers/implementations/serializers/serializer_dsa.c
parent09b3654096ed344edd78cf156cb3ddcdbced6f9a (diff)
Add DSA keygen to provider
Moved some shared FFC code into the FFC files. Added extra paramgen parameters for seed, gindex. Fixed bug in ossl_prov util to print bignums. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11303)
Diffstat (limited to 'providers/implementations/serializers/serializer_dsa.c')
-rw-r--r--providers/implementations/serializers/serializer_dsa.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/providers/implementations/serializers/serializer_dsa.c b/providers/implementations/serializers/serializer_dsa.c
index c26be47e66..f5189d05fb 100644
--- a/providers/implementations/serializers/serializer_dsa.c
+++ b/providers/implementations/serializers/serializer_dsa.c
@@ -19,6 +19,8 @@
#include "prov/implementations.h" /* rsa_keymgmt_functions */
#include "prov/providercommonerr.h" /* PROV_R_BN_ERROR */
#include "serializer_local.h"
+#include "internal/ffc.h"
+#include "crypto/dsa.h"
OSSL_OP_keymgmt_new_fn *ossl_prov_get_keymgmt_dsa_new(void)
{
@@ -39,7 +41,7 @@ int ossl_prov_print_dsa(BIO *out, DSA *dsa, enum dsa_print_type type)
{
const char *type_label = NULL;
const BIGNUM *priv_key = NULL, *pub_key = NULL;
- const BIGNUM *p = NULL, *q = NULL, *g = NULL;
+ const BIGNUM *p = NULL;
switch (type) {
@@ -66,15 +68,13 @@ int ossl_prov_print_dsa(BIO *out, DSA *dsa, enum dsa_print_type type)
goto null_err;
}
- p = DSA_get0_p(dsa);
- q = DSA_get0_q(dsa);
- g = DSA_get0_p(dsa);
- if (p == NULL || q == NULL || g == NULL)
+ p = DSA_get0_p(dsa);
+ if (p == NULL)
goto null_err;
- if (ossl_prov_bio_printf(out, "%s: (%d bit)\n", type_label, BN_num_bits(p))
- <= 0)
+ if (ossl_prov_bio_printf(out, "%s: (%d bit)\n", type_label,
+ BN_num_bits(p)) <= 0)
goto err;
if (priv_key != NULL
&& !ossl_prov_print_labeled_bignum(out, "priv:", priv_key))
@@ -82,11 +82,7 @@ int ossl_prov_print_dsa(BIO *out, DSA *dsa, enum dsa_print_type type)
if (pub_key != NULL
&& !ossl_prov_print_labeled_bignum(out, "pub: ", pub_key))
goto err;
- if (!ossl_prov_print_labeled_bignum(out, "P: ", p))
- goto err;
- if (!ossl_prov_print_labeled_bignum(out, "Q: ", q))
- goto err;
- if (!ossl_prov_print_labeled_bignum(out, "G: ", g))
+ if (!ffc_params_prov_print(out, dsa_get0_params(dsa)))
goto err;
return 1;