[pisa-src] r1411 - in trunk/community-operator: Makefile.am hipl.c

  • From: Thomas Jansen <mithi@xxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Thu, 29 Oct 2009 15:33:09 +0100

Author: tjansen
Date: Thu Oct 29 15:33:09 2009
New Revision: 1411

Log:
Only build co_server if we have HIPL sources available.

co_server need functionality from hipd to sign the certificate. #ifdef-ing
around that yields a binary that noone can use and noone knows why. Be honest
and say: I cannot build co_server unless you give me HIPL sources.

Modified:
   trunk/community-operator/Makefile.am
   trunk/community-operator/hipl.c

Modified: trunk/community-operator/Makefile.am
==============================================================================
--- trunk/community-operator/Makefile.am        Thu Oct 29 15:06:56 2009        
(r1410)
+++ trunk/community-operator/Makefile.am        Thu Oct 29 15:33:09 2009        
(r1411)
@@ -3,7 +3,7 @@
 #
 # Author: Thomas Jansen <mithi@xxxxxxxxx>
 
-bin_PROGRAMS = co_server co_client
+bin_PROGRAMS = co_client
 
 if PISA_FORCE_SHLIB
   LDFLAGS += -L../libpisa -lpisa
@@ -12,6 +12,9 @@
 endif
 
 if PISA_WITH_HIPL
+bin_PROGRAMS += co_server
+co_server_SOURCES = co_server.c hipl.c
+
 LDFLAGS += -lm
 
 # Ugly hacks due to dependencies on internal HIPL stuff.
@@ -32,6 +35,5 @@
 endif
 
 co_client_SOURCES = co_client.c pisa_cert.c
-co_server_SOURCES = co_server.c hipl.c
 
 EXTRA_DIST = *.h

Modified: trunk/community-operator/hipl.c
==============================================================================
--- trunk/community-operator/hipl.c     Thu Oct 29 15:06:56 2009        (r1410)
+++ trunk/community-operator/hipl.c     Thu Oct 29 15:33:09 2009        (r1411)
@@ -5,9 +5,7 @@
 
 #include "hipl.h"
 #include "config.h"
-#ifdef CONFIG_PISA_WITH_HIPL
-# include "certtools.h"        /* in libinet6 under the hipl source tree */
-#endif /* CONFIG_PISA_WITH_HIPL */
+#include "certtools.h" /* in libinet6 under the hipl source tree */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -24,14 +22,15 @@
                      int parallel_users, char *certificate, size_t size)
 #endif /* HIPL_CERTIFICATE_CHANGES */
 {
-#ifdef CONFIG_PISA_WITH_HIPL
-       struct hip_cert_spki_info cert = { 0 };
+       struct hip_cert_spki_info cert;
 
        if (!not_before || !not_after || !hit || !certificate) {
                printf("Invalid parameter in create_certificate.\n");
                return -1;
        }
 
+       memset(&cert, 0, sizeof(cert));
+
 #ifndef HIPL_CERTIFICATE_CHANGES
        hip_cert_spki_create_cert(&cert, "hit", issuer_hit, "hit", hit,
                                  not_before, not_after);
@@ -43,13 +42,11 @@
        snprintf(certificate, size, "(sequence %s%s%s)", cert.public_key,
                 cert.cert, cert.signature);
 
-#endif /* CONFIG_PISA_WITH_HIPL */
        return 0;
 }
 
 int getDefaultHIT(struct in6_addr *result)
 {
-#ifdef CONFIG_PISA_WITH_HIPL
        struct hip_common *msg = NULL;
        struct hip_tlv_common *param = NULL;
        struct in6_addr *hit = NULL;
@@ -74,6 +71,5 @@
        memcpy(result, hit, sizeof(struct in6_addr));
 
        free(msg);
-#endif /* CONFIG_PISA_WITH_HIPL */
        return 0;
 }

Other related posts:

  • » [pisa-src] r1411 - in trunk/community-operator: Makefile.am hipl.c - Thomas Jansen