Home | History | Annotate | Line # | Download | only in fuzz
      1      1.1  christos #! /usr/bin/env perl
      2  1.1.1.2  christos # Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
      3      1.1  christos #
      4  1.1.1.2  christos # Licensed under the Apache License 2.0 (the "License").  You may not use
      5      1.1  christos # this file except in compliance with the License.  You can obtain a copy
      6      1.1  christos # in the file LICENSE in the source distribution or at
      7      1.1  christos # https://www.openssl.org/source/license.html
      8  1.1.1.2  christos use FindBin;
      9  1.1.1.2  christos use lib "$FindBin::Bin/../util/perl";
     10  1.1.1.2  christos use OpenSSL::copyright;
     11      1.1  christos 
     12      1.1  christos my $obj_dat_h = $ARGV[0];
     13  1.1.1.2  christos my $YEAR = OpenSSL::copyright::latest(($0, $obj_dat_h));
     14  1.1.1.2  christos print <<"EOF";
     15  1.1.1.2  christos # WARNING: do not edit!
     16  1.1.1.2  christos # Generated by fuzz/mkfuzzoids.pl
     17  1.1.1.2  christos #
     18  1.1.1.2  christos # Copyright 2020-$YEAR The OpenSSL Project Authors. All Rights Reserved.
     19  1.1.1.2  christos #
     20  1.1.1.2  christos # Licensed under the Apache License 2.0 (the "License").  You may not use
     21  1.1.1.2  christos # this file except in compliance with the License.  You can obtain a copy
     22  1.1.1.2  christos # in the file LICENSE in the source distribution or at
     23  1.1.1.2  christos # https://www.openssl.org/source/license.html
     24  1.1.1.2  christos EOF
     25      1.1  christos 
     26      1.1  christos open IN, '<', $obj_dat_h
     27      1.1  christos     || die "Couldn't open $obj_dat_h : $!\n";
     28      1.1  christos 
     29      1.1  christos while(<IN>) {
     30      1.1  christos     s|\R$||;                    # Better chomp
     31      1.1  christos 
     32      1.1  christos     next unless m|^\s+((0x[0-9A-F][0-9A-F],)*)\s+/\*\s\[\s*\d+\]\s(OBJ_\w+)\s\*/$|;
     33      1.1  christos 
     34      1.1  christos     my $OID = $1;
     35      1.1  christos     my $OBJname = $3;
     36      1.1  christos 
     37      1.1  christos     $OID =~ s|0x|\\x|g;
     38      1.1  christos     $OID =~ s|,||g;
     39      1.1  christos 
     40      1.1  christos     print "$OBJname=\"$OID\"\n";
     41      1.1  christos }
     42      1.1  christos close IN;
     43