From 39ced77b9807d50ea0ee09fc213dbfa42e3898fd Mon Sep 17 00:00:00 2001 From: Johannes Bauer Date: Thu, 24 Oct 2019 16:57:35 +0200 Subject: [PATCH] More disabled code removal Removed the code that was previously the main application. --- luksrku.c | 69 ------------------------------------------------------- 1 file changed, 69 deletions(-) diff --git a/luksrku.c b/luksrku.c index 3921f9b..36206e1 100644 --- a/luksrku.c +++ b/luksrku.c @@ -73,74 +73,5 @@ int main(int argc, char **argv) { case PGM_CLIENT: return main_client(&pgmopts->client); } - - return 0; - -#if 0 - struct options_t options; - if (!parse_cmdline_arguments(&options, argc, argv)) { - print_syntax(argv[0]); - exit(EXIT_FAILURE); - } - if (options.verbose) { - log_setlvl(LLVL_DEBUG); - } - - - struct keydb_t keydb; - bool success = true; - memset(&keydb, 0, sizeof(keydb)); - do { - if (!read_binary_keyfile(options.keydbfile, &keydb)) { - log_msg(LLVL_FATAL, "Could not read key database file %s.", options.keydbfile); - success = false; - break; - } - - log_msg(LLVL_DEBUG, "Successfully loaded key database file %s with %d entries and %d disk keys.", options.keydbfile, keydb.entrycnt, keydb_disk_key_count(&keydb)); -#ifdef DEBUG - keydb_dump(&keydb); -#endif - - if (keydb.entrycnt == 0) { - log_msg(LLVL_FATAL, "Key database file %s contains no keys.", options.keydbfile); - success = false; - break; - } - - if (options.mode == SERVER_MODE) { - if (keydb.entrycnt != 1) { - log_msg(LLVL_FATAL, "Server configuration files need to have exactly one host entry."); - success = false; - break; - } - - if (keydb_disk_key_count(&keydb) != 0) { - log_msg(LLVL_FATAL, "Server configuration files may not contain disk unlocking keys."); - success = false; - break; - } - - if (!dtls_server(keydb_getentry(&keydb, 0), &options)) { - log_msg(LLVL_FATAL, "Failed to start TLS server."); - success = false; - break; - } - } else { - if (!dtls_client(&keydb, &options)) { - log_msg(LLVL_FATAL, "Failed to connect TLS client."); - success = false; - break; - } - } - } while (false); - - keydb_free(&keydb); - if (!success) { - exit(EXIT_FAILURE); - } -#endif - return 0; } -