diff options
42 files changed, 1782 insertions, 1597 deletions
diff --git a/apps/ecdsa.c b/apps/ecdsa.c index 91c8d1d7d7..f54590d61f 100644 --- a/apps/ecdsa.c +++ b/apps/ecdsa.c @@ -60,8 +60,8 @@ #include "apps.h" #include <openssl/bio.h> #include <openssl/err.h> -#include <openssl/ecdsa.h> #include <openssl/evp.h> +#include <openssl/ecdsa.h> #include <openssl/x509.h> #include <openssl/pem.h> @@ -85,7 +85,7 @@ int MAIN(int argc, char **argv) { ENGINE *e = NULL; int ret = 1; - ECDSA *ecdsa = NULL; + EC_KEY *eckey = NULL; int i, badops = 0; const EVP_CIPHER *enc = NULL; BIO *in = NULL, *out = NULL; @@ -279,17 +279,17 @@ bad: if (informat == FORMAT_ASN1) { if (pubin) - ecdsa = d2i_ECDSA_PUBKEY_bio(in, NULL); + eckey = d2i_EC_PUBKEY_bio(in, NULL); else - ecdsa = d2i_ECDSAPrivateKey_bio(in, NULL); + eckey = d2i_ECPrivateKey_bio(in, NULL); } else if (informat == FORMAT_PEM) { if (pubin) - ecdsa = PEM_read_bio_ECDSA_PUBKEY(in, NULL, NULL, + eckey = PEM_read_bio_EC_PUBKEY(in, NULL, NULL, NULL); else - ecdsa = PEM_read_bio_ECDSAPrivateKey(in, NULL, NULL, + eckey = PEM_read_bio_ECPrivateKey(in, NULL, NULL, passin); } else @@ -297,7 +297,7 @@ bad: BIO_printf(bio_err, "bad input format specified for key\n"); goto end; } - if (ecdsa == NULL) + if (eckey == NULL) { BIO_printf(bio_err,"unable to load Key\n"); ERR_print_errors(bio_err); @@ -325,15 +325,15 @@ bad: if (new_form) { - EC_GROUP_set_point_conversion_form(ecdsa->group, form); - ECDSA_set_conversion_form(ecdsa, form); + EC_GROUP_set_point_conversion_form(eckey->group, form); + eckey->conv_form = form; } if (new_asn1_flag) - EC_GROUP_set_asn1_flag(ecdsa->group, asn1_flag); + EC_GROUP_set_asn1_flag(eckey->group, asn1_flag); if (text) - if (!ECDSA_print(out, ecdsa, 0)) + if (!EC_KEY_print(out, eckey, 0)) { perror(outfile); ERR_print_errors(bio_err); @@ -343,24 +343,24 @@ bad: if (noout) goto end; - BIO_printf(bio_err, "writing ECDSA key\n"); + BIO_printf(bio_err, "writing EC key\n"); if (outformat == FORMAT_ASN1) { if (param_out) - i = i2d_ECPKParameters_bio(out, ecdsa->group); + i = i2d_ECPKParameters_bio(out, eckey->group); else if (pubin || pubout) - i = i2d_ECDSA_PUBKEY_bio(out, ecdsa); + i = i2d_EC_PUBKEY_bio(out, eckey); else - i = i2d_ECDSAPrivateKey_bio(out, ecdsa); + i = i2d_ECPrivateKey_bio(out, eckey); } else if (outformat == FORMAT_PEM) { if (param_out) - i = PEM_write_bio_ECPKParameters(out, ecdsa->group); + i = PEM_write_bio_ECPKParameters(out, eckey->group); else if (pubin || pubout) - i = PEM_write_bio_ECDSA_PUBKEY(out, ecdsa); + i = PEM_write_bio_EC_PUBKEY(out, eckey); else - i = PEM_write_bio_ECDSAPrivateKey(out, ecdsa, enc, + i = PEM_write_bio_ECPrivateKey(out, eckey, enc, NULL, 0, NULL, passout); } else @@ -382,8 +382,8 @@ end: BIO_free(in); if (out) BIO_free_all(out); - if (ecdsa) - ECDSA_free(ecdsa); + if (eckey) + EC_KEY_free(eckey); if (passin) OPENSSL_free(passin); if (passout) diff --git a/apps/ecparam.c b/apps/ecparam.c index 4c3054ef50..228791decd 100644 --- a/apps/ecparam.c +++ b/apps/ecparam.c @@ -1,4 +1,7 @@ /* apps/ecparam.c */ +/* + * Originally written by Nils Larsch for the OpenSSL project. + */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * @@ -78,7 +81,7 @@ * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories. * */ -#ifndef OPENSSL_NO_ECDSA +#ifndef OPENSSL_NO_EC #include <assert.h> #include <stdio.h> #include <stdlib.h> @@ -89,7 +92,9 @@ #include <openssl/err.h> #include <openssl/bn.h> #include <openssl/ec.h> +#ifndef OPENSSL_NO_ECDSA #include <openssl/ecdsa.h> +#endif #include <openssl/x509.h> #include <openssl/pem.h> @@ -673,36 +678,36 @@ bad: if (genkey) { - ECDSA *ecdsa = ECDSA_new(); + EC_KEY *eckey = EC_KEY_new(); - if (ecdsa == NULL) + if (eckey == NULL) goto end; assert(need_rand); - ecdsa->group = group; + eckey->group = group; - if (!ECDSA_generate_key(ecdsa)) + if (!EC_KEY_generate_key(eckey)) { - ecdsa->group = NULL; - ECDSA_free(ecdsa); + eckey->group = NULL; + EC_KEY_free(eckey); goto end; } if (outformat == FORMAT_ASN1) - i = i2d_ECDSAPrivateKey_bio(out, ecdsa); + i = i2d_ECPrivateKey_bio(out, eckey); else if (outformat == FORMAT_PEM) - i = PEM_write_bio_ECDSAPrivateKey(out, ecdsa, NULL, + i = PEM_write_bio_ECPrivateKey(out, eckey, NULL, NULL, 0, NULL, NULL); else { BIO_printf(bio_err, "bad output format specified " "for outfile\n"); - ecdsa->group = NULL; - ECDSA_free(ecdsa); + eckey->group = NULL; + EC_KEY_free(eckey); goto end; } - ecdsa->group = NULL; - ECDSA_free(ecdsa); + eckey->group = NULL; + EC_KEY_free(eckey); } if (need_rand) diff --git a/apps/req.c b/apps/req.c index cc87923159..af2db1628b 100644 --- a/apps/req.c +++ b/apps/req.c @@ -142,7 +142,7 @@ static int batch=0; #define TYPE_RSA 1 #define TYPE_DSA 2 #define TYPE_DH 3 -#define TYPE_ECDSA 4 +#define TYPE_EC 4 int MAIN(int, char **); @@ -152,8 +152,8 @@ int MAIN(int argc, char **argv) #ifndef OPENSSL_NO_DSA DSA *dsa_params=NULL; #endif -#ifndef OPENSSL_NO_ECDSA - ECDSA *ecdsa_params = NULL; +#ifndef OPENSSL_NO_EC + EC_KEY *ec_params = NULL; #endif unsigned long nmflag = 0; int ex=1,x509=0,days=30; @@ -327,41 +327,41 @@ int MAIN(int argc, char **argv) } else #endif -#ifndef OPENSSL_NO_ECDSA +#ifndef OPENSSL_NO_EC if (strncmp("ecdsa:",p,4) == 0) { X509 *xtmp=NULL; EVP_PKEY *dtmp; - pkey_type=TYPE_ECDSA; + pkey_type=TYPE_EC; p+=6; if ((in=BIO_new_file(p,"r")) == NULL) { perror(p); goto end; } - if ((ecdsa_params = ECDSA_new()) == NULL) + if ((ec_params = EC_KEY_new()) == NULL) goto end; - if ((ecdsa_params->group = PEM_read_bio_ECPKParameters(in, NULL, NULL, NULL)) == NULL) + if ((ec_params->group = PEM_read_bio_ECPKParameters(in, NULL, NULL, NULL)) == NULL) { - if (ecdsa_params) - ECDSA_free(ecdsa_params); + if (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) { - BIO_printf(bio_err,"unable to load ECDSA parameters from file\n"); + BIO_printf(bio_err,"unable to load EC parameters from file\n"); goto end; } if ((dtmp=X509_get_pubkey(xtmp)) == NULL) goto end; - if (dtmp->type == EVP_PKEY_ECDSA) - ecdsa_params = ECDSAParameters_dup(dtmp->pkey.ecdsa); + if (dtmp->type == EVP_PKEY_EC) + ec_params = ECParameters_dup(dtmp->pkey.eckey); EVP_PKEY_free(dtmp); X509_free(xtmp); - if (ecdsa_params == NULL) + if (ec_params == NULL) { - BIO_printf(bio_err,"Certificate does not contain ECDSA parameters\n"); + BIO_printf(bio_err,"Certificate does not contain EC parameters\n"); goto end; } } @@ -374,7 +374,7 @@ int MAIN(int argc, char **argv) if (!order) goto end; - if (!EC_GROUP_get_order(ecdsa_params->group, order, NULL)) + if (!EC_GROUP_get_order(ec_params->group, order, NULL)) goto end; newkey = BN_num_bits(order); BN_free(order); @@ -745,12 +745,13 @@ bad: dsa_params=NULL; } #endif -#ifndef OPENSSL_NO_ECDSA - if (pkey_type == TYPE_ECDSA) +#ifndef OPENSSL_NO_EC + if (pkey_type == TYPE_EC) { - if (!ECDSA_generate_key(ecdsa_params)) goto end; - if (!EVP_PKEY_assign_ECDSA(pkey, ecdsa_params)) goto end; - ecdsa_params = NULL; + if (!EC_KEY_generate_key(ec_params)) goto end; + if (!EVP_PKEY_assign_EC_KEY(pkey, ec_params)) + goto end; + ec_params = NULL; } #endif @@ -1144,8 +1145,8 @@ end: #ifndef OPENSSL_NO_DSA if (dsa_params != NULL) DSA_free(dsa_params); #endif -#ifndef OPENSSL_NO_ECDSA - if (ecdsa_params != NULL) ECDSA_free(ecdsa_params); +#ifndef OPENSSL_NO_EC + if (ec_params != NULL) EC_KEY_free(ec_params); #endif apps_shutdown(); EXIT(ex); diff --git a/crypto/asn1/Makefile.ssl b/crypto/asn1/Makefile.ssl index 3c659ab87b..56699e57e6 100644 --- a/crypto/asn1/Makefile.ssl +++ b/crypto/asn1/Makefile.ssl @@ -439,19 +439,19 @@ d2i_pr.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h d2i_pr.o: ../../include/openssl/des.h ../../include/openssl/des_old.h d2i_pr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h d2i_pr.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h -d2i_pr.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h -d2i_pr.o: ../../include/openssl/evp.h ../../include/openssl/idea.h -d2i_pr.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h -d2i_pr.o: ../../include/openssl/md4.h ../../include/openssl/md5.h -d2i_pr.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h -d2i_pr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -d2i_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h -d2i_pr.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h -d2i_pr.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h -d2i_pr.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h -d2i_pr.o: ../../include/openssl/sha.h ../../include/openssl/stack.h -d2i_pr.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h -d2i_pr.o: ../../include/openssl/ui_compat.h ../cryptlib.h d2i_pr.c +d2i_pr.o: ../../include/openssl/err.h ../../include/openssl/evp.h +d2i_pr.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h +d2i_pr.o: ../../include/openssl/md2.h ../../include/openssl/md4.h +d2i_pr.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h +d2i_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h +d2i_pr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h +d2i_pr.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc2.h +d2i_pr.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h +d2i_pr.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h +d2i_pr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h +d2i_pr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h +d2i_pr.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h +d2i_pr.o: ../cryptlib.h d2i_pr.c d2i_pu.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h d2i_pu.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h d2i_pu.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h @@ -459,19 +459,19 @@ d2i_pu.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h d2i_pu.o: ../../include/openssl/des.h ../../include/openssl/des_old.h d2i_pu.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h d2i_pu.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h -d2i_pu.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h -d2i_pu.o: ../../include/openssl/evp.h ../../include/openssl/idea.h -d2i_pu.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h -d2i_pu.o: ../../include/openssl/md4.h ../../include/openssl/md5.h -d2i_pu.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h -d2i_pu.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -d2i_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h -d2i_pu.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h -d2i_pu.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h -d2i_pu.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h -d2i_pu.o: ../../include/openssl/sha.h ../../include/openssl/stack.h -d2i_pu.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h -d2i_pu.o: ../../include/openssl/ui_compat.h ../cryptlib.h d2i_pu.c +d2i_pu.o: ../../include/openssl/err.h ../../include/openssl/evp.h +d2i_pu.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h +d2i_pu.o: ../../include/openssl/md2.h ../../include/openssl/md4.h +d2i_pu.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h +d2i_pu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h +d2i_pu.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h +d2i_pu.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc2.h +d2i_pu.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h +d2i_pu.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h +d2i_pu.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h +d2i_pu.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h +d2i_pu.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h +d2i_pu.o: ../cryptlib.h d2i_pu.c evp_asn1.o: ../../e_os.h ../../include/openssl/asn1.h evp_asn1.o: ../../include/openssl/asn1_mac.h ../../include/openssl/bio.h evp_asn1.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h @@ -512,19 +512,19 @@ i2d_pr.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h i2d_pr.o: ../../include/openssl/des.h ../../include/openssl/des_old.h i2d_pr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h i2d_pr.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h -i2d_pr.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h -i2d_pr.o: ../../include/openssl/evp.h ../../include/openssl/idea.h -i2d_pr.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h -i2d_pr.o: ../../include/openssl/md4.h ../../include/openssl/md5.h -i2d_pr.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h -i2d_pr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -i2d_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h -i2d_pr.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h -i2d_pr.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h -i2d_pr.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h -i2d_pr.o: ../../include/openssl/sha.h ../../include/openssl/stack.h -i2d_pr.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h -i2d_pr.o: ../../include/openssl/ui_compat.h ../cryptlib.h i2d_pr.c +i2d_pr.o: ../../include/openssl/err.h ../../include/openssl/evp.h +i2d_pr.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h +i2d_pr.o: ../../include/openssl/md2.h ../../include/openssl/md4.h +i2d_pr.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h +i2d_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h +i2d_pr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h +i2d_pr.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc2.h +i2d_pr.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h +i2d_pr.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h +i2d_pr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h +i2d_pr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h +i2d_pr.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h +i2d_pr.o: ../cryptlib.h i2d_pr.c i2d_pu.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h i2d_pu.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h i2d_pu.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h @@ -532,19 +532,19 @@ i2d_pu.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h i2d_pu.o: ../../include/openssl/des.h ../../include/openssl/des_old.h i2d_pu.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h i2d_pu.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h -i2d_pu.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h -i2d_pu.o: ../../include/openssl/evp.h ../../include/openssl/idea.h -i2d_pu.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h -i2d_pu.o: ../../include/openssl/md4.h ../../include/openssl/md5.h -i2d_pu.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h -i2d_pu.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -i2d_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h -i2d_pu.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h -i2d_pu.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h -i2d_pu.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h -i2d_pu.o: ../../include/openssl/sha.h ../../include/openssl/stack.h -i2d_pu.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h -i2d_pu.o: ../../include/openssl/ui_compat.h ../cryptlib.h i2d_pu.c +i2d_pu.o: ../../include/openssl/err.h ../../include/openssl/evp.h +i2d_pu.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h +i2d_pu.o: ../../include/openssl/md2.h ../../include/openssl/md4.h +i2d_pu.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h +i2d_pu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h +i2d_pu.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h +i2d_pu.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc2.h +i2d_pu.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h +i2d_pu.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h +i2d_pu.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h +i2d_pu.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h +i2d_pu.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h +i2d_pu.o: ../cryptlib.h i2d_pu.c n_pkey.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h n_pkey.o: ../../include/openssl/asn1_mac.h ../../include/openssl/asn1t.h n_pkey.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h @@ -708,13 +708,13 @@ t_pkey.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h t_pkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h t_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h t_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h -t_pkey.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h -t_pkey.o: ../../include/openssl/err.h ../../include/openssl/lhash.h -t_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h -t_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h -t_pkey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rsa.h -t_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -t_pkey.o: ../../include/openssl/symhacks.h ../cryptlib.h t_pkey.c +t_pkey.o: ../../include/openssl/ec.h ../../include/openssl/err.h +t_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h +t_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h +t_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h +t_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h +t_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h +t_pkey.o: ../cryptlib.h t_pkey.c t_req.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h t_req.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h t_req.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h diff --git a/crypto/asn1/asn1.h b/crypto/asn1/asn1.h index 303fe5da8b..1be3e02298 100644 --- a/crypto/asn1/asn1.h +++ b/crypto/asn1/asn1.h @@ -1010,6 +1010,7 @@ void ERR_load_ASN1_strings(void); #define ASN1_F_I2D_ASN1_TIME 160 #define ASN1_F_I2D_DSA_PUBKEY 161 #define ASN1_F_I2D_ECDSA_PUBKEY 174 +#define ASN1_F_I2D_EC_PUBKEY 176 #define ASN1_F_I2D_NETSCAPE_RSA 162 #define ASN1_F_I2D_PRIVATEKEY 163 #define ASN1_F_I2D_PUBLICKEY 164 diff --git a/crypto/asn1/asn1_err.c b/crypto/asn1/asn1_err.c index dbb9753bb9..d64f987ac6 100644 --- a/crypto/asn1/asn1_err.c +++ b/crypto/asn1/asn1_err.c @@ -128,7 +128,8 @@ static ERR_STRING_DATA ASN1_str_functs[]= {ERR_PACK(0,ASN1_F_D2I_X509_PKEY,0), "d2i_X509_PKEY"}, {ERR_PACK(0,ASN1_F_I2D_ASN1_TIME,0), "I2D_ASN1_TIME"}, {ERR_PACK(0,ASN1_F_I2D_DSA_PUBKEY,0), "i2d_DSA_PUBKEY"}, -{ERR_PACK(0,ASN1_F_I2D_ECDSA_PUBKEY,0), "i2d_ECDSA_PUBKEY"}, +{ERR_PACK(0,ASN1_F_I2D_ECDSA_PUBKEY,0), "I2D_ECDSA_PUBKEY"}, +{ERR_PACK(0,ASN1_F_I2D_EC_PUBKEY,0), "i2d_EC_PUBKEY"}, {ERR_PACK(0,ASN1_F_I2D_NETSCAPE_RSA,0), "i2d_Netscape_RSA"}, {ERR_PACK(0,ASN1_F_I2D_PRIVATEKEY,0), "i2d_PrivateKey"}, {ERR_PACK(0,ASN1_F_I2D_PUBLICKEY,0), "i2d_PublicKey"}, diff --git a/crypto/asn1/d2i_pr.c b/crypto/asn1/d2i_pr.c index d56e5fdc6e..8d0dc27904 100644 --- a/crypto/asn1/d2i_pr.c +++ b/crypto/asn1/d2i_pr.c @@ -68,8 +68,8 @@ #ifndef OPENSSL_NO_DSA #include <openssl/dsa.h> #endif -#ifndef OPENSSL_NO_ECDSA -#include <openssl/ecdsa.h> +#ifndef OPENSSL_NO_EC +#include <openssl/ec.h> #endif EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, unsigned char **pp, @@ -111,9 +111,9 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, unsigned char **pp, } break; #endif -#ifndef OPENSSL_NO_ECDSA - case EVP_PKEY_ECDSA: - if ((ret->pkey.ecdsa = d2i_ECDSAPrivateKey(NULL, +#ifndef OPENSSL_NO_EC + case EVP_PKEY_EC: + if ((ret->pkey.eckey = d2i_ECPrivateKey(NULL, (const unsigned char **)pp, length)) == NULL) { ASN1err(ASN1_F_D2I_PRIVATEKEY, ERR_R_ASN1_LIB); @@ -154,7 +154,7 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, unsigned char **pp, if(sk_ASN1_TYPE_num(inkey) == 6) keytype = EVP_PKEY_DSA; else if (sk_ASN1_TYPE_num(inkey) == 4) - keytype = EVP_PKEY_ECDSA; + keytype = EVP_PKEY_EC; else keytype = EVP_PKEY_RSA; sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free); return d2i_PrivateKey(keytype, a, pp, length); diff --git a/crypto/asn1/d2i_pu.c b/crypto/asn1/d2i_pu.c index f66d72fd7b..cf97b83eac 100644 --- a/crypto/asn1/d2i_pu.c +++ b/crypto/asn1/d2i_pu.c @@ -68,8 +68,8 @@ #ifndef OPENSSL_NO_DSA #include <openssl/dsa.h> #endif -#ifndef OPENSSL_NO_ECDSA -#include <openssl/ecdsa.h> +#ifndef OPENSSL_NO_EC +#include <openssl/ec.h> #endif EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp, @@ -111,10 +111,11 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp, } break; #endif -#ifndef OPENSSL_NO_ECDSA - case EVP_PKEY_ECDSA: - if ((ret->pkey.ecdsa = ECDSAPublicKey_set_octet_string(&(ret->pkey.ecdsa), - (const unsigned char **)pp, length)) == NULL) +#ifndef OPENSSL_NO_EC + case EVP_PKEY_EC: + if ((ret->pkey.eckey = ECPublicKey_set_octet_string( + &(ret->pkey.eckey), (const unsigned char **)pp, + length)) == NULL) { ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB); goto err; diff --git a/crypto/asn1/i2d_pr.c b/crypto/asn1/i2d_pr.c index a40c64d3f4..bbf2a0d2d6 100644 --- a/crypto/asn1/i2d_pr.c +++ b/crypto/asn1/i2d_pr.c @@ -67,8 +67,8 @@ #ifndef OPENSSL_NO_DSA #include <openssl/dsa.h> #endif -#ifndef OPENSSL_NO_ECDSA -#include <openssl/ecdsa.h> +#ifndef OPENSSL_NO_EC +#include <openssl/ec.h> #endif int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp) @@ -86,10 +86,10 @@ int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp) return(i2d_DSAPrivateKey(a->pkey.dsa,pp)); } #endif -#ifndef OPENSSL_NO_ECDSA - if (a->type == EVP_PKEY_ECDSA) +#ifndef OPENSSL_NO_EC + if (a->type == EVP_PKEY_EC) { - return(i2d_ECDSAPrivateKey(a->pkey.ecdsa, pp)); + return(i2d_ECPrivateKey(a->pkey.eckey, pp)); } #endif diff --git a/crypto/asn1/i2d_pu.c b/crypto/asn1/i2d_pu.c index 2fcc5554a7..85220b44d6 100644 --- a/crypto/asn1/i2d_pu.c +++ b/crypto/asn1/i2d_pu.c @@ -67,8 +67,8 @@ #ifndef OPENSSL_NO_DSA #include <openssl/dsa.h> #endif -#ifndef OPENSSL_NO_ECDSA -#include <openssl/ecdsa.h> +#ifndef OPENSSL_NO_EC +#include <openssl/ec.h> #endif int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp) @@ -83,9 +83,9 @@ int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp) case EVP_PKEY_DSA: return(i2d_DSAPublicKey(a->pkey.dsa,pp)); #endif -#ifndef OPENSSL_NO_ECDSA - case EVP_PKEY_ECDSA: - return(ECDSAPublicKey_get_octet_string(a->pkey.ecdsa, pp)); +#ifndef OPENSSL_NO_EC + case EVP_PKEY_EC: + return(ECPublicKey_get_octet_string(a->pkey.eckey, pp)); #endif default: ASN1err(ASN1_F_I2D_PUBLICKEY,ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE); diff --git a/crypto/asn1/t_pkey.c b/crypto/asn1/t_pkey.c index 652b26b7b0..fb01e38d79 100644 --- a/crypto/asn1/t_pkey.c +++ b/crypto/asn1/t_pkey.c @@ -70,8 +70,8 @@ #ifndef OPENSSL_NO_DSA #include <openssl/dsa.h> #endif -#ifndef OPENSSL_NO_ECDSA -#include <openssl/ecdsa.h> +#ifndef OPENSSL_NO_EC +#include <openssl/ec.h> #endif static int print(BIO *fp,const char *str,BIGNUM *num, @@ -257,6 +257,22 @@ int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off) BIO_free(b); return(ret); } + +int EC_KEY_print_fp(FILE *fp, const EC_KEY *x, int off) + { + BIO *b; + int ret; + + if ((b=BIO_new(BIO_s_file())) == NULL) + { + ECerr(EC_F_EC_KEY_PRINT_FP, ERR_R_BIO_LIB); + return(0); + } + BIO_set_fp(b, fp, BIO_NOCLOSE); + ret = EC_KEY_print(b, x, off); + BIO_free(b); + return(ret); + } #endif |