]> git.ipfire.org Git - thirdparty/openssl.git/blame - apps/progs.pl
Check that the subject name in a proxy cert complies to RFC 3820
[thirdparty/openssl.git] / apps / progs.pl
CommitLineData
d02b48c6
RE
1#!/usr/local/bin/perl
2
29a28ee5
BM
3print "/* apps/progs.h */\n";
4print "/* automatically generated by progs.pl for openssl.c */\n\n";
c1cf1eec 5
d02b48c6
RE
6grep(s/^asn1pars$/asn1parse/,@ARGV);
7
8foreach (@ARGV)
9 { printf "extern int %s_main(int argc,char *argv[]);\n",$_; }
d02b48c6
RE
10
11print <<'EOF';
12
d02b48c6
RE
13#define FUNC_TYPE_GENERAL 1
14#define FUNC_TYPE_MD 2
15#define FUNC_TYPE_CIPHER 3
0b33dac3 16#define FUNC_TYPE_PKEY 4
5ba4bf35
DSH
17#define FUNC_TYPE_MD_ALG 5
18#define FUNC_TYPE_CIPHER_ALG 6
d02b48c6
RE
19
20typedef struct {
21 int type;
69740c2b
NL
22 const char *name;
23 int (*func)(int argc,char *argv[]);
d02b48c6 24 } FUNCTION;
6e072295 25DECLARE_LHASH_OF(FUNCTION);
d02b48c6
RE
26
27FUNCTION functions[] = {
28EOF
29
30foreach (@ARGV)
31 {
32 push(@files,$_);
33 $str="\t{FUNC_TYPE_GENERAL,\"$_\",${_}_main},\n";
34 if (($_ =~ /^s_/) || ($_ =~ /^ciphers$/))
d6d32437 35 { print "#if !defined(OPENSSL_NO_SOCK)\n${str}#endif\n"; }
69740c2b
NL
36 elsif ( ($_ =~ /^speed$/))
37 { print "#ifndef OPENSSL_NO_SPEED\n${str}#endif\n"; }
38 elsif ( ($_ =~ /^engine$/))
39 { print "#ifndef OPENSSL_NO_ENGINE\n${str}#endif\n"; }
bd08a2bd 40 elsif ( ($_ =~ /^rsa$/) || ($_ =~ /^genrsa$/) || ($_ =~ /^rsautl$/))
e72d5983 41 { print "#ifndef OPENSSL_NO_RSA\n${str}#endif\n"; }
d02b48c6 42 elsif ( ($_ =~ /^dsa$/) || ($_ =~ /^gendsa$/) || ($_ =~ /^dsaparam$/))
e72d5983 43 { print "#ifndef OPENSSL_NO_DSA\n${str}#endif\n"; }
d4a8f90c
BM
44 elsif ( ($_ =~ /^ec$/) || ($_ =~ /^ecparam$/))
45 { print "#ifndef OPENSSL_NO_EC\n${str}#endif\n";}
09483c58 46 elsif ( ($_ =~ /^dh$/) || ($_ =~ /^gendh$/) || ($_ =~ /^dhparam$/))
e72d5983 47 { print "#ifndef OPENSSL_NO_DH\n${str}#endif\n"; }
a31011e8 48 elsif ( ($_ =~ /^pkcs12$/))
e72d5983 49 { print "#if !defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_SHA1)\n${str}#endif\n"; }
8931b30d
DSH
50 elsif ( ($_ =~ /^cms$/))
51 { print "#ifndef OPENSSL_NO_CMS\n${str}#endif\n"; }
6e072295
DSH
52 elsif ( ($_ =~ /^ocsp$/))
53 { print "#ifndef OPENSSL_NO_OCSP\n${str}#endif\n"; }
508bd3d1
DSH
54 elsif ( ($_ =~ /^srp$/))
55 { print "#ifndef OPENSSL_NO_SRP\n${str}#endif\n"; }
d02b48c6
RE
56 else
57 { print $str; }
58 }
59
3009458e 60foreach ("md2","md4","md5","sha","sha1","mdc2","rmd160")
d02b48c6
RE
61 {
62 push(@files,$_);
a52c2fb2 63 printf "#ifndef OPENSSL_NO_".uc($_)."\n\t{FUNC_TYPE_MD,\"".$_."\",dgst_main},\n#endif\n";
d02b48c6
RE
64 }
65
66foreach (
41450b27
BM
67 "aes-128-cbc", "aes-128-ecb",
68 "aes-192-cbc", "aes-192-ecb",
69 "aes-256-cbc", "aes-256-ecb",
f3dea9a5
BM
70 "camellia-128-cbc", "camellia-128-ecb",
71 "camellia-192-cbc", "camellia-192-ecb",
72 "camellia-256-cbc", "camellia-256-ecb",
8931b30d 73 "base64", "zlib",
96afc1cf 74 "des", "des3", "desx", "idea", "seed", "rc4", "rc4-40",
a0e9f529 75 "rc2", "bf", "cast", "rc5",
d02b48c6
RE
76 "des-ecb", "des-ede", "des-ede3",
77 "des-cbc", "des-ede-cbc","des-ede3-cbc",
78 "des-cfb", "des-ede-cfb","des-ede3-cfb",
79 "des-ofb", "des-ede-ofb","des-ede3-ofb",
96afc1cf
BM
80 "idea-cbc","idea-ecb", "idea-cfb", "idea-ofb",
81 "seed-cbc","seed-ecb", "seed-cfb", "seed-ofb",
a0e9f529 82 "rc2-cbc", "rc2-ecb", "rc2-cfb","rc2-ofb", "rc2-64-cbc", "rc2-40-cbc",
58964a49
RE
83 "bf-cbc", "bf-ecb", "bf-cfb", "bf-ofb",
84 "cast5-cbc","cast5-ecb", "cast5-cfb","cast5-ofb",
85 "cast-cbc", "rc5-cbc", "rc5-ecb", "rc5-cfb", "rc5-ofb")
d02b48c6
RE
86 {
87 push(@files,$_);
88
89 $t=sprintf("\t{FUNC_TYPE_CIPHER,\"%s\",enc_main},\n",$_);
e72d5983 90 if ($_ =~ /des/) { $t="#ifndef OPENSSL_NO_DES\n${t}#endif\n"; }
41450b27 91 elsif ($_ =~ /aes/) { $t="#ifndef OPENSSL_NO_AES\n${t}#endif\n"; }
f3dea9a5 92 elsif ($_ =~ /camellia/) { $t="#ifndef OPENSSL_NO_CAMELLIA\n${t}#endif\n"; }
e72d5983 93 elsif ($_ =~ /idea/) { $t="#ifndef OPENSSL_NO_IDEA\n${t}#endif\n"; }
96afc1cf 94 elsif ($_ =~ /seed/) { $t="#ifndef OPENSSL_NO_SEED\n${t}#endif\n"; }
e72d5983
BM
95 elsif ($_ =~ /rc4/) { $t="#ifndef OPENSSL_NO_RC4\n${t}#endif\n"; }
96 elsif ($_ =~ /rc2/) { $t="#ifndef OPENSSL_NO_RC2\n${t}#endif\n"; }
97 elsif ($_ =~ /bf/) { $t="#ifndef OPENSSL_NO_BF\n${t}#endif\n"; }
98 elsif ($_ =~ /cast/) { $t="#ifndef OPENSSL_NO_CAST\n${t}#endif\n"; }
99 elsif ($_ =~ /rc5/) { $t="#ifndef OPENSSL_NO_RC5\n${t}#endif\n"; }
8931b30d 100 elsif ($_ =~ /zlib/) { $t="#ifdef ZLIB\n${t}#endif\n"; }
d02b48c6
RE
101 print $t;
102 }
103
104print "\t{0,NULL,NULL}\n\t};\n";