7 $A=$obj_len{$obj{$nid{$a}}};
8 $B=$obj_len{$obj{$nid{$b}}};
11 return($r) if $r != 0;
13 $A=$obj_der{$obj{$nid{$a}}};
14 $B=$obj_der{$obj{$nid{$b}}};
29 if (($v{$k} =~ s/(OBJ_[^,]+),/$v{$1},/))
41 open (IN,"$ARGV[0]") || die "Can't open input file $ARGV[0]";
42 open (OUT,">$ARGV[1]") || die "Can't open output file $ARGV[1]";
46 next unless /^\#define\s+(\S+)\s+(.*)$/;
51 if ($v =~ /^SN_(.*)$/)
53 if(defined $snames{$d})
55 print "WARNING: Duplicate short name \"$d\"\n";
58 { $snames{$d} = "X"; }
61 elsif ($v =~ /^LN_(.*)$/)
63 if(defined $lnames{$d})
65 print "WARNING: Duplicate long name \"$d\"\n";
68 { $lnames{$d} = "X"; }
71 elsif ($v =~ /^NID_(.*)$/)
73 elsif ($v =~ /^OBJ_(.*)$/)
81 %ob=&expand_obj(*objd);
83 @a=sort { $a <=> $b } keys %nid;
89 for ($i=0; $i<$n; $i++)
91 if (!defined($nid{$i}))
93 push(@out,"{NULL,NULL,NID_undef,0,NULL},\n");
97 $sn=defined($sn{$nid{$i}})?"$sn{$nid{$i}}":"NULL";
98 $ln=defined($ln{$nid{$i}})?"$ln{$nid{$i}}":"NULL";
113 $out.=",NID_$nid{$i},";
114 if (defined($obj{$nid{$i}}))
116 $v=$objd{$obj{$nid{$i}}};
122 foreach (unpack("C*",$r))
124 $z.=sprintf("0x%02X,",$_);
127 $obj_der{$obj{$nid{$i}}}=$z;
128 $obj_len{$obj{$nid{$i}}}=$length;
130 push(@lvalues,sprintf("%-45s/* [%3d] %s */\n",
131 $z,$lvalues,$obj{$nid{$i}}));
132 $out.="$length,&(lvalues[$lvalues]),0";
144 @a=grep(defined($sn{$nid{$_}}),0 .. $n);
145 foreach (sort { $sn{$nid{$a}} cmp $sn{$nid{$b}} } @a)
147 push(@sn,sprintf("&(nid_objs[%2d]),/* \"$sn{$nid{$_}}\" */\n",$_));
150 @a=grep(defined($ln{$nid{$_}}),0 .. $n);
151 foreach (sort { $ln{$nid{$a}} cmp $ln{$nid{$b}} } @a)
153 push(@ln,sprintf("&(nid_objs[%2d]),/* \"$ln{$nid{$_}}\" */\n",$_));
156 @a=grep(defined($obj{$nid{$_}}),0 .. $n);
157 foreach (sort obj_cmp @a)
163 push(@ob,sprintf("&(nid_objs[%2d]),/* %-32s %s */\n",$_,$m,$v));
167 /* crypto/objects/obj_dat.h */
169 /* THIS FILE IS GENERATED FROM objects.h by obj_dat.pl via the
171 * perl obj_dat.pl obj_mac.h obj_dat.h
174 /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
175 * All rights reserved.
177 * This package is an SSL implementation written
178 * by Eric Young (eay@cryptsoft.com).
179 * The implementation was written so as to conform with Netscapes SSL.
181 * This library is free for commercial and non-commercial use as long as
182 * the following conditions are aheared to. The following conditions
183 * apply to all code found in this distribution, be it the RC4, RSA,
184 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
185 * included with this distribution is covered by the same copyright terms
186 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
188 * Copyright remains Eric Young's, and as such any Copyright notices in
189 * the code are not to be removed.
190 * If this package is used in a product, Eric Young should be given attribution
191 * as the author of the parts of the library used.
192 * This can be in the form of a textual message at program startup or
193 * in documentation (online or textual) provided with the package.
195 * Redistribution and use in source and binary forms, with or without
196 * modification, are permitted provided that the following conditions
198 * 1. Redistributions of source code must retain the copyright
199 * notice, this list of conditions and the following disclaimer.
200 * 2. Redistributions in binary form must reproduce the above copyright
201 * notice, this list of conditions and the following disclaimer in the
202 * documentation and/or other materials provided with the distribution.
203 * 3. All advertising materials mentioning features or use of this software
204 * must display the following acknowledgement:
205 * "This product includes cryptographic software written by
206 * Eric Young (eay@cryptsoft.com)"
207 * The word 'cryptographic' can be left out if the rouines from the library
208 * being used are not cryptographic related :-).
209 * 4. If you include any Windows specific code (or a derivative thereof) from
210 * the apps directory (application code) you must include an acknowledgement:
211 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
213 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
214 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
215 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
216 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
217 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
218 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
219 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
220 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
221 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
222 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
225 * The licence and distribution terms for any publically available version or
226 * derivative of this code cannot be changed. i.e. this code cannot simply be
227 * copied and put under another distribution licence
228 * [including the GNU Public Licence.]
233 printf OUT "#define NUM_NID %d\n",$n;
234 printf OUT "#define NUM_SN %d\n",$#sn+1;
235 printf OUT "#define NUM_LN %d\n",$#ln+1;
236 printf OUT "#define NUM_OBJ %d\n\n",$#ob+1;
238 printf OUT "static unsigned char lvalues[%d]={\n",$lvalues+1;
242 printf OUT "static ASN1_OBJECT nid_objs[NUM_NID]={\n";
266 printf OUT "static ASN1_OBJECT *sn_objs[NUM_SN]={\n";
270 printf OUT "static ASN1_OBJECT *ln_objs[NUM_LN]={\n";
274 printf OUT "static ASN1_OBJECT *obj_objs[NUM_OBJ]={\n";
283 local(@a,$i,$ret,@r);
286 $ret.=pack("C*",$a[0]*40+$a[1]);
297 push(@r,((($t++)?0x80:0)|$x));
299 push(@r,((($t++)?0x80:0)|$_));
300 $ret.=pack("C*",reverse(@r));