diff options
Diffstat (limited to 'policy/tools/add-fingerprint.sh')
-rwxr-xr-x | policy/tools/add-fingerprint.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/policy/tools/add-fingerprint.sh b/policy/tools/add-fingerprint.sh new file mode 100755 index 0000000..94941b3 --- /dev/null +++ b/policy/tools/add-fingerprint.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +CERT_ROOT=$1 +XML_PATH=$2 + +if [ -z "$2" ] +then + echo "usage: `basename $0` certificate_root_path fingerprint_xml_path" + exit 2 +fi + +for CATEGORY in developer public partner platform test verify store +do + if [ -d "$CERT_ROOT/$CATEGORY" ] + then + echo + echo " <<$CATEGORY>>" + for CERT_PATH in `ls $CERT_ROOT/$CATEGORY/*.pem` + do + FINGERPRINT=`/usr/bin/openssl x509 -noout -fingerprint -in $CERT_PATH | cut -d '=' -f 2` + echo " ${CERT_PATH##*/}:" + echo " $FINGERPRINT" + ############################################################################################################################# + # Find "<CertificateDomain name="tizen-xxxxxxx">" and then add the fingerprint into the next line + ############################################################################################################################# + # <FingerprintSHA1>XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX</FingerprintSHA1><!-- xxxxxxxxx.pem --> + ############################################################################################################################# + /bin/sed -i "s#<CertificateDomain name=\"tizen-$CATEGORY\">.*#&\n <FingerprintSHA1>$FINGERPRINT</FingerprintSHA1><!-- ${CERT_PATH##*/} -->#" $XML_PATH + done + fi +done +echo |