* @brief
*/
+#include <imaevm.h>
+
#include "im-uigadget.h"
#include "im-common.h"
#include "im-get-policy.h"
char **policy = NULL;
char *formated_policy = NULL;
- // TODO: Call function from libIMA to get currently loaded policy
- // int res = ima_get_ima_policy(&policy);
- // Check error code: if (res) {return;}
- // Temporary allocation - will be removed when function from libIMA will be used
- policy = calloc(4, sizeof(char*));
- policy[0] = strdup("MEASURE something");
- policy[1] = strdup("MEASUER something else");
- policy[2] = strdup("DONT_MEASURE file");
- // ------------
+ int res = ima_get_policy(&policy);
+ LOGD("ima_get_policy returned: %d\n", res);
+ if (res != LIB_SUCCESS) {
+ return;
+ }
formated_policy = _convert_policy((const char *const *const) policy);
i = 0;