diff --git a/KeyMaster b/KeyMaster new file mode 100755 index 0000000..f024f93 Binary files /dev/null and b/KeyMaster differ diff --git a/bin/KeyMaster b/bin/KeyMaster index ff08639..f024f93 100755 Binary files a/bin/KeyMaster and b/bin/KeyMaster differ diff --git a/build/CMakeFiles/KeyMaster.dir/src/main.c.o b/build/CMakeFiles/KeyMaster.dir/src/main.c.o index c2a1a16..fd9fb44 100644 Binary files a/build/CMakeFiles/KeyMaster.dir/src/main.c.o and b/build/CMakeFiles/KeyMaster.dir/src/main.c.o differ diff --git a/include/ui/ui.c b/include/ui/ui.c index 5494b98..a790bac 100644 --- a/include/ui/ui.c +++ b/include/ui/ui.c @@ -40,7 +40,7 @@ char *prompNormalRequest(char *message) temp = size(temp, 256); - printf("%s\n", message); + printf("%s", message); scanf("%s", temp); return temp; diff --git a/src/main.c b/src/main.c index 79e3b31..35a2eb5 100644 --- a/src/main.c +++ b/src/main.c @@ -55,7 +55,7 @@ int main(void) return 0; } } - printf("KeyMaster\nVersion: 0.1.0 (no cli)\n\n"); + printf("KeyMaster\nVersion: 0.2\n\n"); try { @@ -99,7 +99,6 @@ int main(void) free(askedPass); free(key); } - catch (MEMORY_ALLOC_FAILURE) { fprintf(stderr, "Memory allocation failure\n"); @@ -112,6 +111,45 @@ int main(void) } end_try; + char *choice = NULL; + + try + { + choice = create(char); + choice = size(choice, 256); + + if (choice == NULL) + { + throw(MEMORY_ALLOC_FAILURE); + } + } + catch (MEMORY_ALLOC_FAILURE) + { + fprintf(stderr, "Memory allocation failure\n"); + return 1; + } + end_try; + + // Menu loop + while (1) + { + printf("List of existing passwords:\n<------->\n"); + // Show passwords that are stored in the server + printf("<------->\n\n"); + choice = prompNormalRequest(">> "); + if (strcmp(choice, "exit") == 0 || strcmp(choice, "quit") == 0 || strcmp(choice, "q") == 0) + { + break; + } + else + { + printf("Invalid command (%s)\n\"Q\" or \"quit\" or \"exit\" to close the program\n", choice); + } + + // Connect to the server and get the list of passwords tro HTTP GET + } + free(choice); + free(password); return 0; } \ No newline at end of file