summaryrefslogtreecommitdiff
path: root/apps/req.c
diff options
context:
space:
mode:
authornils <nils>2005-05-16 10:10:57 +0000
committernils <nils>2005-05-16 10:10:57 +0000
commit828075686a2ffed4566212137e8a200f7fde246f (patch)
treec81428fecd15df0d378b41fd40a52d17a08e412d /apps/req.c
parent225c2e815a19ddcf4cbb0f4b1c62c17495ac2656 (diff)
downloadopenssl-828075686a2ffed4566212137e8a200f7fde246f.tar.gz
ecc api cleanup; summary:
- hide the EC_KEY structure definition in ec_lcl.c + add some functions to use/access the EC_KEY fields - change the way how method specific data (ecdsa/ecdh) is attached to a EC_KEY - add ECDSA_sign_ex and ECDSA_do_sign_ex functions with additional parameters for pre-computed values - rebuild libeay.num from 0.9.7
Diffstat (limited to 'apps/req.c')
-rw-r--r--apps/req.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/apps/req.c b/apps/req.c
index db70dc227..764ef2906 100644
--- a/apps/req.c
+++ b/apps/req.c
@@ -344,6 +344,7 @@ int MAIN(int argc, char **argv)
{
X509 *xtmp=NULL;
EVP_PKEY *dtmp;
+ EC_GROUP *group;
pkey_type=TYPE_EC;
p+=3;
@@ -354,10 +355,10 @@ int MAIN(int argc, char **argv)
}
if ((ec_params = EC_KEY_new()) == NULL)
goto end;
- if ((ec_params->group = PEM_read_bio_ECPKParameters(in, NULL, NULL, NULL)) == NULL)
+ group = PEM_read_bio_ECPKParameters(in, NULL, NULL, NULL);
+ if (group == NULL)
{
- if (ec_params)
- EC_KEY_free(ec_params);
+ EC_KEY_free(ec_params);
ERR_clear_error();
(void)BIO_reset(in);
if ((xtmp=PEM_read_bio_X509(in,NULL,NULL,NULL)) == NULL)
@@ -369,7 +370,7 @@ int MAIN(int argc, char **argv)
if ((dtmp=X509_get_pubkey(xtmp))==NULL)
goto end;
if (dtmp->type == EVP_PKEY_EC)
- ec_params = ECParameters_dup(dtmp->pkey.eckey);
+ ec_params = EC_KEY_dup(dtmp->pkey.ec);
EVP_PKEY_free(dtmp);
X509_free(xtmp);
if (ec_params == NULL)
@@ -378,12 +379,16 @@ int MAIN(int argc, char **argv)
goto end;
}
}
+ else
+ {
+ if (EC_KEY_set_group(ec_params, group) == 0)
+ goto end;
+ EC_GROUP_free(group);
+ }
BIO_free(in);
in=NULL;
-
- newkey = EC_GROUP_get_degree(ec_params->group);
-
+ newkey = EC_GROUP_get_degree(EC_KEY_get0_group(ec_params));
}
else
#endif