···175175 return NULL;
176176}
177177178178+/* A CRC test in order to reject non OF file */
179179+int test_firmware_tcc(unsigned char* buf, int length)
180180+{
181181+ return telechips_test_crc(buf, length);
182182+}
183183+178184#ifndef LIB
179185int main(int argc, char *argv[])
180186{
···185191 unsigned char *boot_buf = NULL;
186192 unsigned char* image = NULL;
187193 int ret = 0;
188188-194194+189195 if(argc < 3) {
190196 usage();
191197 }
···199205 if (!of_buf)
200206 {
201207 ret = 1;
208208+ goto error_exit;
209209+ }
210210+211211+ /* Validate input file */
212212+ if (test_firmware_tcc(of_buf, of_size))
213213+ {
214214+ printf("[ERR] Unknown OF file used, aborting\n");
215215+ ret = 2;
202216 goto error_exit;
203217 }
204218
+3
rbutil/mktccboot/mktccboot.h
···35353636unsigned char *file_read(char *filename, int *size);
37373838+/* Test TCC firmware file for consistency using CRC test */
3939+int test_firmware_tcc(unsigned char* buf, int length);
4040+3841#ifdef __cplusplus
3942};
4043#endif
+8
rbutil/rbutilqt/base/bootloaderinstalltcc.cpp
···8181 goto exit;
8282 }
83838484+ /* A CRC test in order to reject non OF file */
8585+ if (test_firmware_tcc(of_buf, of_size))
8686+ {
8787+ emit logItem(errstr, LOGERROR);
8888+ emit logItem(tr("Unknown OF file used: %1").arg(m_offile), LOGERROR);
8989+ goto exit;
9090+ }
9191+8492 /* Load bootloader file */
8593 boot_buf = file_read(bootfile.toLocal8Bit().data(), &boot_size);
8694 if (boot_buf == NULL)