diff options
author | José Bollo <jose.bollo@iot.bzh> | 2015-12-11 18:01:18 +0100 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2015-12-11 18:01:18 +0100 |
commit | 7e1027342a3cff95635ba2107f283321cf0efa08 (patch) | |
tree | 50cd50416e25fc1c90c745ff95cd76b9fcb6857b /src/wgtpkg-digsig.c | |
parent | 9ab266df6642c6e930e03b3024d7c3d53ef88bbc (diff) |
work in progress
Change-Id: I65416563a8dc54e877df03a304fe4cbd42ebb3da
Diffstat (limited to 'src/wgtpkg-digsig.c')
-rw-r--r-- | src/wgtpkg-digsig.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/wgtpkg-digsig.c b/src/wgtpkg-digsig.c index 3aa4da3..80428fa 100644 --- a/src/wgtpkg-digsig.c +++ b/src/wgtpkg-digsig.c @@ -188,18 +188,37 @@ error: static int check_references(xmlNodePtr sinfo) { + unsigned int i, n, flags; + struct filedesc *f; + int result; xmlNodePtr elem; + result = 0; elem = sinfo->children; while (elem != NULL) { if (is_element(elem, "Reference")) if (check_one_reference(elem)) - return -1; + result = -1; elem = elem->next; } - return 0; + + n = file_count(); + i = 0; + while(i < n) { + f = file_of_index(i++); + if (f->type == type_file) { + flags = f->flags; + if (!(flags & (flag_signature | flag_referenced))) { + syslog(LOG_ERR, "file not referenced in signature", f->name); + result = -1; + } + } + } + + return result; } + static int get_certificates(xmlNodePtr kinfo) { xmlNodePtr n1, n2; |