X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwgtpkg-digsig.c;h=a1cb55f5ab1d7f132815d5af3969ac9bce800fe8;hb=f97f8d24a1971117bbd4057ca0cd00776bcccb39;hp=e5a8d74ca43cae967bb9254e3c4d4c31ac0fa2cb;hpb=c0fc18e47e49dd4e3cc2f09452a19297dad63f9c;p=src%2Fapp-framework-main.git diff --git a/src/wgtpkg-digsig.c b/src/wgtpkg-digsig.c index e5a8d74..a1cb55f 100644 --- a/src/wgtpkg-digsig.c +++ b/src/wgtpkg-digsig.c @@ -1,5 +1,5 @@ /* - Copyright 2015 IoT.bzh + Copyright (C) 2015-2018 IoT.bzh author: José Bollo @@ -29,7 +29,11 @@ #include "verbose.h" -#include "wgtpkg.h" +#include "wgtpkg-files.h" +#include "wgtpkg-workdir.h" +#include "wgtpkg-certs.h" +#include "wgtpkg-xmlsec.h" +#include "wgtpkg-digsig.h" @@ -343,7 +347,7 @@ int check_all_signatures() for (i = n ; i-- > 0 ; ) { fdesc = signature_of_index(i); irc = verify_digsig(fdesc); - if (!irc) + if (irc < 0) rc = irc; } @@ -353,11 +357,12 @@ int check_all_signatures() /* create a signature of 'index' (0 for author, other values for distributors) using the private 'key' (filename) and the certificates 'certs' (filenames) as trusted chain */ -int create_digsig(int index, const char *key, const char **certs) +int create_digsig(unsigned int index, const char *key, const char **certs) { struct filedesc *fdesc; xmlDocPtr doc; - int rc, len, fd; + int rc, fd; + long len; xmlSaveCtxtPtr ctx; rc = -1;