Add process for custom signature verifier 28/177028/1 accepted/tizen/unified/20180427.131025 submit/tizen/20180427.061142
authorSunmin Lee <sunm.lee@samsung.com>
Tue, 24 Apr 2018 06:56:56 +0000 (15:56 +0900)
committerSunmin Lee <sunm.lee@samsung.com>
Tue, 24 Apr 2018 23:10:33 +0000 (08:10 +0900)
If the custom signature verifier is included,
it would be executed before update.

Change-Id: Ic3e42b661856d9e6599ec2ef833aa1f30e95db01
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
scripts/fota-init.sh

index 7588872..07651c5 100755 (executable)
@@ -3,7 +3,6 @@
 MODULE_MOUNT_FLAG=@MODULE_MOUNT_FLAG@
 WITH_USR_PART=
 
-
 FAKE_ROOT=/system
 
 UPI_NO_DELTA_ERROR=fb15
@@ -170,6 +169,19 @@ do_fota_update() {
                return 1
        fi
 
+       VERIFY_TOOL=/usr/sbin/upg-verifier
+       if [ -e ${VERIFY_TOOL} ]; then
+               ${VERIFY_TOOL} ${DELTA}
+               if [ $? -ne 0 ]; then
+                       echo "signature verification failed!" >> ${INT_LOG_FILE}
+                       return 1
+               else
+                       echo "update package verification success"
+               fi
+       else
+               echo "Warning: No signature verifier... Skip it" >> ${INT_LOG_FILE}
+       fi
+
        if [ "$FOTA_GUI_ENABLE" = "1" ]; then
                ${UA} ${DELTA_DIR} ${FOTA_TEMP_DIR} 0
        else