makeshift fix of --enable-integrity-test option
authorAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 26 Mar 2008 20:16:42 +0000 (20:16 -0000)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 26 Mar 2008 20:16:42 +0000 (20:16 -0000)
src/libstrongswan/Makefile.am
src/libstrongswan/fips/fips.c
src/libstrongswan/fips/fips_signer.c

index 9b0417f..e38f07c 100644 (file)
@@ -61,7 +61,8 @@ endif
 libstrongswan_la_LIBADD = -lpthread -ldl
 
 INCLUDES = -I$(top_srcdir)/src/libstrongswan
-AM_CFLAGS =
+AM_CFLAGS = -DIPSEC_DIR=\"${ipsecdir}\" \
+                       -DIPSEC_PLUGINDIR=\"${plugindir}\"
 
 if USE_LEAK_DETECTIVE
   AM_CFLAGS += -DLEAK_DETECTIVE
index 6701e1f..bb8f779 100644 (file)
@@ -18,7 +18,7 @@
 #include <stdio.h>
 
 #include <debug.h>
-#include <crypto/signers/hmac_signer.h>
+#include <crypto/signers/signer.h>
 #include "fips.h"
 
 extern const u_char FIPS_rodata_start[];
@@ -56,7 +56,7 @@ bool fips_compute_hmac_signature(const char *key, char *signature)
     DBG1("  RODATA: %p + %6d = %p",
                        FIPS_rodata_start, (int)rodata_len, FIPS_rodata_end);
 
-    signer = (signer_t *)hmac_signer_create(HASH_SHA1, HASH_SIZE_SHA1);
+    signer = lib->crypto->create_signer(lib->crypto, AUTH_HMAC_SHA1_128);
        if (signer == NULL)
        {
            DBG1("  SHA-1 HMAC signer could not be created");
index d467943..276e55e 100644 (file)
@@ -26,6 +26,10 @@ int main(int argc, char* argv[])
        char *hmac_key = "strongSwan Version " VERSION;
        char  hmac_signature[BUF_LEN];
 
+       /* initialize library */
+       library_init(IPSEC_DIR "/strongswan.conf");
+       lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, "libstrongswan-");
+
        if (!fips_compute_hmac_signature(hmac_key, hmac_signature))
        {
                exit(1);
@@ -54,5 +58,7 @@ int main(int argc, char* argv[])
        fprintf(f, "\n");
        fprintf(f, "#endif /* FIPS_SIGNATURE_H_ @} */\n");
        fclose(f);
+
+       library_deinit();
        exit(0);
 }