This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MD5 hash technique while OTA upgrade from dropbox

Other Parts Discussed in Thread: CC3200, CC3100

Hi All,

Facing issue while generating MD5-HASH for UCF file extension

I have kept two file in dropbox folder to upgrade FW-

1. f00_sys_servicepack.sig

2. f43_sys_servicepack.ucf

I am using MD5 hash technique to get 16 bytes hash value.  seeing correct hash value for f00_sys_servicepack.sig but hash value is not matching in case of  f43_sys_servicepack.ucf.

But if i modify " f43_sys_servicepack.ucf " to  " f43_sys_servicepack.bin " , seeing correct hash value. 

I cannot upgrade FW if i use " f43_sys_servicepack.bin ".

Kindly help me on this.

Thanks,

Prateek

  • Hi,

    The procedure is not very clear.

    Can you elaborate:

    1. Are you using MD5 to validate that there are no errors in file download? what is the purpose?
    2. is this MD5-HASH you are running is an offline utility?
    3. what is the difference between f43_sys_servicepack.ucf and f43_sys_servicepack.bin. Is it only the name?

    Shlomi

  • Hi Shlomi,

    I am updating  CC3100_CC3200_ServicePack_1.0.1.6-2.6.0.5 (through OTA) from dropbox and generating hash value through Driver of SHA/MD5 module.

    1. Validating hash value for the file integrity check that is downloaded from the dropbox.

    2. I am generating the hash for the downloaded servicepack file with extension .ucf and its signature with extension of .sig. Before uploading the file to dropbox. i am calculating hash for file using online tool- (http://onlinemd5.com/)

    3. Difference between f43_sys_servicepack.ucf and f43_sys_servicepack.bin is only file extension. There is no other change.

    I am getting correct hash value for signature file with servicepack with .bin extension but getting different hash vale for servicepack with .ucf file extension in same step.

    Generated Hash for working case-

    The Hash Value in Hex is: 0xedb26f76a038588e339e62196e534600 ( .sig file)

    The Hash Value in Hex is :0x0ed98b6d65e6a7382a3f72b1949e9686 ( .bin file )

    Generated Hash for non working case-

     The Hash Value in Hex is: 0xedb26f76a038588e339e62196e534600 ( .sig file )

    The Hash Value in Hex is: 0x7e86befa171065749b416f452e25852f ( .ucf file )

    Please find attached working and non working files.

    Working_Dir.zipNon_Working_Dir.zip

    Thanks

  • Well, this is the same content. Only filename is different.

    Can you tell when you call SHA/MD5 API?

    Do you calculate it in real time when the file is being downloaded or do you first store it and then read and calculate hash?

    Shlomi

  • Calling SHA/MD5 API after file download.

    I do first download, then read and calculate hash.


    Thanks

  • But you cannot read the /sys/servicepack.ucf as it is public write only.

    Please check the return value when invoking read() operation on the file.

    Most likely you read giberish content and calculate hash that obviously fails.

    Shlomi 

  • I am using sl_FsRead and reading 1024 bytes every time and using function SHAMD5DataWriteMultiple to write multiple bytes to SHAMD5 module. and everytime sl_FsRead returns correct 1024 bytes.
  • Not clear how you can read /sys/servicepack.ucf which is public write only.

    Can you look at the read bytes and check whether it matches the expected bytes (at least the first few bytes)?

  • So, is there anyway to calculate Hash for .ucf file or any flag to enable it.? 

  • Hi,

    How to calculate hash for servicepack.ucf after it is stored if it is not readable? If that is not possible then what is the other way to calculate hash.

    We have limited RAM and cannot completely download the whole .ucf file in one chunk and calculate hash.

    Thanks,

    Prateek

  • why do you need to calculate hash?

    is it to make sure validity of content download?

    please note that if you download via TCP, you should be OK as it is error-checked and reliable.

    Additionally, you have the signature that is checked when you close the file so any content change would cause signature to fail.

  • Hi Shlomi,

    As per requirement, need to evaluate correct content of data before download or install in CC3200 device, whether it is service pack or any app which will be getting future update.

    SO for each and every file hash calculation and validation should be happen.
    What's your view on this?


    Prateek
  • Hi,

    Calculating MD5 per file is fine. It is just that it cannot be applied on servicepack.ucf (and not really needed as it is done internally as this file is the only one secured).

    Regarding other files, can you tellll if you have this MD5 issue?

    Shlomi