OLD | NEW |
1 #!/usr/local/bin/perl | 1 #!/usr/local/bin/perl |
2 | 2 |
3 print "/* apps/progs.h */\n"; | 3 print "/* apps/progs.h */\n"; |
4 print "/* automatically generated by progs.pl for openssl.c */\n\n"; | 4 print "/* automatically generated by progs.pl for openssl.c */\n\n"; |
5 | 5 |
6 grep(s/^asn1pars$/asn1parse/,@ARGV); | 6 grep(s/^asn1pars$/asn1parse/,@ARGV); |
7 | 7 |
8 foreach (@ARGV) | 8 foreach (@ARGV) |
9 { printf "extern int %s_main(int argc,char *argv[]);\n",$_; } | 9 { printf "extern int %s_main(int argc,char *argv[]);\n",$_; } |
10 | 10 |
11 print <<'EOF'; | 11 print <<'EOF'; |
12 | 12 |
13 #define FUNC_TYPE_GENERAL 1 | 13 #define FUNC_TYPE_GENERAL 1 |
14 #define FUNC_TYPE_MD 2 | 14 #define FUNC_TYPE_MD 2 |
15 #define FUNC_TYPE_CIPHER 3 | 15 #define FUNC_TYPE_CIPHER 3 |
| 16 #define FUNC_TYPE_PKEY 4 |
| 17 #define FUNC_TYPE_MD_ALG 5 |
| 18 #define FUNC_TYPE_CIPHER_ALG 6 |
16 | 19 |
17 typedef struct { | 20 typedef struct { |
18 int type; | 21 int type; |
19 const char *name; | 22 const char *name; |
20 int (*func)(int argc,char *argv[]); | 23 int (*func)(int argc,char *argv[]); |
21 } FUNCTION; | 24 } FUNCTION; |
| 25 DECLARE_LHASH_OF(FUNCTION); |
22 | 26 |
23 FUNCTION functions[] = { | 27 FUNCTION functions[] = { |
24 EOF | 28 EOF |
25 | 29 |
26 foreach (@ARGV) | 30 foreach (@ARGV) |
27 { | 31 { |
28 push(@files,$_); | 32 push(@files,$_); |
29 $str="\t{FUNC_TYPE_GENERAL,\"$_\",${_}_main},\n"; | 33 $str="\t{FUNC_TYPE_GENERAL,\"$_\",${_}_main},\n"; |
30 if (($_ =~ /^s_/) || ($_ =~ /^ciphers$/)) | 34 if (($_ =~ /^s_/) || ($_ =~ /^ciphers$/)) |
31 { print "#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_S
SL2) && defined(OPENSSL_NO_SSL3))\n${str}#endif\n"; } | 35 { print "#if !defined(OPENSSL_NO_SOCK) && !(defined(OPENSSL_NO_S
SL2) && defined(OPENSSL_NO_SSL3))\n${str}#endif\n"; } |
32 elsif ( ($_ =~ /^speed$/)) | 36 elsif ( ($_ =~ /^speed$/)) |
33 { print "#ifndef OPENSSL_NO_SPEED\n${str}#endif\n"; } | 37 { print "#ifndef OPENSSL_NO_SPEED\n${str}#endif\n"; } |
34 elsif ( ($_ =~ /^engine$/)) | 38 elsif ( ($_ =~ /^engine$/)) |
35 { print "#ifndef OPENSSL_NO_ENGINE\n${str}#endif\n"; } | 39 { print "#ifndef OPENSSL_NO_ENGINE\n${str}#endif\n"; } |
36 elsif ( ($_ =~ /^rsa$/) || ($_ =~ /^genrsa$/) || ($_ =~ /^rsautl$/)) | 40 elsif ( ($_ =~ /^rsa$/) || ($_ =~ /^genrsa$/) || ($_ =~ /^rsautl$/)) |
37 { print "#ifndef OPENSSL_NO_RSA\n${str}#endif\n"; } | 41 { print "#ifndef OPENSSL_NO_RSA\n${str}#endif\n"; } |
38 elsif ( ($_ =~ /^dsa$/) || ($_ =~ /^gendsa$/) || ($_ =~ /^dsaparam$/)) | 42 elsif ( ($_ =~ /^dsa$/) || ($_ =~ /^gendsa$/) || ($_ =~ /^dsaparam$/)) |
39 { print "#ifndef OPENSSL_NO_DSA\n${str}#endif\n"; } | 43 { print "#ifndef OPENSSL_NO_DSA\n${str}#endif\n"; } |
40 elsif ( ($_ =~ /^ec$/) || ($_ =~ /^ecparam$/)) | 44 elsif ( ($_ =~ /^ec$/) || ($_ =~ /^ecparam$/)) |
41 { print "#ifndef OPENSSL_NO_EC\n${str}#endif\n";} | 45 { print "#ifndef OPENSSL_NO_EC\n${str}#endif\n";} |
42 elsif ( ($_ =~ /^dh$/) || ($_ =~ /^gendh$/) || ($_ =~ /^dhparam$/)) | 46 elsif ( ($_ =~ /^dh$/) || ($_ =~ /^gendh$/) || ($_ =~ /^dhparam$/)) |
43 { print "#ifndef OPENSSL_NO_DH\n${str}#endif\n"; } | 47 { print "#ifndef OPENSSL_NO_DH\n${str}#endif\n"; } |
44 elsif ( ($_ =~ /^pkcs12$/)) | 48 elsif ( ($_ =~ /^pkcs12$/)) |
45 { print "#if !defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_SHA
1)\n${str}#endif\n"; } | 49 { print "#if !defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_SHA
1)\n${str}#endif\n"; } |
46 elsif ( ($_ =~ /^cms$/)) | 50 elsif ( ($_ =~ /^cms$/)) |
47 { print "#ifndef OPENSSL_NO_CMS\n${str}#endif\n"; } | 51 { print "#ifndef OPENSSL_NO_CMS\n${str}#endif\n"; } |
| 52 elsif ( ($_ =~ /^ocsp$/)) |
| 53 { print "#ifndef OPENSSL_NO_OCSP\n${str}#endif\n"; } |
48 else | 54 else |
49 { print $str; } | 55 { print $str; } |
50 } | 56 } |
51 | 57 |
52 foreach ("md2","md4","md5","sha","sha1","mdc2","rmd160") | 58 foreach ("md2","md4","md5","sha","sha1","mdc2","rmd160") |
53 { | 59 { |
54 push(@files,$_); | 60 push(@files,$_); |
55 printf "#ifndef OPENSSL_NO_".uc($_)."\n\t{FUNC_TYPE_MD,\"".$_."\",dgst_m
ain},\n#endif\n"; | 61 printf "#ifndef OPENSSL_NO_".uc($_)."\n\t{FUNC_TYPE_MD,\"".$_."\",dgst_m
ain},\n#endif\n"; |
56 } | 62 } |
57 | 63 |
58 foreach ( | 64 foreach ( |
59 "aes-128-cbc", "aes-128-ecb", | 65 "aes-128-cbc", "aes-128-ecb", |
60 "aes-192-cbc", "aes-192-ecb", | 66 "aes-192-cbc", "aes-192-ecb", |
61 "aes-256-cbc", "aes-256-ecb", | 67 "aes-256-cbc", "aes-256-ecb", |
62 "camellia-128-cbc", "camellia-128-ecb", | 68 "camellia-128-cbc", "camellia-128-ecb", |
63 "camellia-192-cbc", "camellia-192-ecb", | 69 "camellia-192-cbc", "camellia-192-ecb", |
64 "camellia-256-cbc", "camellia-256-ecb", | 70 "camellia-256-cbc", "camellia-256-ecb", |
65 » "base64", | 71 » "base64", "zlib", |
66 "des", "des3", "desx", "idea", "seed", "rc4", "rc4-40", | 72 "des", "des3", "desx", "idea", "seed", "rc4", "rc4-40", |
67 "rc2", "bf", "cast", "rc5", | 73 "rc2", "bf", "cast", "rc5", |
68 "des-ecb", "des-ede", "des-ede3", | 74 "des-ecb", "des-ede", "des-ede3", |
69 "des-cbc", "des-ede-cbc","des-ede3-cbc", | 75 "des-cbc", "des-ede-cbc","des-ede3-cbc", |
70 "des-cfb", "des-ede-cfb","des-ede3-cfb", | 76 "des-cfb", "des-ede-cfb","des-ede3-cfb", |
71 "des-ofb", "des-ede-ofb","des-ede3-ofb", | 77 "des-ofb", "des-ede-ofb","des-ede3-ofb", |
72 "idea-cbc","idea-ecb", "idea-cfb", "idea-ofb", | 78 "idea-cbc","idea-ecb", "idea-cfb", "idea-ofb", |
73 "seed-cbc","seed-ecb", "seed-cfb", "seed-ofb", | 79 "seed-cbc","seed-ecb", "seed-cfb", "seed-ofb", |
74 "rc2-cbc", "rc2-ecb", "rc2-cfb","rc2-ofb", "rc2-64-cbc", "rc2-40-cbc", | 80 "rc2-cbc", "rc2-ecb", "rc2-cfb","rc2-ofb", "rc2-64-cbc", "rc2-40-cbc", |
75 "bf-cbc", "bf-ecb", "bf-cfb", "bf-ofb", | 81 "bf-cbc", "bf-ecb", "bf-cfb", "bf-ofb", |
76 "cast5-cbc","cast5-ecb", "cast5-cfb","cast5-ofb", | 82 "cast5-cbc","cast5-ecb", "cast5-cfb","cast5-ofb", |
77 "cast-cbc", "rc5-cbc", "rc5-ecb", "rc5-cfb", "rc5-ofb") | 83 "cast-cbc", "rc5-cbc", "rc5-ecb", "rc5-cfb", "rc5-ofb") |
78 { | 84 { |
79 push(@files,$_); | 85 push(@files,$_); |
80 | 86 |
81 $t=sprintf("\t{FUNC_TYPE_CIPHER,\"%s\",enc_main},\n",$_); | 87 $t=sprintf("\t{FUNC_TYPE_CIPHER,\"%s\",enc_main},\n",$_); |
82 if ($_ =~ /des/) { $t="#ifndef OPENSSL_NO_DES\n${t}#endif\n"; } | 88 if ($_ =~ /des/) { $t="#ifndef OPENSSL_NO_DES\n${t}#endif\n"; } |
83 elsif ($_ =~ /aes/) { $t="#ifndef OPENSSL_NO_AES\n${t}#endif\n"; } | 89 elsif ($_ =~ /aes/) { $t="#ifndef OPENSSL_NO_AES\n${t}#endif\n"; } |
84 elsif ($_ =~ /camellia/) { $t="#ifndef OPENSSL_NO_CAMELLIA\n${t}#endif\
n"; } | 90 elsif ($_ =~ /camellia/) { $t="#ifndef OPENSSL_NO_CAMELLIA\n${t}#endif\
n"; } |
85 elsif ($_ =~ /idea/) { $t="#ifndef OPENSSL_NO_IDEA\n${t}#endif\n"; } | 91 elsif ($_ =~ /idea/) { $t="#ifndef OPENSSL_NO_IDEA\n${t}#endif\n"; } |
86 elsif ($_ =~ /seed/) { $t="#ifndef OPENSSL_NO_SEED\n${t}#endif\n"; } | 92 elsif ($_ =~ /seed/) { $t="#ifndef OPENSSL_NO_SEED\n${t}#endif\n"; } |
87 elsif ($_ =~ /rc4/) { $t="#ifndef OPENSSL_NO_RC4\n${t}#endif\n"; } | 93 elsif ($_ =~ /rc4/) { $t="#ifndef OPENSSL_NO_RC4\n${t}#endif\n"; } |
88 elsif ($_ =~ /rc2/) { $t="#ifndef OPENSSL_NO_RC2\n${t}#endif\n"; } | 94 elsif ($_ =~ /rc2/) { $t="#ifndef OPENSSL_NO_RC2\n${t}#endif\n"; } |
89 elsif ($_ =~ /bf/) { $t="#ifndef OPENSSL_NO_BF\n${t}#endif\n"; } | 95 elsif ($_ =~ /bf/) { $t="#ifndef OPENSSL_NO_BF\n${t}#endif\n"; } |
90 elsif ($_ =~ /cast/) { $t="#ifndef OPENSSL_NO_CAST\n${t}#endif\n"; } | 96 elsif ($_ =~ /cast/) { $t="#ifndef OPENSSL_NO_CAST\n${t}#endif\n"; } |
91 elsif ($_ =~ /rc5/) { $t="#ifndef OPENSSL_NO_RC5\n${t}#endif\n"; } | 97 elsif ($_ =~ /rc5/) { $t="#ifndef OPENSSL_NO_RC5\n${t}#endif\n"; } |
| 98 elsif ($_ =~ /zlib/) { $t="#ifdef ZLIB\n${t}#endif\n"; } |
92 print $t; | 99 print $t; |
93 } | 100 } |
94 | 101 |
95 print "\t{0,NULL,NULL}\n\t};\n"; | 102 print "\t{0,NULL,NULL}\n\t};\n"; |
OLD | NEW |