[gcab/wip/hughsie/future: 15/18] Add some simple self tests



commit 301f8fb6fa6bb1789988f17c0bb5e3bd979ecda5
Author: Richard Hughes <richard hughsie com>
Date:   Tue Dec 12 21:32:53 2017 +0000

    Add some simple self tests
    
    This allows us to find a lot of bugs in the library, and can be run on multiple
    architectures to find new build-time and run-time regressions.

 gcab-self-test.c      |  454 +++++++++++++++++++++++++++++++++++++++++++++++++
 meson.build           |   25 +++
 tests/Makefile        |   18 ++
 tests/privkey.pem     |  182 ++++++++++++++++++++
 tests/src/test.sh     |    1 +
 tests/src/test.txt    |    1 +
 tests/test-mszip.cab  |  Bin 0 -> 119 bytes
 tests/test-none.cab   |  Bin 0 -> 115 bytes
 tests/test-signed.cab |  Bin 0 -> 2179 bytes
 9 files changed, 681 insertions(+), 0 deletions(-)
---
diff --git a/gcab-self-test.c b/gcab-self-test.c
new file mode 100644
index 0000000..77cdd5c
--- /dev/null
+++ b/gcab-self-test.c
@@ -0,0 +1,454 @@
+/*
+ * LibGCab
+ * Copyright (c) 2017, Richard Hughes <richard hughsie com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#include "config.h"
+
+#include <limits.h>
+#include <stdlib.h>
+
+#include <libgcab.h>
+
+static gchar *
+gcab_test_get_filename (const gchar *filename)
+{
+    gchar *tmp;
+    char full_tmp[PATH_MAX];
+    g_autofree gchar *path = NULL;
+    path = g_build_filename (TESTDATADIR, filename, NULL);
+    tmp = realpath (path, full_tmp);
+    if (tmp != NULL)
+        return g_strdup (full_tmp);
+    return NULL;
+}
+
+static void
+gcab_test_file_func (void)
+{
+    gboolean ret;
+    GTimeVal tv;
+    g_autofree gchar *fn = NULL;
+    g_autoptr(GCabFile) cabfile = NULL;
+    g_autoptr(GDateTime) dt = NULL;
+    g_autoptr(GFile) gfile = NULL;
+    g_autoptr(GDateTime) dt_bday = NULL;
+
+    /* create object */
+    fn = gcab_test_get_filename ("src/test.sh");
+    g_assert (fn != NULL);
+    gfile = g_file_new_for_path (fn);
+    cabfile = gcab_file_new_with_file ("tæst.bin", gfile);
+    g_assert (cabfile != NULL);
+
+    /* set the time */
+    dt_bday = g_date_time_new_utc (2017, 9, 15, 0, 0, 0.f);
+    ret = g_date_time_to_timeval (dt_bday, &tv);
+    g_assert (ret);
+    gcab_file_set_date (cabfile, &tv);
+
+    /* verify */
+    g_assert (gcab_file_get_file (cabfile) == gfile);
+    g_assert_cmpstr (gcab_file_get_name (cabfile), ==, "tæst.bin");
+    g_assert_cmpstr (gcab_file_get_extract_name (cabfile), ==, "tæst.bin");
+    g_assert_cmpint (gcab_file_get_size (cabfile), ==, 0);
+    g_assert_cmpint (gcab_file_get_attributes (cabfile), ==, 0);
+    ret = gcab_file_get_date (cabfile, &tv);
+    g_assert (ret);
+    dt = g_date_time_new_from_timeval_utc (&tv);
+    g_assert_cmpint (g_date_time_get_year (dt), ==, 2017);
+    g_assert_cmpint (g_date_time_get_month (dt), ==, 9);
+    g_assert_cmpint (g_date_time_get_day_of_month (dt), ==, 15);
+    g_assert_cmpint (g_date_time_get_hour (dt), ==, 0);
+    g_assert_cmpint (g_date_time_get_minute (dt), ==, 0);
+    g_assert_cmpint (g_date_time_get_second (dt), ==, 0);
+
+    /* test changing the extraction name */
+    gcab_file_set_extract_name (cabfile, "new.bin");
+    g_assert_cmpstr (gcab_file_get_extract_name (cabfile), ==, "new.bin");
+    g_assert_cmpstr (gcab_file_get_name (cabfile), ==, "tæst.bin");
+}
+
+static void
+gcab_test_folder_func (void)
+{
+    GCabFile *cabfile_tmp;
+    gboolean ret;
+    g_autofree gchar *fn = NULL;
+    g_autoptr(GCabFile) cabfile2 = NULL;
+    g_autoptr(GCabFile) cabfile = NULL;
+    g_autoptr(GCabFolder) cabfolder = NULL;
+    g_autoptr(GError) error = NULL;
+    g_autoptr(GFile) gfile = NULL;
+    g_autoptr(GSList) cabfiles = NULL;
+
+    /* create GCabFile */
+    fn = gcab_test_get_filename ("test-none.cab");
+    g_assert (fn != NULL);
+    gfile = g_file_new_for_path (fn);
+    cabfile = gcab_file_new_with_file ("test.bin", gfile);
+
+    /* add single file */
+    cabfolder = gcab_folder_new (GCAB_COMPRESSION_NONE);
+    ret = gcab_folder_add_file (cabfolder, cabfile, FALSE, NULL, &error);
+    g_assert_no_error (error);
+    g_assert (ret);
+    g_assert_cmpint (gcab_folder_get_nfiles (cabfolder), ==, 1);
+    cabfiles = gcab_folder_get_files (cabfolder);
+    cabfile_tmp = GCAB_FILE (cabfiles->data);
+    g_assert (cabfile_tmp == cabfile);
+    g_assert_cmpstr (gcab_file_get_name (cabfile_tmp), ==, "test.bin");
+
+    /* add it again */
+    cabfile2 = gcab_file_new_with_file ("test.bin", gfile);
+    ret = gcab_folder_add_file (cabfolder, cabfile2, FALSE, NULL, &error);
+    g_assert_error (error, GCAB_ERROR, GCAB_ERROR_FORMAT);
+    g_assert (!ret);
+}
+
+static void
+gcab_test_folder_path_func (void)
+{
+    GCabFile *cabfile_tmp;
+    gboolean ret;
+    g_autofree gchar *fn = NULL;
+    g_autoptr(GCabFile) cabfile = NULL;
+    g_autoptr(GCabFolder) cabfolder = NULL;
+    g_autoptr(GError) error = NULL;
+    g_autoptr(GFile) gfile = NULL;
+    g_autoptr(GSList) cabfiles = NULL;
+
+    /* create GCabFile of a path */
+    fn = gcab_test_get_filename ("src");
+    g_assert (fn != NULL);
+    gfile = g_file_new_for_path (fn);
+    cabfile = gcab_file_new_with_file ("dirname", gfile);
+
+    /* add entire subdir */
+    cabfolder = gcab_folder_new (GCAB_COMPRESSION_NONE);
+    ret = gcab_folder_add_file (cabfolder, cabfile, TRUE, NULL, &error);
+    g_assert_no_error (error);
+    g_assert (ret);
+    g_assert_cmpint (gcab_folder_get_nfiles (cabfolder), ==, 2);
+    cabfiles = gcab_folder_get_files (cabfolder);
+    cabfile_tmp = GCAB_FILE (cabfiles->data);
+    g_assert (cabfile_tmp != cabfile);
+    g_assert_cmpstr (gcab_file_get_name (cabfile_tmp), ==, "dirname\\test.txt");
+    g_assert_cmpstr (gcab_file_get_extract_name (cabfile_tmp), ==, "dirname\\test.txt");
+
+    /* add it again */
+    ret = gcab_folder_add_file (cabfolder, cabfile, TRUE, NULL, &error);
+    g_assert_error (error, GCAB_ERROR, GCAB_ERROR_FORMAT);
+    g_assert (!ret);
+}
+
+static void
+gcab_test_cabinet_error_not_loaded_func (void)
+{
+    gboolean ret;
+    g_autoptr(GCabCabinet) cabinet = NULL;
+    g_autoptr(GError) error = NULL;
+    g_autoptr(GFile) file = NULL;
+
+    /* we can't extract before loading */
+    cabinet = gcab_cabinet_new ();
+    file = g_file_new_for_path ("/tmp");
+    ret = gcab_cabinet_extract_simple(cabinet, file, NULL, NULL, NULL, &error);
+    g_assert_error (error, GCAB_ERROR, GCAB_ERROR_FAILED);
+    g_assert (!ret);
+}
+
+static void
+gcab_test_cabinet_error_no_folders_func (void)
+{
+    gboolean ret;
+    g_autoptr(GCabCabinet) cabinet = NULL;
+    g_autoptr(GError) error = NULL;
+    g_autoptr(GFile) file = NULL;
+    g_autoptr(GOutputStream) op = NULL;
+
+    /* we can't write with no folders */
+    cabinet = gcab_cabinet_new ();
+    file = g_file_new_for_path ("/tmp/foo.cab");
+    op = G_OUTPUT_STREAM (g_file_replace (file, NULL, FALSE, 0, NULL, &error));
+    g_assert_no_error (error);
+    g_assert (op != NULL);
+    ret = gcab_cabinet_write_simple (cabinet, op, NULL, NULL, NULL, &error);
+    g_assert_error (error, GCAB_ERROR, GCAB_ERROR_FAILED);
+    g_assert (!ret);
+}
+
+static void
+gcab_test_cabinet_func (void)
+{
+    GPtrArray *cabfolders;
+    gboolean ret;
+    g_autoptr(GCabCabinet) cabinet = NULL;
+    g_autoptr(GCabFolder) folder = NULL;
+    g_autoptr(GError) error = NULL;
+
+    /* create cabinet */
+    cabinet = gcab_cabinet_new ();
+
+    /* add folder */
+    folder = gcab_folder_new (GCAB_COMPRESSION_NONE);
+    ret = gcab_cabinet_add_folder (cabinet, folder, &error);
+    g_assert_no_error (error);
+    g_assert (ret);
+
+    /* add folder again */
+    ret = gcab_cabinet_add_folder (cabinet, folder, &error);
+    g_assert_error (error, GCAB_ERROR, GCAB_ERROR_FORMAT);
+    g_assert (!ret);
+    cabfolders = gcab_cabinet_get_folders (cabinet);
+    g_assert_cmpint (cabfolders->len, ==, 1);
+}
+
+static void
+gcab_test_cabinet_error_not_seekable_func (void)
+{
+    const GByteArray *signature;
+    g_autoptr(GCabCabinet) cabinet = NULL;
+    g_autoptr(GError) error = NULL;
+
+    /* verify it has no signature */
+    cabinet = gcab_cabinet_new ();
+    signature = gcab_cabinet_get_signature (cabinet, NULL, &error);
+    g_assert_error (error, GCAB_ERROR, GCAB_ERROR_FAILED);
+    g_assert (signature == NULL);
+}
+
+static gchar *
+_compute_checksum_for_file (GFile *file, GError **error)
+{
+    g_autoptr(GBytes) blob = NULL;
+    g_autoptr(GInputStream) in = NULL;
+    in = G_INPUT_STREAM (g_file_read (file, NULL, error));
+    if (in == NULL)
+        return NULL;
+    blob = g_input_stream_read_bytes (in, 1024, NULL, error);
+    if (blob == NULL)
+        return NULL;
+    return g_compute_checksum_for_bytes (G_CHECKSUM_SHA1, blob);
+}
+
+static void
+gcab_test_cabinet_load_func (void)
+{
+    struct {
+        const gchar *fn;
+        GCabCompression comptype;
+    } tests[] = {
+        { "test-none.cab",          GCAB_COMPRESSION_NONE },
+        { "test-mszip.cab",         GCAB_COMPRESSION_MSZIP },
+        { "test-signed.cab",        GCAB_COMPRESSION_NONE },
+        { NULL,                     0 }
+    };
+
+    for (guint i = 0; tests[i].fn != NULL; i++) {
+        GCabFolder *cabfolder_tmp;
+        GPtrArray *cabfolders;
+        gboolean ret;
+        g_autofree gchar *fn = NULL;
+        g_autoptr(GCabCabinet) cabinet = NULL;
+        g_autoptr(GError) error = NULL;
+        g_autoptr(GFile) file = NULL;
+        g_autoptr(GFile) file_tmpdir = NULL;
+        g_autoptr(GInputStream) in = NULL;
+        struct {
+            const gchar *fn;
+            const gchar *checksum;
+        } files[] = {
+            { "test.sh",            "82b4415cf30efc9b5877e366475d652f263c0ced" },
+            { "test.txt",           "decc67ff4a11acd93430cbb18c7bbddd00abf4fa" },
+            { NULL,                 NULL }
+        };
+
+        /* read file */
+        g_print ("%s... ", tests[i].fn);
+        fn = gcab_test_get_filename (tests[i].fn);
+        g_assert (fn != NULL);
+        file = g_file_new_for_path (fn);
+        in = G_INPUT_STREAM (g_file_read (file, NULL, &error));
+        g_assert_no_error (error);
+        g_assert (in != NULL);
+        cabinet = gcab_cabinet_new ();
+        ret = gcab_cabinet_load (cabinet, in, NULL, &error);
+        g_assert_no_error (error);
+        g_assert (ret);
+
+        cabfolders = gcab_cabinet_get_folders (cabinet);
+        g_assert (cabfolders != NULL);
+        g_assert_cmpint (cabfolders->len, ==, 1);
+        cabfolder_tmp = g_ptr_array_index (cabfolders, 0);
+        g_assert_cmpint (gcab_folder_get_comptype (cabfolder_tmp), ==, tests[i].comptype);
+
+        file_tmpdir = g_file_new_for_path ("/tmp");
+        ret = gcab_cabinet_extract_simple (cabinet, file_tmpdir, NULL, NULL, NULL, &error);
+        g_assert_no_error (error);
+        g_assert (ret);
+
+        /* check files were decompressed okay */
+        for (guint j = 0; files[j].fn != NULL; j++) {
+            g_autofree gchar *fn_src = g_build_filename ("/tmp", files[j].fn, NULL);
+            g_autoptr(GFile) file_dst = g_file_new_for_path (fn_src);
+            g_autofree gchar *csum = _compute_checksum_for_file (file_dst, &error);
+            g_assert_no_error (error);
+            g_assert (csum != NULL);
+            g_assert_cmpstr (csum, ==, files[j].checksum);
+        }
+    }
+}
+
+static void
+gcab_test_cabinet_signature_func (void)
+{
+    const GByteArray *sig;
+    gboolean ret;
+    g_autofree gchar *fn = NULL;
+    g_autoptr(GCabCabinet) cabinet = NULL;
+    g_autoptr(GError) error = NULL;
+    g_autoptr(GFile) file = NULL;
+    g_autoptr(GInputStream) in = NULL;
+
+    /* load file */
+    fn = gcab_test_get_filename ("test-signed.cab");
+    g_assert (fn != NULL);
+    file = g_file_new_for_path (fn);
+    in = G_INPUT_STREAM (g_file_read (file, NULL, &error));
+    g_assert_no_error (error);
+    g_assert (in != NULL);
+    cabinet = gcab_cabinet_new ();
+    ret = gcab_cabinet_load (cabinet, in, NULL, &error);
+    g_assert_no_error (error);
+    g_assert (ret);
+
+    /* get signature */
+    sig = gcab_cabinet_get_signature (cabinet, NULL, &error);
+    g_assert_no_error (error);
+    g_assert (sig != NULL);
+    g_assert_cmpint (sig->len, ==, 2040);
+}
+
+static void
+gcab_test_cabinet_write_func (void)
+{
+    struct {
+        const gchar *fn;
+        GCabCompression comptype;
+    } tests[] = {
+        { "test-none.cab",          GCAB_COMPRESSION_NONE },
+        { "test-mszip.cab",         GCAB_COMPRESSION_MSZIP },
+        { NULL,                     0 }
+    };
+
+    for (guint i = 0; tests[i].fn != NULL; i++) {
+        gboolean ret;
+        g_autofree gchar *checksum_in = NULL;
+        g_autofree gchar *checksum_out = NULL;
+        g_autofree gchar *fn_in = NULL;
+        g_autofree gchar *fn_out = NULL;
+        g_autoptr(GCabCabinet) cabinet = NULL;
+        g_autoptr(GCabFolder) cabfolder = NULL;
+        g_autoptr(GError) error = NULL;
+        g_autoptr(GFile) file_in = NULL;
+        g_autoptr(GFile) file_out = NULL;
+        g_autoptr(GOutputStream) op = NULL;
+        struct {
+            const gchar *fn;
+            const gchar *checksum;
+        } files[] = {
+            { "test.sh",            "82b4415cf30efc9b5877e366475d652f263c0ced" },
+            { "test.txt",           "decc67ff4a11acd93430cbb18c7bbddd00abf4fa" },
+            { NULL,                 NULL }
+        };
+
+        /* create new cabinet with a single folder of the correct type */
+        cabinet = gcab_cabinet_new ();
+        cabfolder = gcab_folder_new (tests[i].comptype);
+        ret = gcab_cabinet_add_folder (cabinet, cabfolder, &error);
+        g_assert_no_error (error);
+        g_assert (ret);
+
+        /* add new files to a folder */
+        for (guint j = 0; files[j].fn != NULL; j++) {
+            g_autofree gchar *fn_src = g_build_filename ("src", files[j].fn, NULL);
+            g_autofree gchar *fn_tmp = gcab_test_get_filename (fn_src);
+            g_autoptr(GFile) file = g_file_new_for_path (fn_tmp);
+            g_autoptr(GCabFile) cabfile = gcab_file_new_with_file (files[j].fn, file);
+            g_autoptr(GDateTime) dt = NULL;
+            GTimeVal tv;
+
+            /* set the time so the checksums match */
+            dt = g_date_time_new_utc (2017, 9, 15, 0, 0, 0.f);
+            ret = g_date_time_to_timeval (dt, &tv);
+            g_assert (ret);
+            gcab_file_set_date (cabfile, &tv);
+
+            ret = gcab_folder_add_file (cabfolder, cabfile, FALSE, NULL, &error);
+            g_assert_no_error (error);
+            g_assert (ret);
+        }
+
+        /* write the file */
+        g_print ("%s... ", tests[i].fn);
+        fn_out = g_build_filename ("/tmp", tests[i].fn, NULL);
+        file_out = g_file_new_for_path (fn_out);
+        op = G_OUTPUT_STREAM (g_file_replace (file_out, NULL, FALSE, 0, NULL, &error));
+        g_assert_no_error (error);
+        g_assert (op != NULL);
+        ret = gcab_cabinet_write_simple (cabinet, op, NULL, NULL, NULL, &error);
+        g_assert_no_error (error);
+        g_assert (ret);
+
+        /* compare checksums */
+        fn_in = gcab_test_get_filename (tests[i].fn);
+        g_assert (fn_in != NULL);
+        file_in = g_file_new_for_path (fn_in);
+        checksum_in = _compute_checksum_for_file (file_in, &error);
+        g_assert_no_error (error);
+        g_assert (checksum_in != NULL);
+        checksum_out = _compute_checksum_for_file (file_out, &error);
+        g_assert_no_error (error);
+        g_assert (checksum_out != NULL);
+        g_assert_cmpstr (checksum_in, ==, checksum_out);
+    }
+}
+
+int
+main (int argc, char **argv)
+{
+    g_test_init (&argc, &argv, NULL);
+
+    /* only critical and error are fatal */
+    g_log_set_fatal_mask (NULL, G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL);
+    g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
+
+    /* tests go here */
+    g_test_add_func ("/GCab/file", gcab_test_file_func);
+    g_test_add_func ("/GCab/folder", gcab_test_folder_func);
+    g_test_add_func ("/GCab/folder{path}", gcab_test_folder_path_func);
+    g_test_add_func ("/GCab/cabinet", gcab_test_cabinet_func);
+    g_test_add_func ("/GCab/cabinet{error-not-seekable}", gcab_test_cabinet_error_not_seekable_func);
+    g_test_add_func ("/GCab/cabinet{error-not-loaded}", gcab_test_cabinet_error_not_loaded_func);
+    g_test_add_func ("/GCab/cabinet{error-no-folders}", gcab_test_cabinet_error_no_folders_func);
+    g_test_add_func ("/GCab/cabinet{load}", gcab_test_cabinet_load_func);
+    g_test_add_func ("/GCab/cabinet{write}", gcab_test_cabinet_write_func);
+    g_test_add_func ("/GCab/cabinet{signature}", gcab_test_cabinet_signature_func);
+    return g_test_run ();
+}
diff --git a/meson.build b/meson.build
index 3e242fd..43b366d 100644
--- a/meson.build
+++ b/meson.build
@@ -97,6 +97,7 @@ conf.set_quoted('PACKAGE_STRING', meson.project_name())
 conf.set_quoted('VERSION', meson.project_version())
 conf.set_quoted('LOCALEDIR', get_option('localedir'))
 conf.set_quoted('PACKAGE_BUGREPORT', 'https://bugzilla.gnome.org/enter_bug.cgi?product=msitools')
