Skip to content
Snippets Groups Projects
Forked from Reform / reform-boundary-uboot
Source project has a limited visibility.
  • mario.six@gdsys.cc's avatar
    c236ebd2
    tools: Fix return code of fit_image_process_sig() · c236ebd2
    mario.six@gdsys.cc authored
    When signing images, we repeatedly call fit_add_file_data() with
    successively increasing size values to include the keys in the DTB.
    
    Unfortunately, if large keys are used (such as 4096 bit RSA keys), this
    process fails sometimes, and mkimage needs to be called repeatedly to
    integrate the keys into the DTB.
    
    This is because fit_add_file_data actually returns the wrong error
    code, and the loop terminates prematurely, instead of trying again with
    a larger size value.
    
    This patch corrects the return value and also removes a error message,
    which is misleading, since we actually allow the function to fail. A
    (hopefully helpful) comment is also added to explain the lack of error
    message.
    
    This is probably related to 1152a05e ("tools: Correct error handling in
    fit_image_process_hash()") and the corresponding error reported here:
    
    https://www.mail-archive.com/u-boot@lists.denx.de/msg217417.html
    
    
    
    Signed-off-by: default avatarMario Six <mario.six@gdsys.cc>
    c236ebd2
    History
    tools: Fix return code of fit_image_process_sig()
    mario.six@gdsys.cc authored
    When signing images, we repeatedly call fit_add_file_data() with
    successively increasing size values to include the keys in the DTB.
    
    Unfortunately, if large keys are used (such as 4096 bit RSA keys), this
    process fails sometimes, and mkimage needs to be called repeatedly to
    integrate the keys into the DTB.
    
    This is because fit_add_file_data actually returns the wrong error
    code, and the loop terminates prematurely, instead of trying again with
    a larger size value.
    
    This patch corrects the return value and also removes a error message,
    which is misleading, since we actually allow the function to fail. A
    (hopefully helpful) comment is also added to explain the lack of error
    message.
    
    This is probably related to 1152a05e ("tools: Correct error handling in
    fit_image_process_hash()") and the corresponding error reported here:
    
    https://www.mail-archive.com/u-boot@lists.denx.de/msg217417.html
    
    
    
    Signed-off-by: default avatarMario Six <mario.six@gdsys.cc>