]> git.saurik.com Git - apple/security.git/blob - SecurityTests/clxutils/importExport/impExpOpensslEcdsa
Security-57031.1.35.tar.gz
[apple/security.git] / SecurityTests / clxutils / importExport / impExpOpensslEcdsa
1 #! /bin/csh -f
2 #
3 # Run OpenSSL/ECDSA import/export tests.
4 #
5 # Run this from SecurityTests/clxutils/importExport. The
6 # kcImport and kcExport programs must exist in the location
7 # specified by the LOCAL_BUILD_DIR env var.
8 #
9
10 source setupCommon
11
12 set ECDSASUBTOOL=./impExpOpensslEcdsaTool
13
14 # user specified variables
15 set QUIET=NO
16 set QUIET_ARG=
17 set NOACL=NO
18 set NOACL_ARG=
19 set SECURE_PHRASE=NO
20 set SECURE_PHRASE_ARG=
21 set NOCLEAN=NO
22
23 # user options
24
25 while ( $#argv > 0 )
26 switch ( "$argv[1]" )
27 case q:
28 set QUIET=YES
29 set QUIET_ARG=-q
30 shift
31 breaksw
32 case n:
33 set NOACL=YES
34 set NOACL_ARG=-n
35 shift
36 breaksw
37 case s:
38 set SECURE_PHRASE=YES
39 set SECURE_PHRASE_ARG=-Z
40 shift
41 breaksw
42 case N:
43 set NOCLEAN=YES
44 shift
45 breaksw
46 default:
47 echo Usage: impExpOpensslEcdsa \[q\(uiet\)\] \[n\(oACL\)\] \[s\(ecurePassphrase\)\] \[N\(oClean\)\]
48 exit(1)
49 endsw
50 end
51
52 echo === Begin ECDSA/openssl test ===
53
54 # always unlock first
55 set cmd="$SECURITY unlock -p $KEYCHAIN_PWD $KEYCHAIN"
56 if ($QUIET == NO) then
57 echo $cmd
58 endif
59 $cmd || exit(1)
60
61 set cmd="$ECDSASUBTOOL 256 $QUIET $NOACL $SECURE_PHRASE $NOCLEAN"
62 if ($QUIET == NO) then
63 echo $cmd
64 endif
65 $cmd || exit(1)
66
67 set cmd="$ECDSASUBTOOL 384 $QUIET $NOACL $SECURE_PHRASE $NOCLEAN"
68 if ($QUIET == NO) then
69 echo $cmd
70 endif
71 $cmd || exit(1)
72
73 set cmd="$ECDSASUBTOOL 521 $QUIET $NOACL $SECURE_PHRASE $NOCLEAN"
74 if ($QUIET == NO) then
75 echo $cmd
76 endif
77 $cmd || exit(1)
78