diff options
author | Bodo Möller <bodo@openssl.org> | 2002-08-07 10:49:54 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2002-08-07 10:49:54 +0000 |
commit | 14a7cfb32a0347a4bc620ae1b552b21c4c1e270b (patch) | |
tree | 13c4bcc3d58ba7db5e598cd668670873b51e8ce3 /crypto/x509/x_all.c | |
parent | 7a8645d1716d7f84435b0f3d8d2fd122d6f75113 (diff) |
use a generic EC_KEY structure (EC keys are not ECDSA specific)
Submitted by: Nils Larsch
Diffstat (limited to 'crypto/x509/x_all.c')
-rw-r--r-- | crypto/x509/x_all.c | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/crypto/x509/x_all.c b/crypto/x509/x_all.c index cc1ff90e9a..801df78f08 100644 --- a/crypto/x509/x_all.c +++ b/crypto/x509/x_all.c @@ -325,59 +325,58 @@ int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa) #endif -#ifndef OPENSSL_NO_ECDSA +#ifndef OPENSSL_NO_EC #ifndef OPENSSL_NO_FP_API -ECDSA *d2i_ECDSAPrivateKey_fp(FILE *fp, ECDSA **ecdsa) +EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey) { - return((ECDSA *)ASN1_d2i_fp((char *(*)()) - ECDSA_new,(char *(*)())d2i_ECDSAPrivateKey, (fp), - (unsigned char **)(ecdsa))); + return((EC_KEY *)ASN1_d2i_fp((char *(*)()) + EC_KEY_new,(char *(*)())d2i_EC_PUBKEY, (fp), + (unsigned char **)(eckey))); } -int i2d_ECDSAPrivateKey_fp(FILE *fp, ECDSA *ecdsa) +int i2d_EC_PUBKEY_fp(FILE *fp, EC_KEY *eckey) { - return(ASN1_i2d_fp(i2d_ECDSAPrivateKey,fp,(unsigned char *)ecdsa)); + return(ASN1_i2d_fp(i2d_EC_PUBKEY,fp,(unsigned char *)eckey)); } - -ECDSA *d2i_ECDSA_PUBKEY_fp(FILE *fp, ECDSA **ecdsa) + +EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey) { - return((ECDSA *)ASN1_d2i_fp((char *(*)()) - ECDSA_new,(char *(*)())d2i_ECDSA_PUBKEY, (fp), - (unsigned char **)(ecdsa))); + return((EC_KEY *)ASN1_d2i_fp((char *(*)()) + EC_KEY_new,(char *(*)())d2i_ECPrivateKey, (fp), + (unsigned char **)(eckey))); } -int i2d_ECDSA_PUBKEY_fp(FILE *fp, ECDSA *ecdsa) +int i2d_ECPrivateKey_fp(FILE *fp, EC_KEY *eckey) { - return(ASN1_i2d_fp(i2d_ECDSA_PUBKEY,fp,(unsigned char *)ecdsa)); + return(ASN1_i2d_fp(i2d_ECPrivateKey,fp,(unsigned char *)eckey)); } #endif - -ECDSA *d2i_ECDSAPrivateKey_bio(BIO *bp, ECDSA **ecdsa) +EC_KEY *d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **eckey) { - return((ECDSA *)ASN1_d2i_bio((char *(*)()) - ECDSA_new,(char *(*)())d2i_ECDSAPrivateKey, (bp), - (unsigned char **)(ecdsa))); + return((EC_KEY *)ASN1_d2i_bio((char *(*)()) + EC_KEY_new,(char *(*)())d2i_EC_PUBKEY, (bp), + (unsigned char **)(eckey))); } -int i2d_ECDSAPrivateKey_bio(BIO *bp, ECDSA *ecdsa) +int i2d_EC_PUBKEY_bio(BIO *bp, EC_KEY *ecdsa) { - return(ASN1_i2d_bio(i2d_ECDSAPrivateKey,bp,(unsigned char *)ecdsa)); + return(ASN1_i2d_bio(i2d_EC_PUBKEY,bp,(unsigned char *)ecdsa)); } - -ECDSA *d2i_ECDSA_PUBKEY_bio(BIO *bp, ECDSA **ecdsa) + +EC_KEY *d2i_ECPrivateKey_bio(BIO *bp, EC_KEY **eckey) { - return((ECDSA *)ASN1_d2i_bio((char *(*)()) - ECDSA_new,(char *(*)())d2i_ECDSA_PUBKEY, (bp), - (unsigned char **)(ecdsa))); + return((EC_KEY *)ASN1_d2i_bio((char *(*)()) + EC_KEY_new,(char *(*)())d2i_ECPrivateKey, (bp), + (unsigned char **)(eckey))); } -int i2d_ECDSA_PUBKEY_bio(BIO *bp, ECDSA *ecdsa) +int i2d_ECPrivateKey_bio(BIO *bp, EC_KEY *eckey) { - return(ASN1_i2d_bio(i2d_ECDSA_PUBKEY,bp,(unsigned char *)ecdsa)); + return(ASN1_i2d_bio(i2d_ECPrivateKey,bp,(unsigned char *)eckey)); } - #endif + int X509_pubkey_digest(const X509 *data, const EVP_MD *type, unsigned char *md, unsigned int *len) { |