mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-18 02:44:37 +00:00
image-host: Fix error value paths and emit error messages to stderr.
A recent refactoring in image-host.c messed up the return values of the function that reads the encryptiong keys. This patch fixes this and also makes sure that error output goes to stderr instead of to stdout. Signed-off-by: Hugo Cornelis <hugo.cornelis@essensium.com>
This commit is contained in:
parent
7b2d32a7d6
commit
55a7d60f8f
1 changed files with 5 additions and 5 deletions
|
@ -346,17 +346,17 @@ static int fit_image_read_key_iv_data(const char *keydir, const char *key_iv_nam
|
|||
unsigned char *key_iv_data, int expected_size)
|
||||
{
|
||||
char filename[PATH_MAX];
|
||||
int ret = -1;
|
||||
int ret;
|
||||
|
||||
ret = snprintf(filename, sizeof(filename), "%s/%s%s",
|
||||
keydir, key_iv_name, ".bin");
|
||||
if (ret >= sizeof(filename)) {
|
||||
printf("Can't format the key or IV filename when setting up the cipher: insufficient buffer space\n");
|
||||
ret = -1;
|
||||
fprintf(stderr, "Can't format the key or IV filename when setting up the cipher: insufficient buffer space\n");
|
||||
return -1;
|
||||
}
|
||||
if (ret < 0) {
|
||||
printf("Can't format the key or IV filename when setting up the cipher: snprintf error\n");
|
||||
ret = -1;
|
||||
fprintf(stderr, "Can't format the key or IV filename when setting up the cipher: snprintf error\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = fit_image_read_data(filename, key_iv_data, expected_size);
|
||||
|
|
Loading…
Add table
Reference in a new issue