X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/80e2389990082500d76eb566d4946be3e786c3ef..d8f41ccd20de16f8ebe2ccc84d47bf1cb2b26bbb:/Security/codesign_tests/validation.sh diff --git a/Security/codesign_tests/validation.sh b/Security/codesign_tests/validation.sh new file mode 100755 index 00000000..c4398936 --- /dev/null +++ b/Security/codesign_tests/validation.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +echo "[TEST] codesign dynamic validation" + +echo "[BEGIN] Dynamic validate pid 1" +codesign --verify --verbose=3 1 + +if [ $? -ne 0 ] +then + echo "[FAIL]" +else + echo "[PASS]" +fi + +echo "[BEGIN] Dynamic validate a universal binary" + +/AppleInternal/CoreOS/codesign_tests/codesign_tests & +pid=$! +codesign --verify --verbose=3 $! + +if [ $? -ne 0 ] +then + echo "[FAIL]" +else + echo "[PASS]" +fi + +echo "[BEGIN] Dynamic validate a universal binary, 32 bit slice" + +arch -i386 /AppleInternal/CoreOS/codesign_tests/codesign_tests & +pid=$! +codesign --verify --verbose=3 $! + +if [ $? -ne 0 ] +then + echo "[FAIL]" +else + echo "[PASS]" +fi + +# Will exit with status of last command. + +exit $?