diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..4f8d9906028fead287b640bc77f0c8d113b8232d --- /dev/null +++ b/.gitignore @@ -0,0 +1,28 @@ +*.o +src/gen_digest_lists +src/verify_digest_lists +*Makefile.in +*Makefile + +ar-lib +config.h +config.h.in +configure.scan +stamp-h1 +aclocal.m4 +autom4te.cache/ +compile +config.log +config.status +config.sub +config.guess +configure +depcomp +install-sh +missing +libtool +ltmain.sh +*/.deps/ +*/.libs/ +*.lo +*.la diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000000000000000000000000000000000000..a83669fa180e5bfa3ca1a0ab05da0d5e64e8942e --- /dev/null +++ b/AUTHORS @@ -0,0 +1,10 @@ +Roberto Sassu, Huawei Technologies Duesseldorf GmbH + +Copyright (C) 2017 Huawei Technologies Duesseldorf GmbH + +All rights reserved. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License as +published by the Free Software Foundation, version 2 of the +License. diff --git a/CHANGES b/CHANGES new file mode 100644 index 0000000000000000000000000000000000000000..5580d89428280072e1b2f0f3b2ab41514945beb8 --- /dev/null +++ b/CHANGES @@ -0,0 +1,3 @@ +2017-11-15 Roberto Sassu + version 0.1 + * first public release diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..efe1bf037fad3bead164c321f059c18642ef337b --- /dev/null +++ b/LICENSE @@ -0,0 +1,3 @@ +A copy of the GPL 2 license can be retrieved from: + +https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..f62a6ff393c1e6c91b9c0e65f57b666f0eed1ac1 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,9 @@ +SUBDIRS = docs \ + lib \ + scripts \ + src + +EXTRA_DIST = AUTHORS \ + CHANGES + +dist_pkgdata_DATA = README diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000000000000000000000000000000000000..34244ab1bdf74de036a357750be8238a91a069a6 --- /dev/null +++ b/configure.ac @@ -0,0 +1,50 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.69]) +AC_INIT([digest-list-tools], [0.1], [roberto.sassu@huawei.com]) +AC_CONFIG_HEADERS([config.h]) +CFLAGS="$CFLAGS -Wall" + +AM_INIT_AUTOMAKE([-Wall foreign]) +AM_PROG_AR +AC_PROG_CC +LT_INIT + +# Checks for programs. +AC_PROG_CXX +AC_PROG_AWK +AC_PROG_CC +AC_PROG_CPP +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_PROG_RANLIB + +# Checks for libraries. +AC_CHECK_LIB([crypto], [SHA256_Init]) +AC_CHECK_LIB([rpm], [headerGetEntry]) +AC_CHECK_LIB([rpmio], [Fopen]) + +# Checks for header files. +AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_CHECK_HEADER_STDBOOL +AC_C_INLINE +AC_TYPE_INT32_T +AC_TYPE_SIZE_T +AC_TYPE_SSIZE_T + +# Checks for library functions. +AC_FUNC_MALLOC +AC_FUNC_MMAP +AC_CHECK_FUNCS([ftruncate memset munmap strstr]) + +AC_CONFIG_FILES([Makefile + docs/Makefile + include/Makefile + lib/Makefile + src/Makefile + scripts/Makefile]) +AC_OUTPUT diff --git a/docs/Makefile.am b/docs/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..5b1c1a221a78174f9732195e29267064f34011ae --- /dev/null +++ b/docs/Makefile.am @@ -0,0 +1,3 @@ +dist_pkgdata_DATA = gen_digest_lists.txt \ + setup_ima_digest_list.txt \ + verify_digest_lists.txt diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..a807be070aa2897fae57eb8a3650d2fe66bfcd88 --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1,6 @@ +noinst_HEADERS = kernel_lib.h \ + kernel_ima.h \ + compact_list.h \ + rpm.h \ + metadata.h \ + lib.h diff --git a/lib/Makefile.am b/lib/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..3472a067b3c5d433dc8a6fb6671915ff08ae32df --- /dev/null +++ b/lib/Makefile.am @@ -0,0 +1,12 @@ +lib_LTLIBRARIES = libdigestlists.la + +libdigestlists_la_LIBADD = -lcrypto -lrpm -lrpmio + +libdigestlists_la_CFLAGS = -I$(top_srcdir)/include + +libdigestlists_la_SOURCES = kernel_lib.c \ + kernel_ima.c \ + compact_list.c \ + rpm.c \ + metadata.c \ + lib.c diff --git a/scripts/Makefile.am b/scripts/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..468d7680104ff29b83e15b1b0b55d20226de381c --- /dev/null +++ b/scripts/Makefile.am @@ -0,0 +1 @@ +bin_SCRIPTS = setup_ima_digest_list diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..3446e3d763f9c86b9e4a1bd78ced28025439d637 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,9 @@ +bin_PROGRAMS = gen_digest_lists verify_digest_lists + +gen_digest_lists_CFLAGS = -I$(top_srcdir)/include +gen_digest_lists_LDADD = $(top_srcdir)/lib/libdigestlists.la -lcrypto -lrpm -lrpmio +gen_digest_lists_SOURCES = gen_digest_lists.c + +verify_digest_lists_CFLAGS = -I$(top_srcdir)/include +verify_digest_lists_LDADD = $(top_srcdir)/lib/libdigestlists.la -lcrypto -lrpm -lrpmio +verify_digest_lists_SOURCES = verify_digest_lists.c