fixed compiler warnings
authorMartin Willi <martin@strongswan.org>
Wed, 26 Mar 2008 09:29:30 +0000 (09:29 -0000)
committerMartin Willi <martin@strongswan.org>
Wed, 26 Mar 2008 09:29:30 +0000 (09:29 -0000)
src/libstrongswan/plugins/x509/x509_ac.c
src/libstrongswan/plugins/x509/x509_cert.c
src/libstrongswan/plugins/x509/x509_crl.c

index fb4074c..6dfbc79 100644 (file)
@@ -25,6 +25,7 @@
 #include <debug.h>
 #include <asn1/oid.h>
 #include <asn1/asn1.h>
+#include <asn1/pem.h>
 #include <utils/identification.h>
 #include <utils/linked_list.h>
 #include <credentials/certificates/x509.h>
@@ -280,12 +281,10 @@ static const asn1Object_t acObjects[] =
 #define AC_OBJ_ROOF                                    55
 
 /**
- * Parses an X.509 attribute certificate
+ * declaration of function implemented in x509_cert.c
  */
-static bool parse(private_x509_ac_t *this)
-{
-       return FALSE;
-}
+extern void x509_parse_generalNames(chunk_t blob, int level0, bool implicit,
+                                                                       linked_list_t *list);
 /**
  * parses a directoryName
  */
@@ -484,7 +483,7 @@ static bool parse_certificate(private_x509_ac_t *this)
                                }
                                break;
                        case AC_OBJ_ALGORITHM:
-                               this->algorithm != parse_algorithmIdentifier(object, level, NULL);
+                               this->algorithm = parse_algorithmIdentifier(object, level, NULL);
                                break;
                        case AC_OBJ_SIGNATURE:
                                this->signature = object;
@@ -911,6 +910,7 @@ static private_x509_ac_t *create_empty(void)
        this->public.interface.certificate.issued_by = (bool (*)(certificate_t *this, certificate_t *issuer,bool))issued_by;
        this->public.interface.certificate.get_public_key = (public_key_t* (*)(certificate_t *this))get_public_key;
        this->public.interface.certificate.get_validity = (bool(*)(certificate_t*, time_t *when, time_t *, time_t*))get_validity;
+       this->public.interface.certificate.is_newer = (bool (*)(certificate_t*,certificate_t*))is_newer;
        this->public.interface.certificate.get_encoding = (chunk_t(*)(certificate_t*))get_encoding;
        this->public.interface.certificate.equals = (bool(*)(certificate_t*, certificate_t *other))equals;
        this->public.interface.certificate.get_ref = (certificate_t* (*)(certificate_t *this))get_ref;
@@ -1004,6 +1004,10 @@ static private_x509_ac_t* build(private_builder_t *this)
                destroy(ac);
                return NULL;
        }
+       else
+       {
+               return NULL;
+       }
 }
 
 /**
index e52416c..dcd393c 100644 (file)
@@ -498,7 +498,7 @@ static identification_t *parse_generalName(chunk_t blob, int level0)
 /**
  * extracts one or several GNs and puts them into a chained list
  */
-void parse_generalNames(chunk_t blob, int level0, bool implicit, linked_list_t *list)
+void x509_parse_generalNames(chunk_t blob, int level0, bool implicit, linked_list_t *list)
 {
        asn1_ctx_t ctx;
        chunk_t object;
@@ -581,7 +581,7 @@ identification_t* x509_parse_authorityKeyIdentifier(chunk_t blob, int level0,
                        }
                        case AUTH_KEY_ID_CERT_ISSUER:
                        {
-                               /* TODO: parse_generalNames(object, level+1, TRUE); */
+                               /* TODO: x509_parse_generalNames(object, level+1, TRUE); */
                                break;
                        }
                        case AUTH_KEY_ID_CERT_SERIAL:
@@ -708,7 +708,7 @@ static void parse_crlDistributionPoints(chunk_t blob, int level0,
                }
                if (objectID == CRL_DIST_POINTS_FULLNAME)
                {       /* append extracted generalNames to existing chained list */
-                       parse_generalNames(object, level+1, TRUE, list);
+                       x509_parse_generalNames(object, level+1, TRUE, list);
        
                        while (list->remove_last(list, (void**)&id) == SUCCESS)
                        {
@@ -817,7 +817,7 @@ static bool parse_certificate(private_x509_cert_t *this)
                                                this->subjectKeyID = parse_keyIdentifier(object, level, FALSE);
                                                break;
                                        case OID_SUBJECT_ALT_NAME:
-                                               parse_generalNames(object, level, FALSE, this->subjectAltNames);
+                                               x509_parse_generalNames(object, level, FALSE, this->subjectAltNames);
                                                break;
                                        case OID_BASIC_CONSTRAINTS:
                                                if (parse_basicConstraints(object, level))
index c67e879..2b5d098 100644 (file)
@@ -23,6 +23,7 @@ typedef struct revoked_t revoked_t;
 #include <debug.h>
 #include <library.h>
 #include <asn1/asn1.h>
+#include <asn1/pem.h>
 #include <credentials/certificates/x509.h>
 #include <utils/linked_list.h>