2
0

mkfuzzoids.pl 1.2 KB

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