diff --git a/KeyMaster b/KeyMaster index 31a9930..e9e8e09 100755 Binary files a/KeyMaster and b/KeyMaster differ diff --git a/bin/KeyMaster b/bin/KeyMaster index 31a9930..e9e8e09 100755 Binary files a/bin/KeyMaster and b/bin/KeyMaster differ diff --git a/src/main.c b/src/main.c index cce1f73..94e6540 100644 --- a/src/main.c +++ b/src/main.c @@ -20,6 +20,7 @@ typedef struct Request unsigned char type; char *key; int ID; + int level; } Request; void clear_input_buffer(void) @@ -59,7 +60,7 @@ int main(void) buffer = size(buffer, 256); emcryptText(buffer, password); - writel(PASS_FILE, buffer, 256 * sizeof(int)); + writel(PASS_FILE, buffer, 256); free(buffer); } @@ -176,9 +177,11 @@ int main(void) send(sockfd, &req, sizeof(Request), 0); // Receive response from the server - char response[1024] = {0}; - recv(sockfd, response, sizeof(response), 0); - printf("%s\n", response); + recv(sockfd, &req, sizeof(req), 0); + if (req.level == -1) + { + printf("No existing passwords, use \"addpass\" command to add a password to the list.\n"); + } printf("<------->\n\n"); choice = prompNormalRequest(">> "); @@ -186,6 +189,10 @@ int main(void) { break; } + else if (strcmp("choise", "addpass")) + { + printf("adding new password to the server."); + } else { printf("Invalid command (%s)\n\"Q\" or \"quit\" or \"exit\" to close the program\n", choice);