#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,
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
int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off)
OPENSSL_free(buffer);
return(ret);
}
-#endif /* OPENSSL_NO_EC */
-
-
-#ifndef OPENSSL_NO_ECDSA
-#ifndef OPENSSL_NO_FP_API
-int ECDSA_print_fp(FILE *fp, const ECDSA *x, int off)
-{
- BIO *b;
- int ret;
-
- if ((b=BIO_new(BIO_s_file())) == NULL)
- {
- ECDSAerr(ECDSA_F_ECDSA_PRINT_FP, ERR_R_BIO_LIB);
- return(0);
- }
- BIO_set_fp(b, fp, BIO_NOCLOSE);
- ret = ECDSA_print(b, x, off);
- BIO_free(b);
- return(ret);
-}
-#endif
-int ECDSA_print(BIO *bp, const ECDSA *x, int off)
+int EC_KEY_print(BIO *bp, const EC_KEY *x, int off)
{
char str[128];
unsigned char *buffer=NULL;
}
if ((pub_key = EC_POINT_point2bn(x->group, x->pub_key,
- ECDSA_get_conversion_form(x), NULL, ctx)) == NULL)
+ x->conv_form, NULL, ctx)) == NULL)
{
reason = ERR_R_EC_LIB;
goto err;
ret=1;
err:
if (!ret)
- ECDSAerr(ECDSA_F_ECDSA_PRINT, reason);
+ ECerr(EC_F_EC_KEY_PRINT, reason);
if (pub_key)
BN_free(pub_key);
if (ctx)
OPENSSL_free(buffer);
return(ret);
}
-#endif
+#endif /* OPENSSL_NO_EC */
static int print(BIO *bp, const char *number, BIGNUM *num, unsigned char *buf,
int off)
#endif /* !OPENSSL_NO_DSA */
-#ifndef OPENSSL_NO_ECDSA
+#ifndef OPENSSL_NO_EC
#ifndef OPENSSL_NO_FP_API
-int ECDSAParameters_print_fp(FILE *fp, const ECDSA *x)
+int ECParameters_print_fp(FILE *fp, const EC_KEY *x)
{
BIO *b;
int ret;
if ((b=BIO_new(BIO_s_file())) == NULL)
- {
- ECDSAerr(ECDSA_F_ECDSAPARAMETERS_PRINT_FP, ERR_R_BIO_LIB);
+ {
+ ECerr(EC_F_ECPARAMETERS_PRINT_FP, ERR_R_BIO_LIB);
return(0);
- }
+ }
BIO_set_fp(b, fp, BIO_NOCLOSE);
- ret = ECDSAParameters_print(b, x);
+ ret = ECParameters_print(b, x);
BIO_free(b);
return(ret);
}
#endif
-int ECDSAParameters_print(BIO *bp, const ECDSA *x)
+int ECParameters_print(BIO *bp, const EC_KEY *x)
{
int reason=ERR_R_EC_LIB, ret=0;
BIGNUM *order=NULL;
err:
if (order)
BN_free(order);
- ECDSAerr(ECDSA_F_ECDSAPARAMETERS_PRINT, reason);
+ ECerr(EC_F_ECPARAMETERS_PRINT, reason);
return(ret);
}