)
IF (${CURRENT_DIGEST} STREQUAL ${CA_BUNDLE_DIGEST})
- MESSAGE("ca-certificate digest is match with static db.")
+ MESSAGE("ca-certificate digest matches with static db.")
INSTALL(FILES
resource/certs-meta-0.0.4.db
)
ELSE (${CURRENT_DIGEST} STREQUAL ${CA_BUNDLE_DIGEST})
- MESSAGE("${CURRENT_DIGEST} digest is not match with static db.")
+ MESSAGE("${CURRENT_DIGEST} digest does not match with static db.")
MESSAGE("Add ssl table to certs-meta.db")
EXECUTE_PROCESS(
subject_hash=`openssl x509 -in $fname -subject_hash -noout`
subject_hash_old=`openssl x509 -in $fname -subject_hash_old -noout`
common_name=`get_common_name $fname`
-
- echo "INSERT INTO ssl \
- (gname, certificate, file_hash, subject_hash, \
- common_name, enabled, is_root_app_enabled) VALUES \
- (\"$gname\", \"$cert\", \"$subject_hash\", \"$subject_hash_old\", \
- \"$common_name\", 1, 1);" >> $ROOT_CERT_SQL
+ echo "INSERT INTO ssl (gname, certificate, file_hash, subject_hash,\
+common_name, enabled, is_root_app_enabled) VALUES\
+('$gname', '$cert', '$subject_hash', '$subject_hash_old','$common_name', \
+1, 1);" >> $ROOT_CERT_SQL
done
echo "END TRANSACTION;" >> $ROOT_CERT_SQL
}
initialize_store_version
initialize_store_data
-cat $ROOT_CERT_SQL | sqlite3 $DB_PATH
-
-rm $ROOT_CERT_SQL
+sqlite3 $DB_PATH ".read $ROOT_CERT_SQL" && rm $ROOT_CERT_SQL