+conf.set_quoted('TESTDATADIR', join_paths(meson.source_root(), 'tests'))
 configure_file(
   output : 'config.h',
   configuration : conf
@@ -142,3 +143,27 @@ executable(
   install : true,
   install_dir : get_option('bindir')
 )
+
+if get_option('tests')
+  testdatadir_src = join_paths(meson.source_root(), 'data', 'tests')
+  e = executable(
+    'gcab-self-test',
+    sources : [
+      'gcab-self-test.c',
+    ],
+    include_directories : [
+      include_directories('.'),
+      include_directories('libgcab'),
+    ],
+    c_args : [
+      '-D_XOPEN_SOURCE=500',
+    ],
+    dependencies : [
+      gio,
+    ],
+    link_with : [
+      libgcab,
+    ],
+  )
+  test('gcab-self-test', e)
+endif
diff --git a/tests/Makefile b/tests/Makefile
new file mode 100644
index 0000000..6b97bec
--- /dev/null
+++ b/tests/Makefile
@@ -0,0 +1,18 @@
+all: test-none.cab test-mszip.cab test-signed.cab
+
+test-none.cab: src/test.sh src/test.txt
+       touch -t 201709150000 src/test.sh src/test.txt &
+       gcab --create --nopath $@ src/test.sh src/test.txt
+
+test-mszip.cab: src/test.sh src/test.txt
+       gcab --create --nopath --zip $@ src/test.sh src/test.txt
+
+privkey.pem:
+       certtool --generate-privkey --outfile $@
+
+test-signed.cab: privkey.pem test-none.cab
+       osslsigncode sign -certs /etc/pki/fwupd/LVFS-CA.pem \
+               -key privkey.pem \
+               -n "Test Firmware" -i https://fwupd.org/ \
+               -jp low \
+               -in test-none.cab -out test-signed.cab
diff --git a/tests/privkey.pem b/tests/privkey.pem
new file mode 100644
index 0000000..453da42
--- /dev/null
+++ b/tests/privkey.pem
@@ -0,0 +1,182 @@
+Public Key Info:
+       Public Key Algorithm: RSA
+       Key Security Level: High (3072 bits)
+
+modulus:
+       00:c0:d5:5c:1d:6c:d9:8b:98:7a:64:07:72:6c:0d:58
+       62:7f:e1:f3:eb:d5:c7:07:7d:f5:21:f4:61:eb:ad:26
+       b4:76:de:e8:9c:97:58:19:17:20:57:0b:bd:e2:0a:f5
+       74:0b:a0:b2:f2:1b:74:f2:25:a5:ae:9e:7e:8e:60:3c
+       8a:2a:df:06:52:62:c2:26:8c:86:e9:fe:fb:91:bf:1c
+       69:da:65:5a:a3:7c:ee:09:f7:62:a9:da:70:75:b2:2c
+       71:9b:df:53:c5:55:ea:ee:89:f2:82:f7:c0:96:f3:40
+       02:84:38:75:4d:52:fd:e8:91:00:27:5f:b1:a5:ec:b3
+       dc:35:b0:80:e8:9e:ef:2d:47:3c:31:ce:a8:ff:9a:ef
+       10:2e:f3:60:7e:6f:e0:62:8a:bc:8c:a9:97:ed:91:a8
+       a7:4d:91:62:46:39:23:ad:e8:9e:f0:37:21:a9:78:c8
+       63:41:f1:37:da:03:a7:68:d2:3a:fe:b0:4c:b3:f5:b6
+       f1:f2:a9:6c:e6:51:ac:11:bb:b1:64:f9:09:8d:c4:00
+       9b:94:5a:9d:6d:ea:d7:87:e9:9c:c9:f2:40:b8:a0:67
+       94:29:88:a2:f8:5e:cb:c5:06:6b:9b:a0:20:37:d8:a8
+       a6:cb:bb:29:31:31:48:85:33:89:ff:87:2c:b1:f4:96
+       8f:19:64:a0:87:c9:84:e6:d5:f7:e4:9c:11:f8:4f:a3
+       1e:47:9c:b5:5f:1e:f8:40:e0:ff:bb:5d:fb:93:3c:8a
+       c5:a7:0e:7a:50:4a:3d:9f:cd:ea:61:98:4d:d5:bd:ec
+       d3:57:0f:0c:21:c3:27:27:90:4b:d2:f9:80:c2:01:76
+       25:ab:0f:32:ad:97:65:bf:49:e1:73:db:c8:fd:8e:a4
+       18:fb:6e:0c:c6:32:4c:cb:7a:bb:79:5b:b2:f7:15:80
+       f5:0c:bb:2c:34:ba:36:3a:47:a0:30:27:52:79:e7:ac
+       07:52:af:a6:5b:88:03:df:90:4f:f0:12:f3:3f:d7:92
+       f7:
+
+public exponent:
+       01:00:01:
+
+private exponent:
+       00:85:68:16:9e:54:db:fc:73:b4:d8:d7:3e:15:fa:f5
+       96:cf:9a:66:c2:55:d7:a8:1b:40:28:09:86:65:22:19
+       90:e8:5c:36:d9:7e:ea:f8:10:c3:d2:f4:d0:9d:3d:af
+       aa:65:10:fc:3b:fb:3a:e0:fb:a2:b0:37:fe:9e:49:7e
+       18:a8:a8:3b:1b:6c:2f:9d:b3:c2:f2:c7:f1:0b:58:08
+       34:43:5f:b3:61:3f:e0:ff:0c:23:3a:17:61:8e:4b:81
+       eb:e7:46:8e:12:0b:ea:c8:b4:af:0e:64:90:dc:dd:d4
+       fe:e8:b2:96:94:b4:41:ed:4f:c3:a7:79:d0:d1:55:fc
+       e8:f0:4b:f8:22:f7:31:c9:45:6b:23:9a:31:d9:04:3b
+       38:1b:03:4d:52:ab:db:b4:d0:fe:b8:e1:eb:b5:f3:fb
+       96:23:57:dd:81:6f:ae:7b:76:5f:df:18:85:35:55:d6
+       6c:b5:06:48:f9:8f:65:96:63:3b:65:50:5b:00:75:91
+       e6:85:df:b6:f6:37:9e:89:27:6e:41:b3:37:66:85:e1
+       12:f1:b4:5f:1e:32:b1:0e:ba:ac:8e:42:65:46:ab:73
+       38:df:b8:ec:62:d9:15:f8:a3:22:35:6d:20:16:5b:1e
+       c8:35:48:5b:10:b5:ec:69:42:66:68:ad:79:ad:43:46
+       57:52:63:77:a7:3b:51:53:49:b1:a5:c5:95:fd:c0:65
+       f7:89:5d:8e:38:dd:e9:9a:1c:cb:34:75:77:0d:42:b7
+       c5:77:e3:e1:16:c0:b8:67:bd:51:6e:bb:95:a3:38:0b
+       6a:7c:17:c5:60:91:df:a9:39:96:2a:17:c8:97:82:a5
+       f1:46:ab:9c:47:5c:e6:cc:39:d5:3d:6a:23:74:88:07
+       d9:c3:49:8d:10:65:cf:42:7b:3e:b3:be:76:3b:57:bd
+       d8:7e:d8:c2:ac:c3:66:02:fc:9e:cc:d4:b6:a7:83:ed
+       30:8e:c3:3d:90:0a:9c:b8:a0:6c:90:19:56:46:13:d3
+       61:
+
+prime1:
+       00:e1:c0:f0:3d:66:0a:43:71:0b:6d:94:b8:d0:93:f2
+       06:66:21:7c:56:53:ad:02:5e:aa:e9:34:28:11:af:bd
+       79:05:ac:2f:05:e1:9d:cf:47:83:a2:46:d8:76:66:3d
+       f6:48:15:15:e2:cf:fb:e5:35:1d:45:5d:e3:7f:33:4e
+       de:33:0f:52:af:00:0c:7f:de:13:20:e6:24:9d:71:6c
+       2d:3f:e8:1d:3b:82:74:69:fa:fa:3e:ff:5c:0b:2c:22
+       49:f1:fe:b1:6f:41:a0:79:58:84:33:cc:28:3d:59:87
+       41:91:4f:15:cd:26:92:07:d5:b4:92:9f:fc:2c:9c:e0
+       76:85:5b:06:3e:a3:ec:a7:ad:e4:44:f7:53:74:6f:d0
+       b6:ed:93:8d:38:e4:61:b8:7c:f5:33:ad:02:ae:95:58
+       69:c5:1a:e2:e7:65:ab:aa:c8:0c:21:74:5d:be:aa:48
+       9b:04:1c:a5:4b:45:e4:91:b1:20:7a:2d:cd:38:9f:d8
+       65:
+
+prime2:
+       00:da:ab:4c:b9:47:a9:4c:b5:f9:a3:18:bd:73:f5:d0
+       10:23:c5:2c:75:df:4e:78:04:12:5f:50:78:c4:7a:20
+       cf:7c:90:85:96:5b:57:bb:78:6c:d6:81:05:6d:3b:76
+       13:7b:21:8b:90:97:ed:07:13:fe:c4:36:53:a3:bd:f0
+       90:fb:ae:cb:ec:54:29:3f:fe:08:0b:8e:be:61:cf:89
+       37:fe:e4:23:4b:2d:ec:e1:b9:ca:f0:4b:50:da:54:b8
+       bf:bc:25:4d:75:d0:16:ad:53:72:88:55:aa:10:03:d4
+       d4:bd:50:1d:0a:04:95:b1:93:40:58:af:6a:6f:29:33
+       65:22:10:08:47:df:5c:38:eb:24:0e:59:df:88:bd:47
+       81:28:8d:81:19:6d:72:e0:29:3e:68:35:48:95:ee:e2
+       b0:05:83:52:ea:25:ee:d2:f7:9b:69:72:ae:a6:2d:13
+       fd:3c:0e:45:51:b5:58:a1:05:e3:a3:d8:3d:39:e8:b2
+       2b:
+
+coefficient:
+       00:a1:15:c8:80:7a:96:6a:3b:db:40:ef:9b:d3:c9:e4
+       3f:16:17:4b:f4:d2:cb:c7:25:60:82:4f:1c:d5:8c:ea
+       d9:5e:74:c6:f0:70:91:7d:9e:82:09:8f:03:58:a5:7f
+       21:da:49:5d:d6:9e:1e:7c:60:5e:d1:b7:96:0e:b1:c6
+       1d:98:ba:32:4f:50:52:46:f6:48:d2:56:14:6d:50:50
+       64:08:e1:1d:9a:6b:7b:c7:c7:40:54:c1:58:2a:9d:24
+       18:27:38:4e:26:94:8a:21:bc:87:b5:fa:39:64:c1:6a
+       4f:12:16:5d:3b:4e:cb:f3:19:17:09:95:1e:e0:36:97
+       46:27:27:f8:ae:fc:24:2d:70:b0:4e:df:1f:7e:f2:fa
+       f4:c4:af:23:80:c7:2f:da:50:c8:cd:24:31:1b:0b:34
+       16:2f:88:c4:85:42:e9:a2:88:83:aa:40:5e:f8:ec:cb
+       33:8a:04:58:ec:d9:9a:1a:1a:7b:8d:34:38:1c:70:b7
+       81:
+
+exp1:
+       05:f5:93:e1:eb:09:a6:52:1b:9d:1e:e9:ea:07:9d:c1
+       f1:7c:3c:ce:02:93:74:96:8f:28:6c:ca:09:fd:7b:a0
+       f0:37:65:5e:60:60:4c:12:75:35:19:6d:a9:62:75:8c
+       44:c6:d9:b7:0d:0a:77:38:79:b7:55:0d:26:54:72:66
+       87:2e:86:5e:3c:40:18:38:02:85:41:ce:01:a1:f6:db
+       12:ee:cb:a6:c0:80:d6:33:5b:db:c1:dd:ea:25:96:1a
+       21:9b:39:8f:d8:49:a6:2a:62:03:04:06:a3:e7:f3:1c
+       15:fb:e2:75:71:e9:34:ef:bd:3e:89:9e:9c:86:df:9e
+       01:53:2f:cd:03:82:c1:c2:63:5e:36:b1:2b:47:b0:58
+       c3:d8:bb:47:9f:2f:bd:30:ff:40:07:f7:24:28:a9:16
+       d1:af:2e:02:31:ba:e0:5d:3b:84:be:8f:a2:f2:d7:cb
+       cf:c5:f9:cf:0c:df:45:c1:49:3c:30:6d:54:6b:53:c9
+       
+
+exp2:
+       55:dd:09:c5:7f:34:25:61:17:63:49:a5:aa:d1:0d:20
+       29:4b:95:47:bb:a5:ce:4e:9b:00:3e:53:0d:a3:7f:1a
+       ba:28:ed:ab:ba:b6:5a:70:d1:1b:f1:91:b5:f0:b1:4e
+       b8:fc:d5:16:b3:f1:68:e4:1b:17:e4:d5:36:e8:b0:7b
+       dd:b8:27:6e:e7:25:43:71:76:ab:43:23:d2:b8:71:83
+       41:5d:47:d6:8f:74:02:b6:b7:cf:5f:63:a2:37:be:4b
+       db:8f:32:39:5e:ba:68:d8:e9:92:4b:40:fa:04:e7:1f
+       9a:2e:c9:18:53:f0:8b:c7:ec:6e:66:82:fe:9f:49:05
+       1f:38:f8:67:70:77:80:0a:25:20:55:7e:06:ed:7c:14
+       65:5e:1b:21:66:ee:c2:c2:af:34:b0:27:8e:68:3d:2f
+       2d:1b:02:05:db:5b:4a:0f:dc:40:ad:bd:92:97:04:d0
+       5d:32:a5:59:8e:41:fd:08:98:f8:8f:42:8b:68:a9:fd
+       
+
+
+Public Key PIN:
+       pin-sha256:Tb40ht8K5iKsfVxc/VFaN81MoQ0Up4EDiijLVZdBdRA=
+Public Key ID:
+       sha256:4dbe3486df0ae622ac7d5c5cfd515a37cd4ca10d14a781038a28cb5597417510
+       sha1:a3994ff1885b904c15351bb545922345f503ba1a
+
+-----BEGIN RSA PRIVATE KEY-----
+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
+-----END RSA PRIVATE KEY-----
diff --git a/tests/src/test.sh b/tests/src/test.sh
new file mode 100644
index 0000000..d1ccbd6
--- /dev/null
+++ b/tests/src/test.sh
@@ -0,0 +1 @@
+echo ola
diff --git a/tests/src/test.txt b/tests/src/test.txt
new file mode 100644
index 0000000..13e8797
--- /dev/null
+++ b/tests/src/test.txt
@@ -0,0 +1 @@
+Ola!
diff --git a/tests/test-mszip.cab b/tests/test-mszip.cab
new file mode 100644
index 0000000..089eada
Binary files /dev/null and b/tests/test-mszip.cab differ
diff --git a/tests/test-none.cab b/tests/test-none.cab
new file mode 100644
index 0000000..6bac36b
Binary files /dev/null and b/tests/test-none.cab differ
diff --git a/tests/test-signed.cab b/tests/test-signed.cab
new file mode 100644
index 0000000..5749596
Binary files /dev/null and b/tests/test-signed.cab differ


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]