Fix: fail on error

This commit is contained in:
Dorian Zedler 2022-07-12 22:36:26 +02:00
parent 03016a1979
commit 2a6bb4354e
Signed by: dorian
GPG Key ID: 989DE36109AFA354
1 changed files with 4 additions and 1 deletions

View File

@ -46,7 +46,10 @@ void md2_checksum_2(size_t, uint8_t*) {}
void md2_hash_2(size_t len, const uint8_t buf[len], uint8_t out[16]) {
FILE* file;
struct stat file_stat;
open_file((char*)buf, &file, &file_stat);
if (!open_file((char*)buf, &file, &file_stat)) {
fprintf(stderr, "Error opening the file!");
return;
}
// === step 3 ===
uint8_t* messageDigestBuf = calloc(48, sizeof(uint8_t));