#ifndef OPENSSL_NO_DSA
#include <openssl/dsa.h>
#endif
+#ifndef OPENSSL_NO_ECDSA
+#include <openssl/ecdsa.h>
+#endif
#include <openssl/objects.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>
if((nmflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) {
mlch = '\n';
- nmindent = 16;
+ nmindent = 12;
}
if(nmflags == X509_FLAG_COMPAT)
if(!(cflag & X509_FLAG_NO_ISSUER))
{
if (BIO_printf(bp," Issuer:%c",mlch) <= 0) goto err;
- if (!X509_NAME_print_ex(bp,X509_get_issuer_name(x),nmindent, nmflags)) goto err;
+ if (X509_NAME_print_ex(bp,X509_get_issuer_name(x),nmindent, nmflags) < 0) goto err;
if (BIO_write(bp,"\n",1) <= 0) goto err;
}
if(!(cflag & X509_FLAG_NO_VALIDITY))
if(!(cflag & X509_FLAG_NO_SUBJECT))
{
if (BIO_printf(bp," Subject:%c",mlch) <= 0) goto err;
- if (!X509_NAME_print_ex(bp,X509_get_subject_name(x),nmindent, nmflags)) goto err;
+ if (X509_NAME_print_ex(bp,X509_get_subject_name(x),nmindent, nmflags) < 0) goto err;
if (BIO_write(bp,"\n",1) <= 0) goto err;
}
if(!(cflag & X509_FLAG_NO_PUBKEY))
DSA_print(bp,pkey->pkey.dsa,16);
}
else
+#endif
+#ifndef OPENSSL_NO_ECDSA
+ if (pkey->type == EVP_PKEY_ECDSA)
+ {
+ BIO_printf(bp, "%12sECDSA Public Key:\n","");
+ ECDSA_print(bp, pkey->pkey.ecdsa, 16);
+ }
+ else
#endif
BIO_printf(bp,"%12sUnknown Public Key:\n","");
unsigned char *dertmp;
int derlen;
int i;
- SHA_CTX SHA1buf ;
unsigned char SHA1md[SHA_DIGEST_LENGTH];
/* display the hash of the subject as it would appear
goto err;
i2d_X509_NAME(x->cert_info->subject, &dertmp);
- SHA1_Init(&SHA1buf);
- SHA1_Update(&SHA1buf, der, derlen);
- SHA1_Final(SHA1md,&SHA1buf);
+ EVP_Digest(der, derlen, SHA1md, NULL, EVP_sha1(), NULL);
for (i=0; i < SHA_DIGEST_LENGTH; i++)
{
if (BIO_printf(bp,"%02X",SHA1md[i]) <= 0) goto err;
if (BIO_printf(bp,"\n Public key OCSP hash: ") <= 0)
goto err;
- SHA1_Init(&SHA1buf);
- SHA1_Update(&SHA1buf, x->cert_info->key->public_key->data,
- x->cert_info->key->public_key->length);
- SHA1_Final(SHA1md,&SHA1buf);
+ EVP_Digest(x->cert_info->key->public_key->data,
+ x->cert_info->key->public_key->length, SHA1md, NULL, EVP_sha1(), NULL);
for (i=0; i < SHA_DIGEST_LENGTH; i++)
{
if (BIO_printf(bp,"%02X",SHA1md[i]) <= 0)
ll=80-2-obase;
s=X509_NAME_oneline(name,buf,256);
+ if (!*s)
+ return 1;
s++; /* skip the first slash */
l=ll;