More disabled code removal
Removed the code that was previously the main application.
This commit is contained in:
parent
25649e0caa
commit
39ced77b98
69
luksrku.c
69
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user