projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make `openssl x509 -noout -modulus' functional also for DSA certificates (in
[openssl.git]
/
apps
/
x509.c
diff --git
a/apps/x509.c
b/apps/x509.c
index b375ffe32f85d792a088bd0c520167b6c38c36dd..c20d213b3d37ec823f04304999923d42dbf4b08d 100644
(file)
--- a/
apps/x509.c
+++ b/
apps/x509.c
@@
-468,7
+468,6
@@
bad:
BIO_printf(STDout,"%08lx\n",X509_subject_name_hash(x));
}
else
BIO_printf(STDout,"%08lx\n",X509_subject_name_hash(x));
}
else
-#ifndef NO_RSA
if (modulus == i)
{
EVP_PKEY *pkey;
if (modulus == i)
{
EVP_PKEY *pkey;
@@
-481,15
+480,21
@@
bad:
goto end;
}
BIO_printf(STDout,"Modulus=");
goto end;
}
BIO_printf(STDout,"Modulus=");
+#ifndef NO_RSA
if (pkey->type == EVP_PKEY_RSA)
BN_print(STDout,pkey->pkey.rsa->n);
else
if (pkey->type == EVP_PKEY_RSA)
BN_print(STDout,pkey->pkey.rsa->n);
else
+#endif
+#ifndef NO_DSA
+ if (pkey->type == EVP_PKEY_DSA)
+ BN_print(STDout,pkey->pkey.dsa->pub_key);
+ else
+#endif
BIO_printf(STDout,"Wrong Algorithm type");
BIO_printf(STDout,"\n");
EVP_PKEY_free(pkey);
}
else
BIO_printf(STDout,"Wrong Algorithm type");
BIO_printf(STDout,"\n");
EVP_PKEY_free(pkey);
}
else
-#endif
if (C == i)
{
unsigned char *d;
if (C == i)
{
unsigned char *d;
@@
-694,7
+699,7
@@
end:
if (Upkey != NULL) EVP_PKEY_free(Upkey);
if (CApkey != NULL) EVP_PKEY_free(CApkey);
if (rq != NULL) X509_REQ_free(rq);
if (Upkey != NULL) EVP_PKEY_free(Upkey);
if (CApkey != NULL) EVP_PKEY_free(CApkey);
if (rq != NULL) X509_REQ_free(rq);
- X509
v3_cleanup_extensions
();
+ X509
V3_EXT_cleanup
();
EXIT(ret);
}
EXIT(ret);
}