[Assignment-7] adjusted some error messages
Some checks failed
Latex Build / build-latex (Assignment 5 - Software Security - Teil 1) (push) Waiting to run
Latex Build / build-latex (Assignment 6 - Software Security - Teil 2) (push) Waiting to run
Latex Build / build-latex (Assignment 4 - Protokollsicherheit (Praxis)) (push) Has been cancelled
Latex Build / build-latex (Assignment 4 - Protokollsicherheit (Praxis)) (pull_request) Successful in 1m0s
Latex Build / build-latex (Assignment 5 - Software Security - Teil 1) (pull_request) Successful in 1m1s
Latex Build / build-latex (Assignment 6 - Software Security - Teil 2) (pull_request) Successful in 1m1s

This commit is contained in:
Sascha Tommasone 2024-07-06 17:42:06 +02:00
parent 192c1b5a52
commit 3d6c886561
Signed by: saschato
GPG key ID: 751068A86FCAA217

View file

@ -21,9 +21,9 @@ typedef struct {
uint8_t *public_key_path;
} embedded_device_args;
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_path, EVP_PKEY **key) {
if(public_key_file == NULL) {
fprintf(stderr, "public_key_file is a null pointer!\n");
fprintf(stderr, "public_key_file_path is a null pointer!\n");
return NULL;
}
@ -100,14 +100,13 @@ int main(int argc, char **argv) {
uint8_t signature[BUFSIZE] = {0};
size_t signature_size = read(0, signature, BUFSIZE);
if(signature_size < 70) {
printf("failed to read firmware signature\n");
fprintf(stderr, "failed to read firmware signature\n");
goto clean;
}
hash_firmware(args.firmware_path, &ctx);
if (EVP_DigestVerifyFinal(ctx, signature, signature_size) != 1) {
printf("failed to verify firmware signature\n");
goto clean;
fprintf(stderr, "failed to verify firmware signature\n");
}
clean: ;