The unified diff between revisions [cd992e6b..] and [1a9f380f..] is displayed below. It can also be downloaded as a raw diff.

This diff has been restricted to the following files: 'src/x509stat.cpp'

#
#
# patch "src/x509stat.cpp"
#  from [21d93457f66f47805d0d1c60167fbcdfcd1ced5c]
#    to [c7081a00e823ddeb6edb0a2720f194196b148fb1]
#
============================================================
--- src/x509stat.cpp	21d93457f66f47805d0d1c60167fbcdfcd1ced5c
+++ src/x509stat.cpp	c7081a00e823ddeb6edb0a2720f194196b148fb1
@@ -30,11 +30,21 @@ Certificate_Extension* X509_GlobalState:
    }

 /*************************************************
+* Destroy this global state object               *
+*************************************************/
+X509_GlobalState::~X509_GlobalState()
+   {
+   for(u32bit j = 0; j != prototypes.size(); ++j)
+      delete prototypes[j];
+   prototypes.clear();
+   }
+
+/*************************************************
 * Set up a new global state for X.509            *
 *************************************************/
 X509_GlobalState::X509_GlobalState()
    {
-#define CREATE_PROTOTYPE(TYPE, NAME)                      \
+#define CREATE_PROTOTYPE(NAME, TYPE)                      \
    struct TYPE ## _Prototype : public Extension_Prototype \
       {                                                   \
       Certificate_Extension* make(const OID& oid)         \
@@ -46,34 +56,15 @@ X509_GlobalState::X509_GlobalState()
       };                                                  \
    add(new TYPE ## _Prototype);

-#if 0
-   class Basic_Constraints_Prototype : public Extension_Prototype
-      {
-      public:
-         Certificate_Extension* make(const OID& oid)
-            {
-            if(oid == OIDS::lookup("X509v3.BasicConstraints"))
-               return new Cert_Extension::Basic_Constraints();
-            return 0;
-            }
-      };
-
-   add(new Basic_Constraints_Prototype);
-#else
-
-   CREATE_PROTOTYPE(Basic_Constraints, "X509v3.BasicConstraints");
-
-#endif
+   CREATE_PROTOTYPE("X509v3.KeyUsage", Key_Usage);
+   CREATE_PROTOTYPE("X509v3.BasicConstraints", Basic_Constraints);
+   CREATE_PROTOTYPE("X509v3.SubjectKeyIdentifier", Subject_Key_ID);
+   CREATE_PROTOTYPE("X509v3.AuthorityKeyIdentifier", Authority_Key_ID);
+   CREATE_PROTOTYPE("X509v3.ExtendedKeyUsage", Extended_Key_Usage);
+   CREATE_PROTOTYPE("X509v3.IssuerAlternativeName", Issuer_Alternative_Name);
+   CREATE_PROTOTYPE("X509v3.SubjectAlternativeName", Subject_Alternative_Name);
+   CREATE_PROTOTYPE("X509v3.CRLNumber", CRL_Number);
+   CREATE_PROTOTYPE("X509v3.CertificatePolicies", Certificate_Policies);
    }

-/*************************************************
-* Destroy this global state object               *
-*************************************************/
-X509_GlobalState::~X509_GlobalState()
-   {
-   for(u32bit j = 0; j != prototypes.size(); ++j)
-      delete prototypes[j];
-   prototypes.clear();
-   }
-
 }