Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/entropy/dyn_entropy_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ rstatus_t entropy_key_iv_load(struct context *ctx) {
FILE *iv_file = fopen(iv_file_name, "r");
if (iv_file == NULL) {
log_error("opening iv.pem file failed %s", pool->recon_iv_file);
close(key_file);
return DN_ERROR;
}

Expand All @@ -365,12 +366,14 @@ rstatus_t entropy_key_iv_load(struct context *ctx) {
if (fstat(fd, &file_stat) < 0) /* Get the file size */
{
log_error("Error fstat --> %s", strerror(errno));
close(iv_file);
return DN_ERROR;
}

if (file_stat.st_size >
BUFFER_SIZE) { /* Compare file size with BUFFER_SIZE */
log_error("key file size is bigger then the buffer size");
close(iv_file);
return DN_ERROR;
}

Expand Down