Path: blob/main/crypto/openssl/fuzz/mkfuzzoids.pl
104102 views
#! /usr/bin/env perl1# Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.2#3# Licensed under the Apache License 2.0 (the "License"). You may not use4# this file except in compliance with the License. You can obtain a copy5# in the file LICENSE in the source distribution or at6# https://www.openssl.org/source/license.html7use FindBin;8use lib "$FindBin::Bin/../util/perl";9use OpenSSL::copyright;1011my $obj_dat_h = $ARGV[0];12my $YEAR = OpenSSL::copyright::latest(($0, $obj_dat_h));13print <<"EOF";14# WARNING: do not edit!15# Generated by fuzz/mkfuzzoids.pl16#17# Copyright 2020-$YEAR The OpenSSL Project Authors. All Rights Reserved.18#19# Licensed under the Apache License 2.0 (the "License"). You may not use20# this file except in compliance with the License. You can obtain a copy21# in the file LICENSE in the source distribution or at22# https://www.openssl.org/source/license.html23EOF2425open IN, '<', $obj_dat_h26|| die "Couldn't open $obj_dat_h : $!\n";2728while(<IN>) {29s|\R$||; # Better chomp3031next unless m|^\s+((0x[0-9A-F][0-9A-F],)*)\s+/\*\s\[\s*\d+\]\s(OBJ_\w+)\s\*/$|;3233my $OID = $1;34my $OBJname = $3;3536$OID =~ s|0x|\\x|g;37$OID =~ s|,||g;3839print "$OBJname=\"$OID\"\n";40}41close IN;424344