]> git.saurik.com Git - apple/security.git/blob - OSX/codesign_tests/validation.sh
Security-59754.41.1.tar.gz
[apple/security.git] / OSX / codesign_tests / validation.sh
1 #!/bin/bash
2
3 echo "[TEST] codesign dynamic validation"
4
5 echo "[BEGIN] Dynamic validate pid 1"
6 codesign --verify --verbose=3 1
7
8 if [ $? -ne 0 ]
9 then
10 echo "[FAIL]"
11 else
12 echo "[PASS]"
13 fi
14
15 echo "[BEGIN] Dynamic validate a universal binary"
16
17 $1 &
18 pid=$!
19 codesign --verify --verbose=3 $!
20
21 if [ $? -ne 0 ]
22 then
23 echo "[FAIL]"
24 else
25 echo "[PASS]"
26 fi
27
28 echo "[BEGIN] Dynamic validate a universal binary, 32 bit slice"
29
30 arch -i386 $1 &
31 pid=$!
32 codesign --verify --verbose=3 $!
33
34 if [ $? -ne 0 ]
35 then
36 echo "[FAIL]"
37 else
38 echo "[PASS]"
39 fi
40
41 # Will exit with status of last command.
42
43 exit $?