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

  • From: Diego Biurrun <diego@xxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Mon, 12 Mar 2012 19:11:10 +0100

Author: biurrun
Date: Mon Mar 12 19:11:09 2012
New Revision: 2910

Log:
pisa-cert-info: Give more sensible names to functions.

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 19:00:55 
2012        (r2909)
+++ trunk/community-operator/client/pisa-cert-info.c    Mon Mar 12 19:11:09 
2012        (r2910)
@@ -15,19 +15,19 @@
 #include <openssl/x509.h>
 
 int X509_print_fp_cop(FILE *fp, X509 *x);
-int X509_print_cop(BIO *bp, X509 *x);
+int print_cert_info(BIO *bp, X509 *x);
 
-static void t1(BIO *bp)
+static void topen(BIO *bp)
 {
     BIO_write(bp, "<tr><td>", 8);
 }
 
-static void t2(BIO *bp)
+static void tnext(BIO *bp)
 {
     BIO_write(bp, "</td><td>", 9);
 }
 
-static void t3(BIO *bp)
+static void tclose(BIO *bp)
 {
     BIO_write(bp, "</td></tr>\n", 11);
 }
@@ -43,12 +43,12 @@
         return 0;
     }
     BIO_set_fp(b, fp, BIO_NOCLOSE);
-    ret = X509_print_cop(b, x);
+    ret = print_cert_info(b, x);
     BIO_free(b);
     return ret;
 }
 
-int X509_print_cop(BIO *bp, X509 *x)
+int print_cert_info(BIO *bp, X509 *x)
 {
     long l;
     int ret          = 0, i, j, n;
@@ -71,11 +71,11 @@
         goto err;
     }
 
-    t1(bp);
+    topen(bp);
     if (BIO_write(bp, "Serial Number", 13) <= 0) {
         goto err;
     }
-    t2(bp);
+    tnext(bp);
 
     bs = X509_get_serialNumber(x);
     if (bs->length <= 4) {
@@ -102,7 +102,7 @@
             }
         }
     }
-    t3(bp);
+    tclose(bp);
 
     i = OBJ_obj2nid(ci->signature->algorithm);
     if (BIO_printf(bp, "<tr><td>Signature Algorithm</td><td> %s</td></tr>\n",
@@ -110,45 +110,45 @@
         goto err;
     }
 
-    t1(bp);
+    topen(bp);
     if (BIO_write(bp, "Issuer", 6) <= 0) {
         goto err;
     }
-    t2(bp);
+    tnext(bp);
     if (!X509_NAME_print(bp, X509_get_issuer_name(x), 16)) {
         goto err;
     }
-    t3(bp);
+    tclose(bp);
 
-    t1(bp);
+    topen(bp);
     if (BIO_write(bp, "Valid Not Before", 16) <= 0) {
         goto err;
     }
-    t2(bp);
+    tnext(bp);
     if (!ASN1_TIME_print(bp, X509_get_notBefore(x))) {
         goto err;
     }
-    t3(bp);
+    tclose(bp);
 
-    t1(bp);
+    topen(bp);
     if (BIO_write(bp, "Valid Not After", 15) <= 0) {
         goto err;
     }
-    t2(bp);
+    tnext(bp);
     if (!ASN1_TIME_print(bp, X509_get_notAfter(x))) {
         goto err;
     }
-    t3(bp);
+    tclose(bp);
 
-    t1(bp);
+    topen(bp);
     if (BIO_write(bp, "Subject", 7) <= 0) {
         goto err;
     }
-    t2(bp);
+    tnext(bp);
     if (!X509_NAME_print(bp, X509_get_subject_name(x), 16)) {
         goto err;
     }
-    t3(bp);
+    tclose(bp);
 
     i    = OBJ_obj2nid(ci->key->algor->algorithm);
     if (BIO_printf(bp, "<tr><td>Public Key Algorithm</td><td>%s<br>\n",
@@ -175,7 +175,7 @@
 #endif
     { BIO_printf(bp, "%12sUnknown Public Key:\n", "");
     }
-    t3(bp);
+    tclose(bp);
     BIO_printf(bp, "</table>\n");
     EVP_PKEY_free(pkey);
 
@@ -187,15 +187,15 @@
         for (i = 0; i < n; i++) {
             ASN1_OBJECT *obj;
             ex  = X509_get_ext(x, i);
-            t1(bp);
+            topen(bp);
             obj = X509_EXTENSION_get_object(ex);
             i2a_ASN1_OBJECT(bp, obj);
             j   = X509_EXTENSION_get_critical(ex);
-            t2(bp);
+            tnext(bp);
             if (BIO_printf(bp, "%1s", j ? "critical" : "") <= 0) {
                 goto err;
             }
-            t3(bp);
+            tclose(bp);
         }
     }
 
@@ -230,7 +230,7 @@
     if (str != NULL) {
         ASN1_STRING_free(str);
     }
-    t3(bp);
+    tclose(bp);
     BIO_write(bp, "\n</table>", 9);
     return ret;
 }
-- 
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] r2910 - trunk/community-operator/client/pisa-cert-info.c - Diego Biurrun