[pisa-src] r2920 - trunk/community-operator/client/pisa-cert-info.c

  • From: Nikou Gholizadeh <nikou.gholizadeh@xxxxxxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Mon, 12 Mar 2012 21:41:49 +0100

Author: nikou
Date: Mon Mar 12 21:41:48 2012
New Revision: 2920

Log:
pisa-cert-info: rename a funktion and adjust an output message

Modified:
   trunk/community-operator/client/pisa-cert-info.c

Modified: trunk/community-operator/client/pisa-cert-info.c
==============================================================================
--- trunk/community-operator/client/pisa-cert-info.c    Mon Mar 12 21:28:40 
2012        (r2919)
+++ trunk/community-operator/client/pisa-cert-info.c    Mon Mar 12 21:41:48 
2012        (r2920)
@@ -14,9 +14,6 @@
 #include <openssl/pem.h>
 #include <openssl/x509.h>
 
-int X509_print_fp_cop(FILE *fp, X509 *x);
-int print_cert_info(BIO *bp, X509 *x);
-
 /* some helper functions to simplify output of table information */
 static void topen(BIO *bp)
 {
@@ -43,23 +40,15 @@
 };
 
 
-int X509_print_fp_cop(FILE *fp, X509 *x)
+/* the function which actually extracts the certificate information */
+int print_cert_info(FILE *fp, X509 *x)
 {
     BIO *bp;
-    int ret;
-
     if ((bp = BIO_new(BIO_s_file())) == NULL) {
         return 0;
     }
     BIO_set_fp(bp, fp, BIO_NOCLOSE);
-    ret = print_cert_info(bp, x);
-    BIO_free(bp);
-    return ret;
-}
 
-/* the function which actually extracts the certificate information */
-int print_cert_info(BIO *bp, X509 *x)
-{
     long version, serial;
     int ret = 0, id, number_ext, i, j, n;
     char *s;
@@ -152,7 +141,7 @@
 
     publickey = X509_get_pubkey(x);
     if (publickey == NULL) {
-        BIO_printf(bp, "%12sUnable to load Public Key\n", "");
+        BIO_printf(bp, "%12sFailed to load Public Key\n", "");
     } else
 #ifndef NO_RSA
     if (publickey->type == EVP_PKEY_RSA) {
@@ -241,6 +230,7 @@
 
     /* finally close the table */
     BIO_write(bp, "\n</table>", 9);
+    BIO_free(bp);
     return ret;
 }
 
@@ -310,7 +300,7 @@
         }
     }
 
-    X509_print_fp_cop(stdout, cert);
+    print_cert_info(stdout, cert);
 
     /* clean up */
     X509_free(cert);
-- 
This is the pisa developer mailing list. Please also subscribe to the main pisa 
list at:
//www.freelists.org/list/pisa

Other related posts:

  • » [pisa-src] r2920 - trunk/community-operator/client/pisa-cert-info.c - Nikou Gholizadeh