Commit 63ac8b5e authored by Tomáš Stefan's avatar Tomáš Stefan

Test of bad signature, improved readme

parent 1784a079
......@@ -7,7 +7,7 @@ Word **sigil** in name stands for latin word *sigillum*, which means **seal** or
### Build
Performs build with output into "build" directory. After those steps, there will be a **static and shared library** and also **selftest executable**.
Performs build and puts the output into *build* directory. After these steps, there will be a **libpdfsigil** shared library with **selftest** executable and also **pdf-sigil** proof-of-concept executable. Also Doxygen documentation will be generated into *dir* directory.
```shell
mkdir build
......
......@@ -679,8 +679,8 @@ int sigil_sigil_self_test(int verbosity)
print_test_result(1, verbosity);
// TEST: fn sigil_verify with subfilter x509.rsa_sha1
print_test_item("VERIFY x509.rsa_sha1", verbosity);
// TEST: fn sigil_verify with subfilter x509.rsa_sha1 (correct)
print_test_item("VERIFY PKCS#1 (correct)", verbosity);
{
int result;
......@@ -704,6 +704,39 @@ int sigil_sigil_self_test(int verbosity)
print_test_result(1, verbosity);
// TEST: fn sigil_verify with subfilter x509.rsa_sha1 (incorrect)
print_test_item("VERIFY PKCS#1 (incorrect)", verbosity);
{
int result;
sgl = test_prepare_sgl_path("test/modified_pkcs1.pdf");
if (sgl == NULL)
goto failed;
if (sigil_set_trusted_system(sgl) != ERR_NONE)
goto failed;
if (sigil_verify(sgl) != ERR_NONE)
goto failed;
err = sigil_get_result(sgl, &result);
if (err != ERR_NONE || result != VERIFY_FAILED)
goto failed;
err = sigil_get_cert_validation_result(sgl, &result);
if (err != ERR_NONE || result != CERT_STATUS_VERIFIED)
goto failed;
err = sigil_get_data_integrity_result(sgl, &result);
if (err != ERR_NONE || result != HASH_CMP_RESULT_DIFFER)
goto failed;
sigil_free(&sgl);
}
print_test_result(1, verbosity);
// all tests done
print_module_result(1, verbosity);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment