summaryrefslogtreecommitdiffstats
path: root/ssl/ssltest.c
diff options
context:
space:
mode:
authorNils Larsch <nils@openssl.org>2005-05-16 10:11:04 +0000
committerNils Larsch <nils@openssl.org>2005-05-16 10:11:04 +0000
commit9dd84053419aa220b5e66a5f9fcf809dbd6d9369 (patch)
tree7818c598a88a5b457333fd9f5951836fe96834b6 /ssl/ssltest.c
parent46a643763de6d8e39ecf6f76fa79b4d04885aa59 (diff)
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 'ssl/ssltest.c')
-rw-r--r--ssl/ssltest.c46
1 files changed, 20 insertions, 26 deletions
diff --git a/ssl/ssltest.c b/ssl/ssltest.c
index 085456c90e..f8e86c3ceb 100644
--- a/ssl/ssltest.c
+++ b/ssl/ssltest.c
@@ -720,36 +720,30 @@ bad:
#ifndef OPENSSL_NO_ECDH
if (!no_ecdhe)
{
- ecdh = EC_KEY_new();
- if (ecdh != NULL)
- {
- if (named_curve)
- {
- int nid = OBJ_sn2nid(named_curve);
-
- if (nid == 0)
- {
- BIO_printf(bio_err, "unknown curve name (%s)\n", named_curve);
- EC_KEY_free(ecdh);
- goto end;
- }
+ int nid;
- ecdh->group = EC_GROUP_new_by_curve_name(nid);
- if (ecdh->group == NULL)
- {
- BIO_printf(bio_err, "unable to create curve (%s)\n", named_curve);
- EC_KEY_free(ecdh);
- goto end;
- }
+ if (named_curve != NULL)
+ {
+ nid = OBJ_sn2nid(named_curve);
+ if (nid == 0)
+ {
+ BIO_printf(bio_err, "unknown curve name (%s)\n", named_curve);
+ goto end;
}
-
- if (ecdh->group == NULL)
- ecdh->group=EC_GROUP_new_by_curve_name(NID_sect163r2);
+ }
+ else
+ nid = NID_sect163r2;
- SSL_CTX_set_tmp_ecdh(s_ctx, ecdh);
- SSL_CTX_set_options(s_ctx, SSL_OP_SINGLE_ECDH_USE);
- EC_KEY_free(ecdh);
+ ecdh = EC_KEY_new_by_curve_name(nid);
+ if (ecdh == NULL)
+ {
+ BIO_printf(bio_err, "unable to create curve\n");
+ goto end;
}
+
+ SSL_CTX_set_tmp_ecdh(s_ctx, ecdh);
+ SSL_CTX_set_options(s_ctx, SSL_OP_SINGLE_ECDH_USE);
+ EC_KEY_free(ecdh);
}
#else
(void)no_ecdhe;