diff options
Diffstat (limited to 'src/lib/libcrypto/conf/keysets.pl')
-rw-r--r-- | src/lib/libcrypto/conf/keysets.pl | 152 |
1 files changed, 135 insertions, 17 deletions
diff --git a/src/lib/libcrypto/conf/keysets.pl b/src/lib/libcrypto/conf/keysets.pl index 1aed0c80c4..56669e76ac 100644 --- a/src/lib/libcrypto/conf/keysets.pl +++ b/src/lib/libcrypto/conf/keysets.pl | |||
@@ -3,12 +3,15 @@ | |||
3 | $NUMBER=0x01; | 3 | $NUMBER=0x01; |
4 | $UPPER=0x02; | 4 | $UPPER=0x02; |
5 | $LOWER=0x04; | 5 | $LOWER=0x04; |
6 | $EOF=0x08; | 6 | $UNDER=0x100; |
7 | $PUNCTUATION=0x200; | ||
7 | $WS=0x10; | 8 | $WS=0x10; |
8 | $ESC=0x20; | 9 | $ESC=0x20; |
9 | $QUOTE=0x40; | 10 | $QUOTE=0x40; |
11 | $DQUOTE=0x400; | ||
10 | $COMMENT=0x80; | 12 | $COMMENT=0x80; |
11 | $UNDER=0x100; | 13 | $FCOMMENT=0x800; |
14 | $EOF=0x08; | ||
12 | 15 | ||
13 | foreach (0 .. 127) | 16 | foreach (0 .. 127) |
14 | { | 17 | { |
@@ -18,44 +21,159 @@ foreach (0 .. 127) | |||
18 | $v|=$UPPER if ($c =~ /[A-Z]/); | 21 | $v|=$UPPER if ($c =~ /[A-Z]/); |
19 | $v|=$LOWER if ($c =~ /[a-z]/); | 22 | $v|=$LOWER if ($c =~ /[a-z]/); |
20 | $v|=$UNDER if ($c =~ /_/); | 23 | $v|=$UNDER if ($c =~ /_/); |
21 | $v|=$WS if ($c =~ / \t\r\n/); | 24 | $v|=$PUNCTUATION if ($c =~ /[!\.%&\*\+,\/;\?\@\^\~\|-]/); |
25 | $v|=$WS if ($c =~ /[ \t\r\n]/); | ||
22 | $v|=$ESC if ($c =~ /\\/); | 26 | $v|=$ESC if ($c =~ /\\/); |
23 | $v|=$QUOTE if ($c =~ /['`"]/); | 27 | $v|=$QUOTE if ($c =~ /['`"]/); # for emacs: "`'}/) |
24 | $v|=$COMMENT if ($c =~ /\#/); | 28 | $v|=$COMMENT if ($c =~ /\#/); |
25 | $v|=$EOF if ($c =~ /\0/); | 29 | $v|=$EOF if ($c =~ /\0/); |
26 | 30 | ||
27 | push(@V,$v); | 31 | push(@V_def,$v); |
32 | } | ||
33 | |||
34 | foreach (0 .. 127) | ||
35 | { | ||
36 | $v=0; | ||
37 | $c=sprintf("%c",$_); | ||
38 | $v|=$NUMBER if ($c =~ /[0-9]/); | ||
39 | $v|=$UPPER if ($c =~ /[A-Z]/); | ||
40 | $v|=$LOWER if ($c =~ /[a-z]/); | ||
41 | $v|=$UNDER if ($c =~ /_/); | ||
42 | $v|=$PUNCTUATION if ($c =~ /[!\.%&\*\+,\/;\?\@\^\~\|-]/); | ||
43 | $v|=$WS if ($c =~ /[ \t\r\n]/); | ||
44 | $v|=$DQUOTE if ($c =~ /["]/); # for emacs: "}/) | ||
45 | $v|=$FCOMMENT if ($c =~ /;/); | ||
46 | $v|=$EOF if ($c =~ /\0/); | ||
47 | |||
48 | push(@V_w32,$v); | ||
28 | } | 49 | } |
29 | 50 | ||
30 | print <<"EOF"; | 51 | print <<"EOF"; |
52 | /* crypto/conf/conf_def.h */ | ||
53 | /* Copyright (C) 1995-1998 Eric Young (eay\@cryptsoft.com) | ||
54 | * All rights reserved. | ||
55 | * | ||
56 | * This package is an SSL implementation written | ||
57 | * by Eric Young (eay\@cryptsoft.com). | ||
58 | * The implementation was written so as to conform with Netscapes SSL. | ||
59 | * | ||
60 | * This library is free for commercial and non-commercial use as long as | ||
61 | * the following conditions are aheared to. The following conditions | ||
62 | * apply to all code found in this distribution, be it the RC4, RSA, | ||
63 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
64 | * included with this distribution is covered by the same copyright terms | ||
65 | * except that the holder is Tim Hudson (tjh\@cryptsoft.com). | ||
66 | * | ||
67 | * Copyright remains Eric Young's, and as such any Copyright notices in | ||
68 | * the code are not to be removed. | ||
69 | * If this package is used in a product, Eric Young should be given attribution | ||
70 | * as the author of the parts of the library used. | ||
71 | * This can be in the form of a textual message at program startup or | ||
72 | * in documentation (online or textual) provided with the package. | ||
73 | * | ||
74 | * Redistribution and use in source and binary forms, with or without | ||
75 | * modification, are permitted provided that the following conditions | ||
76 | * are met: | ||
77 | * 1. Redistributions of source code must retain the copyright | ||
78 | * notice, this list of conditions and the following disclaimer. | ||
79 | * 2. Redistributions in binary form must reproduce the above copyright | ||
80 | * notice, this list of conditions and the following disclaimer in the | ||
81 | * documentation and/or other materials provided with the distribution. | ||
82 | * 3. All advertising materials mentioning features or use of this software | ||
83 | * must display the following acknowledgement: | ||
84 | * "This product includes cryptographic software written by | ||
85 | * Eric Young (eay\@cryptsoft.com)" | ||
86 | * The word 'cryptographic' can be left out if the rouines from the library | ||
87 | * being used are not cryptographic related :-). | ||
88 | * 4. If you include any Windows specific code (or a derivative thereof) from | ||
89 | * the apps directory (application code) you must include an acknowledgement: | ||
90 | * "This product includes software written by Tim Hudson (tjh\@cryptsoft.com)" | ||
91 | * | ||
92 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
93 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
94 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
95 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
96 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
97 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
98 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
99 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
100 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
101 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
102 | * SUCH DAMAGE. | ||
103 | * | ||
104 | * The licence and distribution terms for any publically available version or | ||
105 | * derivative of this code cannot be changed. i.e. this code cannot simply be | ||
106 | * copied and put under another distribution licence | ||
107 | * [including the GNU Public Licence.] | ||
108 | */ | ||
109 | |||
110 | /* THIS FILE WAS AUTOMAGICALLY GENERATED! | ||
111 | Please modify and use keysets.pl to regenerate it. */ | ||
112 | |||
31 | #define CONF_NUMBER $NUMBER | 113 | #define CONF_NUMBER $NUMBER |
32 | #define CONF_UPPER $UPPER | 114 | #define CONF_UPPER $UPPER |
33 | #define CONF_LOWER $LOWER | 115 | #define CONF_LOWER $LOWER |
34 | #define CONF_EOF $EOF | 116 | #define CONF_UNDER $UNDER |
117 | #define CONF_PUNCTUATION $PUNCTUATION | ||
35 | #define CONF_WS $WS | 118 | #define CONF_WS $WS |
36 | #define CONF_ESC $ESC | 119 | #define CONF_ESC $ESC |
37 | #define CONF_QUOTE $QUOTE | 120 | #define CONF_QUOTE $QUOTE |
121 | #define CONF_DQUOTE $DQUOTE | ||
38 | #define CONF_COMMENT $COMMENT | 122 | #define CONF_COMMENT $COMMENT |
123 | #define CONF_FCOMMENT $FCOMMENT | ||
124 | #define CONF_EOF $EOF | ||
39 | #define CONF_ALPHA (CONF_UPPER|CONF_LOWER) | 125 | #define CONF_ALPHA (CONF_UPPER|CONF_LOWER) |
40 | #define CONF_ALPHA_NUMERIC (CONF_ALPHA|CONF_NUMBER|CONF_UNDER) | 126 | #define CONF_ALPHA_NUMERIC (CONF_ALPHA|CONF_NUMBER|CONF_UNDER) |
41 | #define CONF_UNDER $UNDER | 127 | #define CONF_ALPHA_NUMERIC_PUNCT (CONF_ALPHA|CONF_NUMBER|CONF_UNDER| \\ |
128 | CONF_PUNCTUATION) | ||
129 | |||
130 | #define KEYTYPES(c) ((unsigned short *)((c)->meth_data)) | ||
131 | #ifndef CHARSET_EBCDIC | ||
132 | #define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_COMMENT) | ||
133 | #define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_FCOMMENT) | ||
134 | #define IS_EOF(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_EOF) | ||
135 | #define IS_ESC(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_ESC) | ||
136 | #define IS_NUMBER(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_NUMBER) | ||
137 | #define IS_WS(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_WS) | ||
138 | #define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_ALPHA_NUMERIC) | ||
139 | #define IS_ALPHA_NUMERIC_PUNCT(c,a) \\ | ||
140 | (KEYTYPES(c)[(a)&0x7f]&CONF_ALPHA_NUMERIC_PUNCT) | ||
141 | #define IS_QUOTE(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_QUOTE) | ||
142 | #define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_DQUOTE) | ||
143 | |||
144 | #else /*CHARSET_EBCDIC*/ | ||
42 | 145 | ||
43 | #define IS_COMMENT(a) (CONF_COMMENT&(CONF_type[(a)&0x7f])) | 146 | #define IS_COMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_COMMENT) |
44 | #define IS_EOF(a) ((a) == '\\0') | 147 | #define IS_FCOMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_FCOMMENT) |
45 | #define IS_ESC(a) ((a) == '\\\\') | 148 | #define IS_EOF(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_EOF) |
46 | #define IS_NUMER(a) (CONF_type[(a)&0x7f]&CONF_NUMBER) | 149 | #define IS_ESC(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ESC) |
47 | #define IS_WS(a) (CONF_type[(a)&0x7f]&CONF_WS) | 150 | #define IS_NUMBER(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_NUMBER) |
48 | #define IS_ALPHA_NUMERIC(a) (CONF_type[(a)&0x7f]&CONF_ALPHA_NUMERIC) | 151 | #define IS_WS(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_WS) |
49 | #define IS_QUOTE(a) (CONF_type[(a)&0x7f]&CONF_QUOTE) | 152 | #define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ALPHA_NUMERIC) |
153 | #define IS_ALPHA_NUMERIC_PUNCT(c,a) \\ | ||
154 | (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ALPHA_NUMERIC_PUNCT) | ||
155 | #define IS_QUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_QUOTE) | ||
156 | #define IS_DQUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_DQUOTE) | ||
157 | #endif /*CHARSET_EBCDIC*/ | ||
50 | 158 | ||
51 | EOF | 159 | EOF |
52 | 160 | ||
53 | print "static unsigned short CONF_type[128]={"; | 161 | print "static unsigned short CONF_type_default[128]={"; |
162 | |||
163 | for ($i=0; $i<128; $i++) | ||
164 | { | ||
165 | print "\n\t" if ($i % 8) == 0; | ||
166 | printf "0x%03X,",$V_def[$i]; | ||
167 | } | ||
168 | |||
169 | print "\n\t};\n\n"; | ||
170 | |||
171 | print "static unsigned short CONF_type_win32[128]={"; | ||
54 | 172 | ||
55 | for ($i=0; $i<128; $i++) | 173 | for ($i=0; $i<128; $i++) |
56 | { | 174 | { |
57 | print "\n\t" if ($i % 8) == 0; | 175 | print "\n\t" if ($i % 8) == 0; |
58 | printf "0x%03X,",$V[$i]; | 176 | printf "0x%03X,",$V_w32[$i]; |
59 | } | 177 | } |
60 | 178 | ||
61 | print "\n\t};\n"; | 179 | print "\n\t};\n\n"; |