[Assignment-7] small changes
All checks were successful
Latex Build / build-latex (Assignment 4 - Protokollsicherheit (Praxis)) (push) Successful in 1m5s
Latex Build / build-latex (Assignment 5 - Software Security - Teil 1) (push) Successful in 1m4s
Latex Build / build-latex (Assignment 6 - Software Security - Teil 2) (push) Successful in 59s
Latex Build / build-latex (Assignment 4 - Protokollsicherheit (Praxis)) (pull_request) Successful in 31s
Latex Build / build-latex (Assignment 5 - Software Security - Teil 1) (pull_request) Successful in 9s
Latex Build / build-latex (Assignment 6 - Software Security - Teil 2) (pull_request) Successful in 8s
All checks were successful
Latex Build / build-latex (Assignment 4 - Protokollsicherheit (Praxis)) (push) Successful in 1m5s
Latex Build / build-latex (Assignment 5 - Software Security - Teil 1) (push) Successful in 1m4s
Latex Build / build-latex (Assignment 6 - Software Security - Teil 2) (push) Successful in 59s
Latex Build / build-latex (Assignment 4 - Protokollsicherheit (Praxis)) (pull_request) Successful in 31s
Latex Build / build-latex (Assignment 5 - Software Security - Teil 1) (pull_request) Successful in 9s
Latex Build / build-latex (Assignment 6 - Software Security - Teil 2) (pull_request) Successful in 8s
This commit is contained in:
parent
86c1001ce0
commit
6f4c0a8aec
5 changed files with 21 additions and 15 deletions
|
@ -74,7 +74,7 @@ else
|
|||
Urts_Library_Name := sgx_urts
|
||||
endif
|
||||
|
||||
App_C_Files := app/main.c app/proxy.c app/proxysetup.c app/employee.c app/util.c
|
||||
App_C_Files := app/main.c app/proxy.c app/proxysetup.c app/employee.c app/util.c app/embedded_device.c
|
||||
App_Include_Paths := -IInclude -Iapp -I$(SGX_SDK)/include
|
||||
|
||||
App_C_Flags := $(SGX_COMMON_CFLAGS) -fPIC -Wno-attributes $(App_Include_Paths)
|
||||
|
|
|
@ -23,18 +23,18 @@ typedef struct {
|
|||
|
||||
char *embedded_device_syntax(void) {
|
||||
return
|
||||
"embedded device (sim) mock up implementation of a embedded device\n"
|
||||
" -ppub <path> file path of the PEM encoded public key of the proxy\n"
|
||||
" -firm <path> path of to firmware binary\n";
|
||||
"embedded mock up implementation of a embedded device\n"
|
||||
" -ppub <path> file path of the PEM encoded public key of the proxy\n"
|
||||
" -firm <path> path of to firmware binary\n";
|
||||
}
|
||||
|
||||
static EVP_PKEY *read_public_key(uint8_t *public_key_file_path, EVP_PKEY **key) {
|
||||
if(public_key_file == NULL) {
|
||||
static EVP_PKEY *read_public_key(char *public_key_file_path, EVP_PKEY **key) {
|
||||
if(public_key_file_path == NULL) {
|
||||
fprintf(stderr, "public_key_file_path is a null pointer!\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
FILE *fd = fopen(public_key_file, "rb");
|
||||
FILE *fd = fopen(public_key_file_path, "rb");
|
||||
if(fd == NULL) {
|
||||
fprintf(stderr, "failed to open public key file!\n");
|
||||
return NULL;
|
||||
|
@ -110,7 +110,9 @@ int handle_embedded_device(int argc, char **argv) {
|
|||
hash_firmware(args.firmware_path, &ctx);
|
||||
if (EVP_DigestVerifyFinal(ctx, signature, signature_size) != 1) {
|
||||
fprintf(stderr, "failed to verify firmware signature\n");
|
||||
}
|
||||
}else {
|
||||
printf("successfully verified firmware signature\n");
|
||||
}
|
||||
|
||||
clean: ;
|
||||
if(key != NULL)
|
||||
|
@ -119,4 +121,4 @@ int handle_embedded_device(int argc, char **argv) {
|
|||
EVP_MD_CTX_free(ctx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,11 +23,11 @@ struct EmployeeArgs {
|
|||
|
||||
char* employee_syntax(void) {
|
||||
return
|
||||
"employee mock up implementation of the employee binary\n"
|
||||
" outputs signature on stdout\n"
|
||||
" WARNING: output is in binary format, may mess up terminal\n"
|
||||
" -ekey <path> file path of the PEM encoded private key of the employee\n"
|
||||
" -firm <path> path of the firmware\n";
|
||||
"employee mock up implementation of the employee binary\n"
|
||||
" outputs signature on stdout\n"
|
||||
" WARNING: output is in binary format, may mess up terminal\n"
|
||||
" -ekey <path> file path of the PEM encoded private key of the employee\n"
|
||||
" -firm <path> path of the firmware\n";
|
||||
}
|
||||
|
||||
int handle_employee(int argc, char** argv) {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "embedded_device.h"
|
||||
#include "employee.h"
|
||||
#include "proxy.h"
|
||||
#include "proxysetup.h"
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "embedded_device.h"
|
||||
#include "employee.h"
|
||||
#include "util.h"
|
||||
#include "proxy.h"
|
||||
|
@ -27,9 +28,11 @@ void syntax_exit(void) {
|
|||
"\n"
|
||||
"%s"
|
||||
"\n"
|
||||
"%s"
|
||||
"\n"
|
||||
"%s";
|
||||
|
||||
printf(syntax, BIN_NAME, employee_syntax(), proxy_syntax(), proxysetup_syntax());
|
||||
printf(syntax, BIN_NAME, proxysetup_syntax(), employee_syntax(), proxy_syntax(), embedded_device_syntax());
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue