#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
#include <openssl/objects.h>
#include <openssl/x509.h>
if ((b=BIO_new(BIO_s_file())) == NULL)
{
- X509err(X509_F_X509_PRINT_FP,ERR_R_BUF_LIB);
+ X509err(X509_F_X509_PRINT_EX_FP,ERR_R_BUF_LIB);
return(0);
}
BIO_set_fp(b,fp,BIO_NOCLOSE);
}
else
#endif
-#ifndef OPENSSL_NO_ECDSA
- if (pkey->type == EVP_PKEY_ECDSA)
+#ifndef OPENSSL_NO_EC
+ if (pkey->type == EVP_PKEY_EC)
{
- BIO_printf(bp, "%12sECDSA Public Key:\n","");
- ECDSA_print(bp, pkey->pkey.ecdsa, 16);
+ BIO_printf(bp, "%12sEC Public Key:\n","");
+ EC_KEY_print(bp, pkey->pkey.ec, 16);
}
else
#endif
int X509_NAME_print(BIO *bp, X509_NAME *name, int obase)
{
- char *s,*c;
+ char *s,*c,*b;
int ret=0,l,ll,i,first=1;
- char buf[256];
ll=80-2-obase;
- s=X509_NAME_oneline(name,buf,256);
+ b=s=X509_NAME_oneline(name,NULL,0);
if (!*s)
+ {
+ OPENSSL_free(b);
return 1;
+ }
s++; /* skip the first slash */
l=ll;
err:
X509err(X509_F_X509_NAME_PRINT,ERR_R_BUF_LIB);
}
+ OPENSSL_free(b);
return(ret);
}