From 6d565b665ca5adbf4db4918ec60e557f7e4ca951 Mon Sep 17 00:00:00 2001 From: Brian Carrier <carrier@sleuthkit.org> Date: Sun, 21 Mar 2021 10:18:29 -0400 Subject: [PATCH] Add copyright and license info. Continuation of work from #1904 --- tsk/base/mymalloc.c | 2 +- tsk/fs/decmpfs.c | 29 ++++++++++++++++++++++++++++- tsk/fs/decmpfs.h | 14 ++++++++++++++ tsk/fs/lzvn.c | 3 +++ tsk/util/crypto.cpp | 15 ++++++++++++++- tsk/util/crypto.hpp | 15 ++++++++++++++- 6 files changed, 74 insertions(+), 4 deletions(-) diff --git a/tsk/base/mymalloc.c b/tsk/base/mymalloc.c index 8c6b910d9..efbf0aadc 100644 --- a/tsk/base/mymalloc.c +++ b/tsk/base/mymalloc.c @@ -11,7 +11,7 @@ * when an error occurs. */ -/* The IBM Public Licence must be distributed with this software. +/* The IBM Public License must be distributed with this software. * AUTHOR(S) * Wietse Venema * IBM T.J. Watson Research diff --git a/tsk/fs/decmpfs.c b/tsk/fs/decmpfs.c index 7e522172e..ff59281bf 100644 --- a/tsk/fs/decmpfs.c +++ b/tsk/fs/decmpfs.c @@ -1,3 +1,10 @@ +/* This file contains decompression routines used by APFS and HFS + * It has one method derived from public domain ZLIB and others + * that are TSK-specific. + * + * It would probably be cleaner to separate these into two files. + */ + #include "../libtsk.h" #include "tsk_fs_i.h" #include "decmpfs.h" @@ -13,7 +20,13 @@ /***************** ZLIB stuff *******************************/ -// Adapted from zpipe.c (part of zlib) at http://zlib.net/zpipe.c +/* The zlib_inflate method is adapted from the public domain + * zpipe.c (part of zlib) at http://zlib.net/zpipe.c + * + * zpipe.c: example of proper use of zlib's inflate() and deflate() + * Not copyrighted -- provided to the public domain + * Version 1.4 11 December 2005 Mark Adler */ + #define CHUNK 16384 /* @@ -140,6 +153,20 @@ zlib_inflate(char *source, uint64_t sourceLen, char *dest, uint64_t destLen, uin #endif + + +/********************* TSK STUFF **********************/ + +/* + * The Sleuth Kit + * + * Brian Carrier [carrier <at> sleuthkit [dot] org] + * Copyright (c) 2019-2020 Brian Carrier. All Rights reserved + * Copyright (c) 2018-2019 BlackBag Technologies. All Rights reserved + * + * This software is distributed under the Common Public License 1.0 + */ + typedef struct { uint32_t offset; uint32_t length; diff --git a/tsk/fs/decmpfs.h b/tsk/fs/decmpfs.h index 4ab40fd18..2bcfce8e1 100644 --- a/tsk/fs/decmpfs.h +++ b/tsk/fs/decmpfs.h @@ -1,3 +1,12 @@ +/* + * The Sleuth Kit + * + * Brian Carrier [carrier <at> sleuthkit [dot] org] + * Copyright (c) 2018-2019 BlackBag Technologies. All Rights reserved + * + * This software is distributed under the Common Public License 1.0 + */ + #pragma once #include <stdint.h> @@ -8,6 +17,11 @@ extern "C" { #endif +/** + * Contains the structures and function APIs dealing with compressed files + * in APFS and HFS+ file systems. + */ + /* * If a file is compressed, then it will have an extended attribute * with name com.apple.decmpfs. The value of that attribute is a data diff --git a/tsk/fs/lzvn.c b/tsk/fs/lzvn.c index f03afefa2..b264d0f4f 100644 --- a/tsk/fs/lzvn.c +++ b/tsk/fs/lzvn.c @@ -17,6 +17,9 @@ COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +NOTE: This is distributed in licenses/bsd.txt + */ // LZVN low-level decoder diff --git a/tsk/util/crypto.cpp b/tsk/util/crypto.cpp index 263dc6370..870fe83e2 100644 --- a/tsk/util/crypto.cpp +++ b/tsk/util/crypto.cpp @@ -1,3 +1,16 @@ +/* + * The Sleuth Kit + * + * Brian Carrier [carrier <at> sleuthkit [dot] org] + * Copyright (c) 2018-2019 BlackBag Technologies. All Rights reserved + * + * This software is distributed under the Common Public License 1.0 + */ + +/* This file contains routines used by APFS code. + * It could probably move into the 'fs' folder. + * It is XTS wrappers around OpenSSL + */ #include "crypto.hpp" #ifdef HAVE_LIBOPENSSL @@ -195,4 +208,4 @@ std::unique_ptr<uint8_t[]> hash_buffer_sha256(const void *input, return hash; } -#endif \ No newline at end of file +#endif diff --git a/tsk/util/crypto.hpp b/tsk/util/crypto.hpp index 490a7924f..9ff99881f 100644 --- a/tsk/util/crypto.hpp +++ b/tsk/util/crypto.hpp @@ -1,5 +1,18 @@ #pragma once +/* + * The Sleuth Kit + * + * Brian Carrier [carrier <at> sleuthkit [dot] org] + * Copyright (c) 2018-2019 BlackBag Technologies. All Rights reserved + * + * This software is distributed under the Common Public License 1.0 + */ + +/** + * This is currently being used only by APFS + */ + #include "../base/tsk_base.h" #ifdef HAVE_LIBOPENSSL @@ -48,4 +61,4 @@ std::unique_ptr<uint8_t[]> hash_buffer_md5(const void *input, std::unique_ptr<uint8_t[]> hash_buffer_sha256(const void *input, size_t len) noexcept; -#endif \ No newline at end of file +#endif -- GitLab