From 6a1ee981e1c8442f7afe7110497c4fe8ac495af8 Mon Sep 17 00:00:00 2001 From: Sascha Tommasone Date: Sat, 6 Jul 2024 17:51:58 +0200 Subject: [PATCH] [Assignment-7] added embedded device to main.c; adjusted parameter parsing --- 7-SGX_Hands-on/src/app/embedded_device.c | 6 +----- 7-SGX_Hands-on/src/app/main.c | 2 ++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/7-SGX_Hands-on/src/app/embedded_device.c b/7-SGX_Hands-on/src/app/embedded_device.c index 8fd48fb..76be276 100644 --- a/7-SGX_Hands-on/src/app/embedded_device.c +++ b/7-SGX_Hands-on/src/app/embedded_device.c @@ -73,11 +73,7 @@ int handle_embedded_device(int argc, char **argv) { .public_key_path = NULL }; - if(argc == 1) { - syntax_exit(); - } - - for(int i = 1; i < argc; i += 2) { + for(int i = 0; i < argc; i += 2) { if((strcmp(argv[i], "-ppub") == 0) && (argc - i >= 2)) { args.public_key_path = argv[i+1]; } else if((strcmp(argv[i], "-firm") == 0) && (argc - i >= 2)) { diff --git a/7-SGX_Hands-on/src/app/main.c b/7-SGX_Hands-on/src/app/main.c index cd22445..2cfd72c 100644 --- a/7-SGX_Hands-on/src/app/main.c +++ b/7-SGX_Hands-on/src/app/main.c @@ -22,6 +22,8 @@ int main(int argc, char** argv) { handle_proxy(argc-2, argv+2); else if (strcmp(command, "proxysetup")==0) handle_proxysetup(argc-2, argv+2); + else if (strcmp(command, "embedded")==0) + handle_proxysetup(argc-2, argv+2); else syntax_exit(); }