# HG changeset patch # User Andre Heinecke # Date 1410889519 -7200 # Node ID fd85a02d771d9a5f278160ad97b35793cebad867 # Parent 5b6203f78b4e2a9f2077e765d7ffd500c739c47c# Parent 1c1964c27b39659d3581e693fb784dc205ca44d1 (issue54) Implement a privilege drop to execute the program after installation. This commit is extremly ugly as I accidentally worked in a working tree that was partially merged with default. To review the real change please check the commit that will merge this branch into default. diff -r 1c1964c27b39 -r fd85a02d771d .hgtags --- a/.hgtags Tue Sep 02 14:25:40 2014 +0200 +++ b/.hgtags Tue Sep 16 19:45:19 2014 +0200 @@ -10,3 +10,21 @@ 0000000000000000000000000000000000000000 0.85 0000000000000000000000000000000000000000 0.85 c4ba93dbf680e9507290fa7058d660486cc0be2e 0.85 +b4094dc552171376ac9481657ba509abfaecf1bc 0.9 +b4094dc552171376ac9481657ba509abfaecf1bc 0.9 +0000000000000000000000000000000000000000 0.9 +0000000000000000000000000000000000000000 0.9 +4f999c7821ce65f5482b44e12d18da44d6994dd8 0.9 +b1c8ac65f782470dfe400f710513c166a51360f5 0.91 +0000000000000000000000000000000000000000 0.91 +0000000000000000000000000000000000000000 0.91 +96a0e5bdf6a4851fc29d145497fc1a4802f23701 0.9.1 +96a0e5bdf6a4851fc29d145497fc1a4802f23701 0.9.1 +0000000000000000000000000000000000000000 0.9.1 +0000000000000000000000000000000000000000 0.9.1 +b5dc84ea5dacc228b59d2be7ea25a754ec7ed3f8 0.9.1 +0000000000000000000000000000000000000000 0.9.1 +0000000000000000000000000000000000000000 0.9.1 +0000000000000000000000000000000000000000 0.9.1 +e10bc7372545e90823673cd53432f3fce63d2c86 0.9.1 +0ae3c99b82ee75ee26801a879dfc3d047b6da547 0.9.2 diff -r 1c1964c27b39 -r fd85a02d771d CMakeLists.txt --- a/CMakeLists.txt Tue Sep 02 14:25:40 2014 +0200 +++ b/CMakeLists.txt Tue Sep 16 19:45:19 2014 +0200 @@ -9,10 +9,11 @@ project(trustbridge) option(DO_RELEASE_BUILD "Build for a public release." OFF) +option(USE_REAL_RESOURCES "Use real resource names on the download server. Autmatically ON if DO_RELEASE_BUILD is set" OFF ) option(ENABLE_PROFILING "Set to enable profiling." OFF) option(USE_CURL "Use libcurl to download updates and certificate lists." ON) -set(DOWNLOAD_SERVER "https://files.intevation.de:443" CACHE STRING "Used as download server" ) +set(DOWNLOAD_SERVER "https://tb-devel.intevation.de:443" CACHE STRING "Used as download server" ) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") #Old qtmain linking behavior to be compatible with cmake versions < 2.8.11 @@ -38,6 +39,12 @@ find_package(Qt5Widgets) +find_program(OSSLSIGNCODE_EXECUTABLE osslsigncode) + +if (WIN32 AND NOT OSSLSIGNCODE_EXECUTABLE) + message (STATUS "WARNING: osslsigncode not found. Code verification and code verification tests will fail.") +endif() + if (NOT WIN32) find_package(NSS) else () @@ -59,6 +66,7 @@ set (CMAKE_BUILD_TYPE RELEASE) endif (NOT CMAKE_BUILD_TYPE) add_definitions (-DRELEASE_BUILD) + set(USE_REAL_RESOURCES ON) else() # Default to debug build if (NOT CMAKE_BUILD_TYPE) @@ -68,6 +76,10 @@ endif (NOT CMAKE_BUILD_TYPE) endif() +if(USE_REAL_RESOURCES) + add_definitions (-DUSE_REAL_RESOURCES) +endif() + # Warn level to be used for privileged parts set(WARN_HARDENING_FLAGS " -Wextra -Wconversion -Wformat-security") diff -r 1c1964c27b39 -r fd85a02d771d INSTALL --- a/INSTALL Tue Sep 02 14:25:40 2014 +0200 +++ b/INSTALL Tue Sep 16 19:45:19 2014 +0200 @@ -70,11 +70,11 @@ Libcurl: - wget http://curl.haxx.se/download/curl-7.37.1.tar.gz - a32492a38c10a097344892f5fd2041e54698cb909696852311b1161e4aa979f3 curl-7.37.1.tar.gz + wget http://curl.haxx.se/download/curl-7.38.0.tar.gz + 5661028aa6532882fa228cd23c99ddbb8b87643dbb1a7ea55c068d34a943dff1 curl-7.38.0.tar.gz - tar -xf curl-7.37.1.tar.gz - cd curl-7.37.1/ + tar -xf curl-7.38.0.tar.gz + cd curl-7.38.0/ patch -p1 < ../trustbridge/patches/*.patch mkdir build cd build @@ -141,7 +141,7 @@ make install Change to the curl directory - cd ../../curl-7.37.1/ + cd ../../curl-7.38.0/ mkdir build-i386 cd build-i386 CFLAGS="-fpic -m32" CPPFLAGS="-fpic -m32" ../configure --prefix=$YOURPREFIX/i386 \ @@ -170,24 +170,19 @@ for the ssl connection. To build it you may need libxslt-dev as additional dependency. - wget https://www.hiawatha-webserver.org/files/hiawatha-9.5.tar.gz - sha256sum hiawatha-9.5.tar.gz - -c181011db1af187006190fc186689a0707a6f1e7b524c2a4347840e8fdf68b4f hiawatha-9.5.tar.gz + wget https://www.hiawatha-webserver.org/files/hiawatha-9.7.tar.gz + sha256sum hiawatha-9.7.tar.gz - tar -xf hiawatha-9.5.tar.gz - cp polarssl-1.3.7-gpl.tgz hiawatha-9.5/polarssl/polarssl.tgz - cd hiawatha-9.5/polarssl - sed -i 's/wget.*//' upgrade - ./upgrade 1.3.8 - cd .. +e8581336883b7b963f38572f6396f8c47b43e5bedd3147d052fa3652e6c0ed86 hiawatha-9.7.tar.gz + + tar -xf hiawatha-9.7.tar.gz + cd hiawatha-9.7 mkdir build cd build cmake .. -DCMAKE_INSTALL_PREFIX=$YOURPREFIX make && make install - Osslsigncode (for binverify unit test) ====================================== Osslsigncode is used to create PKCS#7 embedded signatures for Windows Authenticode @@ -228,6 +223,10 @@ make qtbase (optional) make curl +Add CMAKE_STRIP to the toolchain file: + echo "set(CMAKE_STRIP $MXEPATH/usr/bin/i686-w64-mingw32.static-strip)" >> \ + "$MXEPATH/usr/i686-w64-mingw32.static/share/cmake/mxe-conf.cmake" + Workaround Qt CMake Bugs: find $MXEPATH/usr/i686-w64-mingw32.static/qt5/lib/cmake -name \*.cmake | \ xargs sed -i 's/\/\([a-z]*\)\.lib/\/lib\1\.a/g' @@ -242,7 +241,7 @@ cmake .. \ -DCMAKE_PREFIX_PATH="$MXETARGET/qt5;$MXETARGET;" \ -DCMAKE_TOOLCHAIN_FILE="$MXETARGET/share/cmake/mxe-conf.cmake" \ - -DCMAKE_VERBOSE_MAKEFILE=True -DUSE_CURL=OFF + -DCMAKE_VERBOSE_MAKEFILE=True Runtime Depdendencies ===================== diff -r 1c1964c27b39 -r fd85a02d771d cinst/CMakeLists.txt --- a/cinst/CMakeLists.txt Tue Sep 02 14:25:40 2014 +0200 +++ b/cinst/CMakeLists.txt Tue Sep 16 19:45:19 2014 +0200 @@ -30,6 +30,30 @@ ${WIN_EXTRA_LIBS}) install(TARGETS cinst DESTINATION bin) +if (WIN32) + add_custom_command( + TARGET cinst + POST_BUILD + COMMAND ${CMAKE_STRIP} cinst.exe + ) + if (NOT RELEASE_BUILD) + add_custom_command( + TARGET cinst + POST_BUILD + COMMAND ${OSSLSIGNCODE_EXECUTABLE} sign -certs ${CMAKE_SOURCE_DIR}/ui/tests/data/codesign/codesigning.pem + -key ${CMAKE_SOURCE_DIR}/ui/tests/data/codesign/codesigning.key + -h sha256 -in ${CMAKE_CURRENT_BINARY_DIR}/cinst.exe + -out ${CMAKE_CURRENT_BINARY_DIR}/cinst-signed.exe && + mv ${CMAKE_CURRENT_BINARY_DIR}/cinst-signed.exe ${CMAKE_CURRENT_BINARY_DIR}/cinst.exe + ) + endif() +else() + add_custom_command( + TARGET cinst + POST_BUILD + COMMAND strip cinst + ) +endif() # ---------------------------------------------------------------------- # Mozilla nss store specific certificate installer: @@ -48,6 +72,31 @@ ${PROFILING_LIBS}) set_target_properties(mozilla PROPERTIES COMPILE_FLAGS "-std=c99") install(TARGETS mozilla DESTINATION bin) + + if (WIN32) + add_custom_command( + TARGET mozilla + POST_BUILD + COMMAND ${CMAKE_STRIP} mozilla.exe + ) + if (NOT RELEASE_BUILD) + add_custom_command( + TARGET mozilla + POST_BUILD + COMMAND ${OSSLSIGNCODE_EXECUTABLE} sign -certs ${CMAKE_SOURCE_DIR}/ui/tests/data/codesign/codesigning.pem + -key ${CMAKE_SOURCE_DIR}/ui/tests/data/codesign/codesigning.key + -h sha256 -in ${CMAKE_CURRENT_BINARY_DIR}/mozilla.exe + -out ${CMAKE_CURRENT_BINARY_DIR}/mozilla-signed.exe && + mv ${CMAKE_CURRENT_BINARY_DIR}/mozilla-signed.exe ${CMAKE_CURRENT_BINARY_DIR}/mozilla.exe + ) + endif() + else() + add_custom_command( + TARGET mozilla + POST_BUILD + COMMAND strip mozilla + ) + endif() else() message(STATUS "WARNING: Could not find nss. Mozilla cert installer will not be build!") endif() diff -r 1c1964c27b39 -r fd85a02d771d cinst/main.c --- a/cinst/main.c Tue Sep 02 14:25:40 2014 +0200 +++ b/cinst/main.c Tue Sep 16 19:45:19 2014 +0200 @@ -14,15 +14,15 @@ * process will modify system wide certificate stores. * Otherwise only the users certificate stores are modified. * - * The first parameter to this process should be list= + * The first parameter to this process should be list=\ * of the certificate list to work on. The second parameter should - * be choices=|uninstall + * be choices=\|uninstall * * choices_file_name should be the absolute path to an * choices file formatted as: * - * I: - * R: + * I:\
+ * R:\ * * Line breaks can be system dependent in the Choices file. * @@ -35,6 +35,8 @@ * to remove all certificates (Even those marked with I) that * are part of the list. * + * For more verbose debug output add --debug to the call. + * **/ #include #include @@ -199,6 +201,11 @@ return 0; } +#ifdef DO_RELEASE_BUILD +bool g_debug = false; +#else +bool g_debug = true; +#endif int main (int argc, char **argv) @@ -219,18 +226,24 @@ /* Some very static argument parsing. list= and choices= is only added to make it more transparent how this programm is called if a user looks at the detailed uac dialog. */ - if (argc != 3 || strncmp(argv[1], "list=", 5) != 0 || + if ((argc != 3 && argc != 4) || strncmp(argv[1], "list=", 5) != 0 || strncmp(argv[2], "choices=", 8) != 0) { ERRORPRINTF ("Invalid arguments.\n" "Expected arguments: list= \n" - " choices=|uninstall\n"); + " choices=|uninstall\n" + "Optional: --debug\n"); return ERR_INVALID_PARAMS; } certificate_file_name = strchr(argv[1], '=') + 1; choices_file_name = strchr(argv[2], '=') + 1; + if (argc == 4 && strncmp(argv[3], "--debug", 7) == 0) + { + g_debug = true; + } + if (!certificate_file_name || !choices_file_name) { ERRORPRINTF ("Invalid arguments.\n" diff -r 1c1964c27b39 -r fd85a02d771d cinst/mozilla.c --- a/cinst/mozilla.c Tue Sep 02 14:25:40 2014 +0200 +++ b/cinst/mozilla.c Tue Sep 16 19:45:19 2014 +0200 @@ -12,12 +12,12 @@ * Reads from a file given on command line or stdin a list of * instructions in the form: * - * I: - * R: + * I:\
+ * R:\ * ... * * With one instruction per line. the maximum size of an input - * line is 9999 characters (including the \r\n) at the end of the line. + * line is 9999 characters (including the \\r\\n) at the end of the line. * * Certificates marked with I: will be installed and the ones * marked with R: will be searched and if available removed from @@ -45,6 +45,9 @@ * purposes each installation / removal of a certificate will be reported * with the profile name that it modified. * + * To get more verbose output add the --debug parameter + * as the last parameter on the command line. + * */ /** @@ -61,6 +64,7 @@ #include #include #include +#include #include #include #include @@ -141,7 +145,7 @@ return cdir; else { - DEBUGPRINTF("FATAL! No %s in environment.\n", envvar); + ERRORPRINTF("FATAL! No %s in environment.\n", envvar); exit(ERR_MOZ_HOMELESS); } } @@ -152,14 +156,14 @@ * Parse the profiles.ini and extract all profile paths from that. * The expected data is in the form: * - * [Profile99] - * IsRelative=1 - * Path=Example/fooo.bar + * [Profile99]
+ * IsRelative=1
+ * Path=Example/foo.bar * - * or - * [Profile0] - * IsRelative=0 - * Path=c:\foo\bar\baz + * or
+ * [Profile0]
+ * IsRelative=0
+ * Path=c:\\foo\\bar\\baz * * Mozilla also accepts the ini file on Windows even if it is UTF-16 * encoded but never writes UTF-16 on its own. So currently we ignore @@ -416,7 +420,7 @@ else { /* Lets create it */ - if (!port_mkdir_p(profile_dir)) + if (!port_mkdir_p(profile_dir, true)) { ERRORPRINTF ("Failed to create directory: '%s'\n", profile_dir); xfree(profile_dir); @@ -451,7 +455,7 @@ { #ifndef _WIN32 /* NSS Shared db does not exist under windows. */ - if (!port_mkdir_p(NSSSHARED_GLOBAL)) + if (!port_mkdir_p(NSSSHARED_GLOBAL, false)) { ERRORPRINTF("Failed to create nssshared skeleton directory. \n"); } @@ -548,7 +552,7 @@ * * Should be freed by caller. * @param[in] secitemp ponts to an SECItem holding the DER certificate. - * @retruns a string of the from "CN of Subject - O of Subject" + * @returns a string of the from "CN of Subject - O of Subject" */ static char * nss_cert_name(SECItem *secitemp) @@ -559,7 +563,7 @@ o_str = x509_parse_subject(secitemp->data, secitemp->len, CERT_OID_O); if (!cn_str || !o_str) { - DEBUGPRINTF("FATAL: Could not parse certificate!"); + ERRORPRINTF("FATAL: Could not parse certificate!"); exit(ERR_INVALID_CERT); } name_len = strlen(cn_str) + strlen(o_str) + 4; @@ -622,16 +626,39 @@ (int)dercert->len); trust = (CERTCertTrust *)xmalloc(sizeof(CERTCertTrust)); CERT_DecodeTrustString(trust, "C,C,C"); - if ((PK11_ImportCert(pk11slot, cert, CK_INVALID_HANDLE, - cert_name, PR_FALSE) - == SECSuccess) && - (CERT_ChangeCertTrust(CERT_GetDefaultCertDB(), cert, trust) - == SECSuccess)) + if (PK11_ImportCert(pk11slot, cert, CK_INVALID_HANDLE, + cert_name, PR_FALSE) == SECSuccess) { - log_certificate_der (pdir, dercert->data, dercert->len, true); - success = true; + if(CERT_ChangeCertTrust(CERT_GetDefaultCertDB(), cert, trust) == SECSuccess) + { + log_certificate_der (pdir, dercert->data, dercert->len, true); + success = true; + } } - else + /* This could have happened on either the import cert or + the cert change trust. If Import Cert fails with that + error the certificate has in fact been added but with + random trist bits. See NSS Bug 595861. + Reference code can be found in gnome evolution under + smime/lib/e-cert-db.c */ + if(PORT_GetError() == SEC_ERROR_TOKEN_NOT_LOGGED_IN) + { + if (PK11_NeedUserInit (pk11slot)) + { + PK11_InitPin (pk11slot, "", ""); + } + if (PK11_Authenticate (pk11slot, PR_TRUE, NULL) != SECSuccess) + { + DEBUGPRINTF("Failed to authenticate.\n"); + } + else if(CERT_ChangeCertTrust(CERT_GetDefaultCertDB(), cert, trust) == SECSuccess) + { + log_certificate_der (pdir, dercert->data, dercert->len, true); + success = true; + } + } + + if (!success) { DEBUGPRINTF("Failed to install certificate '%s' to '%s'!\n", cert_name, pdir); ERRORPRINTF("Error installing certificate err: %i\n", PORT_GetError()); @@ -750,6 +777,7 @@ * Reads command lines (R: and I:) from standard input and puts the * certificates to process in two SECItem lists holding the * certificates in DER format. + * @param[inout] stream from standard input * @param[inout] install_list list of SECItems with certifiactes to install * @param[inout] remove_list list of SECItems with certifiactes to remove */ @@ -801,12 +829,18 @@ if (parserr) { - DEBUGPRINTF("FATAL: Invalid input: %s\n", inpl); + ERRORPRINTF("FATAL: Invalid input: %s\n", inpl); exit(ERR_MOZ_INVALID_INPUT); } } } +#ifdef DO_RELEASE_BUILD +bool g_debug = false; +#else +bool g_debug = true; +#endif + int main (int argc, char **argv) { @@ -822,17 +856,29 @@ input_stream = stdin; break; case 2: + if (strcmp(argv[1], "--debug") == 0) + { + g_debug = true; + DEBUGPRINTF("Opening STDIN for input...\n"); + input_stream = stdin; + break; + } + case 3: DEBUGPRINTF("Opening %s for input...\n", argv[1]); if ((input_stream = fopen(argv[1], "r")) == NULL) { - DEBUGPRINTF("FATAL: Could not open %s for reading!\n", - argv[1]); + ERRORPRINTF ("FATAL: Could not open %s for reading!\n", + argv[1]); exit_code = ERR_MOZ_FAILED_TO_OPEN_INPUT; goto exit; } + if (argc == 3 && strcmp(argv[2], "--debug") == 0) + { + g_debug = true; + } break; default: - DEBUGPRINTF("FATAL: Wrong number of arguments!\n"); + ERRORPRINTF("FATAL: Wrong number of arguments!\n"); exit_code = ERR_MOZ_WRONG_ARGC; goto exit; } diff -r 1c1964c27b39 -r fd85a02d771d cinst/nss-secitemlist.h --- a/cinst/nss-secitemlist.h Tue Sep 02 14:25:40 2014 +0200 +++ b/cinst/nss-secitemlist.h Tue Sep 16 19:45:19 2014 +0200 @@ -39,7 +39,7 @@ * @brief Remove and return first SECItem from list * * @param[inout] list pointer to the list to which the item will be added. - * @retruns the removed item, or NULL if list is empty. + * @returns the removed item, or NULL if list is empty. * The caller shoud free this item after use. */ SECItem *seciteml_pop (seciteml_t **list); diff -r 1c1964c27b39 -r fd85a02d771d cinst/nssstore_linux.c --- a/cinst/nssstore_linux.c Tue Sep 02 14:25:40 2014 +0200 +++ b/cinst/nssstore_linux.c Tue Sep 16 19:45:19 2014 +0200 @@ -37,8 +37,8 @@ * * @param [in] to_install strv of DER encoded certificates to be added. * @param [in] to_remove strv of DER encoded certificates to be remvoed. - * @param [in] uid_t uid of the user to install certificates for. - * @param [in] gid_t the gid of the user to install certificates for. + * @param [in] uid uid of the user to install certificates for. + * @param [in] gid the gid of the user to install certificates for. * @param [in] homedir the homedir of the user. * * @returns childs pid on success. -1 on failure @@ -49,7 +49,7 @@ { int pipe_fd[2]; pid_t pid = 0; - char *argv[2] = {NULL, NULL}, + char *argv[3] = {NULL, NULL, NULL}, *envp[2] = {NULL, NULL}, *inst_dir = NULL; size_t homedir_len = 0, @@ -92,6 +92,11 @@ exe_path_len = strlen(inst_dir) + strlen(NSS_PROCESS_NAME); argv[0] = xmalloc (exe_path_len + 1); + if (g_debug) + { + argv[1] = "--debug"; + } + ret = snprintf(argv[0], exe_path_len + 1, "%s%s", inst_dir, NSS_PROCESS_NAME); xfree (inst_dir); if (ret < 0 || (size_t) ret != exe_path_len) diff -r 1c1964c27b39 -r fd85a02d771d cinst/nssstore_win.c --- a/cinst/nssstore_win.c Tue Sep 02 14:25:40 2014 +0200 +++ b/cinst/nssstore_win.c Tue Sep 16 19:45:19 2014 +0200 @@ -50,6 +50,7 @@ #include "logging.h" #include "util.h" #include "strhelp.h" +#include "binverify.h" #ifndef APPNAME #define APPNAME L"cinst" @@ -97,7 +98,6 @@ xfree (item); } - /**@brief Write strv of instructions to a handle * * Writes the null terminated list of instructions to @@ -348,6 +348,11 @@ + NULL */ cmd_line_len = wcslen (w_inst_dir) + 1 + 2 + wcslen (NSS_APP_NAME) + + 1 + 2 + wcslen(selection_file) + 1; + if (g_debug) + { + /* Add space for whitespace and --debug*/ + cmd_line_len += 8; + } retval = xmalloc (cmd_line_len * sizeof(wchar_t)); wcscpy_s (retval, cmd_line_len, L"\""); @@ -358,6 +363,11 @@ wcscat_s (retval, cmd_line_len, selection_file); wcscat_s (retval, cmd_line_len, L"\""); + if (g_debug) + { + wcscat_s (retval, cmd_line_len, L" --debug"); + } + return retval; } @@ -616,6 +626,7 @@ char *install_dir = get_install_dir(); wchar_t *w_inst_dir; size_t w_path_len = 0; + bin_verify_result v_res; if (!selection_file) { @@ -670,6 +681,22 @@ return false; } + /* Verify the binary */ + { + char *utf8_name = wchar_to_utf8 (lpApplicationPath, wcslen(lpApplicationPath)); + v_res = verify_binary (utf8_name, strlen(utf8_name)); + xfree(utf8_name); + } + + if (v_res.result != VerifyValid) + { + ERRORPRINTF ("Failed to verify the NSS installer.\n"); + syslog_error_printf ("Integrity check of the certificate installation subprocess for NSS failed.\n"); + xfree (lpApplicationPath); + xfree (lpCommandLine); + return false; + } + DEBUGPRINTF ("Starting %S with command line %S\n", lpApplicationPath, lpCommandLine); success = CreateProcessAsUserW (hToken, @@ -683,6 +710,7 @@ NULL, /* Current working directory */ &siStartInfo, &piProcInfo); + fclose (v_res.fptr); xfree (lpApplicationPath); xfree (lpCommandLine); if (!success) @@ -777,7 +805,7 @@ it might be a symlink to another place that a users wants us to grant read access to or makes us overwrite something */ - if(!create_restricted_directory (path)) + if(!create_restricted_directory (path, true)) { ERRORPRINTF ("Failed to create directory\n"); xfree(path); diff -r 1c1964c27b39 -r fd85a02d771d common/binverify.c --- a/common/binverify.c Tue Sep 02 14:25:40 2014 +0200 +++ b/common/binverify.c Tue Sep 16 19:45:19 2014 +0200 @@ -10,6 +10,7 @@ #include "strhelp.h" #include "logging.h" +#include "listutil.h" #ifdef RELEASE_BUILD #include "pubkey-release.h" #else @@ -19,8 +20,13 @@ bin_verify_result verify_binary(const char *filename, size_t name_len) { - if (!filename || !name_len) - return VerifyUnknownError; + if (!filename || !name_len) { + bin_verify_result retval; + retval.fptr = NULL; + retval.result = VerifyUnknownError; + return retval; + } + #ifdef WIN32 return verify_binary_win(filename, name_len); #else @@ -101,7 +107,7 @@ bin_verify_result verify_binary_win(const char *filename, size_t name_len) { - bin_verify_result retval = VerifyUnknownError; + bin_verify_result retval; WCHAR *filenameW = NULL; BOOL result = FALSE; DWORD dwEncoding = 0, @@ -112,17 +118,34 @@ HCRYPTMSG hMsg = NULL; PCERT_INFO pSignerCert = NULL; PCCERT_CONTEXT pSignerCertContext = NULL; + FILE *fptr = NULL; + size_t data_size = 0; + char *data = NULL; + int ret = -1; + CRYPT_INTEGER_BLOB blob; + + retval.result = VerifyUnknownError; + retval.fptr = NULL; if (!filename || name_len > MAX_PATH || strlen(filename) != name_len) { ERRORPRINTF ("Invalid parameters\n"); - return VerifyUnknownError; + return retval; } - filenameW = utf8_to_wchar(filename, name_len); + ret = read_file(filename, &data, &data_size, MAX_VALID_BIN_SIZE, &fptr); - result = CryptQueryObject (CERT_QUERY_OBJECT_FILE, - filenameW, + if (ret != 0) + { + ERRORPRINTF ("Read file failed with error: %i\n", ret); + retval.result = VerifyReadFailed; + return retval; + } + blob.cbData = (DWORD) data_size; + blob.pbData = (PBYTE) data; + + result = CryptQueryObject (CERT_QUERY_OBJECT_BLOB, + &blob, CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED, CERT_QUERY_FORMAT_FLAG_BINARY, 0, @@ -136,7 +159,7 @@ if (!result || !hMsg) { PRINTLASTERROR ("Failed to query crypto object"); - retval = VerifyReadFailed; + retval.result = VerifyReadFailed; goto done; } @@ -152,7 +175,7 @@ else { ERRORPRINTF ("Failed to get signer cert size."); - retval = VerifyUnknownError; + retval.result = VerifyUnknownError; goto done; } @@ -163,7 +186,7 @@ &dwSignerInfoSize))) { ERRORPRINTF ("Failed to get signer cert."); - retval = VerifyUnknownError; + retval.result = VerifyUnknownError; goto done; } @@ -175,7 +198,7 @@ if (!pSignerCertContext) { ERRORPRINTF ("Failed to find signer cert in store."); - retval = VerifyUnknownError; + retval.result = VerifyUnknownError; goto done; } @@ -186,7 +209,7 @@ pSignerCertContext->pCertInfo)) { ERRORPRINTF ("The signature is invalid. \n"); - retval = VerifyInvalidSignature; + retval.result = VerifyInvalidSignature; syslog_error_printf ("Software update embedded signature is invalid."); goto done; } @@ -194,22 +217,29 @@ if(check_certificate(pSignerCertContext)) { DEBUGPRINTF ("Valid signature with pinned certificate."); - retval = VerifyValid; + retval.result = VerifyValid; + retval.fptr = fptr; goto done; } else { ERRORPRINTF ("Certificate mismatch. \n"); - retval = VerifyInvalidCertificate; + retval.result = VerifyInvalidCertificate; syslog_error_printf ("Software update embedded signature " "created with wrong certificate."); goto done; } done: + xfree(data); xfree(filenameW); xfree(pSignerCert); + if (retval.result != VerifyValid) + { + fclose(fptr); + } + if(pSignerCertContext) { CertFreeCertificateContext(pSignerCertContext); @@ -226,8 +256,6 @@ } #else /* WIN32 */ -#include "listutil.h" - #pragma GCC diagnostic ignored "-Wconversion" /* Polarssl mh.h contains a conversion which gcc warns about */ #include @@ -248,29 +276,34 @@ sig_size = TRUSTBRIDGE_RSA_KEY_SIZE / 8; unsigned char signature[sig_size], hash[32]; + FILE *fptr = NULL; - bin_verify_result retval = VerifyUnknownError; + bin_verify_result retval; + retval.result = VerifyUnknownError; + retval.fptr = NULL; x509_crt codesign_cert; if (strnlen(filename, name_len + 1) != name_len || name_len == 0) { ERRORPRINTF ("Invalid call to verify_binary_linux\n"); - return VerifyUnknownError; + retval.result = VerifyUnknownError; + return retval; } - ret = read_file(filename, &data, &data_size, MAX_VALID_BIN_SIZE); + ret = read_file(filename, &data, &data_size, MAX_VALID_BIN_SIZE, &fptr); if (ret != 0) { ERRORPRINTF ("Read file failed with error: %i\n", ret); - return VerifyReadFailed; + retval.result = VerifyReadFailed; + return retval; } /* Fetch the signature from the end of data */ if (data_size < sig_b64_size + 5) { ERRORPRINTF ("File to small to contain a signature.\n"); - retval = VerifyInvalidSignature; + retval.result = VerifyInvalidSignature; goto done; } @@ -280,7 +313,7 @@ data[data_size - sig_b64_size - 5] != '\r') { ERRORPRINTF ("Failed to find valid signature line.\n"); - retval = VerifyInvalidSignature; + retval.result = VerifyInvalidSignature; goto done; } @@ -312,7 +345,8 @@ errbuf[1019] = '\0'; /* Just to be sure */ ERRORPRINTF ("x509_crt_parse failed with -0x%04x\n%s\n", -ret, errbuf); x509_crt_free(&codesign_cert); - return VerifyUnknownError; + retval.result = VerifyUnknownError; + goto done; } ret = pk_verify(&codesign_cert.pk, POLARSSL_MD_SHA256, hash, 0, @@ -325,14 +359,22 @@ errbuf[1019] = '\0'; /* Just to be sure */ ERRORPRINTF ("pk_verify failed with -0x%04x\n %s\n", -ret, errbuf); x509_crt_free(&codesign_cert); - retval = VerifyInvalidSignature; + retval.result = VerifyInvalidSignature; goto done; } x509_crt_free(&codesign_cert); - retval = VerifyValid; + retval.result = VerifyValid; + retval.fptr = fptr; done: + if (retval.result != VerifyValid) + { + if (fptr) + { + fclose(fptr); + } + } xfree (data); return retval; } diff -r 1c1964c27b39 -r fd85a02d771d common/binverify.h --- a/common/binverify.h Tue Sep 02 14:25:40 2014 +0200 +++ b/common/binverify.h Tue Sep 16 19:45:19 2014 +0200 @@ -13,13 +13,14 @@ */ #include #include +#include #ifdef __cplusplus extern "C" { #endif /** - * @enum bin_verify_result + * @enum verify_result * @brief Result of a verification */ typedef enum { @@ -28,6 +29,19 @@ VerifyInvalidSignature = 4, /*! Signature was invalid */ VerifyInvalidCertificate = 5, /*! Certificate mismatch */ VerifyReadFailed = 6, /*! File exists but could not read the file */ +} verify_result; + +/** + * A structure containing a verify_result and a reference to the + * verified file. + */ +typedef struct { + /*@{*/ + verify_result result; /**< the result of the verification */ + FILE *fptr; /**< Pointer to the open file struct of the verified file + The ptr is only valid if verify_result is VerifyValid + and needs to be closed by the caller in that case.*/ + /*@}*/ } bin_verify_result; /** @@ -44,7 +58,7 @@ * file. * * On Linux the file is epxected to and with the pattern of - * \r\nS: (0x0d0a533A) followed by a 3072 Bit Base64 encoded RSA + * \\r\\nS: (0x0d0a533A) followed by a 3072 Bit Base64 encoded RSA * signature. * The signature is verified against the built in codesigning key in * the same certificate that is used for windows verification. @@ -57,14 +71,15 @@ */ bin_verify_result verify_binary(const char *filename, size_t name_len); +/**@def Max size of a valid binary in byte */ +#define MAX_VALID_BIN_SIZE (32 * 1024 * 1024) + #ifdef WIN32 /** * @brief windows implementation of verify_binary */ bin_verify_result verify_binary_win(const char *filename, size_t name_len); #else /* WIN32 */ -/**@def Max size of a valid binary in byte */ -#define MAX_VALID_BIN_SIZE (32 * 1024 * 1024) /** * @brief linux implementation of verify_binary diff -r 1c1964c27b39 -r fd85a02d771d common/linuxlockfile.h --- a/common/linuxlockfile.h Tue Sep 02 14:25:40 2014 +0200 +++ b/common/linuxlockfile.h Tue Sep 16 19:45:19 2014 +0200 @@ -26,7 +26,7 @@ /** * @brief close a lockfile * @details unlock and close a lockfile for the given file descriptor. - * @param[in] path to the lockfile + * @param[in] fd TODO * @returns the file descriptor of the lockfile or -1 on error */ void close_lockfile(int fd); diff -r 1c1964c27b39 -r fd85a02d771d common/listutil.c --- a/common/listutil.c Tue Sep 02 14:25:40 2014 +0200 +++ b/common/listutil.c Tue Sep 16 19:45:19 2014 +0200 @@ -16,6 +16,10 @@ #include #include +#ifdef WIN32 +#include +#endif + #include "strhelp.h" #include "logging.h" @@ -41,7 +45,7 @@ #define READ_FILE_INVALID_CALL -5 int read_file(const char *file_name, char **data, size_t *size, - const size_t max_size) + const size_t max_size, FILE **fptr) { FILE *f; long file_size; @@ -50,8 +54,23 @@ { return READ_FILE_INVALID_CALL; } - +#ifdef WIN32 + { + wchar_t *wFilename = utf8_to_wchar(file_name, strlen(file_name)); + if (!wFilename) + { + return READ_FILE_UNREADABLE; + } + /* We open and write protect the file here so that + as long as the file is open we can be sure that + it was not modified and can use it in subsequent + calls based on the filename. */ + f = _wfsopen(wFilename, L"rb", _SH_DENYWR); + xfree(wFilename); + } +#else f = fopen(file_name, "rb"); +#endif if (f == NULL) return READ_FILE_UNREADABLE; @@ -92,7 +111,14 @@ return READ_FILE_READ_FAILED; } - fclose(f); + if (fptr) + { + *fptr = f; + } + else + { + fclose(f); + } (*data)[*size] = '\0'; @@ -180,7 +206,7 @@ *size = 0; int ret = 0; - ret = read_file(file_name, data, size, MAX_FILESIZE); + ret = read_file(file_name, data, size, MAX_FILESIZE, NULL); /* printf ("Ret: %i \n", ret); */ if (ret != 0) diff -r 1c1964c27b39 -r fd85a02d771d common/listutil.h --- a/common/listutil.h Tue Sep 02 14:25:40 2014 +0200 +++ b/common/listutil.h Tue Sep 16 19:45:19 2014 +0200 @@ -13,6 +13,7 @@ #endif #include +#include /** * @file listutil.h @@ -84,17 +85,22 @@ /** * @brief Read a file into memory. * - * The caller needs to free data + * The caller needs to free data. If fptr is not NULL it will + * recieve the pointer to the read file structure. The caller + * is responsible for closing this. + * fptr only needs to be closed and is only valid if the + * return value is 0. * - * @param[in] fileName Name of the file. + * @param[in] file_name Name of the file. * @param[out] data the file content * @param[out] size size in bytes of the file content. * @param[in] max_size the maximum amount of bytes to read. + * @param[out] fptr pointer to recieve the FILE ptr or NULL * * @return 0 on success an error code otherwise. */ int read_file(const char *file_name, char **data, size_t *size, - const size_t max_size); + const size_t max_size, FILE **fptr); #ifdef __cplusplus } #endif diff -r 1c1964c27b39 -r fd85a02d771d common/logging.h --- a/common/logging.h Tue Sep 02 14:25:40 2014 +0200 +++ b/common/logging.h Tue Sep 16 19:45:19 2014 +0200 @@ -26,6 +26,8 @@ /** @def The name used for logging */ #define LOG_NAME "TrustBridge" +extern bool g_debug; + #ifdef WIN32 #include @@ -68,9 +70,10 @@ */ #ifdef DEBUGOUTPUT # ifndef WIN32 -# define DEBUGPRINTF(fmt, ...) fprintf(stderr, DEBUGPREFIX "DEBUG: " fmt, ##__VA_ARGS__); +# define DEBUGPRINTF(fmt, ...) if (g_debug) fprintf(stderr, DEBUGPREFIX "DEBUG: " fmt, ##__VA_ARGS__); # else /* WIN32 */ # define DEBUGPRINTF(fmt, ...) \ + if (g_debug) \ { \ char buf[512]; \ snprintf(buf, 511, "DEBUG: " fmt, ##__VA_ARGS__); \ @@ -111,8 +114,8 @@ if (my_error) { \ ERRORPRINTF(msg" : %s\n", my_error); \ free (my_error); \ - } \ - ERRORPRINTF ("Failed to get error information\n"); + } else \ + ERRORPRINTF ("Failed to get error information\n"); /** diff -r 1c1964c27b39 -r fd85a02d771d common/portpath.c --- a/common/portpath.c Tue Sep 02 14:25:40 2014 +0200 +++ b/common/portpath.c Tue Sep 16 19:45:19 2014 +0200 @@ -8,6 +8,7 @@ #include "portpath.h" #include "strhelp.h" #include "util.h" +#include "logging.h" #include #include @@ -39,9 +40,13 @@ } bool -port_mkdir(const char *path) +port_mkdir(const char *path, bool propagate_acl) { #ifndef _WIN32 + if (propagate_acl) + { + DEBUGPRINTF("WARNING: ACL propagation only has an effect on Windows.\n"); + } return mkdir(path, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) == 0; #else wchar_t *wchar_path = utf8_to_wchar(path, strlen(path)); @@ -51,7 +56,7 @@ { return false; } - ret = create_restricted_directory (wchar_path); + ret = create_restricted_directory (wchar_path, propagate_acl); xfree (wchar_path); return ret; #endif @@ -90,7 +95,7 @@ } bool -port_mkdir_p(const char *path) +port_mkdir_p(const char *path, bool propagate_acl) { char *parent_path, *p; @@ -113,9 +118,9 @@ *p = '\0'; if (!port_isdir(parent_path)) { - port_mkdir_p(parent_path); + port_mkdir_p(parent_path, false); } - return port_mkdir(path); + return port_mkdir(path, propagate_acl); } bool diff -r 1c1964c27b39 -r fd85a02d771d common/portpath.h --- a/common/portpath.h Tue Sep 02 14:25:40 2014 +0200 +++ b/common/portpath.h Tue Sep 16 19:45:19 2014 +0200 @@ -61,15 +61,25 @@ * to create a directory that is world readable and * writable by the current user / group * @param[in] path the path to the directory + * @param[in] propagate_acl weather or not objects should inherit + * the ACL of this directory. Only has an effect on Windows. * @returns true if the directory was created */ -bool port_mkdir(const char *path); +bool port_mkdir(const char *path, bool propagate_acl); /** * @brief create a directory and its parent directores + * + * On Windows the last directory will propagate it's ACL + * to objects and subdirectories. The parent directories + * will not. + * + * @param[in] propagate_acl weather or not the + * last created directory should propagate it's acl. + * Only has an effect on Windows. * @param[in] path the path to the directory * @returns true if the directory was created */ -bool port_mkdir_p(const char *path); +bool port_mkdir_p(const char *path, bool propagate_acl); #endif diff -r 1c1964c27b39 -r fd85a02d771d common/selftest.c --- a/common/selftest.c Tue Sep 02 14:25:40 2014 +0200 +++ b/common/selftest.c Tue Sep 16 19:45:19 2014 +0200 @@ -6,6 +6,7 @@ bool selftest() { + bin_verify_result res; #ifdef WIN32 wchar_t wPath[MAX_PATH]; char *utf8path = NULL; @@ -27,7 +28,8 @@ return false; } - if (!verify_binary (utf8path, strlen(utf8path)) != VerifyValid) + res = verify_binary (utf8path, strlen(utf8path)); + if (res.result != VerifyValid) { ERRORPRINTF ("Verification of the binary failed"); syslog_error_printf ("Integrity check failed."); @@ -35,12 +37,17 @@ return false; } + fclose(res.fptr); xfree(utf8path); + return true; #else - if (!verify_binary ("/proc/self/exe", 14) != VerifyValid) + res = verify_binary ("/proc/self/exe", 14); + if (res.result != VerifyValid) { syslog_error_printf ("Integrity check failed."); return false; } + fclose(res.fptr); + return true; #endif } diff -r 1c1964c27b39 -r fd85a02d771d common/selftest.h --- a/common/selftest.h Tue Sep 02 14:25:40 2014 +0200 +++ b/common/selftest.h Tue Sep 16 19:45:19 2014 +0200 @@ -8,7 +8,9 @@ * See LICENSE.txt for details. */ -/** @file self test against manipulation +/** + * @file selftest.h + * @brief self test against manipulation * * The selftest is intended to detect untargeted manipulation or * corruption of the executable. Circumvention of the selftest diff -r 1c1964c27b39 -r fd85a02d771d common/util.c --- a/common/util.c Tue Sep 02 14:25:40 2014 +0200 +++ b/common/util.c Tue Sep 16 19:45:19 2014 +0200 @@ -406,6 +406,53 @@ } #endif +#ifdef WIN32 +bool +has_high_integrity(HANDLE hToken) +{ + PTOKEN_MANDATORY_LABEL integrity_label = NULL; + DWORD integrity_level = 0, + size = 0; + + if (hToken == NULL || hToken == INVALID_HANDLE_VALUE) + { + DEBUGPRINTF ("Invalid parameters."); + return false; + } + + /* Get the required size */ + if (!GetTokenInformation(hToken, TokenIntegrityLevel, + NULL, 0, &size) == ERROR_INSUFFICIENT_BUFFER) + { + PRINTLASTERROR ("Failed to get required size.\n"); + return false; + } + integrity_label = (PTOKEN_MANDATORY_LABEL) LocalAlloc(0, size); + if (integrity_label == NULL) + { + ERRORPRINTF ("Failed to allocate label. \n"); + return false; + } + + if (!GetTokenInformation(hToken, TokenIntegrityLevel, + integrity_label, size, &size)) + { + PRINTLASTERROR ("Failed to get integrity level.\n"); + LocalFree(integrity_label); + return false; + } + + /* Get the last integrity level */ + integrity_level = *GetSidSubAuthority(integrity_label->Label.Sid, + (DWORD)(UCHAR)(*GetSidSubAuthorityCount( + integrity_label->Label.Sid) - 1)); + + LocalFree (integrity_label); + + return integrity_level >= SECURITY_MANDATORY_HIGH_RID; +} +#endif + bool is_elevated() { @@ -424,6 +471,13 @@ ret = elevation; } } + /* Elevation will be true and ElevationType TokenElevationTypeFull even + if the token is a user token created by SAFER so we additionally + check the integrity level of the token which will only be high in + the real elevated process and medium otherwise. */ + + ret = ret && has_high_integrity (hToken); + if (hToken) CloseHandle (hToken); #endif @@ -602,7 +656,7 @@ #ifdef WIN32 bool -create_restricted_directory (LPWSTR path) +create_restricted_directory (LPWSTR path, bool objects_should_inherit) { bool retval = false; PSID everyone_SID = NULL, @@ -632,7 +686,9 @@ to allow everyone read access */ explicit_access[0].grfAccessPermissions = GENERIC_READ; /* Give read access */ explicit_access[0].grfAccessMode = SET_ACCESS; /* Overwrite other access for all users */ - explicit_access[0].grfInheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT; /* make it stick */ + explicit_access[0].grfInheritance = objects_should_inherit ? + SUB_CONTAINERS_AND_OBJECTS_INHERIT : /* make it stick */ + NO_PROPAGATE_INHERIT_ACE; /* Don't inherit */ explicit_access[0].Trustee.TrusteeForm = TRUSTEE_IS_SID; explicit_access[0].Trustee.TrusteeType = TRUSTEE_IS_WELL_KNOWN_GROUP; explicit_access[0].Trustee.ptstrName = (LPTSTR) everyone_SID; @@ -653,7 +709,9 @@ it to the children */ explicit_access[1].grfAccessPermissions = GENERIC_ALL; explicit_access[1].grfAccessMode = SET_ACCESS; - explicit_access[1].grfInheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT; + explicit_access[1].grfInheritance = objects_should_inherit ? + SUB_CONTAINERS_AND_OBJECTS_INHERIT : /* make it stick */ + NO_PROPAGATE_INHERIT_ACE; /* Don't inherit */ explicit_access[1].Trustee.TrusteeForm = TRUSTEE_IS_SID; explicit_access[1].Trustee.TrusteeType = TRUSTEE_IS_GROUP; explicit_access[1].Trustee.ptstrName = (LPTSTR) admin_SID; @@ -739,6 +797,12 @@ { SAFER_LEVEL_HANDLE user_level = NULL; HANDLE retval = NULL; + SID_IDENTIFIER_AUTHORITY medium_identifier = {SECURITY_MANDATORY_LABEL_AUTHORITY}; + PSID medium_sid = NULL; + TOKEN_MANDATORY_LABEL integrity_label; + + memset (&integrity_label, 0, sizeof (integrity_label)); + if (!SaferCreateLevel(SAFER_SCOPEID_USER, SAFER_LEVELID_NORMALUSER, SAFER_LEVEL_OPEN, &user_level, NULL)) @@ -753,25 +817,35 @@ return NULL; } - return retval; -} + SaferCloseLevel(user_level); -HANDLE -get_normal_token() -{ - SAFER_LEVEL_HANDLE user_level = NULL; - HANDLE retval = NULL; - if (!SaferCreateLevel(SAFER_SCOPEID_USER, - SAFER_LEVELID_NORMALUSER, - SAFER_LEVEL_OPEN, &user_level, NULL)) + /* Set the SID to medium it will still be high otherwise. Even if + there is no high access allowed. */ + if (!AllocateAndInitializeSid(&medium_identifier, + 1, + SECURITY_MANDATORY_MEDIUM_RID, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + &medium_sid)) { - PRINTLASTERROR ("Failed to create user level.\n"); + PRINTLASTERROR ("Failed to initialize sid.\n"); return NULL; } - if (!SaferComputeTokenFromLevel(user_level, NULL, &retval, 0, NULL)) + integrity_label.Label.Attributes = SE_GROUP_INTEGRITY; + integrity_label.Label.Sid = medium_sid; + + if (!SetTokenInformation(retval, + TokenIntegrityLevel, + &integrity_label, + sizeof(TOKEN_MANDATORY_LABEL))) { - SaferCloseLevel(user_level); + PRINTLASTERROR ("Failed to set token integrity.\n"); return NULL; } diff -r 1c1964c27b39 -r fd85a02d771d common/util.h --- a/common/util.h Tue Sep 02 14:25:40 2014 +0200 +++ b/common/util.h Tue Sep 16 19:45:19 2014 +0200 @@ -43,7 +43,7 @@ * On linux this looks for the installation configuration in /etc * and checks if the current process is inside the installation prefix. * - * The checked path is limited to MAX_PATH on Windows and @MAX_PATH_LINUX on + * The checked path is limited to MAX_PATH on Windows and \@MAX_PATH_LINUX on * Linux. */ bool is_system_install(); @@ -131,10 +131,24 @@ * http://msdn.microsoft.com/en-us/library/windows/desktop/aa446595%28v=vs.85%29.aspx * * @param[in] path Path of the directory to create + * @param[in] propagate_acl weather or not objects should inherit + * the ACL of this directory. * * @returns true on success of if the directory exists, false on error */ -bool create_restricted_directory (LPWSTR path); +bool create_restricted_directory (LPWSTR path, bool propagate_acl); + +/**@briefu Check the integrity level of the token + * + * Returns true if the token has at least SECURITY_MANADTORY_HIGH_RID or + * higher. + * + * @param[in] hToken the Token to check + * + * @returns true if the token has at least high integrity. False on error + * or otherwise. + */ +bool has_high_integrity(HANDLE hToken); /** @brief get a restricted access token to execute nss process * diff -r 1c1964c27b39 -r fd85a02d771d extras/testplan/testplan.xml --- a/extras/testplan/testplan.xml Tue Sep 02 14:25:40 2014 +0200 +++ b/extras/testplan/testplan.xml Tue Sep 16 19:45:19 2014 +0200 @@ -7,22 +7,446 @@ - 0.2 + 0.9.1 - + + + + Nutzer besitzt Administratorrechte bzw. kann welche erlangen. Der TrustBridge-Windows-Installer liegt vor. Ein weiteres Nutzerkonto (Standardbenutzer) ist angelegt und Firefox oder Thunderbird wurden einmal gestartet (erstellt NSS-Datenbank). + + + NSIS-Installer ausführen (mit Administratorrechten) und TrustBridge systemweit installieren. + Abmelden und neu anmelden. + Zertifikatsaktualisierungen ansehen (nicht einspielen). + Button [Aktualisieren] klicken. + + + TrustBridge wurde systemweit installiert. + TrustBridge startet nach Abschluss der Installation automatisch. + Eintrag im Startmenü ist vorhanden. + TrustBridge meldet nach Login, dass neue Zertifikatsaktualisierungen verfügbar sind. + GUI öffnet sich mit neuen Zertifikatsaktualisierungen. + Zeitstempel "Zuletzt nach neuen Empfehlungen gesucht" ändert sich. + + + + + Unter "Neue, empfohlene Wurzelzertifikate installieren" die [Details] einblenden und ein Zertifikat abwählen ("Ignorieren"). + Unter "Abgeratene Wurzelzertifikate entfernen" die [Details] einblenden und ein Zertifikat abwählen ("Behalten"). + Firefox starten und offen lassen. + [Änderungen schreiben] klicken. + Nach Aufforderung: Firefox schließen. + + + Zertifikats-Details werden angezeigt. + Abwahl eines Zertifikats unter "empfohlene" bzw. "abgeratene" Wurzelzertifikate" reduziert die Gesamtanzahl jeweils um 1. + Meldung erscheint, dass Firefox geschlossen werden muss. + Installierte Zertifikate erscheinen unten "Empfohlene Wurzelzertifikate". Abwahlentscheidung ist korrekt. + Entfernte Zertifikate erscheinen unten "Abgeratene Wurzelzertifikate". Abwahlentscheidung ist korrekt. + Mozilla-NSS-Zertifikatsspeicher prüfen: neue Zertifikate sind vorhanden. + Windows-Zertifikatsspeicher prüfen: neue Zertifikate sind vorhanden. + + + + + Seite "Empfohlene Wurzelzertifikate" aufrufen und das abgewählte Zertifikat zum Installieren auswählen. + Seite "Abgeratene Wurzelzertifikate" aufrufen und das abgewählte Zertifikate zum Entfernen auswählen. + Auf Seite "Neue Empfehlungen" wechseln. + [Änderungen schreiben] klicken. + + + Auf dem Button "Neue Empfehlungen" wird die Anzahl der geänderten Zertifikate (2) im roten Kreis dargestellt. + Abschnitt "Abweichend zu behandelnde Wurzelzertifikate" werden eingeblendet. Anzahl und Details sind korrekt. + Geänderte Zertifikate erscheinen nach [Änderungen schreiben] korrekt in den beiden Seiten ("Empfohlene Wurzelzertifikate" und "Abgeratene Wurzelzertifikate". + Mozilla-NSS-Zertifikatsspeicher prüfen: geänderte Zertifikate sind korrekt. + Windows-Zertifikatsspeicher prüfen: geänderte Zertifikate sind korrekt. + + + + + Mit dem vorhandenen Standardbenutzerkonto einloggen. + + + Mozilla-NSS-Zertifikatsspeicher prüfen: neue Zertifikate sind vorhanden. + Windows-Zertifikatsspeicher prüfen: neue Zertifikate sind vorhanden. + + + + + Als Administrator neues Windows-Standardbenutzerkonto mit Umlauten, z.B. "testüser" anlegen. + Als "testüser" einloggen. + + + Mozilla-NSS-Zertifikatsspeicher prüfen: neue Zertifikate sind vorhanden. + Windows-Zertifikatsspeicher prüfen: neue Zertifikate sind vorhanden. + + + + Aktualisierte und signierte Zertifikatsliste liegt vor (wurde mit der Verwaltungsanwendung erstellt). Zum Verfügbarmachen in einem Testverzeichnis: %APPDATA%\BSI\TrustBridge.ini anpassen und unter "[List]" neue "resource" ergänzen, z.B. "resource=/users/aheinecke/zertifikatsliste_2.txt". (Domain des Download-Servers kann nicht geändert werden, nur der Pfad.) + + Aktualisierte Zertifikatsliste (mit einem neuen und einem zurückgezogenen Zertifikat) hochladen. + Als Adminnutzer einloggen, der TrustBridge installiert hat. Dann TrustBridge starten. + [Änderungen schreiben] klicken. + + + "Zuletzt nach neuen Empfehlungen gesucht" ändert sich auf aktuellen Zeitpunkt (des Anwendungsstarts). + Anzahl der Änderungen wird angezeigt: "2" (1 neues und 1 zurückgezogenes Zertifikat) + Aktualisierte Zertifikate erscheinen nach Schritt 3 korrekt unten "Empfohlene Wurzelzertifikate" bzw. "Abgeratene Wurzelzertifikate". + Aktualisierte Zertifikate erscheinen korrekt im Mozilla-NSS-Zertifikatsspeicher. + Aktualisierte Zertifikate erscheinen korrekt im Windows-Zertifikatsspeicher. + "Empfehlungen bereits berücksichtigt bis" aktualisiert sich nach Installation auf Datum der neuen Zertifikatsliste. + + + + Aktualisierter Windows-Installer liegt vor (wurde mit der Verwaltungsanwendung signiert). Zum Verfügbarmachen in einem Testverzeichnis: %APPDATA%\BSI\TrustBridge.ini anpassen und unter "[Software]" neue "resource" ergänzen, z.B. "resource=/users/aheinecke/TrustBridge_2.exe". (Domain des Download-Servers kann nicht geändert werden, nur der Pfad.) + + Aktualisiertes Softwarepaket hochladen. + Button [Aktualisieren] klicken. + System-Tray-Benachrichtigung zum Download und Installation der Software bestätigen. + + + "Zuletzt nach neuen Empfehlungen gesucht" ändert sich nach Schritt 2 auf aktuellen Zeitpunkt. + Software wird, nach Schritt 3, automatisch im Hintergrund aktualisiert. + Nach Neustart der Anwendung wird die neue Versionsnummer auf der Startseite angezeigt. + + + + + Software über die Windows-Softwareverwaltung deinstallieren. + + + Programmverzeichnis wurde entfernt. + Startmenüeintrag wurde entfernt. + Verwaltete Zertifikate wurden aus dem Windows-Zertifikatsspeicher entfernt. + Verwaltete Zertifikate wurden aus dem NSS-Zertifikatsspeicher entfernt. + Datenverzeichnis %APPDATA%\Local\BSI wurde entfernt. + Konfigurationsverzeichnis %APPDATA%\Roaming\BSI wurde entfernt. + + + + + + + + Nutzer besitzt keine Administratorrechte. Der TrustBridge-Windows-Installer liegt vor. + + + NSIS-Installer ausführen (mit Vorbelegung) und lokal im Nutzerverzeichnis installieren. + Abmelden und neu anmelden. + Zertifikatsaktualisierungen ansehen (nicht einspielen). + Button [Aktualisieren] klicken. + + + TrustBridge wurde lokal installiert. + TrustBridge startet nach Abschluss der Installation automatisch. + Eintrag im Startmenü ist vorhanden + TrustBridge meldet nach Login, dass neue Zertifikatsaktualisierungen verfügbar sind. + GUI öffnet sich mit neuen Zertifikatsaktualisierungen. + Zeitstempel "Zuletzt nach neuen Empfehlungen gesucht" ändert sich. + + + + + Unter "Neue, empfohlene Wurzelzertifikate installieren" die [Details] einblenden und ein Zertifikat abwählen ("Ignorieren"). + Unter "Abgeratene Wurzelzertifikate entfernen" die [Details] einblenden und ein Zertifikat abwählen ("Behalten"). + [Änderungen schreiben] klicken. + + + Zertifikats-Details werden angezeigt. + Abwahl eines Zertifikats unter "empfohlene" bzw. "abgeratene" Wurzelzertifikate" reduziert die Gesamtanzahl jeweils um 1. + Windows-Zertifikats-Bestätigungs-Dialog erscheint für jedes Zertifikat. + Installierte Zertifikate erscheinen unten "Empfohlene Wurzelzertifikate". Abwahlentscheidung ist korrekt. + Entfernte Zertifikate erscheinen unten "Abgeratene Wurzelzertifikate". Abwahlentscheidung ist korrekt. + Mozilla-NSS-Zertifikatsspeicher prüfen: neue Zertifikate sind vorhanden. + Windows-Zertifikatsspeicher prüfen: neue Zertifikate sind vorhanden. + + + + + Seite "Empfohlene Wurzelzertifikate" aufrufen und das abgewählte Zertifikat zum Installieren auswählen. + Seite "Abgeratene Wurzelzertifikate" aufrufen und das abgewählte Zertifikate zum Entfernen auswählen. + Auf Seite "Neue Empfehlungen" wechseln. + [Änderungen schreiben] klicken. + + + Auf dem Button "Neue Empfehlungen" wird die Anzahl der geänderten Zertifikate (2) im roten Kreis dargestellt. + Abschnitt "Abweichend zu behandelnde Wurzelzertifikate" werden eingeblendet. Anzahl und Details sind korrekt. + Windows-Zertifikats-Bestätigungs-Dialog erscheint für jedes Zertifikat. + Geänderte Zertifikate erscheinen nach [Änderungen schreiben] korrekt in den beiden Seiten ("Empfohlene Wurzelzertifikate" und "Abgeratene Wurzelzertifikate". + Mozilla-NSS-Zertifikatsspeicher prüfen: geänderte Zertifikate sind korrekt. + Windows-Zertifikatsspeicher prüfen: geänderte Zertifikate sind korrekt. + + + + Aktualisierte und signierte Zertifikatsliste liegt vor (wurde mit der Verwaltungsanwendung erstellt). Zum Verfügbarmachen in einem Testverzeichnis: %APPDATA%\BSI\TrustBridge.ini anpassen und unter "[List]" neue "resource" ergänzen, z.B. "resource=/users/aheinecke/zertifikatsliste_2.txt". (Domain des Download-Servers kann nicht geändert werden, nur der Pfad.) + + Aktualisierte Zertifikatsliste (mit einem neuen und einem zurückgezogenen Zertifikat) hochladen. + Als Nutzer einloggen, der TrustBridge installiert hat. Dann TrustBridge starten. + [Änderungen schreiben] klicken. + + + "Zuletzt nach neuen Empfehlungen gesucht" ändert sich auf aktuellen Zeitpunkt (des Anwendungsstarts). + Anzahl der Änderungen wird angezeigt: "2" (1 neues und 1 zurückgezogenes Zertifikat) + Aktualisierte Zertifikate erscheinen nach Schritt 3 korrekt unten "Empfohlene Wurzelzertifikate" bzw. "Abgeratene Wurzelzertifikate". + Aktualisierte Zertifikate erscheinen korrekt im Mozilla-NSS-Zertifikatsspeicher. + Aktualisierte Zertifikate erscheinen korrekt im Windows-Zertifikatsspeicher. + "Empfehlungen bereits berücksichtigt bis" aktualisiert sich nach Installation auf Datum der neuen Zertifikatsliste. + + + + Aktualisierter Windows-Installer liegt vor (wurde mit der Verwaltungsanwendung signiert). Zum Verfügbarmachen in einem Testverzeichnis: %APPDATA%\BSI\TrustBridge.ini anpassen und unter "[Software]" neue "resource" ergänzen, z.B. "resource=/users/aheinecke/TrustBridge_2.exe". (Domain des Download-Servers kann nicht geändert werden, nur der Pfad.) + + Aktualisiertes Softwarepaket hochladen. + Button [Aktualisieren] klicken. + System-Tray-Benachrichtigung zum Download und Installation der Software bestätigen. + + + "Zuletzt nach neuen Empfehlungen gesucht" ändert sich nach Schritt 2 auf aktuellen Zeitpunkt. + Software wird, nach Schritt 3, automatisch im Hintergrund aktualisiert. + Nach Neustart der Anwendung wird die neue Versionsnummer auf der Startseite angezeigt. + + + + + Software über die Windows-Softwareverwaltung deinstallieren. + + + Programmverzeichnis wurde entfernt. + Startmenüeintrag wurde entfernt. + Verwaltete Zertifikate wurden aus dem Windows-Zertifikatsspeicher entfernt. + Verwaltete Zertifikate wurden aus dem NSS-Zertifikatsspeicher entfernt. + Datenverzeichnis %APPDATA%\Local\BSI wurde entfernt. + Konfigurationsverzeichnis %APPDATA%\Roaming\BSI wurde entfernt. + + + + + + + + Nutzer besitzt sudo-Rechte. Der TrustBridge-Linux-Installationsscript liegt vor. Ein weiteres Nutzerkonto ist angelegt und Firefox oder Thunderbird wurden einmal gestartet (erstellt NSS-Datenbank). + + + Linux-Installationsscript (mit sudo und Option -s) ausführen und TrustBridge systemweit installieren. + Abmelden und neu anmelden. + Zertifikatsaktualisierungen ansehen (nicht einspielen). + Button [Aktualisieren] klicken. + + + TrustBridge wurde lokal installiert. + TrustBridge startet nach Abschluss der Installation automatisch. + Eintrag im Menü der Anwendungen ist vorhanden. + TrustBridge meldet nach Login, dass neue Zertifikatsaktualisierungen verfügbar sind. + GUI öffnet sich mit neuen Zertifikatsaktualisierungen. + Zeitstempel "Zuletzt nach neuen Empfehlungen gesucht" ändert sich. + + + + + Unter "Neue, empfohlene Wurzelzertifikate installieren" die [Details] einblenden und ein Zertifikat abwählen ("Ignorieren"). + Unter "Abgeratene Wurzelzertifikate entfernen" die [Details] einblenden und ein Zertifikat abwählen ("Behalten"). + Firefox starten und offen lassen + [Änderungen schreiben] klicken. + Nach Installation: Firefox schließen. + + + Zertifikats-Details werden angezeigt. + Abwahl eines Zertifikats unter "empfohlene" bzw. "abgeratene" Wurzelzertifikate" reduziert die Gesamtanzahl jeweils um 1. + Es erfolgt eine sudo-Passort-Abfrage. + Installierte Zertifikate erscheinen unten "Empfohlene Wurzelzertifikate". Abwahlentscheidung ist korrekt. + Entfernte Zertifikate erscheinen unten "Abgeratene Wurzelzertifikate". Abwahlentscheidung ist korrekt. + Mozilla-NSS-Zertifikatsspeicher prüfen: neue Zertifikate sind vorhanden. + Chromium prüfen: neue Zertifikate sind vorhanden und vertrauenswürdig. + + + + + Seite "Empfohlene Wurzelzertifikate" aufrufen und das abgewählte Zertifikat zum Installieren auswählen. + Seite "Abgeratene Wurzelzertifikate" aufrufen und das abgewählte Zertifikate zum Entfernen auswählen. + Auf Seite "Neue Empfehlungen" wechseln. + [Änderungen schreiben] klicken. + + + Auf dem Button "Neue Empfehlungen" wird die Anzahl der geänderten Zertifikate (2) im roten Kreis dargestellt. + Abschnitt "Abweichend zu behandelnde Wurzelzertifikate" werden eingeblendet. Anzahl und Details sind korrekt. + Es erfolgt eine sudo-Passort-Abfrage. + Geänderte Zertifikate erscheinen nach [Änderungen schreiben] korrekt in den beiden Seiten ("Empfohlene Wurzelzertifikate" und "Abgeratene Wurzelzertifikate". + Mozilla-NSS-Zertifikatsspeicher prüfen: geänderte Zertifikate sind korrekt. + Chromium prüfen: geänderte Zertifikate sind korrekt. + + + + + Mit dem vorhandenen Standardbenutzerkonto einloggen. + + + Mozilla-NSS-Zertifikatsspeicher prüfen: neue Zertifikate sind vorhanden. + Chromium prüfen: neue Zertifikate sind vorhanden und vertrauenswürdig. + + + + + Mit sudo neues Benutzerkonto, z.B. "testuser" anlegen. + Als "testuser" einloggen. + + + Mozilla-NSS-Zertifikatsspeicher prüfen: neue Zertifikate sind vorhanden. + Chromium prüfen: neue Zertifikate sind vorhanden und vertrauenswürdig. + + + + Aktualisierte und signierte Zertifikatsliste liegt vor (wurde mit der Verwaltungsanwendung erstellt). Zum Verfügbarmachen in einem Testverzeichnis: ~/.config/BSI/TrustBridge.ini anpassen und unter "[List]" neue "resource" ergänzen, z.B. "resource=/users/aheinecke/zertifikatsliste_2.txt". (Domain des Download-Servers kann nicht geändert werden, nur der Pfad.) + + Aktualisierte Zertifikatsliste (mit einem neuen und einem zurückgezogenen Zertifikat) hochladen. + Als Nutzer einloggen, der TrustBridge installiert hat. Dann TrustBridge starten. + [Änderungen schreiben] klicken. + + + "Zuletzt nach neuen Empfehlungen gesucht" ändert sich auf aktuellen Zeitpunkt (des Anwendungsstarts). + Anzahl der Änderungen wird angezeigt: "2" (1 neues und 1 zurückgezogenes Zertifikat) + Aktualisierte Zertifikate erscheinen nach Schritt 3 korrekt unten "Empfohlene Wurzelzertifikate" bzw. "Abgeratene Wurzelzertifikate". + Aktualisierte Zertifikate erscheinen korrekt im Mozilla-NSS-Zertifikatsspeicher. + Aktualisierte Zertifikate erscheinen korrekt in Chromium. + "Empfehlungen bereits berücksichtigt bis" aktualisiert sich nach Installation auf Datum der neuen Zertifikatsliste. + + + + Aktualisiertes Ubuntu-Installationsskript liegt vor (wurde mit der Verwaltungsanwendung signiert). Zum Verfügbarmachen in einem Testverzeichnis: ~/.config/BSI/TrustBridge.ini anpassen und unter "[Software]" neue "resource" ergänzen, z.B. "resource=/users/aheinecke/TrustBridge_2.sh". (Domain des Download-Servers kann nicht geändert werden, nur der Pfad.) + + Aktualisiertes Softwarepaket hochladen. + Button [Aktualisieren] klicken. + System-Tray-Benachrichtigung zum Download und Installation der Software bestätigen. + + + "Zuletzt nach neuen Empfehlungen gesucht" ändert sich nach Schritt 2 auf aktuellen Zeitpunkt. + Software wird, nach Schritt 3, automatisch im Hintergrund aktualisiert. + Nach Neustart der Anwendung wird die neue Versionsnummer auf der Startseite angezeigt. + + + + + Software über das Linux-Installationsscript (Option -d) deinstallieren. + + + Programmdatei (unter /usr/local/bin/) wurde entfernt. + Eintrag aus Anwendungsmenü wurde entfernt. + Verwaltete Zertifikate wurden aus dem NSS-Zertifikatsspeicher entfernt. + Datenverzeichnis ~/.local/share/BSI wurde entfernt. + Konfigurationsverzeichnis ~/.config/BSI wurde entfernt. + + + + + + + + Nutzer besitzt keine sudo-Rechte. Das TrustBridge-Linux-Installationsscript liegt vor. + + + Linux-Installationsscript (ohne Optionen) ausführen und lokal im Nutzerverzeichnis installieren. + Abmelden und neu anmelden. + Zertifikatsaktualisierungen ansehen (nicht einspielen). + Button [Aktualisieren] klicken. + + + TrustBridge wurde lokal installiert. + TrustBridge startet nach Abschluss der Installation automatisch. + Eintrag im Startmenü ist vorhanden + TrustBridge meldet nach Login, dass neue Zertifikatsaktualisierungen verfügbar sind. + GUI öffnet sich mit neuen Zertifikatsaktualisierungen. + Zeitstempel "Zuletzt nach neuen Empfehlungen gesucht" ändert sich. + + + + + Unter "Neue, empfohlene Wurzelzertifikate installieren" die [Details] einblenden und ein Zertifikat abwählen ("Ignorieren"). + Unter "Abgeratene Wurzelzertifikate entfernen" die [Details] einblenden und ein Zertifikat abwählen ("Behalten"). + [Änderungen schreiben] klicken. + + + Zertifikats-Details werden angezeigt. + Abwahl eines Zertifikats unter "empfohlene" bzw. "abgeratene" Wurzelzertifikate" reduziert die Gesamtanzahl jeweils um 1. + Installierte Zertifikate erscheinen unten "Empfohlene Wurzelzertifikate". Abwahlentscheidung ist korrekt. + Entfernte Zertifikate erscheinen unten "Abgeratene Wurzelzertifikate". Abwahlentscheidung ist korrekt. + Mozilla-NSS-Zertifikatsspeicher prüfen: neue Zertifikate sind vorhanden. + Chromium prüfen: neue Zertifikate sind vorhanden und vertrauenswürdig. + + + + + Seite "Empfohlene Wurzelzertifikate" aufrufen und das abgewählte Zertifikat zum Installieren auswählen. + Seite "Abgeratene Wurzelzertifikate" aufrufen und das abgewählte Zertifikate zum Entfernen auswählen. + Auf Seite "Neue Empfehlungen" wechseln. + [Änderungen schreiben] klicken. + + + Auf dem Button "Neue Empfehlungen" wird die Anzahl der geänderten Zertifikate (2) im roten Kreis dargestellt. + Abschnitt "Abweichend zu behandelnde Wurzelzertifikate" werden eingeblendet. Anzahl und Details sind korrekt. + Geänderte Zertifikate erscheinen nach [Änderungen schreiben] korrekt in den beiden Seiten ("Empfohlene Wurzelzertifikate" und "Abgeratene Wurzelzertifikate". + Mozilla-NSS-Zertifikatsspeicher prüfen: geänderte Zertifikate sind korrekt. + Chromium prüfen: geänderte Zertifikate sind korrekt. + + + + Aktualisierte und signierte Zertifikatsliste liegt vor (wurde mit der Verwaltungsanwendung erstellt). Zum Verfügbarmachen in einem Testverzeichnis: ~/.config/BSI/TrustBridge.ini anpassen und unter "[List]" neue "resource" ergänzen, z.B. "resource=/users/aheinecke/zertifikatsliste_2.txt". (Domain des Download-Servers kann nicht geändert werden, nur der Pfad.) + + Aktualisierte Zertifikatsliste (mit einem neuen und einem zurückgezogenen Zertifikat) hochladen. + Als Nutzer einloggen, der TrustBridge installiert hat. Dann TrustBridge starten. + [Änderungen schreiben] klicken. + + + "Zuletzt nach neuen Empfehlungen gesucht" ändert sich auf aktuellen Zeitpunkt (des Anwendungsstarts). + Anzahl der Änderungen wird angezeigt: "2" (1 neues und 1 zurückgezogenes Zertifikat) + Aktualisierte Zertifikate erscheinen nach Schritt 3 korrekt unten "Empfohlene Wurzelzertifikate" bzw. "Abgeratene Wurzelzertifikate". + Aktualisierte Zertifikate erscheinen korrekt im Mozilla-NSS-Zertifikatsspeicher. + Aktualisierte Zertifikate erscheinen korrekt in Chromium. + "Empfehlungen bereits berücksichtigt bis" aktualisiert sich nach Installation auf Datum der neuen Zertifikatsliste. + + + + Aktualisierter Windows-Installer liegt vor (wurde mit der Verwaltungsanwendung signiert). Zum Verfügbarmachen in einem Testverzeichnis: ~/.config/BSI/TrustBridge.ini anpassen und unter "[Software]" neue "resource" ergänzen, z.B. "resource=/users/aheinecke/TrustBridge_2.exe". (Domain des Download-Servers kann nicht geändert werden, nur der Pfad.) + + Aktualisiertes Softwarepaket hochladen. + Button [Aktualisieren] klicken. + System-Tray-Benachrichtigung zum Download und Installation der Software bestätigen. + + + "Zuletzt nach neuen Empfehlungen gesucht" ändert sich nach Schritt 2 auf aktuellen Zeitpunkt. + Software wird, nach Schritt 3, automatisch im Hintergrund aktualisiert. + Nach Neustart der Anwendung wird die neue Versionsnummer auf der Startseite angezeigt. + + + + + Software über die Windows-Softwareverwaltung deinstallieren. + + + Programmdatei (unter ~/TrustBridge/) wurde entfernt. + Eintrag aus Anwendungsmenü wurde entfernt. + Verwaltete Zertifikate wurden aus dem NSS-Zertifikatsspeicher entfernt. + Datenverzeichnis ~/.local/share/BSI wurde entfernt. + Konfigurationsverzeichnis ~/.config/BSI wurde entfernt. + + + + + + + + - + - Verwaltungsanwendung (trustbridge-admin) starten. + Verwaltungsanwendung nach Anleitung installieren und starten. - Die Anwendung startet + Die Anwendung startet. - + Mehrere Zertifikate hinzufügen (z.B. aus ui/tests/data) @@ -32,11 +456,91 @@ Liste erstellen - Liste wurde erfolgreich im Ausgabeverzeichnis gespeichert - Liste wurde erfolgreich im Archivverzeichnis (~/.local share/BSI/trustbridge-admin/) gespeichert + Liste wurde erfolgreich im Ausgabeverzeichnis gespeichert + Liste wurde erfolgreich im Archivverzeichnis (%APPDATA%\Local\BSI\trustbridge-admin\) gespeichert - + + + + Ein Zertifikat aus der Liste entfernen + Ein weiteres Zertifikate hinzufügen (z.B. aus ui/tests/data) + Liste erstellen (Signaturzertifikat und Ausgabeverzeichnis unverändert lassen) + + + Liste wurde erfolgreich im Ausgabeverzeichnis gespeichert + Liste wurde erfolgreich im Archivverzeichnis (%APPDATA%\Local\BSI\trustbridge-admin\) gespeichert + + + + + + Verwaltungsanwendung neustarten + + + Die zuletzt erstellte Zertifikatsliste wird angezeigt + + + + + + Installationspaket erstellen... + Verzeichnis des Binärpakets angeben (enthält meta.ini) + Code-Signing-Zertifikat angeben (z.B. ui/tests/data/codesign/codesigning-combined.pem) + Ausgabeverzeichnis angeben + Installationspaket erzeugen + + + Installationspakete für Windows und Ubuntu (2x) wurde im Ausgabeverzeichnis erstellt. + + + + + + Verwaltungsanwendungs-Hilfe über das Menü aufrufen. + + + Die Hilfe öffnet sich im Standardbrowser. + + + + + + Verwaltungsanwendung beenden. + + + Die Anwendung schließt sich. + + + + + + + + + + + Verwaltungsanwendung nach Anleitung installieren und starten. + + + Die Anwendung startet. + + + + + + Mehrere Zertifikate hinzufügen (z.B. aus ui/tests/data) + Liste erstellen + Signaturzertifikat angeben (z.B. ui/tests/data/testkey-priv.pem) + Ausgabeverzeichnis angeben + Liste erstellen + + + Liste wurde erfolgreich im Ausgabeverzeichnis gespeichert + Liste wurde erfolgreich im Archivverzeichnis (~/.local/share/BSI/trustbridge-admin/) gespeichert + + + Ein Zertifikat aus der Liste entfernen @@ -45,133 +549,49 @@ Liste erstellen - Liste wurde erfolgreich im Ausgabeverzeichnis gespeichert - Liste wurde erfolgreich im Archivverzeichnis (~/.local share/BSI/trustbridge-admin/) gespeichert + Liste wurde erfolgreich im Ausgabeverzeichnis gespeichert + Liste wurde erfolgreich im Archivverzeichnis (~/.local/share/BSI/trustbridge-admin/) gespeichert - + Verwaltungsanwendung neustarten - Die zuletzt erstellte Zertifikatsliste wird angezeigt + Die zuletzt erstellte Zertifikatsliste wird angezeigt - + Installationspaket erstellen... Verzeichnis des Binärpakets angeben (enthält meta.ini) - Code-Signing-Zertifikat angeben (z.B. ui/tests/data/codesign/codesigning.pem) + Code-Signing-Zertifikat angeben (z.B. ui/tests/data/codesign/codesigning-combined.pem) Ausgabeverzeichnis angeben Installationspaket erzeugen - Installationspaket für Windows (NSIS-Installer) wurde im Ausgabeverzeichnis erstellt. - Installationspaket für Ubuntu wurde im Ausgabeverzeichnis erstellt. + Installationspakete für Windows und Ubuntu (2x) wurden im Ausgabeverzeichnis erstellt. - + + + + Verwaltungsanwendungs-Hilfe über das Menü aufrufen. + + + Die Hilfe öffnet sich im Standardbrowser. + + + Verwaltungsanwendung beenden. - Die Anwendung schließt sich + Die Anwendung schließt sich - - - - - - Nutzer besitzt Adminstratorrechte. Der TrustBridge Client Installer liegt vor. - - - NSIS-Installer ausführen (mit Vorbelegung) - - - Eintrag im Startmenü ist vorhanden - - - - - - Anwendung (trustbridge) starten. - - - Die Anwendung startet - - - - - Unter "neue, vertrauenswürdige Zertifikate instalieren" die [Details einblenden] - Ein Zertifikat abwählen (nicht installieren). - [Aktualisierung einspielen] klicken. - - - Nach Programmstart: neue Zertifikate werden zur Aktualisierung angezeigt. - Zertifikatsliste im Detail wird angezeigt. - Abwahl eines Zertifikats reduziert die Gesamtanzahl um 1. - Installierte Zertifikate erscheinen unten "Vertrauenswürdige Zertifikate" - Installierte Zertifikate erscheinen im Mozilla-NSS-Zertifikatsstore? - Installierte Zertifikate erscheinen im Windows-Zertifikatsstore (nur Windows)? - Installierte Zertifikate erscheinen im Chrome-Zertifikatsstore (nur Linux)? - - - - - Aktualisierte Zertifikatsliste (mit einem neuen und einem zurückgezogenen Zertifikat) hochladen. - Button [Nach Aktualisierung suchen] klicken. - [Aktualisierung einspielen] klicken. - - - "Letzte Aktualisierung der Zertifikate" ändert sich nach Schritt 2 auf Zeitpunkt der Bereitstellung. - "2/2" (1 neues und 1 zurückgezogenes Zertifikat) wird angezeigt. - Aktualisierte Zertifikate erscheinen korrekt unten "Vertrauenswürdige Zertifikate" bzw. Zurückgezogene Zertifikate. - Aktualisierte Zertifikate erscheinen korrekt im Mozilla-NSS-Zertifikatsstore? - Aktualisierte Zertifikate erscheinen im Windwos-Zertifikatsstore (nur Windows)? - Aktualisierte Zertifikate erscheinen im Chrome-Zertifikatsstore (nur Linux) - - - - - Aktualisiertes Softwarepaket hochladen. - Button [Nach Aktualisierung suchen] klicken. - System-Tray-Benachrichtigung zum Download und Installation der Software bestätigen. - - - "Letzte Aktualisierung von TrustBridge" ändert sich nach Schritt 2 auf Zeitpunkt der Bereitstellung. - Software wird, nach Schritt 3, automatisch im Hintergrund aktualisiert. - Nach Neustart der Anwendung zeigt der Hilfe-Dialog die neue Versionsnummer an. - - - - - - - - - Nutzer besitzt keine Adminstratorrechte. Der TrustBridge Client Installer liegt vor. - - - NSIS-Installer ausführen (mit Vorbelegung) - - - Eintrag im Startmenü ist vorhanden - - - - - - Anwendung (trustbridge) starten. - - - Die Anwendung startet - - - - diff -r 1c1964c27b39 -r fd85a02d771d manuals/admin-manual/index.rst --- a/manuals/admin-manual/index.rst Tue Sep 02 14:25:40 2014 +0200 +++ b/manuals/admin-manual/index.rst Tue Sep 16 19:45:19 2014 +0200 @@ -1,26 +1,31 @@ Was ist TrustBridge? ==================== -TrustBridge ist eine Anwendung vom `Bundesamt für Sicherheit in der Informationstechnik (BSI) `_ für die Verbreitung von empfohlenen Wurzelzertifikaten. +TrustBridge ist eine Anwendung vom `Bundesamt für Sicherheit in der +Informationstechnik (BSI) `_ für die Verbreitung +von empfohlenen Wurzelzertifikaten. TrustBridge macht es Nutzern einfacher, Wurzelzertifikate für eine X.509-basierende, öffentliche Zertifikatsinfrastruktur (PKI) einzuspielen und aktuell zu halten. TrustBridge verteilt Wurzelzertifikate, welche von den Betriebssystemen und Webbrowsern -nicht mitgeliefert werden. Existierende Zertifikate, die korrumpiert oder missbraucht wurden, können über eine Deinstallations-Empfehlung von TrustBridge entfernt werden. -Dabei ist unerheblich, ob die Zertifikate auf der Anwenderebene -vorher bereits installiert waren. +nicht mitgeliefert werden. Existierende Zertifikate, die korrumpiert +oder missbraucht wurden, können von TrustBridge über eine +Deinstallations-Empfehlung entfernt werden. Dabei ist unerheblich, ob +die Zertifikate auf der Anwenderebene vorher bereits installiert +waren. -**Wurzelzertifikate** sind die Basis einer PKI zur Feststellung der -Authentizität des Kommunikationspartners und der Integrität seiner -Nachrichten für verschiedene Anwendungen -- insbesondere bei der -Übertragung über unsichere Kommunikationskanäle, wie dem Internet. +**Wurzelzertifikate** (auch Rootzertifikate genannt) sind die Basis +einer PKI zur Feststellung der Authentizität des +Kommunikationspartners und der Integrität seiner Nachrichten für +verschiedene Anwendungen -- insbesondere bei der Übertragung über +unsichere Kommunikationskanäle, wie dem Internet. -Ein Wurzel- oder auch "Root"-Zertifikat dient als Vertrauensanker -("Trust Anchor") für alle darunter hängenden Zertifikate. Unterhalb -der Wurzel folgt eine Sicherheitskette ("Trust Chain") von ein oder -mehreren Zwischenzertifikaten der Zertifizierungsstellen, gefolgt von -den ausgestellten Zertifikaten für die Anwendungen. Die Zertifikate +Ein Wurzelzertifikat dient als Vertrauensanker ("Trust Anchor") für +alle darunter hängenden Zertifikate. Unterhalb der Wurzel folgt eine +Sicherheitskette ("Trust Chain") von ein oder mehreren +Zwischenzertifikaten der Zertifizierungsstellen, gefolgt von den +ausgestellten Zertifikaten für die Anwendungen. Die Zertifikate sichern per Public-Key-Kryptoverfahren nach dem X.509-v3 Standard beispielsweise TLS-Verbindungen von Webbrowser zu Webserver (HTTPS) oder E-Mail-Klient zu E-Mail-Server (IMAPS). Ein weiteres Beispiel ist @@ -29,8 +34,9 @@ Über diese Hilfe ================ -Diese Hilfe unterstützt Sie bei der Bedienung der TrustBridge-Verwaltungsanwendung. -Die Hilfeseiten im Überblick: +Diese Hilfe unterstützt Sie bei der Bedienung der +TrustBridge-Verwaltungsanwendung und gibt Hinweise zum Betrieb des +Download-Servers. Die Hilfeseiten im Überblick: .. toctree:: :maxdepth: 2 @@ -42,7 +48,8 @@ Impressum ========= -Copyright 2014 Die Rechte liegen beim `Bundesamt für Sicherheit in der Informationstechnik (BSI) `_. +Copyright 2014 Die Rechte liegen beim `Bundesamt für Sicherheit in der +Informationstechnik (BSI) `_. TrustBridge wurde von den Unternehmen `Intevation GmbH `_ und `DN-Systems GmbH diff -r 1c1964c27b39 -r fd85a02d771d manuals/help-manual/_static/bsi-logo.png Binary file manuals/help-manual/_static/bsi-logo.png has changed diff -r 1c1964c27b39 -r fd85a02d771d manuals/help-manual/_static/extra-style.css --- a/manuals/help-manual/_static/extra-style.css Tue Sep 02 14:25:40 2014 +0200 +++ b/manuals/help-manual/_static/extra-style.css Tue Sep 16 19:45:19 2014 +0200 @@ -11,4 +11,20 @@ font-size: 1.1em; background-color: transparent; } - +#pageheader img { + float: left; + margin-right: 10px; +} +#pageheader h1 { + margin: 5px; + padding: 15px; +} +#breadcrumbs { + display: none; +} +.related.top #rellinks { + margin-top: -25px; +} +#pagefooter { + padding-bottom: 0 !important; +} diff -r 1c1964c27b39 -r fd85a02d771d manuals/help-manual/_static/nsis-installer.png Binary file manuals/help-manual/_static/nsis-installer.png has changed diff -r 1c1964c27b39 -r fd85a02d771d manuals/help-manual/_static/trustbridge-logo.png Binary file manuals/help-manual/_static/trustbridge-logo.png has changed diff -r 1c1964c27b39 -r fd85a02d771d manuals/help-manual/_templates/layout.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/manuals/help-manual/_templates/layout.html Tue Sep 16 19:45:19 2014 +0200 @@ -0,0 +1,17 @@ +{% extends '!layout.html' %} + +{%- block header %} + {%- if theme_showheader|tobool %} + + {%- endif %} +{%- endblock %} + + +{% block footer %} +
+ © 2014, BSI | TrustBridge {{version}}
+ +
+{% endblock %} diff -r 1c1964c27b39 -r fd85a02d771d manuals/help-manual/arbeitsweise.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/manuals/help-manual/arbeitsweise.rst Tue Sep 16 19:45:19 2014 +0200 @@ -0,0 +1,29 @@ +============ +Arbeitsweise +============ + +TrustBridge holt sich regelmäßig über das Internet +neue Vorschlagslisten per HTTPS. Die anzufragenden URLs sind +fest in der Anwendung eingebrannt, wie auch Zertifikate, um +zu prüfen, dass es sich wirklich um den echten Server handelt. + +ZUTUN + + +Wurzelzertifikate +================= +(auch Rootzertifikate genannt) sind die Basis +einer PKI zur Feststellung der Authentizität des +Kommunikationspartners und der Integrität seiner Nachrichten für +verschiedene Anwendungen -- insbesondere bei der Übertragung über +unsichere Kommunikationskanäle, wie dem Internet. + +Ein Wurzelzertifikat dient als Vertrauensanker ("Trust Anchor") für +alle darunter hängenden Zertifikate. Unterhalb der Wurzel folgt eine +Sicherheitskette ("Trust Chain") von ein oder mehreren +Zwischenzertifikaten der Zertifizierungsstellen, gefolgt von den +ausgestellten Zertifikaten für die Anwendungen. Die Zertifikate +sichern per Public-Key-Kryptoverfahren nach dem X.509-v3 Standard +beispielsweise TLS-Verbindungen von Webbrowser zu Webserver (HTTPS) +oder E-Mail-Klient zu E-Mail-Server (IMAPS). Ein weiteres Beispiel ist +die Ende-zu-Ende Absicherung von E-Mail per S/MIME-Standard. diff -r 1c1964c27b39 -r fd85a02d771d manuals/help-manual/bedienung.rst --- a/manuals/help-manual/bedienung.rst Tue Sep 02 14:25:40 2014 +0200 +++ b/manuals/help-manual/bedienung.rst Tue Sep 16 19:45:19 2014 +0200 @@ -13,3 +13,91 @@ :alt: Die TrustBridge-Oberfläche unter Windows bei verfügbaren Zertifikatsänderungen :width: 100% + +Seite "Neue Empfehlungen" +------------------------- + +Neue Zertifikatsänderungen schreiben: +..................................... +Sind neue Zertifikatsaktualisierungen vom BSI verfügbar, werden Sie +über die empfohlenen Änderungen auf dieser Seite informiert. Im Titel +finden Sie die Gesamtanzahl der vorgeschlagenen Zertifikatsänderungen. +Über den Button *[Änderungen schreiben]* können Sie diese Änderungen +vollständig übernehmen. + +Details zu den empfohlenen Zertifikaten (wie z.B. Zertifikatsinhaber, +Gültigkeit, Fingerabdruck) lassen sich im unteren Teil der Seite über +die beiden Gruppierungen mittels der *[Details]* Button einblenden: + +* Neue, empfohlene Wurzelzertifikate installieren (n/n) +* Abgeratene Wurzelzertifikate entfernen (n/n) + +An dieser Stelle haben Sie die Möglichkeit (*vor* dem Schreiben der +Änderungen) ausgewählte Zertifikate "abzuwählen". Dadurch werden diese +Zertifikate *nicht* installiert bzw. entfernt. Solche +Abwahlentscheidungen können Sie später jederzeit wieder auf den Seiten +"Empfohlene Wurzelzertifikate" und "Abgeratene Wurzelzertifikate" +korrigieren. + +Suche nach Aktualisierungen: +............................ +Beim Start der Anwendung wird automatisch nach neuen Aktualisierungen +(Software und Zertifikaten) gesucht. Über den Button *[Aktualisieren]* +kann diese Suche auch manuell angestoßen werden. Der letzte +Suchzeitpunkt wird daneben angezeigt. + +Wurzelzertifikate erneut schreiben: +................................... +Sind alle Zertifikatsänderungen eingespielt und liegen keine +Änderungen vor, können alle von TrustBridge verwalteten Zertifikate +noch einmal installiert werden. Dafür muss auf den Button +*[Wurzelzertifikate erneut schreiben]* geklickt werden. Hilfreich +könnte diese Funktion sein, wenn seit der letzten Aktualisierung durch +TrustBridge im Zertifikatsspeicher *manuell* Zertifikate geändert +wurden. Um den durch TrustBridge empfohlenen Stand wiederherzustellen, +klickt man einmal auf o.g. Schaltfläche. + + +Seite "Empfohlene Wurzelzertifikate" +------------------------------------ +Alle Wurzelzertifikate, die TrustBridge aktuell zur Installation +vorgeschlagen hat, sind auf dieser Seite einsehbar. Jedes Zertifikat +kann einzeln "abgewählt" werden, d.h. es wird mit der nächsten +*[Änderungen schreiben]*-Aktion entfernt. Bereits "abgewählte" +Zertifikate können analog so zur Installation markiert werden. + +Jede manuelle Änderung, die Sie hier vornehmen, wird auf der Seite +"Neue Empfehlungen" aufgelistet. Die Anzahl der "abweichend zu +behandelnden Wurzelzertifikate" wird auch auf der Schaltfläche "Neue +Empfehlungen" im roten Kreis angezeigt. + +**Achtung:** TrustBridge zeigt *nicht* den tatsächlichen +Installationszustand eines Zertifikats im Zertifikatsspeicher an. +TrustBridge selbst kann nur ausgewählte Zertifikate in alle +Zertifikatsspeicher "einspielen". Eine Kontrolle, dass in der +Zwischenzeit diese Zertifikate nicht verändert wurden, kann +TrustBridge nicht geben. + + +Seite "Abgeratene Wurzelzertifikate" +------------------------------------ +Alle Wurzelzertifikate, die TrustBridge zur Deinstallation +vorgeschlagen hat, werden auf dieser Seite aufgelistet. Bereits +deinstallierte Zertifikate lassen sich mit TrustBridge nicht mehr +installieren. + +Sollten Sie Zertifikate bei der Aktualisierung "zurückgehalten" haben, +d.h. noch nicht zur Deinstallation freigegeben haben, können Sie das +Zertifikat über das Auswahlfeld zur Deinstallation markieren. Damit +das Zertifikat endgültig aus allen Zertifikatsspeichern gelöscht wird +müssen Sie anschließend den *[Änderungen schreiben]*-Button auf der +Seite "Neue Empfehlungen" bestätigen. + + +Seite "Information und Hilfe" +----------------------------- +Neben der Erwähnung von Herstellers und Lizenz von TrustBridge finden +Sie hier die Möglichkeit: + +* diese TrustBridge-Hilfe zu starten und +* die Proxy-Server-Einstellungen vorzunehmen. diff -r 1c1964c27b39 -r fd85a02d771d manuals/help-manual/conf.py --- a/manuals/help-manual/conf.py Tue Sep 02 14:25:40 2014 +0200 +++ b/manuals/help-manual/conf.py Tue Sep 16 19:45:19 2014 +0200 @@ -41,7 +41,7 @@ # General information about the project. project = u'TrustBridge-Hilfe' -copyright = u'2014, BSI' +#copyright = u'' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -111,7 +111,7 @@ html_title = 'TrustBridge-Hilfe' # A shorter title for the navigation bar. Default is the same as html_title. -html_short_title = 'Home' +#html_short_title = 'Home' # The name of an image file (relative to this directory) to place at the top # of the sidebar. diff -r 1c1964c27b39 -r fd85a02d771d manuals/help-manual/faq.rst --- a/manuals/help-manual/faq.rst Tue Sep 02 14:25:40 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,170 +0,0 @@ -================================ -Frequently Asked Questions (FAQ) -================================ - - -Welche Zertifikatsspeicher werden verwendet? -============================================ - -Damit Zertifikaten in Anwendungen (wie z.B. Browser oder E-Mail-Klient) -vertraut werden kann, müssen die zugehörigen Wurzelzertifikate in den passenden -Zertifikatsspeichern des Systems installiert werden. -TrustBridge übernimmt diese Zugriff auf die Zertifikatsspeicher. - -Es gibt zwei gängige Zertifikatsspeicher, die von TrustBridge und den meisten -Anwendungen unterstützt werden: - -* der Mozilla NSS-Zertifikatsspeicher ("Network Security Services") und -* der Windows-System-Zertifikatsspeicher. - - -Chrome bzw. Chromium verwendet unter Windows den Windows-System-Speicher und unter -Ubuntu den NSS-Zertifikatsspeicher. Die nachfolgende Abbildung veranschaulicht -die verwendeten Zertifikatsspeicher unter Windows und GNU/Linux. - -.. figure:: _static/stores.png - :width: 100% - :alt: Übersicht der Zertifikatsspeicher - - *Abbildung 1: Übersicht der Zertifikatsspeicher* - -Windows-Zertifikatsspeicher ---------------------------- - -Der Windows 7 und 8 Zertifikatsspeicher kann in drei große Gruppen aufgeteilt werden: - -#. Zertifikate des aktuellen Benutzers -#. Zertifikate für alle Benutzer (Lokaler Computer) -#. Zertifikate für Systemdienste - -Diese Gruppen unterteilen sich wieder in eine Reihe von logischen Speichern. - -Für die Installation von vertrauenswürdigen Wurzelzertifikaten ist der -logische *Root*-Speicher relevant. Nur dort eingetragene Zertifikate -werden als *Trust Anchor* (Vertrauensanker) angesehen und zur -Validierung des Vertrauenspfads zu den weiteren Zertifikaten -verwendet. - -Der logische *Disallowed*-Speicher hat immer Vorrang. Befindet sich ein Zertifikat -sowohl im *Root* als auch im *Disallowed*-Speicher, gilt es als nicht vertrauenswürdig. - - -**Einschränkungen:** -Um unbefugte Manipulationen am Zertifikatsspeicher zu verhindern, werden von Microsoft -seit Windows XP SP2 folgende Schutzmaßnahmen vorgesehen: - -#. Um Zertifikate für alle Benutzer des lokalen Computers zu - bearbeiten, sind erhöhte Privilegien (Administrationsrechte) - erforderlich. -#. Änderungen (Löschen / Hinzufügen von Zertifikaten) am - *Root*-Speicher des aktuellen Nutzers erfordern die explizite - Einwilligung des Nutzers (siehe nachfolgende Abbildung), sofern der - Prozess keine erhöhten Privilegien besitzt. - - -.. figure:: _static/sicherheitswarnung.png - :alt: Windows-Sicherheitswarnung - - *Abbildung 2: Sicherheitswarnung beim Hinzufügen eines Wurzelzertifikats ohne Administrator-Rechte* - - - -Mozilla NSS-Zertifikatsspeicher -------------------------------- -Die Mozilla-Anwendungen Thunderbird und Firefox, sowie Chromium unter -Ubuntu, verwenden die Mozilla "Network Security -Services" (NSS) Zertifikatsspeicher. - -Mozilla liefert den NSS-Zertifikatsspeicher mit einer Auswahl von -voreingesetllten vertrauenswürdigen bzw. nicht -vertrauenswürdigen Zertifikaten aus. - -**Einschränkungen:** - -* Anwendungen, die den NSS-Zertifikatsspeicher verwenden, sollten vor dem Zugriff geschlossen - werden. -* Um den NSS-Speicher anderer Nutzer zu manipulieren, sind erhöhte Rechte nötig. -* Um den NSS-Standard für neue Profile vorzugeben, sind abhängig vom Installationsort - ggf. erhöhte Rechte nötig. - - - -Wie wird der Transport abgesichert? -=================================== -TrustBridge sucht regelmäßig (alle 24 Stunden) auf dem offiziellen TrustBridge-Update-Server -nach aktualisierten Zertifikatslisten und neuen Softwareversionen. - -Sämtliche Transportprozesse sind kryptografisch nach aktuellem Stand -der Technik gegen unbefugte Manipulationen (Authentizität und -Integrität) gesichert. Es gibt drei Transportwege, die abgesichert -werden müssen: - -#. Verfügbarkeit von Aktualisierungen prüfen: - Die regelmäßige Übertragung der Information, ob neue Aktualisierungen - von Zertifiaktsliste oder Software verfügbar sind, wird über eine - HTTPS-Verbindung per TLS 1.2 (mit ECDSA brainpoolP256r1) durchgeführt. -#. Zertifikatslisten-Update durchführen: - Ist eine neue Zertifikatsliste verfügbar, wird die ganze Liste - gebündelt übertragen. Die Zertifikatslistendatei ist signiert (RSA 3076). - Vor einem Zertifikatslisten-Update wird sichergestellt, dass TrustBridge bereits in der - neusten Version installiert ist. -#. Software-Update durchführen: - Ist eine neue TrustBridge-Version verfügbar, kann diese mit einem - Klick auf eine entsprechende Meldung heruntergeladen und installiert - werden. Es wird eine vollständige TrustBridge-Installationsdatei übertragen - und im Hintergrund ausgeführt. Jede Software-Installationsdatei ist signiert. - Bei Fehlschlagen der Signaturprüfung (z.B. durch fehlerhaftes - Herunterladen) wird TrustBridge nicht aktualisiert. - - - -Wie sieht das Datenformat einer Zertifikatsliste aus? -===================================================== - -Die Zertifikatsliste ist eine einzelne Text-Datei, welche von der -TrustBridge-Verwaltungsanwendung erzeugt wird. Diese Datei enthält -alle benötigten Informationen und basiert auf einer zeilenbasierten -Textformat. Dabei bleibt die Struktur für Menschen lesbar und die -meisten Inhalte können mit Standardwerkzeugen sowohl de- als auch -enkodiert werden. - -In der ersten Zeile der Datei ist die Base64-kodierte, kryptografische -Signatur über alle folgenden Zeilen (inklusive der Zeilenenden) -angegeben. So wird die Integrität und Authentizität dieser Daten vor -der Verarbeitung gesichert. - -Einzelne Zeilen haben das Format ``:``, wobei -der Buchstabe angibt, welche Art von Wert folgt. Die Länge der Zeilen -ist (für Version 1) auf 9999 Zeichen begrenzt, inklusive der beiden -Zeichen für Zeilenenden. Die Anzahl der Zeilen ist auf 1000 -beschränkt, was einer Dateigröße von maximal 10 Megabyte entspricht. -(In der Praxis wird die Dateigröße aber deutlich unter 100 Kilobyte -liegen.) Der Text wird in 7Bit-ASCII kodiert. - -Die Zertifikate selbst werden als Base64- und DER-kodierte Daten -aufgeführt. Dies entspricht dem Inhalt gängiger .pem-Dateien - jedoch -ohne den umschließenden BEGIN CERTIFICATE und END CERTIFICATE sowie -ohne den Zeilenumbrüchen. - -Jede Zeile muss mit einem der folgenden gültigen Buchstaben beginnen: - -* ``S:`` Die Signatur der Zertifikatsliste. -* ``F:`` Format-Version -* ``D:`` Zeitpunkt der Listenerstellen (UTC) -* ``I:`` Zu installierendes Zertifikat -* ``R:`` Zu entfernendes Zertifikat - - -Im Folgenden ein Beispiel für den Aufbau der Zertifikatslisten-Datei -mit zwei zu installierenden Zertifikaten und einem zu löschenden -Zertifikat. Die Signatur- und Zertifikatszeilen sind, aus Gründen der -Übersichtlichkeit, in diesem Beispiel gekürzt: - -.. parsed-literal:: - S:EjzX0sTkstnnGbPIC7n1a5WlYCFsthPl8OYplLyihR1RdqcUsSnikrVowFo8QgpMutcz0... - F:1 - D:2014-01-03T12:30Z - I:MIIEiTCCA3GgAwIBAgIDAWn+MA0GCSqGSIb3DQBQUAMEAxCzAJBVBAYTAlVTMRcwFQYDV... - I:MIIHojCCBoqgAwIBAgIDAW96MA0GCSqGSIb3DQEBBQUAGMMQswCDVQQGEwJJTDEWMBQGA... - R:MIIGUjCCBTqgAwIBAgIODocAAQACqS54FrSbGvYwDQKoZIhvcNAQBQAwfDELMAkGA1UEB... - diff -r 1c1964c27b39 -r fd85a02d771d manuals/help-manual/index.rst --- a/manuals/help-manual/index.rst Tue Sep 02 14:25:40 2014 +0200 +++ b/manuals/help-manual/index.rst Tue Sep 16 19:45:19 2014 +0200 @@ -1,55 +1,60 @@ -Was ist TrustBridge? -==================== - -TrustBridge ist eine Anwendung vom `Bundesamt für Sicherheit in der Informationstechnik (BSI) `_ für die Verbreitung von empfohlenen Wurzelzertifikaten. - -TrustBridge macht es Nutzern einfacher, Wurzelzertifikate für eine -X.509-basierende, öffentliche Zertifikatsinfrastruktur (PKI) -einzuspielen und aktuell zu halten. TrustBridge verteilt -Wurzelzertifikate, welche von den Betriebssystemen und Webbrowsern -nicht mitgeliefert werden. Existierende Zertifikate, die korrumpiert -oder missbraucht wurden, können von TrustBridge über eine Deinstallations-Empfehlung -entfernt werden. Dabei ist unerheblich, ob die -Zertifikate auf der Anwenderebene vorher bereits installiert waren. - -**Wurzelzertifikate** (auch Rootzertifikate genannt) sind die Basis einer PKI zur Feststellung der -Authentizität des Kommunikationspartners und der Integrität seiner -Nachrichten für verschiedene Anwendungen -- insbesondere bei der -Übertragung über unsichere Kommunikationskanäle, wie dem Internet. - -Ein Wurzelzertifikat dient als Vertrauensanker -("Trust Anchor") für alle darunter hängenden Zertifikate. Unterhalb -der Wurzel folgt eine Sicherheitskette ("Trust Chain") von ein oder -mehreren Zwischenzertifikaten der Zertifizierungsstellen, gefolgt von -den ausgestellten Zertifikaten für die Anwendungen. Die Zertifikate -sichern per Public-Key-Kryptoverfahren nach dem X.509-v3 Standard -beispielsweise TLS-Verbindungen von Webbrowser zu Webserver (HTTPS) -oder E-Mail-Klient zu E-Mail-Server (IMAPS). Ein weiteres Beispiel ist -die Ende-zu-Ende Absicherung von E-Mail per S/MIME-Standard. - - -Über diese Hilfe -================ -Diese Hilfe unterstützt Sie bei der Bedienung von TrustBridge |version| sowie -vermittelt Ihnen ein beseres Verständnis was die Anwendung macht und -wofür das gut ist. Die Hilfeseiten im Überblick: +Inhaltsverzeichnis +================== .. toctree:: :maxdepth: 2 installation bedienung - faq + arbeitsweise + techn-referenz + + +Was ist TrustBridge? +==================== +TrustBridge erleichtert Ihnen das Einpflegen von Wurzelzertifikaten +zur Absicherung von Kommunikation durch Verschlüsselung und Signaturen. +Dazu holt sich TrustBridge regelmäßig die Wurzelzertifikate, +welche von einer zentralen Stelle vorgeschlagen werden und bietet +Sie Ihnen zum Einfügen in den Zertifikatspeicher Ihres Rechners an. + +Über TrustBridge werden üblicherweise nur Zertifikate verteilt, +welche von Ihrem Betriebssystem nicht mitgeliefert werden. Sie können sich +dafür entscheiden nur einen Teil der Wurzelzertifikate zu übernehmen. +TrustBridge respektiert Ihre bisherigen Wurzelzertifikatsentscheidungen. + +Wenn ein früher vorschlagenes Wurzelzertifikat lange in Benutzung war +oder ein Problem damit bekannt wurde, empfiehlt TrustBridge +es wieder zu entfernen. Auch für diese Änderung holt sich TrustBridge +erst Ihre Erlaubnis. + +Wurzelzertifikate verwalten den Zugang zu Ihren Daten. +Verwenden Sie TrustBridge deshalb nur, wenn Sie der Organisation +vertrauen von der Sie die Software erhalten +und welche die Wurzelzertifikatsvorschläge pflegt. + +TrustBridge arbeitet im Hintergrund und meldet sich +bei Ihnen, wenn es etwas Neues gibt. + +TrustBridge ist eine Anwendung vom `Bundesamt für Sicherheit in der +Informationstechnik (BSI) `_ für die Verbreitung +von empfohlenen Wurzelzertifikaten. + +TrustBridge macht es Nutzern einfacher, Wurzelzertifikate für eine +X.509-basierende, öffentliche Zertifikatsinfrastruktur (PKI) +einzuspielen und aktuell zu halten. + Impressum ========= -Copyright 2014 Die Rechte liegen beim `Bundesamt für Sicherheit in der Informationstechnik (BSI) `_. +Ausgabe 2014, Die Rechte liegen beim `Bundesamt für Sicherheit in der +Informationstechnik (BSI) `_. TrustBridge wurde von den Unternehmen `Intevation GmbH `_ und `DN-Systems GmbH -`_ entwickelt, im Auftrag vom BSI. +`_ entwickelt, im Auftrag des BSIs. Diese TrustBridge-Hilfe ist unter der `Creative Commons CC BY-SA 3.0 `_ lizensiert. diff -r 1c1964c27b39 -r fd85a02d771d manuals/help-manual/installation.rst --- a/manuals/help-manual/installation.rst Tue Sep 02 14:25:40 2014 +0200 +++ b/manuals/help-manual/installation.rst Tue Sep 16 19:45:19 2014 +0200 @@ -48,8 +48,8 @@ Für die Installation von TrustBridge unter Ubuntu wird ein interaktives Installationsskript für die Kommandozeile angeboten - jeweils ein Script für 32 und 64 Bit-Systeme. -Führen Sie das Skript ohne Option aus, um Trustbridge **lokal** in Ihrem Home-Verzeichnis zu installieren -(standardmäßg unter ``/home/TrustBridge/``). +Führen Sie das Skript ohne Option aus, um TrustBridge **lokal** in Ihrem Home-Verzeichnis zu installieren +(standardmäßig unter ``/home/TrustBridge/``). Für 64-Bit-Systeme: diff -r 1c1964c27b39 -r fd85a02d771d manuals/help-manual/techn-referenz.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/manuals/help-manual/techn-referenz.rst Tue Sep 16 19:45:19 2014 +0200 @@ -0,0 +1,170 @@ +=================== +Technische Referenz +=================== + + +Welche Zertifikatsspeicher werden verwendet? +============================================ + +Damit Zertifikaten in Anwendungen (wie z.B. Browser oder E-Mail-Klient) +vertraut werden kann, müssen die zugehörigen Wurzelzertifikate in den passenden +Zertifikatsspeichern des Systems installiert werden. +TrustBridge übernimmt diesen Zugriff auf die Zertifikatsspeicher. + +Es gibt zwei gängige Zertifikatsspeicher, die von TrustBridge und den meisten +Anwendungen unterstützt werden: + +* der Mozilla NSS-Zertifikatsspeicher ("Network Security Services") und +* der Windows-System-Zertifikatsspeicher. + + +Chrome bzw. Chromium verwendet unter Windows den Windows-System-Speicher und unter +Ubuntu den NSS-Zertifikatsspeicher. Die nachfolgende Abbildung veranschaulicht +die verwendeten Zertifikatsspeicher unter Windows und GNU/Linux. + +.. figure:: _static/stores.png + :width: 100% + :alt: Übersicht der Zertifikatsspeicher + + *Abbildung 1: Übersicht der Zertifikatsspeicher* + +Windows-Zertifikatsspeicher +--------------------------- + +Der Windows 7 und 8 Zertifikatsspeicher kann in drei große Gruppen aufgeteilt werden: + +#. Zertifikate des aktuellen Benutzers +#. Zertifikate für alle Benutzer (Lokaler Computer) +#. Zertifikate für Systemdienste + +Diese Gruppen unterteilen sich wieder in eine Reihe von logischen Speichern. + +Für die Installation von vertrauenswürdigen Wurzelzertifikaten ist der +logische *Root*-Speicher relevant. Nur dort eingetragene Zertifikate +werden als *Trust Anchor* (Vertrauensanker) angesehen und zur +Validierung des Vertrauenspfads zu den weiteren Zertifikaten +verwendet. + +Der logische *Disallowed*-Speicher hat immer Vorrang. Befindet sich ein Zertifikat +sowohl im *Root* als auch im *Disallowed*-Speicher, gilt es als nicht vertrauenswürdig. + + +**Einschränkungen:** +Um unbefugte Manipulationen am Zertifikatsspeicher zu verhindern, werden von Microsoft +seit Windows XP SP2 folgende Schutzmaßnahmen vorgesehen: + +#. Um Zertifikate für alle Benutzer des lokalen Computers zu + bearbeiten, sind erhöhte Privilegien (Administrationsrechte) + erforderlich. +#. Änderungen (Löschen / Hinzufügen von Zertifikaten) am + *Root*-Speicher des aktuellen Nutzers erfordern die explizite + Einwilligung des Nutzers (siehe nachfolgende Abbildung), sofern der + Prozess keine erhöhten Privilegien besitzt. + + +.. figure:: _static/sicherheitswarnung.png + :alt: Windows-Sicherheitswarnung + + *Abbildung 2: Sicherheitswarnung beim Hinzufügen eines Wurzelzertifikats ohne Administrator-Rechte* + + + +Mozilla NSS-Zertifikatsspeicher +------------------------------- +Die Mozilla-Anwendungen Thunderbird und Firefox, sowie Chromium unter +Ubuntu, verwenden die Mozilla "Network Security +Services" (NSS) Zertifikatsspeicher. + +Mozilla liefert den NSS-Zertifikatsspeicher mit einer Auswahl von +voreingesetllten vertrauenswürdigen bzw. nicht +vertrauenswürdigen Zertifikaten aus. + +**Einschränkungen:** + +* Anwendungen, die den NSS-Zertifikatsspeicher verwenden, sollten vor dem Zugriff geschlossen + werden. +* Um den NSS-Speicher anderer Nutzer zu manipulieren, sind erhöhte Rechte nötig. +* Um den NSS-Standard für neue Profile vorzugeben, sind abhängig vom Installationsort + ggf. erhöhte Rechte nötig. + + + +Wie wird der Transport abgesichert? +=================================== +TrustBridge sucht regelmäßig (alle 24 Stunden) auf dem offiziellen TrustBridge-Update-Server +nach aktualisierten Zertifikatslisten und neuen Softwareversionen. + +Sämtliche Transportprozesse sind kryptografisch nach aktuellem Stand +der Technik gegen unbefugte Manipulationen (Authentizität und +Integrität) gesichert. Es gibt drei Transportwege, die abgesichert +werden müssen: + +#. Verfügbarkeit von Aktualisierungen prüfen: + Die regelmäßige Übertragung der Information, ob neue Aktualisierungen + von Zertifikatsliste oder Software verfügbar sind, wird über eine + HTTPS-Verbindung per TLS 1.2 (mit ECDSA brainpoolP256r1) durchgeführt. +#. Zertifikatslisten-Update durchführen: + Ist eine neue Zertifikatsliste verfügbar, wird die ganze Liste + gebündelt übertragen. Die Zertifikatslistendatei ist signiert (RSA 3076). + Vor einem Zertifikatslisten-Update wird sichergestellt, dass TrustBridge bereits in der + neusten Version installiert ist. +#. Software-Update durchführen: + Ist eine neue TrustBridge-Version verfügbar, kann diese mit einem + Klick auf eine entsprechende Meldung heruntergeladen und installiert + werden. Es wird eine vollständige TrustBridge-Installationsdatei übertragen + und im Hintergrund ausgeführt. Jede Software-Installationsdatei ist signiert. + Bei Fehlschlagen der Signaturprüfung (z.B. durch fehlerhaftes + Herunterladen) wird TrustBridge nicht aktualisiert. + + + +Wie sieht das Datenformat einer Zertifikatsliste aus? +===================================================== + +Die Zertifikatsliste ist eine einzelne Text-Datei, welche von der +TrustBridge-Verwaltungsanwendung erzeugt wird. Diese Datei enthält +alle benötigten Informationen und basiert auf einer zeilenbasierten +Textformat. Dabei bleibt die Struktur für Menschen lesbar und die +meisten Inhalte können mit Standardwerkzeugen sowohl de- als auch +enkodiert werden. + +In der ersten Zeile der Datei ist die Base64-kodierte, kryptografische +Signatur über alle folgenden Zeilen (inklusive der Zeilenenden) +angegeben. So wird die Integrität und Authentizität dieser Daten vor +der Verarbeitung gesichert. + +Einzelne Zeilen haben das Format ``:``, wobei +der Buchstabe angibt, welche Art von Wert folgt. Die Länge der Zeilen +ist (für Version 1) auf 9999 Zeichen begrenzt, inklusive der beiden +Zeichen für Zeilenenden. Die Anzahl der Zeilen ist auf 1000 +beschränkt, was einer Dateigröße von maximal 10 Megabyte entspricht. +(In der Praxis wird die Dateigröße aber deutlich unter 100 Kilobyte +liegen.) Der Text wird in 7Bit-ASCII kodiert. + +Die Zertifikate selbst werden als Base64- und DER-kodierte Daten +aufgeführt. Dies entspricht dem Inhalt gängiger .pem-Dateien - jedoch +ohne den umschließenden BEGIN CERTIFICATE und END CERTIFICATE sowie +ohne den Zeilenumbrüchen. + +Jede Zeile muss mit einem der folgenden gültigen Buchstaben beginnen: + +* ``S:`` Die Signatur der Zertifikatsliste. +* ``F:`` Format-Version +* ``D:`` Zeitpunkt der Listenerstellen (UTC) +* ``I:`` Zu installierendes Zertifikat +* ``R:`` Zu entfernendes Zertifikat + + +Im Folgenden ein Beispiel für den Aufbau der Zertifikatslisten-Datei +mit zwei zu installierenden Zertifikaten und einem zu löschenden +Zertifikat. Die Signatur- und Zertifikatszeilen sind, aus Gründen der +Übersichtlichkeit, in diesem Beispiel gekürzt: + +.. parsed-literal:: + S:EjzX0sTkstnnGbPIC7n1a5WlYCFsthPl8OYplLyihR1RdqcUsSnikrVowFo8QgpMutcz0... + F:1 + D:2014-01-03T12:30Z + I:MIIEiTCCA3GgAwIBAgIDAWn+MA0GCSqGSIb3DQBQUAMEAxCzAJBVBAYTAlVTMRcwFQYDV... + I:MIIHojCCBoqgAwIBAgIDAW96MA0GCSqGSIb3DQEBBQUAGMMQswCDVQQGEwJJTDEWMBQGA... + R:MIIGUjCCBTqgAwIBAgIODocAAQACqS54FrSbGvYwDQKoZIhvcNAQBQAwfDELMAkGA1UEB... + diff -r 1c1964c27b39 -r fd85a02d771d packaging/CMakeLists.txt --- a/packaging/CMakeLists.txt Tue Sep 02 14:25:40 2014 +0200 +++ b/packaging/CMakeLists.txt Tue Sep 16 19:45:19 2014 +0200 @@ -9,14 +9,15 @@ # Build the nss safer plugin. include_directories(${CMAKE_SOURCE_DIR}/common) - add_library(saferrunas SHARED safer_run_as.c) - target_link_libraries(saferrunas + add_library(desktopshellrun SHARED desktopshellrun.cpp) + target_link_libraries(desktopshellrun trustbridge_common -luserenv -lshell32 -lcrypt32 -lssp + -lshlwapi ${POLARSSL_LIBRARIES}) # trustbridge_common pulls it in. - set_target_properties(saferrunas PROPERTIES PREFIX "") - set_target_properties(saferrunas PROPERTIES OUTPUT_NAME "SaferRunAs") + set_target_properties(desktopshellrun PROPERTIES PREFIX "") + set_target_properties(desktopshellrun PROPERTIES OUTPUT_NAME "DesktopShellRun") endif() diff -r 1c1964c27b39 -r fd85a02d771d packaging/desktopshellrun.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/packaging/desktopshellrun.cpp Tue Sep 16 19:45:19 2014 +0200 @@ -0,0 +1,326 @@ +/* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU GPL (v>=2) + * and comes with ABSOLUTELY NO WARRANTY! + * See LICENSE.txt for details. + */ + +/** + * @file tasksched_run_as.cpp + * @brief Run a command with the Task Scheduler API + * + * This effectively starts a program as the user regardles of the current + * process token. + */ +#include +#include "logging.h" +#include "strhelp.h" + +#ifndef INITGUID +#define INITGUID +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +/* Some declarations missing in mingw-w64 3.1.0 taken from msdn */ + +__CRT_UUID_DECL(IShellWindows, 0x85CB6900, 0x4D95, 0x11CF, + 0x96, 0x0C, 0x00, 0x80, 0xC7, 0xF4, 0xEE, 0x85); + +DEFINE_GUID(IID_IShellWindows, + 0x85CB6900, 0x4D95, 0x11CF, + 0x96, 0x0C, 0x00, 0x80, 0xC7, 0xF4, 0xEE, 0x85); +DEFINE_GUID(CLSID_ShellWindows, + 0x9BA05972, 0xF6A8, 0x11CF, + 0xA4, 0x42, 0x00, 0xA0, 0xC9, 0x0A, 0x8F, 0x39); + + +__CRT_UUID_DECL(IShellDispatch2, 0xA4C6892C, 0x3BA9, 0x11d2, + 0x9D, 0xEA, 0x00, 0xC0, 0x4F, 0xB1, 0x61, 0x62); +__CRT_UUID_DECL(IShellFolderViewDual, 0xe7a1af80, 0x4d96, + 0x11cf, 0x96, 0x0c, 0x00, 0x80, 0xc7, 0xf4, 0xee, 0x85); + +#ifndef SWC_DESKTOP /* Will probably be addedd in future mingw */ +#define SWC_DESKTOP 0x00000008 +/* from http://msdn.microsoft.com/en-us/library/windows/desktop/cc836581%28v=vs.85%29.aspx */ +#endif + +#undef INITGUID + +#ifdef DO_RELEASE_BUILD +bool g_debug = false; +#else +bool g_debug = true; +#endif + +typedef struct _stack_t +{ + struct _stack_t *next; + char text[1]; /* This should be the length of string_size. */ +} stack_t; + +static HINSTANCE g_hInstance; /* Our Instance. */ + +#define UNUSED(x) (void)(x) + +/** @brief the actual execuation call on the shell dispatcher + * + * @param[in] disp The shell dispatcher to use for shell execute. + * @param[in] fName The file that should be exectued. + * + * @returns true on success. + */ +static bool +shellexecute(IShellDispatch2 *disp, wchar_t *fName) +{ + BSTR bName = NULL, + bParam = NULL, + bDir = NULL, + bOp = NULL; + VARIANT vParams[4]; + HRESULT hr; + + if (!fName || !disp) + { + ERRORPRINTF ("Invalid call to shellexecute."); + return false; + } + + bName = SysAllocString(fName); + bParam = SysAllocString(L""); + bDir = SysAllocString(L""); + bOp = SysAllocString(L""); + + if (!bName || !bParam || !bDir || !bOp) + { + /* Out of memory */ + ERRORPRINTF ("Failed to allocate bstr values "); + return false; + } + + vParams[0].vt = VT_BSTR; + vParams[0].bstrVal = bParam; + vParams[1].vt = VT_BSTR; + vParams[1].bstrVal = bDir; + vParams[2].vt = VT_BSTR; + vParams[2].bstrVal = bOp; + vParams[3].vt = VT_INT; + vParams[3].intVal = SW_SHOWNORMAL; + + hr = disp->ShellExecute(bName, vParams[0], vParams[1], vParams[2], vParams[3]); + + SysFreeString(bName); + SysFreeString(bParam); + SysFreeString(bOp); + SysFreeString(bDir); + + if (FAILED(hr)) + { + ERRORPRINTF ("Failed to execute."); + return false; + } + return true; +} + +#ifdef __cplusplus +extern "C" { +#endif + +/* Standard entry point for DLLs. */ +int WINAPI +DllMain (HANDLE hinst, DWORD reason, LPVOID reserved) +{ + UNUSED(reserved); + if (reason == DLL_PROCESS_ATTACH) + g_hInstance = (HINSTANCE)hinst; + return TRUE; +} + +/** @brief Execute a command with the current running shell. + * + * This function is intended to be called when you want to + * make sure that your application is not executed with higher + * privileges then the normal desktop session. + * + * The code is based on the idea: + * http://blogs.msdn.com/b/oldnewthing/archive/2013/11/18/10468726.aspx + * + * The function signature is explained by NSIS. + */ +void __declspec(dllexport) __cdecl Exec(HWND hwndParent, + int string_size, + char *variables, + stack_t **stacktop) +{ + UNUSED(hwndParent); + UNUSED(string_size); + HRESULT hr; + wchar_t *wbuf = NULL; + IShellWindows *shellWindows = NULL; + IShellBrowser *shellBrowser = NULL; + IShellView *shellView = NULL; + IShellFolderViewDual *folderView = NULL; + IShellDispatch2 *shellDispatch = NULL; + IServiceProvider *serviceProv = NULL; + HWND hwnd; + IDispatch *disp = NULL, + *bgDisp = NULL, + *sDisp = NULL; + VARIANT vEmpty = {}; + + + if (!stacktop || !*stacktop || !(*stacktop)->text) + { + ERRORPRINTF ("Invalid call to exec :"); + return; + } + + /* Initialize com ctx */ + hr = CoInitialize(NULL); + if(FAILED(hr)) + { + ERRORPRINTF ("CoInitializeEx failed. error = 0x%lx.", hr); + return; + } + + /* Get the shell interface */ + hr = CoCreateInstance(CLSID_ShellWindows, + NULL, CLSCTX_LOCAL_SERVER, + IID_PPV_ARGS(&shellWindows)); + if (FAILED(hr)) + { + ERRORPRINTF ("Failed to get shell interface."); + goto done; + } + + /* Get the desktop shell window */ + hr = shellWindows->FindWindowSW(&vEmpty, + &vEmpty, + SWC_DESKTOP, + (long*)&hwnd, + SWFO_NEEDDISPATCH, + &disp); + if (FAILED(hr)) + { + ERRORPRINTF ("Failed to find the desktop dispatcher."); + goto done; + } + + hr = disp->QueryInterface(IID_PPV_ARGS(&serviceProv)); + + if (FAILED(hr)) + { + ERRORPRINTF ("Failed to get the service provider."); + goto done; + } + + /* Get the shell browser */ + hr = serviceProv->QueryService(SID_STopLevelBrowser, IID_PPV_ARGS(&shellBrowser)); + if (FAILED(hr)) + { + ERRORPRINTF ("Failed to find the top level browser."); + goto done; + } + + hr = shellBrowser->QueryActiveShellView(&shellView); + + if (FAILED(hr)) + { + ERRORPRINTF ("Failed to find the active view."); + goto done; + } + + hr = shellView->GetItemObject(SVGIO_BACKGROUND, IID_PPV_ARGS(&bgDisp)); + + if (FAILED(hr)) + { + ERRORPRINTF ("Failed to get the views background."); + goto done; + } + + hr = bgDisp->QueryInterface(IID_PPV_ARGS(&folderView)); + + if (FAILED(hr)) + { + ERRORPRINTF ("Failed to get the folder view."); + goto done; + } + + + hr = folderView->get_Application(&sDisp); + + if (FAILED(hr)) + { + ERRORPRINTF ("Failed to get the shell dispatch."); + goto done; + } + + hr = sDisp->QueryInterface(IID_PPV_ARGS(&shellDispatch)); + + if (FAILED(hr)) + { + ERRORPRINTF ("Failed to get the shell dispatch interface."); + goto done; + } + + wbuf = utf8_to_wchar((*stacktop)->text, strlen((*stacktop)->text)); + if (!wbuf) + { + ERRORPRINTF ("Failed to convert argument to wchar. error = 0x%lx.", hr); + goto done; + } + + if (!shellexecute(shellDispatch, wbuf)) + { + ERRORPRINTF ("Failed to execute."); + } + xfree (wbuf); +done: + if (folderView) + { + folderView->Release(); + } + if (disp) + { + disp->Release(); + } + if (shellBrowser) + { + shellBrowser->Release(); + } + if (shellWindows) + { + shellWindows->Release(); + } + if (shellView) + { + shellView->Release(); + } + if (sDisp) + { + sDisp->Release(); + } + if (shellDispatch) + { + shellDispatch->Release(); + } + if (serviceProv) + { + serviceProv->Release(); + } + CoUninitialize(); + return; +} +#ifdef __cplusplus +} +#endif + + diff -r 1c1964c27b39 -r fd85a02d771d packaging/exdll.h --- a/packaging/exdll.h Tue Sep 02 14:25:40 2014 +0200 +++ b/packaging/exdll.h Tue Sep 16 19:45:19 2014 +0200 @@ -1,4 +1,4 @@ -/* exdll.h for use with gpg4win +/* exdll.h for use with TrustBrdige * Copyright (C) 1999-2005 Nullsoft, Inc. * * This license applies to everything in the NSIS package, except @@ -25,6 +25,7 @@ ************************************************************ * 2005-11-14 wk Applied license text to orginal exdll.h file from * NSIS 2.0.4 and did some formatting changes. + * 2014-09-16 ah Stripped out uneccesary stuff for TrustBridge plugin */ #ifndef _EXDLL_H_ @@ -33,74 +34,6 @@ /* only include this file from one place in your DLL. (it is all static, if you use it in two places it will fail) */ -#define EXDLL_INIT() { \ - g_stringsize=(unsigned int)string_size; \ - g_stacktop=stacktop; \ - g_variables=variables; } - /* For page showing plug-ins */ -#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8) -#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd) -#define NOTIFY_BYE_BYE 'x' - -typedef struct _stack_t { - struct _stack_t *next; - char text[1]; /* This should be the length of string_size. */ -} stack_t; - - -static unsigned int g_stringsize; -static stack_t **g_stacktop; -static char *g_variables; - -enum - { - INST_0, // $0 - INST_1, // $1 - INST_2, // $2 - INST_3, // $3 - INST_4, // $4 - INST_5, // $5 - INST_6, // $6 - INST_7, // $7 - INST_8, // $8 - INST_9, // $9 - INST_R0, // $R0 - INST_R1, // $R1 - INST_R2, // $R2 - INST_R3, // $R3 - INST_R4, // $R4 - INST_R5, // $R5 - INST_R6, // $R6 - INST_R7, // $R7 - INST_R8, // $R8 - INST_R9, // $R9 - INST_CMDLINE, // $CMDLINE - INST_INSTDIR, // $INSTDIR - INST_OUTDIR, // $OUTDIR - INST_EXEDIR, // $EXEDIR - INST_LANG, // $LANGUAGE - __INST_LAST -}; - -typedef struct { - int autoclose; - int all_user_var; - int exec_error; - int abort; - int exec_reboot; - int reboot_called; - int XXX_cur_insttype; /* deprecated */ - int XXX_insttype_changed; /* deprecated */ - int silent; - int instdir_error; - int rtl; - int errlvl; -} exec_flags_t; - -typedef struct { - exec_flags_t *exec_flags; - int (__stdcall *ExecuteCodeSegment)(int, HWND); -} extra_parameters_t; #endif//_EXDLL_H_ diff -r 1c1964c27b39 -r fd85a02d771d packaging/getxt-gen-l10n-array.sh --- a/packaging/getxt-gen-l10n-array.sh Tue Sep 02 14:25:40 2014 +0200 +++ b/packaging/getxt-gen-l10n-array.sh Tue Sep 16 19:45:19 2014 +0200 @@ -1,12 +1,13 @@ -# ------------------------------------------------------------------- -# Copyright (C) 2014 by Intevation GmbH +# Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik +# Software engineering by Intevation GmbH +# +# This file is Free Software under the GNU GPL (v>=2) +# and comes with ABSOLUTELY NO WARRANTY! +# See LICENSE.txt for details. +# # Author(s): # Sascha Wilde -# This program is free software under the GNU GPL (>=v2) -# Read the file COPYING coming with the software for details. -# ------------------------------------------------------------------- - # Extract getxt strings from source and generate an array for usage in # the script using our getxt function. @@ -20,7 +21,7 @@ # If ARRAYFILE exists, values already defined will be preserved, # if the MSGID still exists. -# FIXME: we can't handle quoted quotes: "\"" -- don't use them for +# NOTE: we can't handle quoted quotes: "\"" -- don't use them for # now... declare -a MSGIDS diff -r 1c1964c27b39 -r fd85a02d771d packaging/linux-createpackage.sh.in --- a/packaging/linux-createpackage.sh.in Tue Sep 02 14:25:40 2014 +0200 +++ b/packaging/linux-createpackage.sh.in Tue Sep 16 19:45:19 2014 +0200 @@ -14,6 +14,8 @@ if [ "$ARCH" != "i386" -a "$ARCH" != "x86_64" ]; then echo "Usage $0 " echo "with archtiecture either i386 or x86_64" + echo "defaulting to x86_64" + ARCH=x86_64 fi INSTALLER="@CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.sh" diff -r 1c1964c27b39 -r fd85a02d771d packaging/linux-installer.inc.in --- a/packaging/linux-installer.inc.in Tue Sep 02 14:25:40 2014 +0200 +++ b/packaging/linux-installer.inc.in Tue Sep 16 19:45:19 2014 +0200 @@ -1,4 +1,35 @@ #!/bin/bash +# Um TrustBridge zu installieren: +# 1. Prüfen Sie ob Sie dieser Datei genügend vertrauen, um ihr die Kontrolle +# über diesen Rechner zu übergeben. Beispielsweise durch Vergleich mit +# einer starken Prüfsumme aus einer zweiten, unabhängigen Quelle. +# 2. Öffnen Sie eine Kommandozeile, z.B. klicken Sie auf das "Terminal"-Symbol. +# 3. Wechseln Sie in das Verzeichnis, in welchem diese Datei gespeichert ist. +# Geben Sie Z.B. in die Kommandozeile ein: cd ~/Schreibtisch +# 4. Starten Sie die Anwendung auf der Kommandozeile, beispielsweise +# als Installation nur für den aktuellen Nutzer, indem Sie eingeben: +# bash TrustBridge-1.0.0-i386.sh +# Tipp: Die Tab-Taste nach dem "Tr" ergänzt oft den ganzen Namen. +# +# NB: Wir konnten kein übliches .deb Paket verwenden, da wir Ihnen +# auch die Installation als reiner Nutzer ohne Admin-Rechte ermöglichen. +# +# To install TrustBridge: +# 1. Verify that you trust this specific file far enough, that you are willing +# to hand over the control of your computer to it. For example compare +# a strong checksum of the file to one from a second, independent source. +# 2. Open a command line, e.g. click on the "Terminal"-Symbol. +# 3. Change your working directory to where this file is stored. +# For example type "cd ~/Desktop" on your command line. +# 4. Start the installation on the command line, e.g. for the current user +# only by typing something like "bash TrustBridge-1.0.0-i386.sh". +# Hint: If you press the tab-key after "Tr" it may complete the filename. +# +# N.B. We could not have used a .deb package, because the installation must +# also work without without adminstrator priviledges. +# +# +# Search the file for 'version()' to find the license information. set -u ME=`basename "$0"` @@ -14,6 +45,8 @@ FORCE=0 SYSINST=0 DEINSTALL=0 +UPDATE=0 +SHOWAFTERUPDATE=0 BINNAMES="###BINNAMES###" ICONNAME="###ICONNAME###" HELPNAMES="###HELPNAMES###" @@ -68,9 +101,9 @@ Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH -This is free software. You may redistribute copies of it under the terms of -the GNU GPL (v>=2). See LICENSE.txt for details. -There is NO WARRANTY, to the extent permitted by law. +This file is Free Software under the GNU GPL (v>=2) +and comes with ABSOLUTELY NO WARRANTY! +See LICENSE.txt for details. EOF exit 0 } @@ -123,7 +156,7 @@ parse_args() { OPTS=`getopt \ - -l deinstall,force,help,prefix:,system,version \ + -l deinstall,update,show-after-update,force,help,prefix:,system,version \ -o d,f,p:,s -n "$ME" -- "$@"` [ $? -eq 0 ] || usage 23 @@ -147,6 +180,14 @@ DEINSTALL=1 shift 1 ;; + --update) + UPDATE=1 + shift 1 + ;; + --show-after-update) + SHOWAFTERUPDATE=1 + shift 1 + ;; --help) usage 0 ;; @@ -163,6 +204,11 @@ init_vars() { + if [ -n "${SUDO_USER-}" ] ; then + # Default to system wide installation when running with sudo + SYSINST=1 + fi + if [ $SYSINST -eq 1 ] ; then inst_default_prefix="$SYSDEFAULT_PREFIX" instcfg_path="${SYSCFGPATH}" @@ -175,12 +221,53 @@ instdata_path="${DATAPATH}" autostart_path=${XDG_CONFIG_HOME:-~/.config/autostart} startmenu_path=${XDG_DATA_HOME:-~/.local/share/applications} + if [ $DEINSTALL -eq 1 ] ; then + if [ ! -r ${instcfg_path}/${INSTCFGNAME} ]; then + if [ -r ${SYSCFGPATH}/${INSTCFGNAME} ]; then + # Fall back to system uninstallation if no user config found + SYSINST=1 + init_vars + check_priv + fi + fi + fi fi instcfg_file="${instcfg_path}/${INSTCFGNAME}" extra_bin_path=`mktemp --tmpdir -d tmpbin.XXXXXXXXXX` HOST_ARCH=$(uname -m) } +finished() +{ + echo + echo "#################################################################################" + if [ $SYSINST -eq 1 ]; then + getxt "System wide installation successful.\n" + RUNCMD="su -l $SUDO_USER -c " + else + getxt "Single user installation successful.\n" + RUNCMD="" + fi + getxt "TrustBridge has been installed to: '%s'\n\n" "${instcfg[PREFIX]}" + + getxt "To remove the application and the root certificates it has inserted,\n" + getxt "call the deinstall command:\n" + echo " $RUNCMD ${instcfg[PREFIX]}/bin/trustbridge-deinstall-TODO.sh" + + echo "#################################################################################" + getxt "Press enter to launch '%s'\n" "${instcfg[PREFIX]}/bin/trustbridge" + if [ $UPDATE -eq 0 ]; then + read + $RUNCMD "${instcfg[PREFIX]}/bin/trustbridge" & + else + if [ $SHOWAFTERUPDATE -eq 0 ]; then + $RUNCMD "${instcfg[PREFIX]}/bin/trustbridge" --tray & + else + $RUNCMD "${instcfg[PREFIX]}/bin/trustbridge" & + fi + fi +} + cleanup() { getxt "Cleaning up temporary stuff ...\n" @@ -217,7 +304,7 @@ check_priv() { if [ $SYSINST -eq 1 -a "$UID" -ne 0 ] ; then - fatal "System wide installation requires root privileges!\n" + fatal "System wide installation or deinstallation requires root privileges!\n" fi } @@ -495,8 +582,8 @@ trap cleanup EXIT parse_args "$@" +check_priv init_vars -check_priv read_oldinstcfg cat < -#include "exdll.h" -#include "util.h" -#include "logging.h" - -static HINSTANCE g_hInstance; /* Our Instance. */ -static HWND g_hwndParent; /* Handle of parent window or NULL. */ - -#define UNUSED(x) (void)(x) - -/* Standard entry point for DLLs. */ -int WINAPI -DllMain (HANDLE hinst, DWORD reason, LPVOID reserved) -{ - UNUSED(reserved); - if (reason == DLL_PROCESS_ATTACH) - g_hInstance = hinst; - return TRUE; -} - -void __declspec(dllexport) __cdecl Exec(HWND hwndParent, - int string_size, - char *variables, - stack_t **stacktop) -{ - HANDLE restricted_token = NULL; - STARTUPINFO si; - PROCESS_INFORMATION pi; - - EXDLL_INIT(); - - UNUSED(hwndParent); - UNUSED(g_hwndParent); - - memset(&si, 0, sizeof(STARTUPINFO)); - - if (!stacktop || !*stacktop || !(*stacktop)->text) - { - ERRORPRINTF ("Invalid call to exec\n"); - return; - } - - restricted_token = get_normal_token(); - - if (restricted_token == NULL || restricted_token == INVALID_HANDLE_VALUE) - { - ERRORPRINTF ("Failed to obtain restricted token.\n"); - return; - } - - if (CreateProcessAsUser(restricted_token, - 0, - (*stacktop)->text, - 0, - 0, - FALSE, - CREATE_NEW_CONSOLE, - 0, - 0, - &si, - &pi)) - { - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); - } -} - diff -r 1c1964c27b39 -r fd85a02d771d packaging/trustbridge.nsi --- a/packaging/trustbridge.nsi Tue Sep 02 14:25:40 2014 +0200 +++ b/packaging/trustbridge.nsi Tue Sep 16 19:45:19 2014 +0200 @@ -188,8 +188,7 @@ ; the UI elevated as this could be a security ; problem. Function RunAsUser - SaferRunAs::Exec "cmd.exe" - ;$INSTDIR\trustbridge.exe" + DesktopShellRun::Exec "$INSTDIR\trustbridge.exe" FunctionEnd ;-------------------------------- diff -r 1c1964c27b39 -r fd85a02d771d packaging/win-createpackage.sh.in --- a/packaging/win-createpackage.sh.in Tue Sep 02 14:25:40 2014 +0200 +++ b/packaging/win-createpackage.sh.in Tue Sep 16 19:45:19 2014 +0200 @@ -30,6 +30,7 @@ -Dversion_number=@PROJECT_VERSION@ \ -Dsetupname="$TMPINST" \ -Dproductname="TrustBridge" \ + -Ddescription="TrustBridge" \ -Dpath_sep="/" \ -Dinfo_url="http://wald.intevation.org/projects/trustbridge/" \ -Dsize=$EST_SIZE \ @@ -46,6 +47,7 @@ -Dversion_number=@PROJECT_VERSION@ \ -Dsetupname="@CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.exe" \ -Dproductname="TrustBridge" \ + -Ddescription="TrustBridge" \ -Dpath_sep="/" \ -Dinfo_url="http://wald.intevation.org/projects/trustbridge/" \ -Dsize=$EST_SIZE \ @@ -55,6 +57,6 @@ -key @CMAKE_SOURCE_DIR@/ui/tests/data/codesign/codesigning.key \ -h sha256 -in @CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.exe \ -out @CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@-signed.exe -mv @CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@-signed.exe CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.exe +mv @CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@-signed.exe @CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.exe rm -r $TMPDIR diff -r 1c1964c27b39 -r fd85a02d771d patches/0001-Implement-CURLOPT_SSLVERSION-for-polarssl.patch --- a/patches/0001-Implement-CURLOPT_SSLVERSION-for-polarssl.patch Tue Sep 02 14:25:40 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -From bebf7d617091042828fc5838170b35c42ab60396 Mon Sep 17 00:00:00 2001 -From: Andre Heinecke -Date: Mon, 1 Sep 2014 16:06:03 +0200 -Subject: [PATCH 1/3] Implement CURLOPT_SSLVERSION for polarssl - - Forwards the setting as minimum ssl version to polarssl. - If the server does not support the requested version the - SSL Handshake will fail. ---- - lib/vtls/polarssl.c | 21 +++++++++++++++++++++ - 1 file changed, 21 insertions(+) - -diff --git a/lib/vtls/polarssl.c b/lib/vtls/polarssl.c -index f948486..e18cadf 100644 ---- a/lib/vtls/polarssl.c -+++ b/lib/vtls/polarssl.c -@@ -270,6 +270,27 @@ polarssl_connect_step1(struct connectdata *conn, - return CURLE_SSL_CONNECT_ERROR; - } - -+ if(data->set.ssl.version == CURL_SSLVERSION_SSLv3) { -+ ssl_set_min_version(&connssl->ssl, SSL_MAJOR_VERSION_3, -+ SSL_MINOR_VERSION_0); -+ infof(data, "PolarSSL: Forced min. SSL Version to be SSLv3\n"); -+ } -+ else if(data->set.ssl.version == CURL_SSLVERSION_TLSv1_0) { -+ ssl_set_min_version(&connssl->ssl, SSL_MAJOR_VERSION_3, -+ SSL_MINOR_VERSION_1); -+ infof(data, "PolarSSL: Forced min. SSL Version to be TLS 1.0\n"); -+ } -+ else if(data->set.ssl.version == CURL_SSLVERSION_TLSv1_1) { -+ ssl_set_min_version(&connssl->ssl, SSL_MAJOR_VERSION_3, -+ SSL_MINOR_VERSION_2); -+ infof(data, "PolarSSL: Forced min. SSL Version to be TLS 1.1\n"); -+ } -+ else if(data->set.ssl.version == CURL_SSLVERSION_TLSv1_2) { -+ ssl_set_min_version(&connssl->ssl, SSL_MAJOR_VERSION_3, -+ SSL_MINOR_VERSION_3); -+ infof(data, "PolarSSL: Forced min. SSL Version to be TLS 1.2\n"); -+ } -+ - ssl_set_endpoint(&connssl->ssl, SSL_IS_CLIENT); - ssl_set_authmode(&connssl->ssl, SSL_VERIFY_OPTIONAL); - --- -1.9.1 - diff -r 1c1964c27b39 -r fd85a02d771d patches/0002-Add-CURLOPT_PEERCERT-option-to-pin-a-peer-cert.patch --- a/patches/0002-Add-CURLOPT_PEERCERT-option-to-pin-a-peer-cert.patch Tue Sep 02 14:25:40 2014 +0200 +++ b/patches/0002-Add-CURLOPT_PEERCERT-option-to-pin-a-peer-cert.patch Tue Sep 16 19:45:19 2014 +0200 @@ -1,16 +1,16 @@ -From c57d951c3bda8b1ca66cac45dfd6270fa34b01d3 Mon Sep 17 00:00:00 2001 +From e5c7feec5151299975fe03184cc322ea51fb45c2 Mon Sep 17 00:00:00 2001 From: Andre Heinecke -Date: Mon, 1 Sep 2014 16:55:40 +0200 -Subject: [PATCH 2/3] Add CURLOPT_PEERCERT option to pin a peer cert +Date: Fri, 12 Sep 2014 13:01:07 +0200 +Subject: [PATCH 2/2] Add CURLOPT_PEERCERT option to pin a peer cert - Only implemented for a specific usecase with polarssl + This is only implemented for a specific usecase with polarssl --- include/curl/curl.h | 3 +++ include/curl/typecheck-gcc.h | 1 + lib/url.c | 8 ++++++++ lib/urldata.h | 1 + - lib/vtls/polarssl.c | 42 ++++++++++++++++++++++++++++++++++++++++-- - 5 files changed, 53 insertions(+), 2 deletions(-) + lib/vtls/polarssl.c | 41 +++++++++++++++++++++++++++++++++++++++++ + 5 files changed, 54 insertions(+) diff --git a/include/curl/curl.h b/include/curl/curl.h index d40b2db..20a9d82 100644 @@ -39,7 +39,7 @@ (option) == CURLOPT_SSH_KNOWNHOSTS || \ (option) == CURLOPT_MAIL_FROM || \ diff --git a/lib/url.c b/lib/url.c -index 89c3fd5..b089cdf 100644 +index 67126ab3..5721ee2 100644 --- a/lib/url.c +++ b/lib/url.c @@ -2015,6 +2015,14 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, @@ -70,69 +70,64 @@ STRING_PASSWORD, /* , if used */ STRING_OPTIONS, /* , if used */ diff --git a/lib/vtls/polarssl.c b/lib/vtls/polarssl.c -index e18cadf..2c40e36 100644 +index 08dc4c6..8f34901 100644 --- a/lib/vtls/polarssl.c +++ b/lib/vtls/polarssl.c -@@ -360,6 +360,7 @@ polarssl_connect_step2(struct connectdata *conn, - #ifdef HAS_ALPN - const char* next_protocol; - #endif -+ const x509_crt *peer_cert = NULL; +@@ -403,6 +403,44 @@ polarssl_connect_step1(struct connectdata *conn, + return CURLE_OK; + } - char errorbuf[128]; - memset(errorbuf, 0, sizeof(errorbuf)); -@@ -419,12 +420,49 @@ polarssl_connect_step2(struct connectdata *conn, - return CURLE_PEER_FAILED_VERIFICATION; - } - -- if(ssl_get_peer_cert(&(connssl->ssl))) { -+ peer_cert = ssl_get_peer_cert(&(connssl->ssl)); -+ if(peer_cert) { -+ if(data->set.str[STRING_SSL_PEERCERT]) { -+ x509_crt pinned_cert; -+ unsigned int i; -+ -+ /* Handle pinned certificate */ -+ x509_crt_init(&pinned_cert); -+ ret = x509_crt_parse_file(&pinned_cert, -+ data->set.str[STRING_SSL_PEERCERT]); ++static int ++pinned_verify(void *pinned_cert_file_name, x509_crt *crt, ++ int depth, int *flags) ++{ ++ x509_crt pinned_cert; ++ x509_crt *leaf = crt; ++ unsigned int i; ++ int ret; + -+ if(ret) { -+#ifdef POLARSSL_ERROR_C -+ error_strerror(ret, errorbuf, sizeof(errorbuf)); -+#endif /* POLARSSL_ERROR_C */ -+ failf(data, "Error reading peer cert file %s - PolarSSL: (-0x%04X) %s", -+ data->set.str[STRING_SSL_PEERCERT], -ret, errorbuf); -+ -+ x509_crt_free(&pinned_cert); -+ return CURLE_PEER_FAILED_VERIFICATION; -+ } ++ if (pinned_cert_file_name == NULL || crt == NULL) { ++ *flags |= BADCERT_NOT_TRUSTED; ++ return *flags; ++ } + -+ if (peer_cert->raw.len == 0 || -+ peer_cert->raw.len != pinned_cert.raw.len) { -+ failf(data, "Error validating peer certificate. Size does " -+ "not match the certificate set with PEERCERT option.\n"); -+ x509_crt_free(&pinned_cert); -+ return CURLE_PEER_FAILED_VERIFICATION; -+ } -+ for (i = 0; i < peer_cert->raw.len; i++) { -+ if (peer_cert->raw.p[i] != pinned_cert.raw.p[i]) { -+ failf(data, "Error validating peer certificate. Does " -+ "not match the certificate set with PEERCERT option.\n"); -+ return CURLE_PEER_FAILED_VERIFICATION; -+ } -+ } -+ } ++ x509_crt_init(&pinned_cert); ++ ret = x509_crt_parse_file(&pinned_cert, pinned_cert_file_name); + - /* If the session was resumed, there will be no peer certs */ - memset(buffer, 0, sizeof(buffer)); ++ if(ret) { ++ x509_crt_free(&pinned_cert); ++ *flags |= BADCERT_NOT_TRUSTED; ++ return *flags; ++ } ++ ++ while (leaf->next) { ++ leaf = leaf->next; ++ } ++ ++ ret = memcmp(pinned_cert.raw.p, leaf->raw.p, pinned_cert.raw.len); ++ x509_crt_free(&pinned_cert); ++ if (ret == 0) { ++ *flags = 0; ++ return 0; ++ } ++ ++ *flags |= BADCERT_NOT_TRUSTED; ++ return *flags; ++} ++ + static CURLcode + polarssl_connect_step2(struct connectdata *conn, + int sockindex) +@@ -422,6 +460,9 @@ polarssl_connect_step2(struct connectdata *conn, + conn->recv[sockindex] = polarssl_recv; + conn->send[sockindex] = polarssl_send; - if(x509_crt_info(buffer, sizeof(buffer), (char *)"* ", -- ssl_get_peer_cert(&(connssl->ssl))) != -1) -+ peer_cert) != -1) - infof(data, "Dumping cert info:\n%s\n", buffer); - } - ++ if(data->set.str[STRING_SSL_PEERCERT]) ++ ssl_set_verify (&connssl->ssl, pinned_verify, data->set.str[STRING_SSL_PEERCERT]); ++ + for(;;) { + if(!(ret = ssl_handshake(&connssl->ssl))) + break; -- 1.9.1 diff -r 1c1964c27b39 -r fd85a02d771d patches/0003-Add-possibility-to-force-polarssl-ciphersuites.patch --- a/patches/0003-Add-possibility-to-force-polarssl-ciphersuites.patch Tue Sep 02 14:25:40 2014 +0200 +++ b/patches/0003-Add-possibility-to-force-polarssl-ciphersuites.patch Tue Sep 16 19:45:19 2014 +0200 @@ -1,14 +1,14 @@ -From a36ec2b65e81109c151759b282c221daf91b83ee Mon Sep 17 00:00:00 2001 +From 6389827510dbeed12dfcc4a50d885fd70de6ac65 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Tue, 2 Sep 2014 09:58:44 +0200 -Subject: [PATCH] Add possibility to force polarssl ciphersuites. +Subject: [PATCH 1/2] Add possibility to force polarssl ciphersuites. --- lib/vtls/polarssl.c | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/lib/vtls/polarssl.c b/lib/vtls/polarssl.c -index 2c40e36..c3f1b8e 100644 +index 5332b92..08dc4c6 100644 --- a/lib/vtls/polarssl.c +++ b/lib/vtls/polarssl.c @@ -55,6 +55,7 @@ @@ -37,7 +37,7 @@ static CURLcode polarssl_connect_step1(struct connectdata *conn, -@@ -300,7 +303,41 @@ polarssl_connect_step1(struct connectdata *conn, +@@ -318,7 +321,41 @@ polarssl_connect_step1(struct connectdata *conn, net_recv, &conn->sock[sockindex], net_send, &conn->sock[sockindex]); diff -r 1c1964c27b39 -r fd85a02d771d ui/CMakeLists.txt --- a/ui/CMakeLists.txt Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/CMakeLists.txt Tue Sep 16 19:45:19 2014 +0200 @@ -223,3 +223,49 @@ configure_file(trustbridge-tray-starter.sh trustbridge-tray-starter.sh COPYONLY) install(FILES trustbridge-tray-starter.sh DESTINATION bin) endif() + +# Strip the binaries +if (WIN32) + add_custom_command( + TARGET trustbridge + POST_BUILD + COMMAND ${CMAKE_STRIP} trustbridge.exe + ) + add_custom_command( + TARGET trustbridge-admin + POST_BUILD + COMMAND ${CMAKE_STRIP} trustbridge-admin.exe + ) + if (NOT RELEASE_BUILD) + message("Status will sign.") + add_custom_command( + TARGET trustbridge + POST_BUILD + COMMAND ${OSSLSIGNCODE_EXECUTABLE} sign -certs ${CMAKE_SOURCE_DIR}/ui/tests/data/codesign/codesigning.pem + -key ${CMAKE_SOURCE_DIR}/ui/tests/data/codesign/codesigning.key + -h sha256 -in ${CMAKE_CURRENT_BINARY_DIR}/trustbridge.exe + -out ${CMAKE_CURRENT_BINARY_DIR}/trustbridge-signed.exe && + mv ${CMAKE_CURRENT_BINARY_DIR}/trustbridge-signed.exe ${CMAKE_CURRENT_BINARY_DIR}/trustbridge.exe + ) + add_custom_command( + TARGET trustbridge-admin + POST_BUILD + COMMAND ${OSSLSIGNCODE_EXECUTABLE} sign -certs ${CMAKE_SOURCE_DIR}/ui/tests/data/codesign/codesigning.pem + -key ${CMAKE_SOURCE_DIR}/ui/tests/data/codesign/codesigning.key + -h sha256 -in ${CMAKE_CURRENT_BINARY_DIR}/trustbridge-admin.exe + -out ${CMAKE_CURRENT_BINARY_DIR}/trustbridge-admin-signed.exe && + mv ${CMAKE_CURRENT_BINARY_DIR}/trustbridge-admin-signed.exe ${CMAKE_CURRENT_BINARY_DIR}/trustbridge-admin.exe + ) + endif() +else() + add_custom_command( + TARGET trustbridge + POST_BUILD + COMMAND strip trustbridge + ) + add_custom_command( + TARGET trustbridge-admin + POST_BUILD + COMMAND strip trustbridge-admin + ) +endif() diff -r 1c1964c27b39 -r fd85a02d771d ui/administrator.cpp --- a/ui/administrator.cpp Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/administrator.cpp Tue Sep 16 19:45:19 2014 +0200 @@ -40,6 +40,25 @@ Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) #endif +#ifdef DO_RELEASE_BUILD +bool g_debug = false; +#else +bool g_debug = true; +#endif + +QtMessageHandler g_default_msg_handler = NULL; + +void filterDebugOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) +{ + if (!g_debug && type == QtDebugMsg) { + return; + } + + if (g_default_msg_handler) { + (*g_default_msg_handler)(type, context, msg); + } +} + int main(int argc, char **argv) { QApplication app (argc, argv); @@ -58,6 +77,11 @@ return 0; } + if (arguments.contains("--debug")) { + g_debug = true; + } + g_default_msg_handler = qInstallMessageHandler(filterDebugOutput); + QTranslator translator; if (QLocale::system().name() == "C") { /* Useful for testing / development as the primary target is german */ diff -r 1c1964c27b39 -r fd85a02d771d ui/administratorwindow.h --- a/ui/administratorwindow.h Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/administratorwindow.h Tue Sep 16 19:45:19 2014 +0200 @@ -48,7 +48,7 @@ * saved as current. * * @param currentCerts Path to the current certificate list file. - * @param certFingerprint The fingerprint of the signing key used. + * @param keyFingerprint The fingerprint of the signing key used. */ void logChanges(const QString ¤tCerts, const QString &keyFingerprint); diff -r 1c1964c27b39 -r fd85a02d771d ui/certificateitemwidget.cpp --- a/ui/certificateitemwidget.cpp Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/certificateitemwidget.cpp Tue Sep 16 19:45:19 2014 +0200 @@ -10,40 +10,31 @@ #include #include #include +#include CertificateItemWidget::CertificateItemWidget(QWidget *parent, const Certificate &cert, bool state, - bool editable, - const QString &installLabel, - const QString &removeLabel) : + QToolButton *btn) : QWidget(parent), - mInstallLabel (installLabel), - mRemoveLabel (removeLabel) + mButton(btn) { mCertificate = cert; - mState = state; - mEditable = editable; + mOriginalState = state; + btn->setCheckable(true); + btn->setStyleSheet("QToolButton:Checked{" + "border: 1px solid #8f8f91;" + "background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1," + "stop: 0 #f6f7fa, stop: 1 #dadbde);" + "}" + ); + setState(state); setupGUI(); } - -/* We use the label as data to hide it in the normal dropdown menu and only - * show it when the popup is shown.*/ - void CertificateItemWidget::setupGUI() { mLabel = new QLabel; - mComboBox = new IconOnlyTextPopupBox; - QStyle *fusionStyle = QStyleFactory::create("Fusion"); - if (!fusionStyle) { - qDebug() << "Failed to create fusion style"; - } else { - mComboBox->setStyle(fusionStyle); - } - - mComboBox->setIconSize(QSize(32, 32)); - mComboBox->setFixedWidth(64); setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); @@ -61,76 +52,40 @@ mLabel->setTextInteractionFlags( Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); - mComboBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - connect(mComboBox, SIGNAL(currentIndexChanged(int)), - this, SLOT(currentStateChanged(int))); + mButton->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + connect(mButton, SIGNAL(toggled (bool)), + this, SLOT(currentStateChanged(bool))); QHBoxLayout *layout = new QHBoxLayout; - if (mCertificate.isInstallCert()) { - mComboBox->addItem(QIcon(":/img/security-high.png"), QString(), mInstallLabel); - mComboBox->addItem(QIcon(":/img/security-low.png"), QString(), mRemoveLabel); - if (mState) { - mComboBox->setCurrentIndex(0); - mComboBox->setToolTip(tr("This certificate is currently installed.")); - } - else { - mComboBox->setCurrentIndex(1); - mComboBox->setToolTip(tr("This certificate is currently not installed.")); - } - layout->addWidget(mComboBox); - } - else if (!mCertificate.isInstallCert() && !mEditable){ - QImage *img = new QImage(":/img/trash-empty.png"); - QLabel *imgLabel = new QLabel; - imgLabel->setPixmap(QPixmap::fromImage(*img)); - imgLabel->setFixedSize(64, 64); - imgLabel->setMargin(8); - imgLabel->setToolTip(tr("This certificate was uninstalled.")); - layout->addWidget(imgLabel); - } - else { - mComboBox->addItem(QIcon(":/img/trash-empty.png"), QString(), tr("uninstall")); - mComboBox->addItem(QIcon(":/img/security-medium.png"), QString(), tr("keep")); - mComboBox->setToolTip(tr("This certificate is currently installed.")); - if (mState) - mComboBox->setCurrentIndex(0); - else { - mComboBox->setCurrentIndex(1); - } - layout->addWidget(mComboBox); - } + layout->addWidget(mButton); + mButton->setFixedSize(64, 64); + mButton->setIconSize(QSize(48, 48)); layout->addWidget(mLabel); this->setLayout(layout); } bool CertificateItemWidget::state() { - if (!mEditable) { + if (!mButton->isEnabled()) { return true; } - const QString currentString = mComboBox->currentData().toString(); - - if (!mCertificate.isInstallCert()) { - return currentString == tr("uninstall"); - } - - return currentString == mInstallLabel; + return !mButton->isChecked(); } void CertificateItemWidget::setState(bool state) { - disconnect(mComboBox, SIGNAL(currentIndexChanged(int)), - this, SLOT(currentStateChanged(int))); - - if (state) { - mComboBox->setCurrentIndex(0); + /* The internal state we get here is inverted for Ui reasons the logic + * is if a certificate is selected for installation the button + * is disabled (as this is the default) Only those that are + * unselected have the enabled button. */ + mButton->blockSignals(true); // code did this and not the user + mButton->setChecked(!state); + mButton->blockSignals(false); + if (mButton->isEnabled()) { + mButton->setToolTip(mButton->property(!state ? "ToolTip_On" : + "ToolTip_Off").toString()); } - else { - mComboBox->setCurrentIndex(1); - } - connect(mComboBox, SIGNAL(currentIndexChanged(int)), - this, SLOT(currentStateChanged(int))); } Certificate CertificateItemWidget::certificate() @@ -138,22 +93,9 @@ return mCertificate; } -void CertificateItemWidget::currentStateChanged(int) +void CertificateItemWidget::currentStateChanged(bool state) { - bool state = !mComboBox->currentIndex(); + mButton->setToolTip(mButton->property(state ? "ToolTip_On" : + "ToolTip_Off").toString()); emit stateChanged(state, mCertificate); } - -void IconOnlyTextPopupBox::showPopup() { - for (int i = 0; i < count(); i++) { - setItemText(i, itemData(i).toString()); - } - QComboBox::showPopup(); -} - -void IconOnlyTextPopupBox::hidePopup() { - for (int i = 0; i < count(); i++) { - setItemText(i, QString()); - } - QComboBox::hidePopup(); -} diff -r 1c1964c27b39 -r fd85a02d771d ui/certificateitemwidget.h --- a/ui/certificateitemwidget.h Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/certificateitemwidget.h Tue Sep 16 19:45:19 2014 +0200 @@ -8,26 +8,16 @@ #ifndef CERTIFICATELISTITEM_H #define CERTIFICATELISTITEM_H /** - * @file certificateitemdelegate.h + * @file certificateitemwidget.h * @brief Item delegate drawing custom certificate items in list views. * */ #include #include -#include #include "certificate.h" -/** @brief A combo box that shows the text only in the popup - * - * The text shown is the data set as Qt::UserRole - */ -class IconOnlyTextPopupBox : public QComboBox -{ -protected: - virtual void showPopup(); - virtual void hidePopup(); -}; +class QToolButton; class CertificateItemWidget : public QWidget { @@ -37,9 +27,7 @@ QWidget *parent = 0, const Certificate &cert = Certificate(), bool state = false, - bool editable = true, - const QString& installLabel = tr("install"), - const QString& removeLabel = tr("remove")); + QToolButton * btn = NULL); bool state(); void setState(bool state); @@ -49,15 +37,12 @@ void setupGUI(); Certificate mCertificate; - bool mState; - bool mEditable; + bool mOriginalState; QLabel *mLabel; - IconOnlyTextPopupBox *mComboBox; - QString mInstallLabel; - QString mRemoveLabel; + QToolButton *mButton; private slots: - void currentStateChanged(int ndx); + void currentStateChanged(bool state); signals: void stateChanged(bool state, const Certificate &cert); diff -r 1c1964c27b39 -r fd85a02d771d ui/certificatelistwidget.cpp --- a/ui/certificatelistwidget.cpp Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/certificatelistwidget.cpp Tue Sep 16 19:45:19 2014 +0200 @@ -25,13 +25,10 @@ void CertificateListWidget::addCertificate( const Certificate &certificate, bool state, - bool editable, - const QString &installLabel, - const QString &removeLabel) + QToolButton *button) { CertificateItemWidget *widget = - new CertificateItemWidget(this, certificate, state, editable, - installLabel, removeLabel); + new CertificateItemWidget(this, certificate, state, button); connect(widget, SIGNAL(stateChanged(bool, const Certificate&)), this, SLOT(certStateChanged(bool, const Certificate&))); diff -r 1c1964c27b39 -r fd85a02d771d ui/certificatelistwidget.h --- a/ui/certificatelistwidget.h Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/certificatelistwidget.h Tue Sep 16 19:45:19 2014 +0200 @@ -22,6 +22,7 @@ */ class CertificateItemWidget; +class QToolButton; Q_DECLARE_METATYPE(Certificate); class CertificateListWidget : public QWidget @@ -31,9 +32,7 @@ CertificateListWidget(QWidget *parent, Qt::WindowFlags flags = 0); void addCertificate(const Certificate &certificate, bool state, - bool editable = true, - const QString& installLabel = tr("install"), - const QString& removeLabel = tr("remove")); + QToolButton *btn); void removeCertificate(const Certificate &cert); void setCertState(bool state, const Certificate &cert); void clear(); diff -r 1c1964c27b39 -r fd85a02d771d ui/certificates/geotrust.der Binary file ui/certificates/geotrust.der has changed diff -r 1c1964c27b39 -r fd85a02d771d ui/certificates/intevation.de.der Binary file ui/certificates/intevation.de.der has changed diff -r 1c1964c27b39 -r fd85a02d771d ui/certificates/ssl-test.der Binary file ui/certificates/ssl-test.der has changed diff -r 1c1964c27b39 -r fd85a02d771d ui/certificatetabledelegate.cpp --- a/ui/certificatetabledelegate.cpp Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/certificatetabledelegate.cpp Tue Sep 16 19:45:19 2014 +0200 @@ -48,6 +48,7 @@ bool editable = index.data(Qt::UserRole).toBool(); // Create a combobox and add two items for install/remove. QComboBox *comboBox = new QComboBox(parent); + comboBox->setFixedWidth(110); comboBox->addItem(QIcon(":/img/list-add.png"), tr("add"), QVariant("true")); if (editable) { comboBox->addItem(QIcon(":/img/list-remove.png"), diff -r 1c1964c27b39 -r fd85a02d771d ui/certificatetabledelegate.h --- a/ui/certificatetabledelegate.h Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/certificatetabledelegate.h Tue Sep 16 19:45:19 2014 +0200 @@ -45,11 +45,9 @@ /** * @brief Draw the item using the given parameters. * - * @param painter The painter to draw the item. + * @param parent The parent widget. * @param option The style options. * @param index The model index of the item to draw. - * @param icon The icon to display. - * @param font The font used to draw text. */ QWidget *drawComboBox(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; diff -r 1c1964c27b39 -r fd85a02d771d ui/certs.qrc --- a/ui/certs.qrc Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/certs.qrc Tue Sep 16 19:45:19 2014 +0200 @@ -1,6 +1,5 @@ - certificates/intevation.de.der - certificates/geotrust.der + certificates/ssl-test.der diff -r 1c1964c27b39 -r fd85a02d771d ui/createcertlistdialog.h --- a/ui/createcertlistdialog.h Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/createcertlistdialog.h Tue Sep 16 19:45:19 2014 +0200 @@ -66,7 +66,7 @@ * If the file is not a valid key or an error * occurs mPk will be NULL after a call to this function. * - * @param [in] the file to load + * @param [in] fileName the file to load */ void loadKeyFile(const QString& fileName); diff -r 1c1964c27b39 -r fd85a02d771d ui/createinstallerdialog.h --- a/ui/createinstallerdialog.h Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/createinstallerdialog.h Tue Sep 16 19:45:19 2014 +0200 @@ -98,8 +98,8 @@ public slots: /**@brief Append a base64 encoded sha256 RSA signature to a file. * - * The format of the added signature line will be: - * S:\r\n + * The format of the added signature line will be:
+ * S:\\\r\\n
* For the signature the key in mCertFile is used. * * @param[in] input The absolute path of the file to sign diff -r 1c1964c27b39 -r fd85a02d771d ui/downloader.cpp --- a/ui/downloader.cpp Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/downloader.cpp Tue Sep 16 19:45:19 2014 +0200 @@ -8,7 +8,7 @@ #include "downloader.h" #ifndef DOWNLOAD_SERVER -#define DOWNLOAD_SERVER "https://www.intevation.de" +#define DOWNLOAD_SERVER "https://tb-devel.intevation.de" #endif #include @@ -36,24 +36,12 @@ #include "sslconnection_bare.h" #endif -#ifdef RELEASE_BUILD static int accept_ciphers[] = { TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384, 0 }; -#else -static int accept_ciphers[] = { - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, - TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384, - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, - TLS_RSA_WITH_AES_256_CBC_SHA, - 0 -}; -#endif Downloader::Downloader(QObject* parent, const QString& url, const QByteArray& certificate, @@ -74,13 +62,14 @@ /* Set up Proxy support. */ QSettings settings; QString settingsProxy = settings.value("ProxyURL").toString(); - if (settingsProxy.isEmpty()) { + bool useProxy = settings.value("UseProxy", false).toBool(); + if (useProxy && settingsProxy.isEmpty()) { QByteArray envProxy = qgetenv("http_proxy"); if (envProxy.size()) { settingsProxy = QString::fromLocal8Bit(envProxy); } } - if (!settingsProxy.isEmpty()) { + if (useProxy && !settingsProxy.isEmpty()) { mSSLConnection->setProxy(QUrl(settingsProxy)); } #else diff -r 1c1964c27b39 -r fd85a02d771d ui/downloader.h --- a/ui/downloader.h Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/downloader.h Tue Sep 16 19:45:19 2014 +0200 @@ -43,6 +43,7 @@ * @param[in] newestList datetime after which the list should be downloaded * @param[in] resourceSW the path where the software is to be found * @param[in] resourceList the path where the list is to be found + * @param[in] downloadSW TODO */ Downloader(QObject* parent, const QString& url, const QByteArray& certificate = QByteArray(), @@ -118,7 +119,7 @@ * @brief An error happened * * @param[out] message: A message to show. Can be empty. - * @param[out] errorCode: ErrorCode of this error. + * @param[out] error: ErrorCode of this error. */ void error(const QString &message, SSLConnection::ErrorCode error); diff -r 1c1964c27b39 -r fd85a02d771d ui/icons.qrc --- a/ui/icons.qrc Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/icons.qrc Tue Sep 16 19:45:19 2014 +0200 @@ -26,5 +26,7 @@ img/preferences-network_16.png img/preferences-network_64.png img/show-help_16.png + img/write-into-48.png + img/write-remove-48.png diff -r 1c1964c27b39 -r fd85a02d771d ui/img/README.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/img/README.txt Tue Sep 16 19:45:19 2014 +0200 @@ -0,0 +1,27 @@ += How to create the pixel icons. + +== update-list.png + +Was taken from the Oxygen Icon set (where rendering is done by inkscape). +prerendered in green. + +The color was adapted on the pixel version with gimp +by visial matching shades of blue in the other icons. + +Gimp tools used: +Menu -> Color -> colorize.. : + with parameters approx 210, 65, 15 +Menu -> Color -> Curves: + Adding more billiance by dragging the ligher blue color shades more apart. + So from the default curve make it go a little bit steeper for 4/5 + of the way and then less steep. + +== write-into / write-remove + +Original files: oxygen-icons_4.13.0.orig.tar.xz +./svn-commit.svgz -> write-remove +./svn-update.svgz -> write-into: + Using inkscape to move the arrow up. + +Rendered with inkscape to 48pixel height. + diff -r 1c1964c27b39 -r fd85a02d771d ui/img/update-list.png Binary file ui/img/update-list.png has changed diff -r 1c1964c27b39 -r fd85a02d771d ui/img/write-into-48.png Binary file ui/img/write-into-48.png has changed diff -r 1c1964c27b39 -r fd85a02d771d ui/img/write-into.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/img/write-into.svg Tue Sep 16 19:45:19 2014 +0200 @@ -0,0 +1,3472 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 1c1964c27b39 -r fd85a02d771d ui/img/write-remove-48.png Binary file ui/img/write-remove-48.png has changed diff -r 1c1964c27b39 -r fd85a02d771d ui/installwrapper.cpp --- a/ui/installwrapper.cpp Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/installwrapper.cpp Tue Sep 16 19:45:19 2014 +0200 @@ -16,6 +16,7 @@ #include "logging.h" #include "util.h" +#include "binverify.h" #define INSTALL_TIMEOUT 3600000 /* Wait up to an hour */ @@ -44,12 +45,13 @@ } foreach (const QString &b64data, mChoices) { - if (choicesFile->write(b64data.toLatin1()) == -1) { - return false; - } - if (choicesFile->write("\n") == -1) { - return false; - } + syslog_info_printf ("Selected certificate: %s\n", b64data.toLatin1().constData()); + if (choicesFile->write(b64data.toLatin1()) == -1) { + return false; + } + if (choicesFile->write("\n") == -1) { + return false; + } } choicesFile->close(); @@ -78,6 +80,15 @@ } #ifdef WIN32 + bin_verify_result vres = verify_binary(cinstFileName.toUtf8().constData(), + cinstFileName.toUtf8().size()); + + if (vres.result != VerifyValid) { + emit error(tr("Integrity check of the certificate installation process failed. ") + + "\n" + tr("Please reinstall the software.")); + return; + } + /* QProcess on Windows uses CreateProcess but we have to * use the runas shell command to get the UAC prompt if necessary. * So we have to handle the process ourself. Starting with @@ -94,6 +105,10 @@ QString parameters = "\"list=" + mCertListFile + "\" \"choices=" + choicesFile.fileName() + "\""; + if (g_debug) { + parameters += " --debug"; + } + shExecInfo.cbSize = sizeof(SHELLEXECUTEINFOW); shExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS; if (!is_system_install()) { @@ -111,6 +126,7 @@ QString qerrmsg = QString::fromUtf8(errmsg); free(errmsg); emit error(tr("Error executing process: %1").arg(qerrmsg)); + fclose(vres.fptr); return; } @@ -122,9 +138,11 @@ QString qerrmsg = QString::fromUtf8(errmsg); free(errmsg); emit error (tr("Error monitoring process: %1").arg(qerrmsg)); + fclose(vres.fptr); return; } else { emit error (tr("Certificate installation timed out.")); + fclose(vres.fptr); return; } } @@ -139,9 +157,11 @@ free(errmsg); emit error (tr("Failed to check process status: %1").arg(qerrmsg)); CloseHandle(shExecInfo.hProcess); + fclose(vres.fptr); return; } CloseHandle(shExecInfo.hProcess); + fclose(vres.fptr); if (retval != 0) { /* TODO make this nicer */ @@ -155,6 +175,10 @@ choicesFile.setAutoRemove(false); parameters << "list=" + mCertListFile << "choices=" + choicesFile.fileName(); + if (g_debug) { + parameters << "--debug"; + } + bool sudo_started = false; bool use_sudo = is_admin() && is_system_install(); if (use_sudo) { diff -r 1c1964c27b39 -r fd85a02d771d ui/installwrapper.h --- a/ui/installwrapper.h Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/installwrapper.h Tue Sep 16 19:45:19 2014 +0200 @@ -52,8 +52,8 @@ * as the current application. * * @param[in] parent the parent object. - * @param[in] listFileName the absolute path to the certificatelist. - * @param[in] choices a list of R: / I: lines to execute. + * @param[in] path the absolute path to the certificatelist. + * @param[in] instructions a list of R: / I: \ lines to execute. */ InstallWrapper(QObject* parent, const QString& path, const QStringList& instructions); diff -r 1c1964c27b39 -r fd85a02d771d ui/l10n/administrator_de_DE.ts --- a/ui/l10n/administrator_de_DE.ts Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/l10n/administrator_de_DE.ts Tue Sep 16 19:45:19 2014 +0200 @@ -70,95 +70,101 @@ AdministratorWindow - - + + TrustBridge Administration TrustBridge Verwaltung - + Menu Menü - + Create installer ... Installationspaket erstellen ... - + About TrustBridge Über TrustBridge - + + Help + Hilfe + + + Quit Beenden - + All managed root certificates of the certificate list: The english original should be improved In der Liste enthaltene Zertifikate: - + Select certificate list file Zertifikatsliste auswählen - - - + + + + Error! Fehler! - + Failed to load the certificate list. Fehler beim Laden der Zertifikatsliste. - + Failed to open log file: Fehler beim Öffnen der Log-Datei: - - + + Changes are not logged! Änderungen wurden nicht geloggt! - + Failed to write log file: Fehler beim Schreiben der Log-Datei: - + new certificatelist neue Zertifikatsliste - + based on list from basiert auf der Liste vom - + signing certificate: - + new certificates: - + certificates marked to remove: @@ -166,23 +172,28 @@ signing certificate: - Signaturzertifikat: + Signaturzertifikat: new certificates: - Neue Zertifikate: + Neue Zertifikate: certificates marked to remove: - Zertifikate zum löschen markiert: + Zertifikate zum löschen markiert: + + Failed to find the manual + Handbuch konnte nicht gefunden werden + + new certificates: Neues Zertifikat: @@ -192,27 +203,27 @@ Alle verwalteten Wurzelzertifikate der Zertifikatsliste: - + Management application of the BSI certificate installer Verwaltungsanwendung des BSI-Zertifikatsinstallers - + Save list Liste speichern - + Load list Liste laden - + Add certificate Zertifikat hinzufügen - + Remove certificate Zertifikat entfernen @@ -221,7 +232,7 @@ Zertifikatslistendatei auswählen - + Select certificate Zertifikat auswählen @@ -302,12 +313,12 @@ CertificateTableDelegate - + add hinzufügen - + remove entfernen @@ -568,7 +579,7 @@ Failed to sign linux package: %1 - + Fehler beim signieren des Linux Paketes: %1 diff -r 1c1964c27b39 -r fd85a02d771d ui/l10n/trustbridge_de_DE.ts --- a/ui/l10n/trustbridge_de_DE.ts Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/l10n/trustbridge_de_DE.ts Tue Sep 16 19:45:19 2014 +0200 @@ -51,41 +51,50 @@ Fingerabdruck (SHA1): &lt;%1&gt; - + install + Installieren + + + remove + Entfernen + + + Install + Installieren + + + Remove + Entfernen + + + Validity: %1 until %2 Gültigkeit: %1 bis %2 - + Fingerprint (SHA1): <code>%1</code> Fingerabdruck (SHA1): <code>%1</code> - - This certificate is currently installed. - Dieses Zertifikat ist aktuell installiert. - - - - This certificate is currently not installed. - Dieses Zertifikat ist aktuell nicht installiert. + Dieses Zertifikat ist aktuell installiert. - - This certificate was uninstalled. - Dieses Zertifikat wurde deinstalliert. + This certificate is currently not installed. + Dieses Zertifikat ist aktuell nicht installiert. - - - uninstall - Deinstallieren + This certificate was uninstalled. + Dieses Zertifikat wurde deinstalliert. - + uninstall + Deinstallieren + + keep - Behalten + Behalten @@ -131,48 +140,58 @@ InstallWrapper - + Could not find certificate installation process. Der Zertifikatsinstallations-Prozess konnte nicht gefunden werden. - + Failed to write temporary file. Fehler beim Schreiben der temporären Datei. - + + Integrity check of the certificate installation process failed. + Integritätsprüfung des Zertifikatsinstallationsprozesses fehlgeschlagen. + + + + Please reinstall the software. + Bitte installieren Sie die Software neu. + + + Error executing process: %1 Auführungsfehler: %1 - + Error monitoring process: %1 Fehlerüberwachung: %1 - + Certificate installation timed out. Zeitüberschreitung bei der Zertifikatsinstallation. - + Failed to check process status: %1 Fehler in der Prozess-Statusprüfung: %1 - + The process failed with return code. %1 Der Prozess ist fehlgeschlagen. Fehlercode: %1 - + Failed to start installer process. Fehler beim Starten des Installer-Prozess. - - + + Failed to complete installation. Fehler beim Abschließen der Installation. @@ -184,50 +203,45 @@ Neue Vorschläge für Wurzelzertifikate sind verfügbar. Klicken Sie hier zum Installieren. - - + + Check for Updates Neue Empfehlungen suchen - - + + Quit Beenden - + TrustBridge TrustBridge - Installed certificates from: - Empfehlungen bereits berücksichtigt bis: + Empfehlungen bereits berücksichtigt bis: - TrustBridge Version: - TrustBridge Version: + TrustBridge Version: Last sucessful update check: Zuletzt nach Aktualisierungen gesucht: - - Last successful update check: - Zuletzt nach neuen Empfehlungen gesucht: + Zuletzt nach neuen Empfehlungen gesucht: - Updates - Neue + Neue Empfehlungen - + Revoked certificates Abgeratene @@ -242,41 +256,41 @@ Aktualisierungen (%1/%2) - - + + Quit without saving Beenden ohne Schreiben - - + + Remove revoked certificates (%1/%2) Abgeratene Wurzelzertifikate entfernen (%1/%2) - + Trusted certificates Empfohlene Wurzelzertifikate - + The following list of trusted root certificates is managed by the BSI. The BSI validates independently the authenticity, security and actuality of these certificates. Die folgenden Wurzelzertifikate wurden bisher vom BSI zur Installation vorgeschlagen. Sie können erkennen, welche Sie bereits geschrieben haben. - + Please choose the certificates you want to trust or untrust. TrustBridge will install these certificates for your secure communication for email and internet. Legen Sie fest, ob Sie der Empfehlung ganz oder teilweise folgen möchten. TrustBridge wird die Änderungen an den Wurzelzertifikaten vornehmen. - + Trusted certificates Empfohlene Wurzelzertifikate - + Information and help Informationen @@ -303,31 +317,27 @@ Aktualisierungen einspielen - - + + Install new trusted certificates (%1/%2) Neue, empfohlene Wurzelzertifikate installieren (%1/%2) - - - - - - - - - + + + + + Show details Details einblenden - + Revoked certificates Abgeratene Wurzelzertifikate - + Certificates can be corrupted or stolen and misused in many ways. Therefore the BSI recommends to remove all revoked certificates from your system. Wurzelzertifikate können veraltet sein, korrumpiert, gestohlen oder missbraucht werden. Die Wurzelzertifikate , von denen das BSI abrät, sollten umgehend entfernt werden. @@ -336,15 +346,11 @@ Von den folgenden, ehemals empfohlenen Wurzelzerts, rät das BSI nun ab. Über diese Anwendung können sie auch nicht mehr installiert werden. Markieren Sie verbleibende Wurzelzerts zur Löschung, sobald Sie können. - - - - Manually changed certificates (%1) - Abweichend zu behandelnde Wurzelzertifikate (%1) + Abweichend zu behandelnde Wurzelzertifikate (%1) - + Trust in your digital communication Vertrauen in Ihre digitale Kommunikation @@ -353,8 +359,8 @@ Änderungen - - + + Certificates unchanged Wurzelzertifikate unverändert @@ -371,46 +377,70 @@ Es wird empfohlen, die nachfolgenden Änderungen an Ihren Wurzelzertifikaten zu übernehmen. - + Apply changes Änderungen schreiben - + Version: Version: - - + + An updated certificate list is available. Neue Vorschläge für Wurzelzertifikate sind verfügbar. - + Click here to install. Klicken Sie hier zum Installieren. - - + + An update for %1 is available. Eine Aktualisierung für %1 ist verfügbar. - + Click here to download and install the update. Hier klicken, um Download und Installation zu starten. - - - There are currently no changes for your certificate stores. - Es liegem keine neuen Empfehlungen vor. + + Failed to create update process. + - - + + This could be caused by not enough disk space or invalid permissions. + + + + + Failed to check for updates: + Fehler bei Updateprüfung: + + + + You should apply the following, recommended changes to your certificate stores: + Es wird empfohlen, die nachfolgenden Änderungen an Ihren Zertifikatsspeichern vorzunehmen: + + + + You can apply the following, changes to your certificate stores: + Sie können die nachfolgenden Änderungen an Ihren Zertifikatsspeichern vornehmen: + + + + There are currently no changes for your certificate stores. + Es liegen keine neuen Empfehlungen vor. + + + + Install certificates again Wurzelzertifikate erneut schreiben @@ -443,32 +473,27 @@ Änderungen (%1) - install - Installieren + Installieren - ignore - Ignorieren + Ignorieren Installed certificates from: %1 Installierte Zertifikate vom: %1 - - - Hide details - Details ausblenden + Details ausblenden Last successful update check: %1 Letzte erfolgreiche Prüfung nach Aktualisierungen: %1 - + Sucessfully checked for updates. Suche nach neuen Empfehlungen erfolgreich. @@ -479,102 +504,219 @@ Hier klicken, um Download und Installation zu starten. - + TrustBridge is a root certificate installer for Windows and GNU/Linux.<br/> - TrustBridge ist eine Wurzelzertifikatsinstaller für Windows und GNU/Linux.<br/> + TrustBridge ist ein Wurzelzertifikatsinstaller für Windows und GNU/Linux.<br/> - + The root certificate lists are managed by the German <a href="https://www.bsi.bund.de">Federal Office for Information Security (BSI)</a>.<br/><br/> Die Wurzelzertifikate werden vom <a href="https://www.bsi.bund.de">Bundesamt für Sicherheit in der Informationstechnik (BSI)</a> vorgeschlagen.<br/><br/> - + The software was developed by the companies <a href="http://www.intevation.de">Intevation GmbH</a> and <a href="http://www.dn-systems.de">DN-Systems GmbH</a>, <br> contracted by the German Federal Office for Information Security (BSI).<br/><br/> Die Software wurde von den Unternehmen <a href="http://www.intevation.de">Intevation GmbH</a> und <a href="http://www.dn-systems.de">DN-Systems GmbH</a> entwickelt, <br> beauftragt vom Bundesamt für Sicherheit in der Informationstechnik (BSI).<br/><br/> - + TrustBridge is Free Software licensed under GNU GPL v2+.<br/><br/>Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik TrustBridge ist Freie Software, lizensiert unter der GNU GPL v2+.<br/><br/>(C) 2014. Die Rechte liegen beim Bundesamt für Sicherheit in der Informationstechnik. - + Show Help - + Hilfe anzeigen - + Proxy settings - + Proxy-Einstellungen - + + Last update check: + Letzte Suche: + + + No connection with the updateserver. Keine Verbindung zum Updateserver. - + Update Aktualisieren - - - + + + Details Details - + The following unsecure certificates were revoked by the BSI. Already uninstalled certificates cannot be reinstalled. It is recommended that you select all certificates to uninstall if you still have revoked certificates installed. Von den folgenden, ehemals empfohlenen Wurzelzertifikaten, rät das BSI ab. Über diese Anwendung können sie auch nicht mehr installiert werden. Markieren Sie verbleibende Wurzelzertifikate zur Löschung, sobald Sie können. - - You should apply the following, recommended changes to your certificate stores. - Es wird empfohlen, die nachfolgenden Änderungen an Ihren Zertifikatsspeichern vorzunehmen. + + Version + Version - + + Pending +changes + Ausstehende +Änderungen + + + + Manual changes (%1) + Manuelle Änderungen (%1) + + + + Certificate list from: + Zertifikatsliste vom: + + + + Currently installed certificate list: + Aktuell installierte Zertifikatsliste: + + + + No certificate list installed. + Keine Zertifikatsliste installiert. + + + + + + Certificate will be installed. + + + + + + Certifcate is not installed. + + + + + + Certificate is installed. + + + + + + + + + Certificate will be removed. + + + + + + Certificate has not been removed. + + + + + + Certificate has been removed. + + + + + Certificate will not be installed. + + + + + Certificate will not be removed. + + + + You should apply the following, recommended changes to your certificate stores. + Es wird empfohlen, die nachfolgenden Änderungen an Ihren Zertifikatsspeichern vorzunehmen. + + You can apply the following, changes to your certificate stores. Der Unterschied "can", "should" könnte nicht signifikant genug sein. - Sie können die nachfolgenden Änderungen an Ihren Zertifikatsspeichern vornehmen. + Sie können die nachfolgenden Änderungen an Ihren Zertifikatsspeichern vornehmen. - - Changes to certificate stores (%1) - Neue empfohlene Änderungen (%1) + + Pending changes (%1) + Ausstehende +Änderungen (%1) - + + New, recommended changes (%1/%2) + Neue, empfohlene Änderungen (%1/%2) + + + + No new recommendations + Keine neuen Empfehlungen + + + Certificatelist from: + Zertifikatsliste vom: + + + Currently installed Certificatelist: + Aktuell installierte Zertifikatsliste: + + + No Certificatelist installed. + Keine Zertifikatsliste installiert. + + + Changes to certificate stores (%1) + Neue empfohlene Änderungen (%1) + + + Error executing update Fehler bei der Aktualisierung - + Installation with standard user account - + Installation mit Standardbenutzerkonto - - Windows will now ask you to confirm qeach root certificate modification because TrustBridge does not have the necessary privileges to install root certificates into the Windows certificate store silently. - + + Windows will now ask you to confirm each root certificate modification because TrustBridge does not have the necessary privileges to install root certificates into the Windows certificate store silently. + Windows wird Sie nun bitten, jede Wurzelzertifikatsänderung zu bestätigen. Grund dafür: TrustBridge besitzt nicht die nötigen Privilegien, um Wurzelzertifikate ohne Nachfrage in den Windows-Zertifikatsspeicher zu installieren. - + Installing certificates... Wurzelzertifikate werden geändert... - + Error! - + Fehler! - + Failed to find the manual - + Fehler beim Finden des Handbuchs + + + + TrustBridge error + TrustBridge Fehler @@ -593,39 +735,48 @@ ProxySettingsDlg - + Proxy server settings - - - - - Please enter the proxy server to use in the field below. - + Proxy-Server-Einstellungen - The URL can follow the scheme: - + Please enter the proxy server to use in the field below. + Bitte geben Sie den zu verwendenden Proxy-Server ein. - &lt;username&gt;:&lt;password&gt;@&lt;hostname&gt;:&lt;port&gt; - + The URL can follow the scheme: + Die URL folgt diesem Schema: - - Proxy Server: - + + [&lt;username&gt;:&lt;password&gt;@]&lt;hostname&gt;[:&lt;port&gt;] + [&lt;Benutzername&gt;:&lt;Passwort&gt;@]&lt;Hostname&gt;[:&lt;Port&gt;] - - &Save - + + Use Proxy Server + Proxy-Server verwenden - + &lt;username&gt;:&lt;password&gt;@&lt;hostname&gt;:&lt;port&gt; + &lt;Benutzername&gt;:&lt;Passwort&gt;@&lt;Hostname&gt;:&lt;Port&gt; + + + + Proxy Server: + Proxy-Server: + + + + &Save + &Speichern + + + &Cancel - + &Abbrechen @@ -635,6 +786,32 @@ TrustBridge automatic update check. Automatische Aktualisierungsprüfung von TrustBridge. + + + TrustBridge-Updater + Used as filename for the updater. Only use ASCII please. + + + + + Hide details + Details ausblenden + + + + Less + Weniger + + + + Show details + Details einblenden + + + + Details + Details + TrayIcon diff -r 1c1964c27b39 -r fd85a02d771d ui/main.cpp --- a/ui/main.cpp Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/main.cpp Tue Sep 16 19:45:19 2014 +0200 @@ -52,6 +52,26 @@ Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) #endif +#ifdef DO_RELEASE_BUILD +bool g_debug = false; +#else +bool g_debug = true; +#endif + +QtMessageHandler g_default_msg_handler = NULL; + +void filterDebugOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) +{ + if (!g_debug && type == QtDebugMsg) { + return; + } + + if (g_default_msg_handler) { + (*g_default_msg_handler)(type, context, msg); + } +} + + int main(int argc, char **argv) { #ifdef WIN32 @@ -63,10 +83,17 @@ * monitor executable corruptions. */ if (!selftest()) { - syslog_error_printf ("Integrity check failed."); -#ifdef RELEASE_BUILD + syslog_error_printf("Integrity check failed."); + MessageBoxW(NULL, + L"TrustBridge wurde nach der Installation modifizert.\n" + L"Um ihr System zu schützen wurde das Starten der Anwendung abgebrochen.\n" + L"Bitte installieren Sie TrustBridge erneut.\n\n" + L"TrustBridge has been modified after installation.\n" + L"To protect your system the application launch has been aborted.\n" + L"Please reinstall TrustBridge.", + L"Integritätsprüfung fehlgeschlagen / Integrity check failed.", + MB_ICONERROR | MB_OK); return -1; -#endif } #endif @@ -77,12 +104,17 @@ QApplication::setApplicationName(QString::fromLatin1(APPNAME)); QApplication::setApplicationVersion(QString::fromLatin1(VERSION)); QSettings::setDefaultFormat(QSettings::IniFormat); + QStringList arguments = QApplication::arguments(); + + if (arguments.contains("--debug")) { + g_debug = true; + } + g_default_msg_handler = qInstallMessageHandler(filterDebugOutput); qDebug() << "Application style is: " << app.style()->metaObject()->className(); qDebug() << "Available styles: " << QStyleFactory::keys().join(", "); qDebug() << "Font is: " << app.font(); - QStringList arguments = QApplication::arguments(); bool trayMode = arguments.contains("--tray"); if (arguments.contains("--version")) { diff -r 1c1964c27b39 -r fd85a02d771d ui/mainwindow.cpp --- a/ui/mainwindow.cpp Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/mainwindow.cpp Tue Sep 16 19:45:19 2014 +0200 @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -49,7 +50,7 @@ // something to say #define NAG_INTERVAL_MINUTES 70 -#define DATETIME_FORMAT "dddd, d. MMMM yyyy HH:mm:ss" +#define DATETIME_FORMAT "d. MMM yyyy HH:mm" #ifndef APPNAME #define APPNAME "TrustBridge" @@ -65,23 +66,23 @@ #define TB_ARCH_STRING "-amd64" #endif -#ifdef RELEASE_BUILD -# define LIST_RESOURCE "/users/aheinecke/zertifikatsliste.txt" +#ifdef USE_REAL_RESOURCES +# define LIST_RESOURCE "/zertifikatsliste.txt" # ifdef Q_OS_WIN -# define SW_RESOURCE_VERSION "/users/aheinecke/TrustBridge-%1.exe" -# define SW_RESOURCE "/users/aheinecke/TrustBridge.exe" +# define SW_RESOURCE_VERSION "/TrustBridge-%1.exe" +# define SW_RESOURCE "/TrustBridge.exe" # else -# define SW_RESOURCE_VERSION "/users/aheinecke/TrustBridge-%1" TB_ARCH_STRING ".sh" -# define SW_RESOURCE "/users/aheinecke/TrustBridge" TB_ARCH_STRING ".sh" +# define SW_RESOURCE_VERSION "/TrustBridge-%1" TB_ARCH_STRING ".sh" +# define SW_RESOURCE "/TrustBridge" TB_ARCH_STRING ".sh" # endif #else // RELEASE_BUILD -# define LIST_RESOURCE "/users/aheinecke/development/zertifikatsliste.txt" +# define LIST_RESOURCE "/zertifikatsliste.txt" # ifdef Q_OS_WIN -# define SW_RESOURCE_VERSION "/users/aheinecke/development/TrustBridge-development.exe" -# define SW_RESOURCE "/users/aheinecke/development/TrustBridge.exe" +# define SW_RESOURCE_VERSION "/development/TrustBridge-development.exe" +# define SW_RESOURCE "/development/TrustBridge.exe" # else -# define SW_RESOURCE_VERSION "/users/aheinecke/development/TrustBridge-development" TB_ARCH_STRING ".sh" -# define SW_RESOURCE "/users/aheinecke/development/TrustBridge" TB_ARCH_STRING ".sh" +# define SW_RESOURCE_VERSION "/development/TrustBridge-development" TB_ARCH_STRING ".sh" +# define SW_RESOURCE "/development/TrustBridge" TB_ARCH_STRING ".sh" # endif #endif @@ -93,8 +94,12 @@ #define HELP_PATH "/../share/doc/trustbridge/index.html" #endif +static void activateDetailsButton(QPushButton *); +static void deactivateDetailsButton(QPushButton *); + MainWindow::MainWindow(bool trayMode): - mTrayMode(trayMode) + mTrayMode(trayMode), + mManualDetailsShown(false) { createActions(); createTrayIcon(); @@ -234,14 +239,15 @@ } bin_verify_result verifyResult = verify_binary(swFileName.toUtf8().constData(), swFileName.toUtf8().size()); - qDebug() << "Binary verify result: " << verifyResult; - if (verifyResult != VerifyValid) { + qDebug() << "Binary verify result: " << verifyResult.result; + if (verifyResult.result != VerifyValid) { qDebug() << "Failed to verify downloaded data."; QFile::remove(swFileName); mSettings.remove("Software/available"); mSettings.remove("Software/availableDate"); return; } + fclose(verifyResult.fptr); } void MainWindow::handleNewList(const QString& fileName, const QDateTime& modDate) { @@ -286,12 +292,46 @@ showMessage(); } +QString getPrettyInstallerName(QString realFileName) { + QTemporaryDir tDir; + if (!tDir.isValid()) { + qDebug () << "Failed to create temporary directory."; + return QString(); + } + QString targetPath = tDir.path() + QObject::tr("TrustBridge-Updater", + "Used as filename for the updater. Only use ASCII please."); + + tDir.setAutoRemove(false); +#ifdef WIN32 + targetPath += ".exe"; +#endif + if (!QFile::copy(realFileName, targetPath)) { + qDebug() << "Failed to create temporary copy of installer."; + } + return targetPath; +} + void MainWindow::installNewSW(const QString& fileName, const QDateTime& modDate) { QFileInfo instProcInfo = QFileInfo(fileName); QString filePath = QDir::toNativeSeparators(instProcInfo.absoluteFilePath()); - if (verify_binary(filePath.toUtf8().constData(), - filePath.toUtf8().size()) != VerifyValid) { + /* Copy the file to a temporary name for installation */ + filePath = getPrettyInstallerName(filePath); + + if (filePath.isEmpty()) { + qDebug() << "Failed to copy updater to temporary location."; + showErrorMessage(tr("Failed to create update process.") + "\n" + + tr("This could be caused by not enough disk space or invalid permissions.")); + return; + } + mSettings.setValue("Software/Updater", filePath); /* So it can be deleted + on next start */ + mSettings.sync(); + + bin_verify_result vres = verify_binary(filePath.toUtf8().constData(), + filePath.toUtf8().size()); + + if (vres.result != VerifyValid) { qDebug() << "Invalid software. Not installing"; return; } @@ -328,6 +368,7 @@ free(errmsg); qDebug() << "Failed to start process: " << qerrmsg; setState(NewSoftwareAvailable); + fclose(vres.fptr); return; } #else /* WIN32 */ @@ -335,6 +376,10 @@ QStringList parameters; installDir.cdUp(); parameters << "--prefix" << installDir.path(); + parameters << "--update"; + if (isVisible()) { + parameters << "--show-after-update"; + } bool sudo_started = false; bool use_sudo = is_admin() && is_system_install(); if (use_sudo) { @@ -356,12 +401,15 @@ qDebug() << "Starting process " << filePath <<" params: " << parameters; if (!sudo_started && !QProcess::startDetached(filePath, parameters)) { qDebug() << "Failed to start process."; + fclose(vres.fptr); return; } #endif + + syslog_info_printf ("Installing update: %s\n", fileName.toUtf8().constData()); /* Installer process should now be running. We exit */ - + fclose(vres.fptr); closeApp(); } @@ -369,6 +417,22 @@ { verifyListData(); + /* Delete old temporary installers if they exist */ + QString oldUpdater = mSettings.value("Software/Updater").toString(); + + if (!oldUpdater.isEmpty()) { + qDebug() << "Removing old updater: " << oldUpdater; + QFileInfo fiUpdater(oldUpdater); + if (!QFile::remove(fiUpdater.absoluteFilePath())) { + qDebug() << "Failed to remove file"; + } else { + if (!fiUpdater.absoluteDir().rmdir(fiUpdater.absoluteDir().absolutePath())) { + qDebug() << "Failed to remove temporary directory."; + } + } + mSettings.remove("Software/Updater"); + } + if (!mSettings.contains("Software/installedDate") || mSettings.value("Software/installedVersion").toString() != QApplication::applicationVersion()) { /* This should only happen on initial startup and after an update has @@ -379,6 +443,30 @@ QDateTime listInstalledLastMod = mSettings.value("List/installedDate").toDateTime(); QDateTime swInstalledLastMod = mSettings.value("Software/installedDate").toDateTime(); + QDateTime swAvailableLastMod = mSettings.value("Software/availableDate").toDateTime(); + + if (swAvailableLastMod.isValid()) { + qDebug() << "Installed an update: " << swInstalledLastMod << + " available " << swAvailableLastMod; + syslog_info_printf ("Software has been updated to version: %s\n", + QApplication::applicationVersion().toUtf8().constData()); + if (swInstalledLastMod == swAvailableLastMod) { + QString fileName = mSettings.value("Software/available").toString(); + if (fileName.isEmpty()) { + qDebug() << "Software marked as available but no filename set."; + } else { + if (QFile::remove(fileName)) { + qDebug() << "Removed: " << fileName; + } else { + qDebug() << "Failed to remove: " << fileName; + } + } + /* Clear out available data. */ + mSettings.remove("Software/available"); + mSettings.remove("Software/availableDate"); + } + } + QString listResource = QString::fromLatin1(LIST_RESOURCE); QString swResource = QString::fromLatin1(SW_RESOURCE); @@ -388,7 +476,6 @@ swResource = mSettings.value("Software/resource", swResource).toString(); #endif - Downloader* downloader = new Downloader(this, QString::fromLatin1(SERVER_URL), QByteArray(), @@ -453,9 +540,13 @@ { /* TODO logging and handle error according to a plan */ syslog_error_printf ("Failed to check for updates: %s", message.toUtf8().constData()); - mCurMessage = message; - mTrayIcon->show(); - showMessage(); + if (!isVisible()) { + mCurMessage = message; + mTrayIcon->show(); + showMessage(); + } else { + showErrorMessage(tr("Failed to check for updates:") + "\n" + message); + } setState(TransferError); } @@ -563,58 +654,15 @@ QVBoxLayout *updatesMainLayout = new QVBoxLayout; /* The header */ - QGridLayout *updatesHeaderLayout = new QGridLayout; + QVBoxLayout *updatesHeaderLayout = new QVBoxLayout; - /* Header 1: Update date and search button */ - QHBoxLayout *updateDateAndSearchButton = new QHBoxLayout; + QGridLayout *detailsLayout = new QGridLayout; + + /* Header 1: Action buttons and summary*/ mUpdatesHeader = new QLabel("

" + tr("Certificates unchanged")+ "

"); - mLastCertUpdate = - new QLabel(tr("Installed certificates from:")); - mLastCertUpdateContents = new QLabel(QString()); - mLastCertUpdate->hide(); - mLastCertUpdateContents->hide(); - mSoftwareVersionLabel = - new QLabel(tr("TrustBridge Version:")); - mSoftwareVersionContents = new QLabel(QApplication::applicationVersion()); + updatesHeaderLayout->addWidget(mUpdatesHeader); - const QDateTime lastCheck = mSettings.value("lastUpdateCheck").toDateTime().toLocalTime(); - if (lastCheck.isValid()) { - const QString lastUpdateCheck = QLocale::system().toString(lastCheck, DATETIME_FORMAT); - mLastUpdateCheck = - new QLabel(tr("Last successful update check:")); - mLastUpdateCheckContents = new QLabel(lastUpdateCheck); - } else { - mLastUpdateCheck = new QLabel(tr("Last successful update check:")); - mLastUpdateCheckContents = new QLabel(tr("No connection with the updateserver.")); - } - QPushButton *searchUpdates = new QPushButton(" " + tr("Update")); - searchUpdates->setFixedHeight(22); - searchUpdates->setToolTip(tr("Check for Updates")); - searchUpdates->setStyleSheet("font-size: 10px;"); - searchUpdates->setIcon(QIcon(":/img/update-list.png")); - connect(searchUpdates, SIGNAL(clicked()), this, SLOT(checkUpdates())); - updateDateAndSearchButton->addWidget(mLastUpdateCheckContents); - updateDateAndSearchButton->addWidget(searchUpdates); - - // addWidget(*Widget, row, column, rowspan, colspan, [Qt::Alignment]) - updatesHeaderLayout->addWidget(mUpdatesHeader, 0, 0, 1, 2); - updatesHeaderLayout->addWidget(mSoftwareVersionLabel, 1, 0, 1, 1); - updatesHeaderLayout->addWidget(mSoftwareVersionContents, 1, 1, 1, 1); - updatesHeaderLayout->addWidget(mLastUpdateCheck, 2, 0, 1, 1); - updatesHeaderLayout->addLayout(updateDateAndSearchButton, 2, 1, 1, 1); -// updatesHeaderLayout->addWidget(mLastUpdateCheckContents, 2, 1, 1, 1); - updatesHeaderLayout->addWidget(mLastCertUpdate, 3, 0, 1, 1); - updatesHeaderLayout->addWidget(mLastCertUpdateContents, 3, 1, 1, 1); - updatesHeaderLayout->setColumnStretch(3, 1); - -// updatesHeaderLayout->addWidget(searchUpdates, 1, 4, 1, 2, Qt::AlignRight); - updatesHeaderLayout->setRowMinimumHeight(4, 15); - - /* Header 2: Action text and buttons */ - mUpdatesTip = - new QLabel(tr("There are currently no changes for your certificate stores.")); - mUpdatesTip->setWordWrap(true); QHBoxLayout *updatesHeaderActionButtonLayout = new QHBoxLayout; mQuitButton = new QPushButton(" " + tr("Quit without saving")); mQuitButton->setIcon(QIcon(":/img/application-exit.png")); @@ -633,16 +681,66 @@ connect(mQuitButton, SIGNAL(clicked()), this, SLOT(closeApp())); connect(mInstallButton, SIGNAL(clicked()), this, SLOT(checkAndInstallCerts())); - // addWidget(*Widget, row, column, rowspan, colspan) - updatesHeaderLayout->addWidget(mUpdatesTip, 5, 0, 1, 4); updatesHeaderActionButtonLayout->addWidget(mInstallButton); updatesHeaderActionButtonLayout->addWidget(mQuitButton); - updatesHeaderLayout->addLayout(updatesHeaderActionButtonLayout, 6, 0, 1, -1, Qt::AlignRight); - updatesHeaderLayout->setRowMinimumHeight(7, 10); + updatesHeaderActionButtonLayout->addStretch(-1); + + updatesHeaderLayout->addLayout(updatesHeaderActionButtonLayout); + updatesHeaderLayout->addSpacing(20); + + /* The splitter line */ + QFrame *line = new QFrame(); + line->setFrameShape(QFrame::HLine); + line->setFrameShadow(QFrame::Sunken); + updatesHeaderLayout->addWidget(line); + + updatesMainLayout->addLayout(updatesHeaderLayout); + + /* Central Header Details and update button. Part of the scroll area */ + QScrollArea *centralScrollArea = new QScrollArea; + QVBoxLayout *updatesCenterLayout = new QVBoxLayout; + mUpdatesDetailsHeader = new QLabel(QString()); + + QHBoxLayout *updateDateAndSearchButton = new QHBoxLayout; + mCertListVersion = + new QLabel(QString()); + mCertListVersionContents = new QLabel(QString()); + const QDateTime lastCheck = mSettings.value("lastUpdateCheck").toDateTime().toLocalTime(); + mLastUpdateCheck = new QLabel(tr("Last update check:")); + if (lastCheck.isValid()) { + const QString lastUpdateCheck = QLocale::system().toString(lastCheck, DATETIME_FORMAT); + mLastUpdateCheckContents = new QLabel(lastUpdateCheck); + } else { + mLastUpdateCheckContents = new QLabel(tr("No connection with the updateserver.")); + } + QPushButton *searchUpdates = new QPushButton(" " + tr("Update")); + searchUpdates->setFixedHeight(22); + searchUpdates->setToolTip(tr("Check for Updates")); + searchUpdates->setStyleSheet("font-size: 10px;"); + searchUpdates->setIcon(QIcon(":/img/update-list.png")); + connect(searchUpdates, SIGNAL(clicked()), this, SLOT(checkUpdates())); + updateDateAndSearchButton->addWidget(mLastUpdateCheckContents); + updateDateAndSearchButton->addWidget(searchUpdates); + + mUpdatesTip = + new QLabel(QString()); + mUpdatesTip->setWordWrap(true); + + // addWidget(*Widget, row, column, rowspan, colspan) + updatesCenterLayout->addWidget(mUpdatesDetailsHeader); + detailsLayout->addWidget(mLastUpdateCheck, 0, 0, 1, 1); + detailsLayout->addLayout(updateDateAndSearchButton, 0, 1, 1, 1); + detailsLayout->addWidget(mCertListVersion, 1, 0, 1, 1); + detailsLayout->addWidget(mCertListVersionContents, 1, 1, 1, 1); + detailsLayout->addItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum), 2, 2, 1, 1); + detailsLayout->setColumnStretch(2, 1); + + updatesCenterLayout->addLayout(detailsLayout); + + updatesCenterLayout->addItem(new QSpacerItem(100, 10)); + updatesCenterLayout->addWidget(mUpdatesTip); /* The central panels. */ - QScrollArea *centralScrollArea = new QScrollArea; - QVBoxLayout *updatesCenterLayout = new QVBoxLayout; QHBoxLayout *updatesNewLayout = new QHBoxLayout; QHBoxLayout *updatesRemoveLayout = new QHBoxLayout; QHBoxLayout *updatesManualLayout = new QHBoxLayout; @@ -690,10 +788,7 @@ this, SLOT(listChanged(int))); mUpdatesRemove->hide(); - mUpdatesManualCertificates = - new QLabel("

" + - tr("Manually changed certificates (%1)").arg(0) + - "

"); + mUpdatesManualCertificates = new QLabel(QString()); mUpdatesDetailsManual = new QPushButton(); mUpdatesDetailsManual->setText(" " + tr("Details")); mUpdatesDetailsManual->setToolTip(tr("Show details")); @@ -705,7 +800,6 @@ this, SLOT(toggleUpdatesManual())); mUpdatesDetailsManual->hide(); - mUpdatesManualCertificates->hide(); updatesManualLayout->addWidget(mUpdatesManualCertificates); updatesManualLayout->addWidget(mUpdatesDetailsManual); updatesManualLayout->addStretch(1); @@ -723,6 +817,7 @@ updatesCenterLayout->addWidget(mUpdatesNew); updatesCenterLayout->addLayout(updatesRemoveLayout); updatesCenterLayout->addWidget(mUpdatesRemove); + updatesCenterLayout->addSpacing(10); updatesCenterLayout->addLayout(updatesManualLayout); updatesCenterLayout->addWidget(mUpdatesManual); @@ -733,7 +828,6 @@ centralScrollArea->setFrameShape(QFrame::NoFrame); centralScrollArea->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - updatesMainLayout->addLayout(updatesHeaderLayout); updatesMainLayout->addWidget(centralScrollArea); updatesCenterLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); @@ -831,6 +925,7 @@ QVBoxLayout *mainLayout = new QVBoxLayout; QHBoxLayout *headerLayout = new QHBoxLayout; QVBoxLayout *headerTextLayout = new QVBoxLayout; + QHBoxLayout *headerSubtitleLayout = new QHBoxLayout; QHBoxLayout *centerLayout = new QHBoxLayout; QVBoxLayout *buttonBarLayout = new QVBoxLayout; QHBoxLayout *bottomLayout = new QHBoxLayout; @@ -843,8 +938,19 @@ logo->setPixmap(QPixmap::fromImage(*logoImage)); QLabel *title = new QLabel("

" + QString::fromLatin1(APPNAME) + "

"); QLabel *subTitle = new QLabel(tr("Trust in your digital communication")); + QLabel *swVersion = new QLabel(QString::fromLatin1("") + + tr("Version") + " " + QApplication::applicationVersion() + + QString::fromLatin1(" ")); + + swVersion->setTextInteractionFlags(Qt::TextSelectableByKeyboard | Qt::TextSelectableByMouse); + swVersion->setTextFormat(Qt::RichText); + + headerSubtitleLayout->addWidget(subTitle); + headerSubtitleLayout->addStretch(-1); + headerSubtitleLayout->addWidget(swVersion); + headerTextLayout->addWidget(title); - headerTextLayout->addWidget(subTitle); + headerTextLayout->addLayout(headerSubtitleLayout); headerLayout->addWidget(logo); headerLayout->addLayout(headerTextLayout); headerLayout->setStretch(0, 0); @@ -860,7 +966,7 @@ updatesButton->setBackgroundIcon(":/img/red-circle.png"); updatesButton->setIcon(QIcon(":/img/view-refresh.png")); updatesButton->setIconSize(QSize(48, 48)); - updatesButton->setText(tr("Updates")); + updatesButton->setText(tr("Pending\nchanges")); updatesButton->setFixedWidth(120); updatesButton->setFixedHeight(90); updatesButton->setCheckable(true); @@ -962,10 +1068,10 @@ * changes available */ if (changeCount() && !mUpdatesManual->certificates().size()) { mUpdatesTip->setText( - tr("You should apply the following, recommended changes to your certificate stores.")); + tr("You should apply the following, recommended changes to your certificate stores:")); } else if (changeCount()) { mUpdatesTip->setText( - tr("You can apply the following, changes to your certificate stores.")); + tr("You can apply the following, changes to your certificate stores:")); } else { mUpdatesTip->setText( tr("There are currently no changes for your certificate stores.")); @@ -979,7 +1085,7 @@ mInstallButton->setText(" " + tr("Install certificates again")); } else { mQuitButton->setText(" " + tr("Quit without saving")); - mUpdatesHeader->setText("

" + tr("Changes to certificate stores (%1)") + mUpdatesHeader->setText("

" + tr("Pending changes (%1)") .arg(changeCount()) + "

"); mInstallButton->setText(" " + tr("Apply changes")); @@ -987,14 +1093,19 @@ if (mUpdatesManual->certificates().size()) { mUpdatesDetailsManual->show(); - mUpdatesDetailsManual->setIcon(QIcon(":/img/dialog-information_16px.png")); - mUpdatesDetailsManual->setToolTip(tr("Show details")); - mUpdatesManualCertificates->show(); + if (mManualDetailsShown) { + mUpdatesManual->show(); + deactivateDetailsButton(mUpdatesDetailsManual); + } else { + activateDetailsButton(mUpdatesDetailsManual); + } } else { mUpdatesDetailsManual->hide(); - mUpdatesManualCertificates->hide(); mUpdatesManual->hide(); } + mUpdatesManualCertificates->setText("

" + + tr("Manual changes (%1)").arg(mUpdatesManual->certificates().size()) + + "

"); if (mUpdatesNew->certificates().size()) { mUpdatesNewCertificates->setText("

" + @@ -1027,6 +1138,36 @@ mUpdatesDetailsRemove->hide(); mUpdatesRemove->hide(); } + + /* Update the details header */ + if (mUpdatesRemove->certificates().size() || + mUpdatesNew->certificates().size()) { + mUpdatesDetailsHeader->setText("

" + + tr("New, recommended changes (%1/%2)") + .arg(mUpdatesRemove->selectedCertCount() + + mUpdatesNew->selectedCertCount()) + .arg(mUpdatesRemove->certificates().size() + + mUpdatesNew->certificates().size()) + + "

"); + } else { + mUpdatesDetailsHeader->setText(QString::fromLatin1("

") + + tr("No new recommendations") + QString::fromLatin1("

")); + } + + if (mListToInstall.isValid()) { + mCertListVersion->setText(tr("Certificate list from:")); + mCertListVersionContents->setText(QLocale::system().toString( + mListToInstall.date().toLocalTime(), DATETIME_FORMAT)); + } else { + if (mInstalledList.isValid()) { + mCertListVersion->setText(tr("Currently installed certificate list:")); + mCertListVersionContents->setText(QLocale::system().toString( + mInstalledList.date().toLocalTime(), DATETIME_FORMAT)); + } else { + mCertListVersion->setText(tr("No certificate list installed.")); + mCertListVersionContents->setText(""); + } + } } void MainWindow::loadCertificateList() @@ -1048,11 +1189,37 @@ bool state = !mPreviouslyUnselected.contains(cert.base64Line()); if (cert.isInstallCert()) { oldInstallCerts.append(cert); - mInstallList->addCertificate(cert, state); + QToolButton* actionBtn = new QToolButton(); + QIcon btnIcon; + if (!state) { + btnIcon.addFile(":/img/write-into-48.png", QSize(48, 48), QIcon::Normal, QIcon::Off); + btnIcon.addFile(":/img/security-low.png", QSize(48, 48), QIcon::Normal, QIcon::On); + actionBtn->setProperty("ToolTip_Off", tr("Certificate will be installed.")); + actionBtn->setProperty("ToolTip_On", tr("Certifcate is not installed.")); + } else { + actionBtn->setProperty("ToolTip_Off", tr("Certificate is installed.")); + actionBtn->setProperty("ToolTip_On", tr("Certificate will be removed.")); + btnIcon.addFile(":/img/security-high.png", QSize(48, 48), QIcon::Normal, QIcon::Off); + btnIcon.addFile(":/img/write-remove-48.png", QSize(48, 48), QIcon::Normal, QIcon::On); + } + actionBtn->setIcon(btnIcon); + mInstallList->addCertificate(cert, state, actionBtn); } else { oldRemoveCerts.append(cert); - mRemoveList->addCertificate(cert, state, !state); + QToolButton* actionBtn = new QToolButton(); + QIcon btnIcon; + actionBtn->setProperty("ToolTip_Off", tr("Certificate will be removed.")); + actionBtn->setProperty("ToolTip_On", tr("Certificate has not been removed.")); + btnIcon.addFile(":/img/write-remove-48.png", QSize(48, 48), QIcon::Normal, QIcon::Off); + btnIcon.addFile(":/img/security-medium.png", QSize(48, 48), QIcon::Normal, QIcon::On); + btnIcon.addFile(":/img/trash-empty.png", QSize(48, 48), QIcon::Disabled, QIcon::Off); + actionBtn->setIcon(btnIcon); + if (state) { + actionBtn->setEnabled(false); + actionBtn->setToolTip(tr("Certificate has been removed.")); + } + mRemoveList->addCertificate(cert, state, actionBtn); } } } @@ -1065,13 +1232,26 @@ if (mInstalledList.getCertificates().contains(cert)) { // Was in the old list. oldInstallCerts.append(cert); - mInstallList->addCertificate(cert, state); + QToolButton* actionBtn = new QToolButton(); + QIcon btnIcon; + actionBtn->setProperty("ToolTip_Off", tr("Certificate is installed.")); + actionBtn->setProperty("ToolTip_On", tr("Certifcate is not installed.")); + btnIcon.addFile(":/img/security-high.png", QSize(48, 48), QIcon::Normal, QIcon::Off); + btnIcon.addFile(":/img/security-low.png", QSize(48, 48), QIcon::Normal, QIcon::On); + actionBtn->setIcon(btnIcon); + mInstallList->addCertificate(cert, state, actionBtn); } else { // Is a brand new certificate newInstallCerts.append(cert); - mUpdatesNew->addCertificate(cert, state, true, - tr("install"), tr("ignore")); + QToolButton* actionBtn = new QToolButton(); + QIcon btnIcon; + actionBtn->setProperty("ToolTip_Off", tr("Certificate will be installed.")); + actionBtn->setProperty("ToolTip_On", tr("Certificate will not be installed.")); + btnIcon.addFile(":/img/write-into-48.png", QSize(48, 48), QIcon::Normal, QIcon::Off); + btnIcon.addFile(":/img/security-low.png", QSize(48, 48), QIcon::Normal, QIcon::On); + actionBtn->setIcon(btnIcon); + mUpdatesNew->addCertificate(cert, state, actionBtn); } } else { @@ -1080,27 +1260,37 @@ // Was in the old list. oldRemoveCerts.append(cert); // Is removed, so set editable to false. - mRemoveList->addCertificate(cert, state, !state); + QToolButton* actionBtn = new QToolButton(); + QIcon btnIcon; + actionBtn->setProperty("ToolTip_Off", tr("Certificate will be removed.")); + actionBtn->setProperty("ToolTip_On", tr("Certificate has not been removed.")); + btnIcon.addFile(":/img/write-remove-48.png", QSize(48, 48), QIcon::Normal, QIcon::Off); + btnIcon.addFile(":/img/security-medium.png", QSize(48, 48), QIcon::Normal, QIcon::On); + btnIcon.addFile(":/img/trash-empty.png", QSize(48, 48), QIcon::Disabled, QIcon::Off); + actionBtn->setIcon(btnIcon); + if (state) { + actionBtn->setEnabled(false); + actionBtn->setToolTip(tr("Certificate has been removed.")); + } + mRemoveList->addCertificate(cert, state, actionBtn); } else { // Was in the old list with status "install" and now has the // status "remove". newRemoveCerts.append(cert); - mUpdatesRemove->addCertificate(cert, state); + QToolButton* actionBtn = new QToolButton(); + QIcon btnIcon; + actionBtn->setProperty("ToolTip_Off", tr("Certificate will be removed.")); + actionBtn->setProperty("ToolTip_On", tr("Certificate will not be removed.")); + btnIcon.addFile(":/img/write-remove-48.png", QSize(48, 48), QIcon::Normal, QIcon::Off); + btnIcon.addFile(":/img/security-medium.png", QSize(48, 48), QIcon::Normal, QIcon::On); + actionBtn->setIcon(btnIcon); + mUpdatesRemove->addCertificate(cert, state, actionBtn); } } } } - if (mInstalledList.date().isValid()) { - mLastCertUpdateContents->setText(QLocale::system().toString(mInstalledList.date().toLocalTime(), - DATETIME_FORMAT)); - mLastCertUpdate->show(); - mLastCertUpdateContents->show(); - } - mUpdatesManualCertificates->setText("

" + - tr("Manually changed certificates (%1)").arg(0) + - "

"); listChanged(0); } @@ -1193,7 +1383,7 @@ if (!is_system_install()) { QMessageBox::warning(this, tr("Installation with standard user account"), - tr("Windows will now ask you to confirm qeach root certificate modification " + tr("Windows will now ask you to confirm each root certificate modification " "because TrustBridge does not have the necessary privileges to install " "root certificates into the Windows certificate store silently.")); } @@ -1207,11 +1397,17 @@ progress->setMinimumDuration(0); progress->show(); + CertificateList *instList = mListToInstall.isValid() ? + &mListToInstall : + &mInstalledList; + InstallWrapper *instWrap = new InstallWrapper(this, - mListToInstall.isValid() ? - mListToInstall.fileName() : - mInstalledList.fileName(), + instList->fileName(), choices); + + syslog_info_printf ("Installing certificate list: '%s' Version '%s'\n", + instList->fileName().toUtf8().constData(), + instList->date().toString().toUtf8().constData()); /* Clean up object and progress dialog */ connect(instWrap, SIGNAL(finished()), instWrap, SLOT(deleteLater())); connect(instWrap, SIGNAL(finished()), progress, SLOT(deleteLater())); @@ -1258,27 +1454,24 @@ void MainWindow::toggleInManual(bool state, const Certificate &cert) { if (!mUpdatesManual->contains(cert)) { - mUpdatesManual->addCertificate(cert, state); + QToolButton* actionBtn = new QToolButton(); + QIcon btnIcon; + btnIcon.addFile(":/img/write-into-48.png", QSize(48, 48), QIcon::Normal, QIcon::On); + btnIcon.addFile(":/img/write-remove-48.png", QSize(48, 48), QIcon::Normal, QIcon::Off); + actionBtn->setProperty("ToolTip_On", tr("Certificate will be installed.")); + actionBtn->setProperty("ToolTip_Off", tr("Certificate will be removed.")); + actionBtn->setIcon(btnIcon); + mUpdatesManual->addCertificate(cert, state, actionBtn); } else { mUpdatesManual->removeCertificate(cert); } - - mUpdatesManualCertificates->setText("

" + - tr("Manually changed certificates (%1)") - .arg(mUpdatesManual->certificates().size()) + - "

"); } void MainWindow::removeFromManual(bool state, const Certificate &cert) { mUpdatesManual->removeCertificate(cert); - mUpdatesManualCertificates->setText("

" + - tr("Manually changed certificates (%1)") - .arg(mUpdatesManual->certificates().size()) + - "

"); - if (cert.isInstallCert()) { mInstallList->setCertState(state, cert); } @@ -1332,42 +1525,50 @@ return; } +static void deactivateDetailsButton(QPushButton *btn) { + btn->setToolTip(QObject::tr("Hide details")); + btn->setText(" " + QObject::tr("Less")); + btn->setIcon(QIcon(":/img/dialog-information_grey_16px.png")); +} + +static void activateDetailsButton(QPushButton *btn) { + btn->setToolTip(QObject::tr("Show details")); + btn->setText(" " + QObject::tr("Details")); + btn->setIcon(QIcon(":/img/dialog-information_16px.png")); +} + void MainWindow::toggleUpdatesNew() { if (!mUpdatesNew->isVisible()) { - mUpdatesDetailsNew->setToolTip(tr("Hide details")); - mUpdatesDetailsNew->setIcon(QIcon(":/img/dialog-information_grey_16px.png")); mUpdatesNew->show(); + deactivateDetailsButton(mUpdatesDetailsNew); } else { mUpdatesNew->hide(); - mUpdatesDetailsNew->setToolTip(tr("Show details")); - mUpdatesDetailsNew->setIcon(QIcon(":/img/dialog-information_16px.png")); + activateDetailsButton(mUpdatesDetailsNew); } } void MainWindow::toggleUpdatesRemove() { if (!mUpdatesRemove->isVisible()) { - mUpdatesDetailsRemove->setToolTip(tr("Hide details")); - mUpdatesDetailsRemove->setIcon(QIcon(":/img/dialog-information_grey_16px.png")); mUpdatesRemove->show(); + deactivateDetailsButton(mUpdatesDetailsRemove); } else { mUpdatesRemove->hide(); - mUpdatesDetailsRemove->setToolTip(tr("Show details")); - mUpdatesDetailsRemove->setIcon(QIcon(":/img/dialog-information_16px.png")); + activateDetailsButton(mUpdatesDetailsRemove); } } void MainWindow::toggleUpdatesManual() { if (!mUpdatesManual->isVisible()) { - mUpdatesDetailsManual->setToolTip(tr("Hide details")); - mUpdatesDetailsManual->setIcon(QIcon(":/img/dialog-information_grey_16px.png")); mUpdatesManual->show(); + mManualDetailsShown = true; + deactivateDetailsButton(mUpdatesDetailsManual); } else { - mUpdatesDetailsManual->setToolTip(tr("Show details")); - mUpdatesDetailsManual->setIcon(QIcon(":/img/dialog-information_16px.png")); mUpdatesManual->hide(); + mManualDetailsShown = false; + activateDetailsButton(mUpdatesDetailsManual); } } @@ -1392,7 +1593,8 @@ mLastUpdateCheck->show(); syslog_info_printf(tr("Sucessfully checked for updates.").toUtf8().constData()); } - if (getState() != NewSoftwareAvailable && getState() != NewListAvailable && mTrayMode) { + if ((getState() != NewSoftwareAvailable && getState() != NewListAvailable && mTrayMode) + && !isVisible()) { qDebug() << "Shutting down as no list or Software is available."; closeApp(); } else { @@ -1442,3 +1644,8 @@ free (inst_dir); return; } + +void MainWindow::showErrorMessage(const QString &msg) +{ + QMessageBox::warning(this, tr("TrustBridge error"), msg); +} diff -r 1c1964c27b39 -r fd85a02d771d ui/mainwindow.h --- a/ui/mainwindow.h Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/mainwindow.h Tue Sep 16 19:45:19 2014 +0200 @@ -169,6 +169,13 @@ * the application. */ void installNewSW(const QString& fileName, const QDateTime& modDate); + /** @brief show an error message + * + * This is a wrapper around QMessageBox to allow for central + * styling of error messages. + */ + void showErrorMessage(const QString &msg); + signals: /** @brief emits the changecount as a string when it changes */ void changesChanged(const QString& cnt); @@ -217,11 +224,14 @@ * (accessible via button panel) */ QWidget *createRemoveWidget(); - /* Are we running in tray mode ?*/ + /** @brief true if the software is running in tray mode*/ const bool mTrayMode; - /* The message currently shown at intervals */ + + /** @brief The currently shown message */ QString mCurMessage; + /** @brief The version the Software thinks is installed */ QString mInstalledSWVersion; + /** @brief The certificate list the Software thinks is installed */ QString mInstalledListVersion; QSettings mSettings; @@ -253,10 +263,9 @@ QWidget *mInfoWidget; QLabel *mUpdatesHeader; - QLabel *mLastCertUpdate; - QLabel *mLastCertUpdateContents; - QLabel *mSoftwareVersionLabel; - QLabel *mSoftwareVersionContents; + QLabel *mUpdatesDetailsHeader; + QLabel *mCertListVersion; + QLabel *mCertListVersionContents; QLabel *mLastUpdateCheck; QLabel *mLastUpdateCheckContents; QLabel *mUpdatesNewCertificates; @@ -280,6 +289,7 @@ QPushButton *mInstallButton; int mChangeCount; + bool mManualDetailsShown; }; #endif // MAINWINDOW_H diff -r 1c1964c27b39 -r fd85a02d771d ui/processhelp.h --- a/ui/processhelp.h Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/processhelp.h Tue Sep 16 19:45:19 2014 +0200 @@ -15,8 +15,8 @@ #include /** - * @file Static helper functions for process handling - * @brief process handling functions + * @file processhelp.h + * @brief Static helper functions for process handling */ namespace ProcessHelp diff -r 1c1964c27b39 -r fd85a02d771d ui/processwaitdialog.h --- a/ui/processwaitdialog.h Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/processwaitdialog.h Tue Sep 16 19:45:19 2014 +0200 @@ -10,7 +10,9 @@ #include #include -/** @file Dialog to show that some processes need to be closed +/** + * @file processwaitdialog.h + * @brief Dialog to show that some processes need to be closed * * This dialog informs about processes that are still running and * need to be closed. diff -r 1c1964c27b39 -r fd85a02d771d ui/proxysettingsdlg.cpp --- a/ui/proxysettingsdlg.cpp Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/proxysettingsdlg.cpp Tue Sep 16 19:45:19 2014 +0200 @@ -16,6 +16,7 @@ #include #include #include +#include #include "proxysettingsdlg.h" @@ -35,18 +36,27 @@ iconTextLayout->addWidget(iconLabel); QLabel *explanation = new QLabel(tr("Please enter the proxy server to use in the field below.") + - "
" + tr("The URL can follow the scheme:") + " " + - tr("<username>:<password>@<hostname>:<port>") + - "

"); + " " + tr("The URL can follow the scheme:") + "
" + + tr("[<username>:<password>@]<hostname>[:<port>]") + + "

"); explanation->setTextFormat(Qt::RichText); explanation->setWordWrap(true); iconTextLayout->addWidget(explanation); mainLayout->addLayout(iconTextLayout); + bool useProxy = settings.value("UseProxy", false).toBool(); + mCheckBox = new QCheckBox(tr("Use Proxy Server")); + mCheckBox->setTristate(false); + mCheckBox->setCheckState(useProxy ? Qt::Checked : Qt::Unchecked); + + mainLayout->addWidget(mCheckBox); + mProxyURL = new QLineEdit(settings.value("ProxyURL").toString()); QLabel *proxyLabel = new QLabel(tr("Proxy Server:")); proxyLabel->setBuddy(mProxyURL); + mProxyURL->setReadOnly(!useProxy); + mProxyURL->setEnabled(useProxy); labelLineLayout->addWidget(proxyLabel); labelLineLayout->addWidget(mProxyURL); @@ -61,6 +71,7 @@ connect(mSaveButton, SIGNAL(clicked()), this, SLOT(save())); connect(mProxyURL, SIGNAL(textChanged(const QString &)), this, SLOT(checkCanSave(const QString&))); + connect(mCheckBox, SIGNAL(stateChanged(int)), this, SLOT(checkCanEdit(int))); mainLayout->addLayout(labelLineLayout); mainLayout->addLayout(okCancelLayout); @@ -69,12 +80,19 @@ } void ProxySettingsDlg::checkCanSave(const QString &val) { - mSaveButton->setEnabled(val.isEmpty() || QUrl(val).isValid()); + mSaveButton->setEnabled(mCheckBox->checkState() == Qt::Unchecked || + QUrl(val).isValid()); +} + +void ProxySettingsDlg::checkCanEdit(int state) { + mProxyURL->setReadOnly(state != Qt::Checked); + mProxyURL->setEnabled(state == Qt::Checked); } void ProxySettingsDlg::save() { QSettings settings; settings.setValue("ProxyURL", mProxyURL->text()); + settings.setValue("UseProxy", mCheckBox->checkState() == Qt::Checked); settings.sync(); accept(); } diff -r 1c1964c27b39 -r fd85a02d771d ui/proxysettingsdlg.h --- a/ui/proxysettingsdlg.h Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/proxysettingsdlg.h Tue Sep 16 19:45:19 2014 +0200 @@ -12,8 +12,12 @@ class QLineEdit; class QPushButton; +class QCheckBox; -/** @file Small dialog for proxy settings. */ +/** + * @file proxysettingsdlg.h + * @brief Small dialog for proxy settings. + */ class ProxySettingsDlg : public QDialog { @@ -29,9 +33,13 @@ /** @brief save the contents of mProxyURL in the settings. */ void save(); + /** @brief make the URL editiable depending on UseProxy setting. */ + void checkCanEdit(int state); + private: QLineEdit *mProxyURL; QPushButton *mSaveButton; + QCheckBox *mCheckBox; }; #endif // PROXYSETTINGSDLG_H diff -r 1c1964c27b39 -r fd85a02d771d ui/sslconnection.cpp --- a/ui/sslconnection.cpp Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/sslconnection.cpp Tue Sep 16 19:45:19 2014 +0200 @@ -6,7 +6,10 @@ * See LICENSE.txt for details. */ -/**@file base implemetation of sslconnection. */ +/** + * @file sslconnection.cpp + * @brief Base implemetation of sslconnection. + */ #include "sslconnection.h" @@ -25,9 +28,9 @@ if (certificate.isEmpty()) { #ifdef RELEASE_BUILD /* TODO Change certificate here in case of release build */ - QFile certResource(":certs/intevation.de"); + QFile certResource(":certs/ssl-test"); #else - QFile certResource(":certs/intevation.de"); + QFile certResource(":certs/ssl-test"); #endif certResource.open(QFile::ReadOnly); mPinnedCert = certResource.readAll(); diff -r 1c1964c27b39 -r fd85a02d771d ui/sslconnection.h --- a/ui/sslconnection.h Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/sslconnection.h Tue Sep 16 19:45:19 2014 +0200 @@ -88,7 +88,7 @@ /** @brief Set acceptable ciphersuites. * - * @param [in] cipers a zero terminated list of ciphers as defined in + * @param [in] ciphers a zero terminated list of ciphers as defined in * polarssl/ssl_ciphersuites.h */ virtual void setCiphersuites(int ciphers[]) = 0; diff -r 1c1964c27b39 -r fd85a02d771d ui/sslconnection_curl.cpp --- a/ui/sslconnection_curl.cpp Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/sslconnection_curl.cpp Tue Sep 16 19:45:19 2014 +0200 @@ -7,12 +7,11 @@ */ #include "sslconnection_curl.h" +#include "logging.h" #include #include -#undef CONNECTION_DEBUG - SSLConnectionCurl::SSLConnectionCurl(const QString& url, const QByteArray& certificate): SSLConnection (url, certificate), @@ -26,25 +25,7 @@ return; } -#ifdef RELEASE_BUILD if (curl_easy_setopt(mCurl, CURLOPT_SSL_VERIFYPEER, 1L) != CURLE_OK) { -#else - /* For testing we do not have to trust the issuer. This should not - * be dangerous as we pin the peer certificate directly. */ - if (curl_easy_setopt(mCurl, CURLOPT_SSL_VERIFYPEER, 0L) != CURLE_OK) { -#endif - /* Should be default anyway */ - qDebug() << "Setting verifypeer failed"; - return; - } - -#ifdef RELEASE_BUILD - if (curl_easy_setopt(mCurl, CURLOPT_SSL_VERIFYHOST, 1L) != CURLE_OK) { -#else - /* For testing we do not have to trust host. This should not - * be dangerous as we pin the peer certificate directly. */ - if (curl_easy_setopt(mCurl, CURLOPT_SSL_VERIFYHOST, 0L) != CURLE_OK) { -#endif /* Should be default anyway */ qDebug() << "Setting verifypeer failed"; return; @@ -55,12 +36,10 @@ return; } -#ifdef RELEASE_BUILD if (curl_easy_setopt(mCurl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2) != CURLE_OK) { qDebug() << "Setting ssl version failed."; return; } -#endif mCertFile.open(); if (mCertFile.write(mPinnedCert) != mPinnedCert.size()) { @@ -83,10 +62,9 @@ return; } mInitialized = true; - -#ifdef CONNECTION_DEBUG - curl_easy_setopt(mCurl, CURLOPT_VERBOSE, 1L); -#endif + if (g_debug) { + curl_easy_setopt(mCurl, CURLOPT_VERBOSE, 1L); + } } SSLConnectionCurl::~SSLConnectionCurl() { @@ -151,6 +129,15 @@ return written; } +size_t debug_write(void *ptr, size_t size, size_t nmemb, + void *unused) +{ + Q_UNUSED(unused); + + qDebug() << QString::fromUtf8((const char *)ptr, size * nmemb); + return size *nmemb; +} + bool SSLConnectionCurl::downloadFile(const QString &resource, const QString &fileName, size_t maxSize) @@ -213,6 +200,11 @@ QUrl urlCopy = mUrl; urlCopy.setPath(resource); + if (curl_easy_setopt(mCurl, CURLOPT_WRITEFUNCTION, debug_write) != CURLE_OK) { + qDebug() << "Failed to set write function"; + return QDateTime(); + } + if (curl_easy_setopt(mCurl, CURLOPT_URL, urlCopy.toEncoded().constData()) != CURLE_OK) { qDebug() << "Failed to set URL"; return QDateTime(); diff -r 1c1964c27b39 -r fd85a02d771d ui/taskscheduler.h --- a/ui/taskscheduler.h Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/taskscheduler.h Tue Sep 16 19:45:19 2014 +0200 @@ -9,8 +9,10 @@ #define TASKSCHEDULER_H /** - * @file Interface to the Task Scheduler API - * @brief Provides a Qt / C++ API to work with the windows task scheduler + * @file taskscheduler.h + * @brief Interface to the Task Scheduler API + * + * Provides a Qt / C++ API to work with the windows task scheduler. */ #include diff -r 1c1964c27b39 -r fd85a02d771d ui/tests/CMakeLists.txt --- a/ui/tests/CMakeLists.txt Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/tests/CMakeLists.txt Tue Sep 16 19:45:19 2014 +0200 @@ -15,7 +15,6 @@ find_package(Qt5Test) include_directories(${Qt5Test_INCLUDE_DIRS}) find_program(HIAWATHA_EXECUTABLE hiawatha) -find_program(OSSLSIGNCODE_EXECUTABLE osslsigncode) find_program(OPENSSL_EXECUTABLE openssl) if (NOT HIAWATHA_EXECUTABLE) @@ -24,10 +23,6 @@ add_definitions(-DHIAWATHA_EXECUTABLE="${HIAWATHA_EXECUTABLE}") endif() -if (WIN32 AND NOT OSSLSIGNCODE_EXECUTABLE) - message (STATUS "WARNING: osslsigncode not found. Authenticode tests will not be run.") -endif() - if (UNIX AND NOT OPENSSL_EXECUTABLE) message (STATUS "WARNING: openssl (the tool) not found. Binary verification tests will not be run.") endif() @@ -69,7 +64,9 @@ add_custom_test(commontest.cpp "") add_custom_test(createcertlisttest.cpp "") -add_custom_test(mainwindowtest.cpp "") + +# Disabled for now at it executes too much and brings up the mainwindow +# add_custom_test(mainwindowtest.cpp "") # Using fakeinstaller here would cause windows UAC heuristics to trigger add_executable(fakeinst fakeinstaller.c) @@ -77,7 +74,7 @@ if (WIN32) add_custom_test(windowsstoretest.cpp "${CMAKE_SOURCE_DIR}/cinst/windowsstore.c") - if (NOT "${CMAKE_STRIP}") + if (NOT CMAKE_STRIP) message(STATUS "WARNING CMAKE_STRIP not set. Please set this in your toolchain file. Falling back to: i686-w64-mingw32-strip") set (CMAKE_STRIP "i686-w64-mingw32-strip") endif() diff -r 1c1964c27b39 -r fd85a02d771d ui/tests/binverifytest.cpp --- a/ui/tests/binverifytest.cpp Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/tests/binverifytest.cpp Tue Sep 16 19:45:19 2014 +0200 @@ -30,17 +30,17 @@ /* Some general robustness checks */ void BinVerifyTest::testMiscErrors() { - QVERIFY (verify_binary (NULL, 10) != VerifyValid); - QVERIFY (verify_binary ("foo", 10) != VerifyValid); - QVERIFY (verify_binary ("bar", -1) != VerifyValid); + QVERIFY (verify_binary (NULL, 10).result != VerifyValid); + QVERIFY (verify_binary ("foo", 10).result != VerifyValid); + QVERIFY (verify_binary ("bar", -1).result!= VerifyValid); /* On windows the next line will check that a valid microsoft * signed executable is not valid for us (pinning). On linux * it will just fail with a read error which we tested above */ #ifdef Q_OS_WIN QVERIFY (verify_binary ("c:\\Windows\\System32\\mmc.exe", - strlen("c:\\Windows\\System32\\mmc.exe")) != VerifyInvalidCertificate); + strlen("c:\\Windows\\System32\\mmc.exe")).result != VerifyInvalidCertificate); #endif - QVERIFY (verify_binary ("/dev/null", strlen("/dev/null")) != VerifyValid); + QVERIFY (verify_binary ("/dev/null", strlen("/dev/null")).result != VerifyValid); } /* Check that a signature with only a different key (of the same size) @@ -48,14 +48,16 @@ void BinVerifyTest::testOtherKey() { QVERIFY(VerifyInvalidSignature == verify_binary ("fakeinst-other-key" EXE_SUFFIX, - strlen("fakeinst-other-key" EXE_SUFFIX))); + strlen("fakeinst-other-key" EXE_SUFFIX)).result); } /* Check that an invalid signature is not validated */ void BinVerifyTest::testInvalidSig() { - QVERIFY(VerifyValid != verify_binary ("fakeinst-invalid" EXE_SUFFIX, - strlen("fakeinst-invalid" EXE_SUFFIX))); + bin_verify_result res = verify_binary ("fakeinst-invalid" EXE_SUFFIX, + strlen("fakeinst-invalid" EXE_SUFFIX)); + QVERIFY(VerifyValid != res.result); + QVERIFY(res.fptr == NULL); } #ifdef Q_OS_WIN @@ -64,22 +66,34 @@ void BinVerifyTest::testOtherCert() { QVERIFY(VerifyInvalidCertificate == verify_binary ("fakeinst-other-cert" EXE_SUFFIX, - strlen("fakeinst-other-cert" EXE_SUFFIX))); + strlen("fakeinst-other-cert" EXE_SUFFIX)).result); } #endif /* Check that no signature is not validated */ void BinVerifyTest::testNoSignature() { - QVERIFY(VerifyValid != verify_binary ("fakeinst" EXE_SUFFIX, - strlen("fakeinst" EXE_SUFFIX))); + bin_verify_result res = verify_binary ("fakeinst" EXE_SUFFIX, + strlen("fakeinst" EXE_SUFFIX)); + QVERIFY(VerifyValid != res.result); + QVERIFY(res.fptr == NULL); } /* Check that a valid signed executable is verified */ void BinVerifyTest::testValidBinary() { - QVERIFY (VerifyValid == verify_binary ("fakeinst-signed" EXE_SUFFIX, - strlen("fakeinst-signed" EXE_SUFFIX))); + bin_verify_result res = verify_binary ("fakeinst-signed" EXE_SUFFIX, + strlen("fakeinst-signed" EXE_SUFFIX)); + QVERIFY (VerifyValid == res.result); + QFile thefile ("fakeinst-signed" EXE_SUFFIX); +#ifdef WIN32 + /* Verifies the deny write open mode. But on linuy we dont have it. */ + QVERIFY (!thefile.open(QIODevice::ReadWrite)); +#endif + QVERIFY (res.fptr != NULL); + fclose(res.fptr); + QVERIFY (thefile.open(QIODevice::ReadWrite)); + thefile.close(); } void BinVerifyTest::testSignatureCreation() @@ -95,8 +109,10 @@ bool ret = theDialog->appendTextSignatureToFile (garbage, outfile.fileName()); QVERIFY(QFile::remove(garbage)); QVERIFY(ret == true); - QVERIFY(VerifyValid == verify_binary (outfile.fileName().toUtf8().constData(), - outfile.fileName().toUtf8().size())); + bin_verify_result res = verify_binary (outfile.fileName().toUtf8().constData(), + outfile.fileName().toUtf8().size()); + QVERIFY(VerifyValid == res.result); } +bool g_debug = true; QTEST_MAIN (BinVerifyTest); diff -r 1c1964c27b39 -r fd85a02d771d ui/tests/cinstprocesstest.cpp --- a/ui/tests/cinstprocesstest.cpp Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/tests/cinstprocesstest.cpp Tue Sep 16 19:45:19 2014 +0200 @@ -32,8 +32,11 @@ } } + QStringList newArgs = args; + newArgs << "--debug"; + QProcess *installerProcess = new QProcess(); - installerProcess->setArguments(args); + installerProcess->setArguments(newArgs); installerProcess->setProgram(processPath); installerProcess->start(); installerProcess->waitForStarted(); diff -r 1c1964c27b39 -r fd85a02d771d ui/tests/createcertlisttest.cpp --- a/ui/tests/createcertlisttest.cpp Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/tests/createcertlisttest.cpp Tue Sep 16 19:45:19 2014 +0200 @@ -84,4 +84,6 @@ QVERIFY(signature.toBase64() == QByteArray("KMOni98NWbt6SWd13H0JlGA1B7hBlXWH84e883s7gMrWeCCj0fUyHmdsNCyY0rmosu+o9mo2K847S3CdnxFPPJcjbfcmILZWRw0hHMtUYta1i9jypHJbz4oznuDctgXz59L4SQzzliCNUzItNoe6UpUznkS5gja4ZHbzqIj3qDVX3H86Z+qOdLICw+LXKlTs5ghsq+SdhZRAFFpHnt+URICWHjEIQKRlmIGEUIh1NgEHInHB/teFLqNGJMu1khi0MTsWDzesAEF5LQTM7Fo3fKmVxEUSbHKupluZrX1XSfnp5w3MaxBQK/t5nFvkVVdFrdEWvb68FIkMt21XqCvjyCPG2oWNh9jjfx3/R+eQ8kFbXzgUIhlZNxbB7bOCVDe2fYNxlXhy+HAqfHsIDP8qegHU+ngLck7tJHScC5dZwTCBDL6sxAvaeGyb3m6FraqaipNI+SGLii63ou9H7PlH5xWOTY9JvJDXGpfjN9U0UrZ6X5hPutOa/llT7s0pmoQb")); } +bool g_debug = true; + QTEST_GUILESS_MAIN (CreateCertListTest); diff -r 1c1964c27b39 -r fd85a02d771d ui/tests/data/NOTES --- a/ui/tests/data/NOTES Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/tests/data/NOTES Tue Sep 16 19:45:19 2014 +0200 @@ -130,3 +130,57 @@ not_before=20130101000000 not_after=20151231235959 \ key_usage=digital_signature \ ns_cert_type=object_signing + +# Testserver mit hiawatha +apt-get install build-essential cmake libxslt-dev libxml2-dev libz-dev + + wget https://www.hiawatha-webserver.org/files/hiawatha-9.7.tar.gz + sha256sum hiawatha-9.7.tar.gz + +e8581336883b7b963f38572f6396f8c47b43e5bedd3147d052fa3652e6c0ed86 hiawatha-9.7.tar.gz + + mkdir hiawatha-prefix + tar -xf hiawatha-9.7.tar.gz + cd hiawatha-9.7 + mkdir build + cd build + cmake .. -DCMAKE_INSTALL_PREFIX=/home/intevation/hiawatha-prefix + make && make install + +# Root CA + gen_key filename=ssl_root.key + cert_write issuer_name="CN=TrustBridge SSL Test CA,O=Public secret do not trust this,C=DE" \ + selfsign=1 issuer_key=ssl_root.key \ + not_before=20130101000000 not_after=20151231235959 \ + is_ca=1 max_pathlen=0 output_file=ssl_root.pem + +# SSL cert + gen_key type=ec ec_curve=brainpoolP256r1 filename=ssl-test.key + cert_req filename=ssl-test.key output_file=ssl-test.csr \ + subject_name="CN=tb-devel.intevation.de,O=Public secret do not trust this,C=DE" \ + ns_cert_type=ssl_server + +# Sign it + cert_write request_file=ssl-test.csr issuer_crt=ssl_root.pem \ + issuer_key=ssl_root.key output_file=ssl-test.pem \ + not_before=20130101000000 not_after=20151231235959 \ + ns_cert_type=ssl_server + + cat ssl-test.pem ssl-test.key > ssl-test-combined.pem + +# Kopieren des Zertifikats nach /home/intevation auf dem testserver +# Editieren von /home/intevation/hiawatha-prefix/etc/hiawatha + +# Binding settings: + Port = 44413 + SSLcertFile = /home/intevation/ssl-test-combined.pem + +# Default website settings + Hostname = thetis.intevation.de:44413 + WebsiteRoot = /home/intevation/m13-files + StartFile = index.html + +# Trustbridge download ordner nach /home/intevation/m13-files kopieren. + + screen -R server + /home/intevation/hiawatha-prefix/sbin/hiawatha -d diff -r 1c1964c27b39 -r fd85a02d771d ui/tests/data/ssl-test.pem --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/tests/data/ssl-test.pem Tue Sep 16 19:45:19 2014 +0200 @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIIDwjCCAaqgAwIBAgIBATANBgkqhkiG9w0BAQUFADBZMSAwHgYDVQQDExdUcnVz +dEJyaWRnZSBTU0wgVGVzdCBDQTEoMCYGA1UEChMfUHVibGljIHNlY3JldCBkbyBu +b3QgdHJ1c3QgdGhpczELMAkGA1UEBhMCREUwHhcNMTMwMTAxMDAwMDAwWhcNMTUx +MjMxMjM1OTU5WjBYMR8wHQYDVQQDExZ0Yi1kZXZlbC5pbnRldmF0aW9uLmRlMSgw +JgYDVQQKEx9QdWJsaWMgc2VjcmV0IGRvIG5vdCB0cnVzdCB0aGlzMQswCQYDVQQG +EwJERTBaMBQGByqGSM49AgEGCSskAwMCCAEBBwNCAARDyErp7HHK72FWzjC/S3Tf +FnU6UuUAt9A46KOQpdxDYnRTg0bsdXnu2Pdh0g/Hj8vVe1rvyVrEMux4LLnL8q/1 +o2AwXjAJBgNVHRMEAjAAMB0GA1UdDgQWBBSeaZrzvOqRFK/HS2+ipUxQ4WE8kzAf +BgNVHSMEGDAWgBRrgmr4LKgEyDNB0FdDpty3dHHZ3zARBglghkgBhvhCAQEEBAMC +AEAwDQYJKoZIhvcNAQEFBQADggIBAEgWk/jA7wH4+5xr18WoA7v+VgNGnmJom3bA +kMA6y/iXaqIjbP+KRNvM32so4a3V2Q453DVdj2aaUW4RlcrSq+4G7XmSS8i5FvY3 +L/OMMvMao26ZMKmSDTpgTAI/fLq7q56T+WSUbUex6r0K5ECPDw1fmfDwCcxjkWoI +YGGmEPkRUvAnaD9PeuUd0ldL85wRxZ02PlOKAQcGWG7BvTj3tP8CeXfR9vTDO4t1 +5DgTHz/ug3DtF8oJE+CVT0QsfbTYyHiUbLlpZz6wJNYkWlb7iYb1dO4yVx3k8xhW +zvm3id6+8nPsTbt6I5P428t3+rlr05lrNdiaATTOzvRgp25jSBJHY1uIYyYBcCAP +vrtb5xkSw21uzRy2I6aZZYrYuN9GLMzBS3C5IqkiQ8gFw4Q6iFNMJIgAo8oFHtr2 +Ry3Vqrw9xqLuSYdAwje1gU8nX5oWOYd1WedLBemVQoxkwBJi/9V2O+oytOr47XnZ +Ngyvcvn3SkdO77sLQweJsDnIEac4ON/ZCajBHd0lKkGJ3xqx6e4cxORZ22rjz0Pf +EZm0ZzqlHe2zw223FMghRLDHUhABVPstaXKH57mRivwNex2JTPpC5RrwPwRCC9B4 +X6xY6TzZfc976UCCPof5Pn4kHBEmgycyRdA4fsqO3v5pm10GJ2hHiI/meghP0lE1 +ab374f0o +-----END CERTIFICATE----- diff -r 1c1964c27b39 -r fd85a02d771d ui/tests/data/ssl_root.key --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/tests/data/ssl_root.key Tue Sep 16 19:45:19 2014 +0200 @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKgIBAAKCAgEAtMBUHwHawNLTouyz0d1cmjdvtZTI6eHSyxozmwNBF8bKagq9 +zsi1Tmb2nZDy5oqEajArIvJia92d+L1c+8KooSoBNIEVIE8igO/UiVdbhDK73atm +RuHG6RzWvSJW2TWQ7ZQXuZUXsihF8xxr/7cQMjql+D/jGzj+IlbrQZsjPnn4kH3j +XdQUHBHCJJ3Blauii/AVo/iUpx40WtmYyoGgH+Uxmp7OQBjCZxDKrRvr43cYSNqT +s4XIbQskMw2ftHl3w0DEAfAneZj2Hta1sNGKrSeUn8CISfv3lkBKHt8ZUg8t1Lmv +YAswsjzKzNTWH5pMbKJzUVXdTjgcl1c+QpxZBWi5EX3L1tuYFdv+6oYs+61Sv3SM +9hPM9tNvIEzj6kJqJLJS1v2r8aRS3iqlksF45dtQvI2QnRnP1bzLhBunUm5Ur4WN +TshDJnQvaOOD2e34h+9Lfhyas8GnrkkqXx4RJNCZ9mdd09PoM9JVJexs9/b3oz9/ +rdg4l6yt9GknSrbAgwbzRI5RaoC6KCvNWbcD6MaTx5uqS4gzw9d0AV228OFNkec9 +yTYSDuGEhqWREuU0+z4WJSHZhiGwNUYXEW2zdMZOq1v4fU0rybLlxV8iQleeA1Ib +S3i7OmEzrFeMqfBslsCl5ZWSCRTjm/wLb1OKCwjq9co0C4rm9nImnzdteBsCAwEA +AQKCAgEAnywzqC6o5l+CshpCbJDEiKZDAKPqnlQYnnUPdvXRr8+G1wVoix4i081G +ZhGMZksbOqv6gMb0t0qtX6vao3aTq4FjGEqIQTCPEP6iquO8GtnWqOnUop0W3phf +3qTL2HIck6tzjSFngaOHngSscr9SSvlsyQXxyDpTSghDGj41NkKRCyVhQXKO1v0o +e7hVDqnb9eHSHNi+h8DImCzBKawnR489NI2e0cE8CSk3YmSRQXnSb+3UXiZ1Dtnd +4fugZX0GY3K4aYCEMsfqDdREolaVCdEuR9Rz8LssGCu7Wh5bnPDzCj8O2sRf+MYi +TWksux3VKWGRrdGwlr5BJ2FT2bL3jJniX/d0KFe7spDjbUCv+HKlf+T3EFGbXHya +fjx2TyHF1RfIN/Tkp+93n3P8hv8oR8xzkV0BdBiQQTUO/oT4MtjJFj3KCC/sGVa6 +RT1vECjuK7TDGZ0RwI3xhtImVZZ500lnc1tbuRR3HAn2pA5S76Gel8/xUOxz10e7 +YrVNhAOumx/AOOs3AGQfFxn5txk2e04DmMjDSIxJlEtIptU0H8OmlyLQdTs9vDOh +M6bXzWejzK6P3NQ/vBGqByZSFumc4PNPri1A6Y50u4BM9Gpc++tp+M0UKamjNZl6 +EjBJdICYaDO2To90oHWnSTDbDlWFilYvgMn7mcqqFPMKLarESfECggEBANzWaBnC +juXk3dClNWqacveHHguTAJxU/5HqboQZm1YBo9BS1zzZSThgBzu+zmBsoLwUN1RN +t8kn/wioCsUUlmbUrWlM74dXBf/p1hf7UGKU/vjn6IghDjxA6Af2sRFuyFf1NBEN +mnXRnJ/sKF6mlrxTnqssBI4fHVJecZgNymEW9ZEgBfNGXWkJp+8Vm1ll9AytZMnr +qeOomPLoXfA5snrGF7SAvjGd/s9aBXbfBx9nSqJx9acgO7VaxXkPKo0SoNome4uT +lGOYBiF3RVdBW/kYBP0WB3u2OkMN+nwkWmU9hUgpWxwwrTJmWb060TGYcjTHci/x +zNDghngymhvxLjkCggEBANGH9dUqNWEBQ7UuhTtzepIYyI2tjCi/uPFZ69t2WtQh +rbUrxssZCB4qVePsTZCP96cow7GybFWk7y2/fD+JAfoBvYMcVO+vVpRzTBTuI8eb +YxYA3p9irzSnIRUXmAtizXG1Dp6Vpn/P9mWAnptdttdC5ls3TwFgZvdOadYJHUCo +BMe3YFHc1j55NDeWHs/2pFN+DcaSGqNt//2pLzGzNqyoHvQDsN8C7DqB38rKrBCs +aDXrIiiKUJZLoU+lCXkfASO9DFHMNdFTYj5KXimXwxlQIRqKNvzy+hvVT8yIFJeq +m+e7juybVHwS1St6eYj/+U6p3AkrGIwLeCD0xDZzWPMCggEBANjOsnMf3JT9JXwS +xid7rIUxJSEt2DqjBCnoI0oTrbo5b+81dVSq6kSrmk5gnFJ0MzWTD2L3zghx+OMx +vykPdj1MbVdlDgAsQpqlouf2dkvihZQucc87zLMA8gvneJ1pysz30X8wgMVM3dzv +yA5stK391lespmg1Sd81E4a5e0fod3xcGRtmqIxXy4RhDRwuiPPtQ3cto6P7QPWx +hZAzxPLeCiXPA2rI94Hwmk7C1UZSbSaghRDoB1ab4CVi616GvF6Py1kTsWo5tUMj +ynLImxgpKbSi7QPausZcMd+w/QJJ7NEUsPszGsbRTycFWJ29UdpZONSzKmajF8Fn +xH7MQJkCggEARVsIr2eKRbLCc62TYktmLgfQEr14YGCd2h3WqU0y4XbIZei4o6+E +dV+0EH6+afSNmCIxLJeProWquezhNrKmGdgLn+N35eKW+Qp1C5SL+V1g3f6psf5b +WkVb+PxXUqWAtXul/C4y76mpuI1rcqgBhp1ZXKYhG6aKTqAA/l0D9svm0SjM1CwS +Kpm6BBBH4LSWTiCydKEV+jTGAHPI8F2O4nW/0SuLlzYDdZZZuml9rQM0d2x+YQbv +h+A+4/sP+KyflvHTqxu6ULCWG2JIauIWLUHNw1guvWm8CgyAnoYIsu9BLeJye7Uq +sOsW7o5avlNkdXpaIBrIxEpjmB0M+a0SqwKCAQEAv2LRIzq4OylBSceryZG077li +Fqr3jXlRUjfpjjMSnJEyJE+Iji2e8NplYwIfCRm/wCGNjummgHhi+7wZyU3C5dCc +wQhwZ0kIc4i1IUBSfILedVvMQe1/J32tRUGHuDw+LSjLNaXnDNyhq7Qqjrk+WWl0 +kO3Lxlm0UpO4nsnpn3gyGN9cGnhhKsatYKn3Dp9r7aqBRsTo2BTRBn9rH0vPtTTe +0r8sDTkFJSnpZzXXlEJWhLWd0xiD73eJnDjHFQSGnqy2wST3QiQHsImG6j9o7y5w +hi6sqGTBLqasrlO7togs+3wsE4Kfp1i83CoIbFvCX8+yBsIG7ah3oIlsYBArZQ== +-----END RSA PRIVATE KEY----- diff -r 1c1964c27b39 -r fd85a02d771d ui/tests/data/ssl_root.pem --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/tests/data/ssl_root.pem Tue Sep 16 19:45:19 2014 +0200 @@ -0,0 +1,32 @@ +-----BEGIN CERTIFICATE----- +MIIFgDCCA2igAwIBAgIBATANBgkqhkiG9w0BAQUFADBZMSAwHgYDVQQDExdUcnVz +dEJyaWRnZSBTU0wgVGVzdCBDQTEoMCYGA1UEChMfUHVibGljIHNlY3JldCBkbyBu +b3QgdHJ1c3QgdGhpczELMAkGA1UEBhMCREUwHhcNMTMwMTAxMDAwMDAwWhcNMTUx +MjMxMjM1OTU5WjBZMSAwHgYDVQQDExdUcnVzdEJyaWRnZSBTU0wgVGVzdCBDQTEo +MCYGA1UEChMfUHVibGljIHNlY3JldCBkbyBub3QgdHJ1c3QgdGhpczELMAkGA1UE +BhMCREUwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC0wFQfAdrA0tOi +7LPR3VyaN2+1lMjp4dLLGjObA0EXxspqCr3OyLVOZvadkPLmioRqMCsi8mJr3Z34 +vVz7wqihKgE0gRUgTyKA79SJV1uEMrvdq2ZG4cbpHNa9IlbZNZDtlBe5lReyKEXz +HGv/txAyOqX4P+MbOP4iVutBmyM+efiQfeNd1BQcEcIkncGVq6KL8BWj+JSnHjRa +2ZjKgaAf5TGans5AGMJnEMqtG+vjdxhI2pOzhchtCyQzDZ+0eXfDQMQB8Cd5mPYe +1rWw0YqtJ5SfwIhJ+/eWQEoe3xlSDy3Uua9gCzCyPMrM1NYfmkxsonNRVd1OOByX +Vz5CnFkFaLkRfcvW25gV2/7qhiz7rVK/dIz2E8z2028gTOPqQmokslLW/avxpFLe +KqWSwXjl21C8jZCdGc/VvMuEG6dSblSvhY1OyEMmdC9o44PZ7fiH70t+HJqzwaeu +SSpfHhEk0Jn2Z13T0+gz0lUl7Gz39vejP3+t2DiXrK30aSdKtsCDBvNEjlFqgLoo +K81ZtwPoxpPHm6pLiDPD13QBXbbw4U2R5z3JNhIO4YSGpZES5TT7PhYlIdmGIbA1 +RhcRbbN0xk6rW/h9TSvJsuXFXyJCV54DUhtLeLs6YTOsV4yp8GyWwKXllZIJFOOb +/AtvU4oLCOr1yjQLiub2ciafN214GwIDAQABo1MwUTAPBgNVHRMECDAGAQEBAgEA +MB0GA1UdDgQWBBRrgmr4LKgEyDNB0FdDpty3dHHZ3zAfBgNVHSMEGDAWgBRrgmr4 +LKgEyDNB0FdDpty3dHHZ3zANBgkqhkiG9w0BAQUFAAOCAgEAiVqKrj6+HMFGkLTB +345ZhbjqYMpr9Ze65qV2bzUS3B9tUKJQeb42aWfpEXT8VNlLYX1GCZiJrgZTr0vw +rVGLo7Z6SXYfKbkApS5bAsYwc8/822rhJuAXZ5Aq9pennhnRrmAsxd85eRcgP9v2 +w/4fFkjjuCQpIsj6DEx2hIHkZS3jqILzNwmBUGiTxmTIaSnXduYVmWliZ2x7Fbxh +BcqN7AsYPjxdXxRfWC5lO2LtaRh3fRTcdqRsYMkdZxu+05JILVbZ/i+r+0dIolh1 +QhSExsC2mzDi+CMsJxV0wXwpXg1GUEkRHCssDjH7ggeqgs1LPsuLRL//WsyDbwCS +zmHJlTAf0fdf99h99UD5WVqbbMMk43w9z4aDDBK0u6uZBdFZWsZmtSGbY6Mr8CMa +S+QbKYyLwik7ime7a2Yh4BIvxAyV+halazmCZyye0z9ZxF9zo8F3AB0K3hHNsozA +sLV3Uit/9KNIaTAjtZG9GHNVn1HR+2uEfn/Nri38JQhpC91cU9QDt9GJJBlfOtyU ++KY3HPXfTXm7JYpVP5afbsnmNs40OPB4gw/BhNQ6mr9MoSf5Uf/uyU8kxQAM2Sxk +IyCXDlYhC1QOY/1ou2Bj2Ghyc6R1revnc370f7+3tLfK60LUj8AsgGycU9aaw7oa +JO2qAkbI1BEnPlIL5YBlGiw70kE= +-----END CERTIFICATE----- diff -r 1c1964c27b39 -r fd85a02d771d ui/tests/downloadertest.cpp --- a/ui/tests/downloadertest.cpp Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/tests/downloadertest.cpp Tue Sep 16 19:45:19 2014 +0200 @@ -149,9 +149,7 @@ QVERIFY(error == SSLConnection::NoConnection); } static int accept_ciphers[] = { - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384, + TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256, 0 }; @@ -162,8 +160,8 @@ QByteArray(), /* Use default testing certificate */ QDateTime::currentDateTime(), QDateTime::fromString("2010", "YYYY"), - "/users/aheinecke/development/TrustBridge-development.exe", - "/users/aheinecke/development/zertifikatsliste.txt"); + "/development/TrustBridge-development.exe", + "/development/zertifikatsliste.txt"); downloader->setCiphersuites(accept_ciphers); @@ -238,8 +236,8 @@ QByteArray(), QDateTime::currentDateTime(), // Last installed SW QDateTime::fromString("2010", "YYYY"), - QString("/users/aheinecke/zertifikatsliste.txt"), - QString("/users/aheinecke/zertifikatsliste.txt")); + QString("/zertifikatsliste.txt"), + QString("/zertifikatsliste.txt")); SETUP_SPY @@ -309,5 +307,7 @@ } } +bool g_debug = true; + QTEST_GUILESS_MAIN (DownloaderTest); diff -r 1c1964c27b39 -r fd85a02d771d ui/tests/nsstest.cpp --- a/ui/tests/nsstest.cpp Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/tests/nsstest.cpp Tue Sep 16 19:45:19 2014 +0200 @@ -266,4 +266,7 @@ write_stores_nss(to_install, to_remove); } } + +bool g_debug = true; + QTEST_GUILESS_MAIN (NSSTest); diff -r 1c1964c27b39 -r fd85a02d771d ui/tests/windowsstoretest.cpp --- a/ui/tests/windowsstoretest.cpp Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/tests/windowsstoretest.cpp Tue Sep 16 19:45:19 2014 +0200 @@ -158,4 +158,7 @@ void WindowsStoreTest::cleanupTestCase() { CertCloseStore(testStore, 0); } + +bool g_debug = true; + QTEST_GUILESS_MAIN (WindowsStoreTest); diff -r 1c1964c27b39 -r fd85a02d771d ui/textoverlaybutton.h --- a/ui/textoverlaybutton.h Tue Sep 02 14:25:40 2014 +0200 +++ b/ui/textoverlaybutton.h Tue Sep 16 19:45:19 2014 +0200 @@ -8,7 +8,10 @@ * See LICENSE.txt for details. */ -/** @file A tool button that overlays a text over the icon */ +/** + * @file textoverlaybutton.h + * @brief A tool button that overlays a text over the icon. + */ #include #include