wgtpkg: spliting of headers
[src/app-framework-main.git] / src / wgtpkg-xmlsec.c
index 6b6302e..2d52cc6 100644 (file)
@@ -1,6 +1,8 @@
 /*
  Copyright 2015 IoT.bzh
 
+ author: José Bollo <jose.bollo@iot.bzh>
+
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
@@ -15,7 +17,6 @@
 */
 
 
-#include <syslog.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <dirent.h>
 
 
 #include "verbose.h"
-#include "wgtpkg.h"
+#include "wgtpkg-files.h"
+#include "wgtpkg-workdir.h"
+#include "wgtpkg-xmlsec.h"
 
 static int initstatus;
 static int initdone;
 static xmlSecKeysMngrPtr keymgr;
 
-#ifndef CA_ROOT_DIRECTORY
-#define CA_ROOT_DIRECTORY "./ca-certificates"
-#endif
+static const char trusted_certificates_directory[] = WGTPKG_TRUSTED_CERT_DIR;
 
 /* checks if a file match  uri (should not be a distributor signature) */
 static int file_match_cb(const char *uri)
@@ -191,7 +192,7 @@ int xmlsec_init()
                ERROR("xmlSecCryptoAppDefaultKeysMngrInit failed.");
                goto end;
        }
-       fill_trusted_keys_dir(CA_ROOT_DIRECTORY);
+       fill_trusted_keys_dir(trusted_certificates_directory);
 
        initstatus = 0;
 end: