[Assignment-7] .
All checks were successful
Latex Build / build-latex (Assignment 4 - Protokollsicherheit (Praxis)) (push) Successful in 59s
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 1m0s
Latex Build / build-latex (Assignment 4 - Protokollsicherheit (Praxis)) (pull_request) Successful in 33s
Latex Build / build-latex (Assignment 5 - Software Security - Teil 1) (pull_request) Successful in 8s
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 59s
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 1m0s
Latex Build / build-latex (Assignment 4 - Protokollsicherheit (Praxis)) (pull_request) Successful in 33s
Latex Build / build-latex (Assignment 5 - Software Security - Teil 1) (pull_request) Successful in 8s
Latex Build / build-latex (Assignment 6 - Software Security - Teil 2) (pull_request) Successful in 8s
This commit is contained in:
parent
d61bafdb85
commit
5a12559f5d
1 changed files with 5 additions and 2 deletions
|
@ -27,6 +27,7 @@ static void syntax_exit() {
|
||||||
static EVP_PKEY *read_public_key(uint8_t *public_key_file, EVP_PKEY **key) {
|
static EVP_PKEY *read_public_key(uint8_t *public_key_file, EVP_PKEY **key) {
|
||||||
if(public_key_file == NULL) {
|
if(public_key_file == NULL) {
|
||||||
fprintf(stderr, "public_key_file is a null pointer!\n");
|
fprintf(stderr, "public_key_file is a null pointer!\n");
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE *fd = fopen(public_key_file, "rb");
|
FILE *fd = fopen(public_key_file, "rb");
|
||||||
|
@ -44,11 +45,13 @@ static EVP_PKEY *read_public_key(uint8_t *public_key_file, EVP_PKEY **key) {
|
||||||
static void hash_firmware(uint8_t *firmware_path, EVP_MD_CTX **ctx) {
|
static void hash_firmware(uint8_t *firmware_path, EVP_MD_CTX **ctx) {
|
||||||
if(firmware_path == NULL) {
|
if(firmware_path == NULL) {
|
||||||
fprintf(stderr, "firmware_path is a null pointer!\n");
|
fprintf(stderr, "firmware_path is a null pointer!\n");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE *fd = fopen(firmware_path, "rb");
|
FILE *fd = fopen(firmware_path, "rb");
|
||||||
if(fd == NULL) {
|
if(fd == NULL) {
|
||||||
fprintf(stderr, "failed to open firmware!\n");
|
fprintf(stderr, "failed to open firmware!\n");
|
||||||
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t size;
|
size_t size;
|
||||||
|
@ -57,7 +60,7 @@ static void hash_firmware(uint8_t *firmware_path, EVP_MD_CTX **ctx) {
|
||||||
EVP_DigestVerifyUpdate(*ctx, buf, size);
|
EVP_DigestVerifyUpdate(*ctx, buf, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(fd);
|
exit: fclose(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void read_signature(uint8_t *signature, size_t *signature_size) {
|
static void read_signature(uint8_t *signature, size_t *signature_size) {
|
||||||
|
|
Loading…
Reference in a new issue