Latest update.
This commit is contained in:
+32
-171
@@ -15,7 +15,10 @@ use strict;
|
||||
use warnings;
|
||||
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin/perl";
|
||||
use OpenSSL::fallback "$FindBin::Bin/../external/perl/MODULES.txt";
|
||||
use Getopt::Std;
|
||||
use OpenSSL::Template;
|
||||
|
||||
# We actually expect to get the following hash tables from configdata:
|
||||
#
|
||||
@@ -26,117 +29,8 @@ use Getopt::Std;
|
||||
#
|
||||
# We just do a minimal test to see that we got what we expected.
|
||||
# $config{target} must exist as an absolute minimum.
|
||||
die "You must run this script with -Mconfigdata\n" if !exists($config{target});
|
||||
|
||||
# Make a subclass of Text::Template to override append_text_to_result,
|
||||
# as recommended here:
|
||||
#
|
||||
# http://search.cpan.org/~mjd/Text-Template-1.46/lib/Text/Template.pm#Automatic_postprocessing_of_template_hunks
|
||||
|
||||
package OpenSSL::Template;
|
||||
|
||||
# Because we know that Text::Template isn't a core Perl module, we use
|
||||
# a fallback in case it's not installed on the system
|
||||
use File::Basename;
|
||||
use File::Spec::Functions;
|
||||
use lib "$FindBin::Bin/perl";
|
||||
use with_fallback "Text::Template 1.46";
|
||||
|
||||
#use parent qw/Text::Template/;
|
||||
use vars qw/@ISA/;
|
||||
push @ISA, qw/Text::Template/;
|
||||
|
||||
# Override constructor
|
||||
sub new {
|
||||
my ($class) = shift;
|
||||
|
||||
# Call the constructor of the parent class, Person.
|
||||
my $self = $class->SUPER::new( @_ );
|
||||
# Add few more attributes
|
||||
$self->{_output_off} = 0; # Default to output hunks
|
||||
bless $self, $class;
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub append_text_to_output {
|
||||
my $self = shift;
|
||||
|
||||
if ($self->{_output_off} == 0) {
|
||||
$self->SUPER::append_text_to_output(@_);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
sub output_reset_on {
|
||||
my $self = shift;
|
||||
$self->{_output_off} = 0;
|
||||
}
|
||||
|
||||
sub output_on {
|
||||
my $self = shift;
|
||||
if (--$self->{_output_off} < 0) {
|
||||
$self->{_output_off} = 0;
|
||||
}
|
||||
}
|
||||
|
||||
sub output_off {
|
||||
my $self = shift;
|
||||
$self->{_output_off}++;
|
||||
}
|
||||
|
||||
# Come back to main
|
||||
|
||||
package main;
|
||||
|
||||
# Helper functions for the templates #################################
|
||||
|
||||
# It might be practical to quotify some strings and have them protected
|
||||
# from possible harm. These functions primarily quote things that might
|
||||
# be interpreted wrongly by a perl eval.
|
||||
|
||||
# quotify1 STRING
|
||||
# This adds quotes (") around the given string, and escapes any $, @, \,
|
||||
# " and ' by prepending a \ to them.
|
||||
sub quotify1 {
|
||||
my $s = shift @_;
|
||||
$s =~ s/([\$\@\\"'])/\\$1/g;
|
||||
'"'.$s.'"';
|
||||
}
|
||||
|
||||
# quotify_l LIST
|
||||
# For each defined element in LIST (i.e. elements that aren't undef), have
|
||||
# it quotified with 'quotify1'
|
||||
sub quotify_l {
|
||||
map {
|
||||
if (!defined($_)) {
|
||||
();
|
||||
} else {
|
||||
quotify1($_);
|
||||
}
|
||||
} @_;
|
||||
}
|
||||
|
||||
# Error reporter #####################################################
|
||||
|
||||
# The error reporter uses %lines to figure out exactly which file the
|
||||
# error happened and at what line. Not that the line number may be
|
||||
# the start of a perl snippet rather than the exact line where it
|
||||
# happened. Nothing we can do about that here.
|
||||
|
||||
my %lines = ();
|
||||
sub broken {
|
||||
my %args = @_;
|
||||
my $filename = "<STDIN>";
|
||||
my $deducelines = 0;
|
||||
foreach (sort keys %lines) {
|
||||
$filename = $lines{$_};
|
||||
last if ($_ > $args{lineno});
|
||||
$deducelines += $_;
|
||||
}
|
||||
print STDERR $args{error}," in $filename, fragment starting at line ",$args{lineno}-$deducelines;
|
||||
undef;
|
||||
}
|
||||
die "You must run this script with -Mconfigdata\n"
|
||||
if !exists($config{target});
|
||||
|
||||
# Check options ######################################################
|
||||
|
||||
@@ -147,74 +41,41 @@ my %opts = ();
|
||||
getopt('o', \%opts);
|
||||
|
||||
my @autowarntext = ("WARNING: do not edit!",
|
||||
"Generated"
|
||||
. (defined($opts{o}) ? " by ".$opts{o} : "")
|
||||
. (scalar(@ARGV) > 0 ? " from ".join(", ",@ARGV) : ""));
|
||||
"Generated"
|
||||
. (defined($opts{o}) ? " by ".$opts{o} : "")
|
||||
. (scalar(@ARGV) > 0 ? " from ".join(", ",@ARGV) : ""));
|
||||
|
||||
# Template reading ###################################################
|
||||
# Template setup #####################################################
|
||||
|
||||
# Read in all the templates into $text, while keeping track of each
|
||||
# file and its size in lines, to try to help report errors with the
|
||||
# correct file name and line number.
|
||||
|
||||
my $prev_linecount = 0;
|
||||
my $text =
|
||||
my @template_settings =
|
||||
@ARGV
|
||||
? join("", map { my $x = Text::Template::_load_text($_);
|
||||
if (!defined($x)) {
|
||||
die $Text::Template::ERROR, "\n";
|
||||
}
|
||||
$x = "{- output_reset_on() -}" . $x;
|
||||
my $linecount = $x =~ tr/\n//;
|
||||
$prev_linecount = ($linecount += $prev_linecount);
|
||||
$lines{$linecount} = $_;
|
||||
$x } @ARGV)
|
||||
: join("", <STDIN>);
|
||||
? map { { TYPE => 'FILE', SOURCE => $_, FILENAME => $_ } } @ARGV
|
||||
: ( { TYPE => 'FILEHANDLE', SOURCE => \*STDIN, FILENAME => '<stdin>' } );
|
||||
|
||||
# Engage! ############################################################
|
||||
|
||||
# Load the full template (combination of files) into Text::Template
|
||||
# and fill it up with our data. Output goes directly to STDOUT
|
||||
|
||||
my $prepend = qq{
|
||||
my $prepend = <<"_____";
|
||||
use File::Spec::Functions;
|
||||
use lib catdir('$config{sourcedir}', 'util', 'perl');
|
||||
};
|
||||
$prepend .= qq{
|
||||
use lib catdir('$config{sourcedir}', 'Configurations');
|
||||
_____
|
||||
$prepend .= <<"_____" if defined $target{perl_platform};
|
||||
use lib "$FindBin::Bin/../Configurations";
|
||||
use lib '$config{builddir}';
|
||||
use platform;
|
||||
} if defined $target{perl_platform};
|
||||
_____
|
||||
|
||||
my $template =
|
||||
OpenSSL::Template->new(TYPE => 'STRING',
|
||||
SOURCE => $text,
|
||||
PREPEND => $prepend);
|
||||
|
||||
sub output_reset_on {
|
||||
$template->output_reset_on();
|
||||
"";
|
||||
foreach (@template_settings) {
|
||||
my $template = OpenSSL::Template->new(%$_);
|
||||
$template->fill_in(%$_,
|
||||
OUTPUT => \*STDOUT,
|
||||
HASH => { config => \%config,
|
||||
target => \%target,
|
||||
disabled => \%disabled,
|
||||
withargs => \%withargs,
|
||||
unified_info => \%unified_info,
|
||||
autowarntext => \@autowarntext },
|
||||
PREPEND => $prepend,
|
||||
# To ensure that global variables and functions
|
||||
# defined in one template stick around for the
|
||||
# next, making them combinable
|
||||
PACKAGE => 'OpenSSL::safe');
|
||||
}
|
||||
sub output_on {
|
||||
$template->output_on();
|
||||
"";
|
||||
}
|
||||
sub output_off {
|
||||
$template->output_off();
|
||||
"";
|
||||
}
|
||||
|
||||
$template->fill_in(OUTPUT => \*STDOUT,
|
||||
HASH => { config => \%config,
|
||||
target => \%target,
|
||||
disabled => \%disabled,
|
||||
withargs => \%withargs,
|
||||
unified_info => \%unified_info,
|
||||
autowarntext => \@autowarntext,
|
||||
quotify1 => \"ify1,
|
||||
quotify_l => \"ify_l,
|
||||
output_reset_on => \&output_reset_on,
|
||||
output_on => \&output_on,
|
||||
output_off => \&output_off },
|
||||
DELIMITERS => [ "{-", "-}" ],
|
||||
BROKEN => \&broken);
|
||||
Executable
+62
@@ -0,0 +1,62 @@
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
# in the file LICENSE in the source distribution or at
|
||||
# https://www.openssl.org/source/license.html
|
||||
|
||||
# Run this program like this:
|
||||
# perl -pi util/err-to-error files...
|
||||
# or
|
||||
# git ls-files | grep '\.c$' | xargs perl -pi util/err-to-raise
|
||||
# Consider running util/merge-err-lines first, to catch most (all?) of the
|
||||
# cases where the XXXerr() call is split into two lines.
|
||||
|
||||
# Also, what to do about the engines files? This includes:
|
||||
# AFALGerr, CAPIerr, DASYNC, OSSLTEST
|
||||
# There are about 70 such lines.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
s/ASN1err\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_ASN1, $1)/;
|
||||
s/([^D])ASYNCerr\(\w+, *(\w+)\)/$1ERR_raise(ERR_LIB_ASYNC, $2)/;
|
||||
s/BIOerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_BIO, $1)/;
|
||||
s/BNerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_BN, $1)/;
|
||||
s/BUFerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_BUF, $1)/;
|
||||
s/CMPerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_CMP, $1)/;
|
||||
s/CMSerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_CMS, $1)/;
|
||||
s/COMPerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_COMP, $1)/;
|
||||
s/CONFerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_CONF, $1)/;
|
||||
s/CRMFerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_CRMF, $1)/;
|
||||
s/CRYPTOerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_CRYPTO, $1)/;
|
||||
s/CTerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_CT, $1)/;
|
||||
s/DHerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_DH, $1)/;
|
||||
s/DSAerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_DSA, $1)/;
|
||||
s/DSOerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_DSO, $1)/;
|
||||
s/ECDHerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_ECDH, $1)/;
|
||||
s/ECDSAerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_ECDSA, $1)/;
|
||||
s/ECerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_EC, $1)/;
|
||||
s/ENGINEerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_ENGINE, $1)/;
|
||||
s/ESSerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_ESS, $1)/;
|
||||
s/EVPerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_EVP, $1)/;
|
||||
s/FIPSerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_FIPS, $1)/;
|
||||
s/KDFerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_KDF, $1)/;
|
||||
s/OBJerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_OBJ, $1)/;
|
||||
s/OCSPerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_OCSP, $1)/;
|
||||
s/OSSL_STOREerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_OSSL_STORE, $1)/;
|
||||
s/PEMerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_PEM, $1)/;
|
||||
s/PKCS12err\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_PKCS12, $1)/;
|
||||
s/PKCS7err\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_PKCS7, $1)/;
|
||||
s/PROPerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_PROP, $1)/;
|
||||
s/PROVerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_PROV, $1)/;
|
||||
s/RANDerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_RAND, $1)/;
|
||||
s/RSAerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_RSA, $1)/;
|
||||
s/SM2err\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_SM2, $1)/;
|
||||
s/SSLerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_SSL, $1)/;
|
||||
s/SYSerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_SYS, $1)/;
|
||||
s/TSerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_TS, $1)/;
|
||||
s/UIerr\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_UI, $1)/;
|
||||
s/X509V3err\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_X509V3, $1)/;
|
||||
s/X509err\(\w+, *(\w+)\)/ERR_raise(ERR_LIB_X509, $1)/;
|
||||
+155
-106
@@ -31,8 +31,7 @@ our($opt_u);
|
||||
our($opt_v);
|
||||
our($opt_c);
|
||||
|
||||
sub help()
|
||||
{
|
||||
sub help {
|
||||
print <<EOF;
|
||||
Find small errors (nits) in documentation. Options:
|
||||
-d Detailed list of undocumented (implies -u)
|
||||
@@ -53,6 +52,7 @@ EOF
|
||||
my $temp = '/tmp/docnits.txt';
|
||||
my $OUT;
|
||||
my %public;
|
||||
my $status = 0;
|
||||
|
||||
my %mandatory_sections =
|
||||
( '*' => [ 'NAME', 'DESCRIPTION', 'COPYRIGHT' ],
|
||||
@@ -61,9 +61,14 @@ my %mandatory_sections =
|
||||
5 => [ ],
|
||||
7 => [ ] );
|
||||
|
||||
# Print error message, set $status.
|
||||
sub err {
|
||||
print join(" ", @_), "\n";
|
||||
$status = 1
|
||||
}
|
||||
|
||||
# Cross-check functions in the NAME and SYNOPSIS section.
|
||||
sub name_synopsis()
|
||||
{
|
||||
sub name_synopsis {
|
||||
my $id = shift;
|
||||
my $filename = shift;
|
||||
my $contents = shift;
|
||||
@@ -72,35 +77,38 @@ sub name_synopsis()
|
||||
return unless $contents =~ /=head1 NAME(.*)=head1 SYNOPSIS/ms;
|
||||
my $tmp = $1;
|
||||
$tmp =~ tr/\n/ /;
|
||||
print "$id trailing comma before - in NAME\n" if $tmp =~ /, *-/;
|
||||
err($id, "trailing comma before - in NAME")
|
||||
if $tmp =~ /, *-/;
|
||||
$tmp =~ s/ -.*//g;
|
||||
print "$id POD markup among the names in NAME\n" if $tmp =~ /[<>]/;
|
||||
err($id, "POD markup among the names in NAME")
|
||||
if $tmp =~ /[<>]/;
|
||||
$tmp =~ s/ */ /g;
|
||||
print "$id missing comma in NAME\n" if $tmp =~ /[^,] /;
|
||||
err($id, "missing comma in NAME")
|
||||
if $tmp =~ /[^,] /;
|
||||
|
||||
my $dirname = dirname($filename);
|
||||
my $simplename = basename($filename);
|
||||
$simplename =~ s/.pod$//;
|
||||
my $simplename = basename(basename($filename, ".in"), ".pod");
|
||||
my $foundfilename = 0;
|
||||
my %foundfilenames = ();
|
||||
my %names;
|
||||
foreach my $n ( split ',', $tmp ) {
|
||||
$n =~ s/^\s+//;
|
||||
$n =~ s/\s+$//;
|
||||
print "$id the name '$n' contains white-space\n"
|
||||
err($id, "the name '$n' contains white-space")
|
||||
if $n =~ /\s/;
|
||||
$names{$n} = 1;
|
||||
$foundfilename++ if $n eq $simplename;
|
||||
$foundfilenames{$n} = 1
|
||||
if -f "$dirname/$n.pod" && $n ne $simplename;
|
||||
if ((-f "$dirname/$n.pod.in" || -f "$dirname/$n.pod")
|
||||
&& $n ne $simplename);
|
||||
}
|
||||
print "$id the following exist as other .pod files:\n",
|
||||
join(" ", sort keys %foundfilenames), "\n"
|
||||
err($id, "the following exist as other .pod or .pod.in files:",
|
||||
sort keys %foundfilenames)
|
||||
if %foundfilenames;
|
||||
print "$id $simplename (filename) missing from NAME section\n"
|
||||
err($id, "$simplename (filename) missing from NAME section")
|
||||
unless $foundfilename;
|
||||
foreach my $n ( keys %names ) {
|
||||
print "$id $n is not public\n"
|
||||
err($id, "$n is not public")
|
||||
if $opt_p and !defined $public{$n};
|
||||
}
|
||||
|
||||
@@ -136,37 +144,66 @@ sub name_synopsis()
|
||||
else {
|
||||
next;
|
||||
}
|
||||
print "$id $sym missing from NAME section\n"
|
||||
err($id, "$sym missing from NAME section")
|
||||
unless defined $names{$sym};
|
||||
$names{$sym} = 2;
|
||||
|
||||
# Do some sanity checks on the prototype.
|
||||
print "$id prototype missing spaces around commas: $line\n"
|
||||
err($id, "prototype missing spaces around commas: $line")
|
||||
if ( $line =~ /[a-z0-9],[^ ]/ );
|
||||
}
|
||||
|
||||
foreach my $n ( keys %names ) {
|
||||
next if $names{$n} == 2;
|
||||
print "$id $n missing from SYNOPSIS\n";
|
||||
err($id, "$n missing from SYNOPSIS")
|
||||
}
|
||||
}
|
||||
|
||||
# Check if SECTION is located before BEFORE
|
||||
sub check_section_location()
|
||||
{
|
||||
my $filename = shift;
|
||||
# Check if SECTION ($3) is located before BEFORE ($4)
|
||||
sub check_section_location {
|
||||
my $id = shift;
|
||||
my $contents = shift;
|
||||
my $section = shift;
|
||||
my $before = shift;
|
||||
|
||||
return unless $contents =~ /=head1 $section/
|
||||
and $contents =~ /=head1 $before/;
|
||||
print "$filename: $section should be placed before $before section\n"
|
||||
err($id, "$section should appear before $before section")
|
||||
if $contents =~ /=head1 $before.*=head1 $section/ms;
|
||||
}
|
||||
|
||||
sub check()
|
||||
{
|
||||
# Check if a =head1 is duplicated, or a =headX is duplicated within a
|
||||
# =head1. Treats =head2 =head3 as equivalent -- it doesn't reset the head3
|
||||
# sets if it finds a =head2 -- but that is good enough for now. Also check
|
||||
# for proper capitalization, trailing periods, etc.
|
||||
sub check_head_style {
|
||||
my $id = shift;
|
||||
my $contents = shift;
|
||||
my %head1;
|
||||
my %subheads;
|
||||
|
||||
foreach my $line ( split /\n+/, $contents ) {
|
||||
next unless $line =~ /^=head/;
|
||||
if ( $line =~ /head1/ ) {
|
||||
err($id, "duplicate section $line")
|
||||
if defined $head1{$line};
|
||||
$head1{$line} = 1;
|
||||
%subheads = ();
|
||||
} else {
|
||||
err($id, "duplicate subsection $line")
|
||||
if defined $subheads{$line};
|
||||
$subheads{$line} = 1;
|
||||
}
|
||||
err($id, "period in =head")
|
||||
if $line =~ /\.[^\w]/ or $line =~ /\.$/;
|
||||
err($id, "not all uppercase in =head1")
|
||||
if $line =~ /head1.*[a-z]/;
|
||||
err($id, "all uppercase in subhead")
|
||||
if $line =~ /head[234][ A-Z0-9]+$/;
|
||||
}
|
||||
}
|
||||
|
||||
sub check {
|
||||
my $filename = shift;
|
||||
my $dirname = basename(dirname($filename));
|
||||
|
||||
@@ -178,40 +215,45 @@ sub check()
|
||||
close POD;
|
||||
}
|
||||
|
||||
# Check if EXAMPLES is located after RETURN VALUES section.
|
||||
&check_section_location($filename, $contents, "RETURN VALUES", "EXAMPLES") if $filename =~ m|man3/|;
|
||||
# Check if HISTORY is located after SEE ALSO
|
||||
&check_section_location($filename, $contents, "SEE ALSO", "HISTORY") if $filename =~ m|man3/|;
|
||||
# Check if SEE ALSO is located after EXAMPLES
|
||||
&check_section_location($filename, $contents, "EXAMPLES", "SEE ALSO") if $filename =~ m|man3/|;
|
||||
|
||||
my $id = "${filename}:1:";
|
||||
check_head_style($id, $contents);
|
||||
|
||||
&name_synopsis($id, $filename, $contents)
|
||||
# Check ordering of some sections in man3
|
||||
if ( $filename =~ m|man3/| ) {
|
||||
check_section_location($id, $contents, "RETURN VALUES", "EXAMPLES");
|
||||
check_section_location($id, $contents, "SEE ALSO", "HISTORY");
|
||||
check_section_location($id, $contents, "EXAMPLES", "SEE ALSO");
|
||||
}
|
||||
|
||||
name_synopsis($id, $filename, $contents)
|
||||
unless $contents =~ /=for comment generic/
|
||||
or $filename =~ m@man[157]/@;
|
||||
|
||||
print "$id doesn't start with =pod\n"
|
||||
err($id, "doesn't start with =pod")
|
||||
if $contents !~ /^=pod/;
|
||||
print "$id doesn't end with =cut\n"
|
||||
err($id, "doesn't end with =cut")
|
||||
if $contents !~ /=cut\n$/;
|
||||
print "$id more than one cut line.\n"
|
||||
err($id, "more than one cut line.")
|
||||
if $contents =~ /=cut.*=cut/ms;
|
||||
print "$id missing copyright\n"
|
||||
err($id, "EXAMPLE not EXAMPLES section.")
|
||||
if $contents =~ /=head1 EXAMPLE[^S]/;
|
||||
err($id, "WARNING not WARNINGS section.")
|
||||
if $contents =~ /=head1 WARNING[^S]/;
|
||||
err($id, "missing copyright")
|
||||
if $contents !~ /Copyright .* The OpenSSL Project Authors/;
|
||||
print "$id copyright not last\n"
|
||||
err($id, "copyright not last")
|
||||
if $contents =~ /head1 COPYRIGHT.*=head/ms;
|
||||
print "$id head2 in All uppercase\n"
|
||||
err($id, "head2 in All uppercase")
|
||||
if $contents =~ /head2\s+[A-Z ]+\n/;
|
||||
print "$id extra space after head\n"
|
||||
err($id, "extra space after head")
|
||||
if $contents =~ /=head\d\s\s+/;
|
||||
print "$id period in NAME section\n"
|
||||
err($id, "period in NAME section")
|
||||
if $contents =~ /=head1 NAME.*\.\n.*=head1 SYNOPSIS/ms;
|
||||
print "$id Duplicate $1 in L<>\n"
|
||||
err($id, "Duplicate $1 in L<>")
|
||||
if $contents =~ /L<([^>]*)\|([^>]*)>/ && $1 eq $2;
|
||||
print "$id Bad =over $1\n"
|
||||
err($id, "Bad =over $1")
|
||||
if $contents =~ /=over([^ ][^24])/;
|
||||
print "$id Possible version style issue\n"
|
||||
err($id, "Possible version style issue")
|
||||
if $contents =~ /OpenSSL version [019]/;
|
||||
|
||||
if ( $contents !~ /=for comment multiple includes/ ) {
|
||||
@@ -221,7 +263,8 @@ sub check()
|
||||
my $count = 0;
|
||||
foreach my $line ( split /\n+/, $1 ) {
|
||||
if ( $line =~ m@include <openssl/@ ) {
|
||||
print "$id has multiple includes\n" if ++$count == 2;
|
||||
err($id, "has multiple includes")
|
||||
if ++$count == 2;
|
||||
} else {
|
||||
$count = 0;
|
||||
}
|
||||
@@ -248,15 +291,14 @@ sub check()
|
||||
|
||||
foreach ((@{$mandatory_sections{'*'}}, @{$mandatory_sections{$section}})) {
|
||||
# Skip "return values" if not -s
|
||||
print "$id: missing $_ head1 section\n"
|
||||
err($id, "missing $_ head1 section")
|
||||
if $contents !~ /^=head1\s+${_}\s*$/m;
|
||||
}
|
||||
}
|
||||
|
||||
my %dups;
|
||||
|
||||
sub parsenum()
|
||||
{
|
||||
sub parsenum {
|
||||
my $file = shift;
|
||||
my @apis;
|
||||
|
||||
@@ -283,7 +325,7 @@ sub getdocced
|
||||
my $dir = shift;
|
||||
my %return;
|
||||
|
||||
foreach my $pod ( glob("$dir/*.pod") ) {
|
||||
foreach my $pod ( glob("$dir/*.pod"), glob("$dir/*.pod.in") ) {
|
||||
my %podinfo = extract_pod_info($pod);
|
||||
foreach my $n ( @{$podinfo{names}} ) {
|
||||
$return{$n} = $pod;
|
||||
@@ -315,8 +357,7 @@ sub loadmissing($)
|
||||
return @missing;
|
||||
}
|
||||
|
||||
sub checkmacros()
|
||||
{
|
||||
sub checkmacros {
|
||||
my $count = 0;
|
||||
my %seen;
|
||||
my @missing;
|
||||
@@ -327,7 +368,8 @@ sub checkmacros()
|
||||
@missing = loadmissing('util/missingmacro.txt');
|
||||
}
|
||||
|
||||
print "# Checking macros (approximate)\n" if !$opt_s;
|
||||
print "# Checking macros (approximate)\n"
|
||||
if !$opt_s;
|
||||
foreach my $f ( glob('include/openssl/*.h') ) {
|
||||
# Skip some internals we don't want to document yet.
|
||||
next if $f eq 'include/openssl/asn1.h';
|
||||
@@ -347,17 +389,18 @@ sub checkmacros()
|
||||
# Skip macros known to be missing
|
||||
next if $opt_v && grep( /^$macro$/, @missing);
|
||||
|
||||
print "$f:$macro\n" if $opt_d || $opt_e;
|
||||
print "$f:$macro\n"
|
||||
if $opt_d || $opt_e;
|
||||
$count++;
|
||||
$seen{$macro} = 1;
|
||||
}
|
||||
close(IN);
|
||||
}
|
||||
print "# Found $count macros missing\n" if !$opt_s || $count > 0;
|
||||
print "# Found $count macros missing\n"
|
||||
if !$opt_s || $count > 0;
|
||||
}
|
||||
|
||||
sub printem()
|
||||
{
|
||||
sub printem {
|
||||
my $libname = shift;
|
||||
my $numfile = shift;
|
||||
my $missingfile = shift;
|
||||
@@ -366,7 +409,7 @@ sub printem()
|
||||
|
||||
my @missing = loadmissing($missingfile) if ($opt_v);
|
||||
|
||||
foreach my $func ( &parsenum($numfile) ) {
|
||||
foreach my $func ( parsenum($numfile) ) {
|
||||
next if $docced{$func} || defined $seen{$func};
|
||||
|
||||
# Skip ASN1 utilities
|
||||
@@ -375,11 +418,13 @@ sub printem()
|
||||
# Skip functions known to be missing
|
||||
next if $opt_v && grep( /^$func$/, @missing);
|
||||
|
||||
print "$libname:$func\n" if $opt_d || $opt_e;
|
||||
print "$libname:$func\n"
|
||||
if $opt_d || $opt_e;
|
||||
$count++;
|
||||
$seen{$func} = 1;
|
||||
}
|
||||
print "# Found $count missing from $numfile\n\n" if !$opt_s || $count > 0;
|
||||
print "# Found $count missing from $numfile\n\n"
|
||||
if !$opt_s || $count > 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -394,7 +439,7 @@ sub collectnames {
|
||||
my $filename = shift;
|
||||
$filename =~ m|man(\d)/|;
|
||||
my $section = $1;
|
||||
my $simplename = basename($filename, ".pod");
|
||||
my $simplename = basename(basename($filename, ".in"), ".pod");
|
||||
my $id = "${filename}:1:";
|
||||
|
||||
my $contents = '';
|
||||
@@ -408,27 +453,34 @@ sub collectnames {
|
||||
$contents =~ /=head1 NAME([^=]*)=head1 /ms;
|
||||
my $tmp = $1;
|
||||
unless (defined $tmp) {
|
||||
print "$id weird name section\n";
|
||||
err($id, "weird name section");
|
||||
return;
|
||||
}
|
||||
$tmp =~ tr/\n/ /;
|
||||
$tmp =~ s/-.*//g;
|
||||
$tmp =~ s/ -.*//g;
|
||||
|
||||
my @names = map { s/^\s+//g; s/\s+$//g; $_ } split(/,/, $tmp);
|
||||
my @names =
|
||||
map { s|/|-|g; $_ } # Treat slash as dash
|
||||
map { s/^\s+//g; s/\s+$//g; $_ } # Trim prefix and suffix blanks
|
||||
split(/,/, $tmp);
|
||||
unless (grep { $simplename eq $_ } @names) {
|
||||
print "$id missing $simplename\n";
|
||||
err($id, "missing $simplename");
|
||||
push @names, $simplename;
|
||||
}
|
||||
foreach my $name (@names) {
|
||||
next if $name eq "";
|
||||
if ($name =~ /\s/) {
|
||||
print "$id '$name' contains white space\n";
|
||||
err($id, "'$name' contains white space")
|
||||
}
|
||||
my $name_sec = "$name($section)";
|
||||
if (! exists $name_collection{$name_sec}) {
|
||||
$name_collection{$name_sec} = $filename;
|
||||
} else { #elsif ($filename ne $name_collection{$name_sec}) {
|
||||
print "$id $name_sec also in $name_collection{$name_sec}\n";
|
||||
} elsif ($filename eq $name_collection{$name_sec}) {
|
||||
err($id, "$name_sec repeated in NAME section of",
|
||||
$name_collection{$name_sec});
|
||||
} else {
|
||||
err($id, "$name_sec also in NAME section of",
|
||||
$name_collection{$name_sec});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,20 +506,20 @@ sub collectnames {
|
||||
sub checklinks {
|
||||
foreach my $filename (sort keys %link_collection) {
|
||||
foreach my $link (@{$link_collection{$filename}}) {
|
||||
print "${filename}:1: reference to non-existing $link\n"
|
||||
err("${filename}:1:", "reference to non-existing $link")
|
||||
unless exists $name_collection{$link};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub publicize() {
|
||||
foreach my $name ( &parsenum('util/libcrypto.num') ) {
|
||||
sub publicize {
|
||||
foreach my $name ( parsenum('util/libcrypto.num') ) {
|
||||
$public{$name} = 1;
|
||||
}
|
||||
foreach my $name ( &parsenum('util/libssl.num') ) {
|
||||
foreach my $name ( parsenum('util/libssl.num') ) {
|
||||
$public{$name} = 1;
|
||||
}
|
||||
foreach my $name ( &parsenum('util/private.num') ) {
|
||||
foreach my $name ( parsenum('util/private.num') ) {
|
||||
$public{$name} = 1;
|
||||
}
|
||||
}
|
||||
@@ -489,11 +541,11 @@ my %skips = (
|
||||
'[digest]' => 1,
|
||||
);
|
||||
|
||||
sub checkflags() {
|
||||
sub checkflags {
|
||||
my $cmd = shift;
|
||||
my $doc = shift;
|
||||
my %cmdopts;
|
||||
my %docopts;
|
||||
my $ok = 1;
|
||||
|
||||
# Get the list of options in the command.
|
||||
open CFH, "./apps/openssl list --options $cmd|"
|
||||
@@ -506,8 +558,8 @@ sub checkflags() {
|
||||
close CFH;
|
||||
|
||||
# Get the list of flags from the synopsis
|
||||
open CFH, "<doc/man1/$cmd.pod"
|
||||
|| die "Can't open $cmd.pod, $!";
|
||||
open CFH, "<$doc"
|
||||
|| die "Can't open $doc, $!";
|
||||
while ( <CFH> ) {
|
||||
chop;
|
||||
last if /DESCRIPTION/;
|
||||
@@ -522,9 +574,8 @@ sub checkflags() {
|
||||
push @undocced, $k unless $docopts{$k};
|
||||
}
|
||||
if ( scalar @undocced > 0 ) {
|
||||
$ok = 0;
|
||||
foreach ( @undocced ) {
|
||||
print "doc/man1/$cmd.pod: Missing -$_\n";
|
||||
err("doc/man1/$cmd.pod: Missing -$_");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -534,27 +585,26 @@ sub checkflags() {
|
||||
push @unimpl, $k unless $cmdopts{$k};
|
||||
}
|
||||
if ( scalar @unimpl > 0 ) {
|
||||
$ok = 0;
|
||||
foreach ( @unimpl ) {
|
||||
next if defined $skips{$_};
|
||||
print "doc/man1/$cmd.pod: Not implemented -$_\n";
|
||||
err("doc/man1/$cmd.pod: Not implemented -$_");
|
||||
}
|
||||
}
|
||||
|
||||
return $ok;
|
||||
}
|
||||
|
||||
getopts('cdesolnphuv');
|
||||
|
||||
&help() if $opt_h;
|
||||
help() if $opt_h;
|
||||
|
||||
$opt_n = 1 if $opt_p;
|
||||
$opt_u = 1 if $opt_d;
|
||||
$opt_e = 1 if $opt_s;
|
||||
$opt_v = 1 if $opt_o || $opt_e;
|
||||
|
||||
die "Cannot use both -u and -v" if $opt_u && $opt_v;
|
||||
die "Cannot use both -d and -e" if $opt_d && $opt_e;
|
||||
die "Cannot use both -u and -v"
|
||||
if $opt_u && $opt_v;
|
||||
die "Cannot use both -d and -e"
|
||||
if $opt_d && $opt_e;
|
||||
|
||||
# We only need to check c, l, n, u and v.
|
||||
# Options d, e, s, o and p imply one of the above.
|
||||
@@ -562,7 +612,6 @@ die "Need one of -[cdesolnpuv] flags.\n"
|
||||
unless $opt_c or $opt_l or $opt_n or $opt_u or $opt_v;
|
||||
|
||||
if ( $opt_c ) {
|
||||
my $ok = 1;
|
||||
my @commands = ();
|
||||
|
||||
# Get list of commands.
|
||||
@@ -575,13 +624,14 @@ if ( $opt_c ) {
|
||||
close FH;
|
||||
|
||||
# See if each has a manpage.
|
||||
foreach ( @commands ) {
|
||||
next if $_ eq 'help' || $_ eq 'exit';
|
||||
if ( ! -f "doc/man1/$_.pod" ) {
|
||||
print "doc/man1/$_.pod does not exist\n";
|
||||
$ok = 0;
|
||||
foreach my $cmd ( @commands ) {
|
||||
next if $cmd eq 'help' || $cmd eq 'exit';
|
||||
my $doc = "doc/man1/$cmd.pod";
|
||||
$doc = "doc/man1/openssl-$cmd.pod" if -f "doc/man1/openssl-$cmd.pod";
|
||||
if ( ! -f "$doc" ) {
|
||||
err("$doc does not exist");
|
||||
} else {
|
||||
$ok = 0 if not &checkflags($_);
|
||||
checkflags($cmd, $doc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -591,16 +641,15 @@ if ( $opt_c ) {
|
||||
while ( <FH> ) {
|
||||
chop;
|
||||
my ($cmd, $flag) = split;
|
||||
print "$cmd has no help for -$flag\n";
|
||||
$ok = 0;
|
||||
err("$cmd has no help for -$flag");
|
||||
}
|
||||
close FH;
|
||||
|
||||
exit 1 if not $ok;
|
||||
exit $status;
|
||||
}
|
||||
|
||||
if ( $opt_l ) {
|
||||
foreach (@ARGV ? @ARGV : (glob('doc/*/*.pod'),
|
||||
foreach (@ARGV ? @ARGV : (glob('doc/*/*.pod'), glob('doc/*/*.pod.in'),
|
||||
glob('doc/internal/*/*.pod'))) {
|
||||
collectnames($_);
|
||||
}
|
||||
@@ -608,14 +657,14 @@ if ( $opt_l ) {
|
||||
}
|
||||
|
||||
if ( $opt_n ) {
|
||||
&publicize() if $opt_p;
|
||||
foreach (@ARGV ? @ARGV : glob('doc/*/*.pod')) {
|
||||
&check($_);
|
||||
publicize() if $opt_p;
|
||||
foreach (@ARGV ? @ARGV : (glob('doc/*/*.pod'), glob('doc/*/*.pod.in'))) {
|
||||
check($_);
|
||||
}
|
||||
{
|
||||
local $opt_p = undef;
|
||||
foreach (@ARGV ? @ARGV : glob('doc/internal/*/*.pod')) {
|
||||
&check($_);
|
||||
check($_);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -626,13 +675,13 @@ if ( $opt_u || $opt_v) {
|
||||
$docced{$_} = $temp{$_};
|
||||
}
|
||||
if ($opt_o) {
|
||||
&printem('crypto', 'util/libcrypto.num', 'util/missingcrypto111.txt');
|
||||
&printem('ssl', 'util/libssl.num', 'util/missingssl111.txt');
|
||||
printem('crypto', 'util/libcrypto.num', 'util/missingcrypto111.txt');
|
||||
printem('ssl', 'util/libssl.num', 'util/missingssl111.txt');
|
||||
} else {
|
||||
&printem('crypto', 'util/libcrypto.num', 'util/missingcrypto.txt');
|
||||
&printem('ssl', 'util/libssl.num', 'util/missingssl.txt');
|
||||
printem('crypto', 'util/libcrypto.num', 'util/missingcrypto.txt');
|
||||
printem('ssl', 'util/libssl.num', 'util/missingssl.txt');
|
||||
}
|
||||
&checkmacros();
|
||||
checkmacros();
|
||||
}
|
||||
|
||||
exit;
|
||||
exit $status;
|
||||
@@ -36,7 +36,6 @@
|
||||
-T ACCESS_DESCRIPTION
|
||||
-T ADDED_OBJ
|
||||
-T AES_KEY
|
||||
-T APP_INFO
|
||||
-T ARGS
|
||||
-T ASIdOrRange
|
||||
-T ASIdOrRanges
|
||||
@@ -586,7 +585,6 @@
|
||||
-T STACK_OF_nid_triple_
|
||||
-T STACK_OF_void_
|
||||
-T LHASH_OF_ADDED_OBJ_
|
||||
-T LHASH_OF_APP_INFO_
|
||||
-T LHASH_OF_CONF_VALUE_
|
||||
-T LHASH_OF_ENGINE_PILE_
|
||||
-T LHASH_OF_ERR_STATE_
|
||||
|
||||
+118
-32
@@ -515,7 +515,7 @@ DH_generate_parameters 526 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_0
|
||||
BN_set_negative 527 3_0_0 EXIST::FUNCTION:
|
||||
i2d_TS_RESP_bio 528 3_0_0 EXIST::FUNCTION:TS
|
||||
ASYNC_WAIT_CTX_set_wait_fd 529 3_0_0 EXIST::FUNCTION:
|
||||
ERR_func_error_string 530 3_0_0 EXIST::FUNCTION:
|
||||
ERR_func_error_string 530 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3
|
||||
ASN1_STRING_data 531 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_1_1_0
|
||||
X509_CRL_add1_ext_i2d 532 3_0_0 EXIST::FUNCTION:
|
||||
i2d_TS_TST_INFO 533 3_0_0 EXIST::FUNCTION:TS
|
||||
@@ -757,7 +757,7 @@ EVP_rc5_32_12_16_cfb64 775 3_0_0 EXIST::FUNCTION:RC5
|
||||
PKCS7_dataVerify 776 3_0_0 EXIST::FUNCTION:
|
||||
PKCS7_SIGNER_INFO_free 777 3_0_0 EXIST::FUNCTION:
|
||||
PKCS7_add_attrib_smimecap 778 3_0_0 EXIST::FUNCTION:
|
||||
ERR_peek_last_error_line_data 779 3_0_0 EXIST::FUNCTION:
|
||||
ERR_peek_last_error_line_data 779 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3
|
||||
EVP_PKEY_meth_set_sign 780 3_0_0 EXIST::FUNCTION:
|
||||
ASN1_i2d_bio 781 3_0_0 EXIST::FUNCTION:
|
||||
DSA_verify 782 3_0_0 EXIST::FUNCTION:DSA
|
||||
@@ -969,7 +969,7 @@ DH_get_default_method 993 3_0_0 EXIST::FUNCTION:DH
|
||||
PEM_proc_type 994 3_0_0 EXIST::FUNCTION:
|
||||
BIO_printf 995 3_0_0 EXIST::FUNCTION:
|
||||
a2i_IPADDRESS 996 3_0_0 EXIST::FUNCTION:
|
||||
ERR_peek_error_line_data 997 3_0_0 EXIST::FUNCTION:
|
||||
ERR_peek_error_line_data 997 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3
|
||||
ERR_unload_strings 998 3_0_0 EXIST::FUNCTION:
|
||||
SEED_cfb128_encrypt 999 3_0_0 EXIST::FUNCTION:SEED
|
||||
ASN1_BIT_STRING_it 1000 3_0_0 EXIST::FUNCTION:
|
||||
@@ -998,7 +998,7 @@ OPENSSL_LH_get_down_load 1023 3_0_0 EXIST::FUNCTION:
|
||||
EVP_md4 1024 3_0_0 EXIST::FUNCTION:MD4
|
||||
X509_set_subject_name 1025 3_0_0 EXIST::FUNCTION:
|
||||
i2d_PKCS8PrivateKey_nid_bio 1026 3_0_0 EXIST::FUNCTION:
|
||||
ERR_put_error 1027 3_0_0 EXIST::FUNCTION:
|
||||
ERR_put_error 1027 3_0_0 NOEXIST::FUNCTION:
|
||||
ERR_add_error_data 1028 3_0_0 EXIST::FUNCTION:
|
||||
X509_ALGORS_it 1029 3_0_0 EXIST::FUNCTION:
|
||||
MD5_Update 1030 3_0_0 EXIST::FUNCTION:MD5
|
||||
@@ -1157,7 +1157,7 @@ EVP_PKEY_CTX_set0_keygen_info 1183 3_0_0 EXIST::FUNCTION:
|
||||
ENGINE_unregister_digests 1184 3_0_0 EXIST::FUNCTION:ENGINE
|
||||
IPAddressOrRange_new 1185 3_0_0 EXIST::FUNCTION:RFC3779
|
||||
EVP_aes_256_ofb 1186 3_0_0 EXIST::FUNCTION:
|
||||
CRYPTO_mem_debug_push 1187 3_0_0 EXIST::FUNCTION:CRYPTO_MDEBUG
|
||||
CRYPTO_mem_debug_push 1187 3_0_0 EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3
|
||||
X509_PKEY_new 1188 3_0_0 EXIST::FUNCTION:
|
||||
X509_get_key_usage 1189 3_0_0 EXIST::FUNCTION:
|
||||
X509_ATTRIBUTE_create_by_txt 1190 3_0_0 EXIST::FUNCTION:
|
||||
@@ -1554,7 +1554,7 @@ SRP_VBASE_free 1588 3_0_0 EXIST::FUNCTION:SRP
|
||||
PKCS7_add0_attrib_signing_time 1589 3_0_0 EXIST::FUNCTION:
|
||||
X509_STORE_set_flags 1590 3_0_0 EXIST::FUNCTION:
|
||||
UI_get0_output_string 1591 3_0_0 EXIST::FUNCTION:
|
||||
ERR_get_error_line_data 1592 3_0_0 EXIST::FUNCTION:
|
||||
ERR_get_error_line_data 1592 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3
|
||||
CTLOG_get0_name 1593 3_0_0 EXIST::FUNCTION:CT
|
||||
ASN1_TBOOLEAN_it 1594 3_0_0 EXIST::FUNCTION:
|
||||
RC2_set_key 1595 3_0_0 EXIST::FUNCTION:RC2
|
||||
@@ -1807,7 +1807,6 @@ i2d_ASN1_bio_stream 1849 3_0_0 EXIST::FUNCTION:
|
||||
CRYPTO_THREAD_init_local 1850 3_0_0 EXIST::FUNCTION:
|
||||
TS_RESP_CTX_set_serial_cb 1851 3_0_0 EXIST::FUNCTION:TS
|
||||
POLICY_MAPPING_it 1852 3_0_0 EXIST::FUNCTION:
|
||||
ERR_load_KDF_strings 1853 3_0_0 EXIST::FUNCTION:
|
||||
UI_method_set_reader 1854 3_0_0 EXIST::FUNCTION:
|
||||
BIO_next 1855 3_0_0 EXIST::FUNCTION:
|
||||
ASN1_STRING_set_default_mask_asc 1856 3_0_0 EXIST::FUNCTION:
|
||||
@@ -1848,7 +1847,7 @@ IDEA_cbc_encrypt 1890 3_0_0 EXIST::FUNCTION:IDEA
|
||||
BN_CTX_secure_new 1891 3_0_0 EXIST::FUNCTION:
|
||||
OCSP_ONEREQ_add_ext 1892 3_0_0 EXIST::FUNCTION:OCSP
|
||||
CMS_uncompress 1893 3_0_0 EXIST::FUNCTION:CMS
|
||||
CRYPTO_mem_debug_pop 1895 3_0_0 EXIST::FUNCTION:CRYPTO_MDEBUG
|
||||
CRYPTO_mem_debug_pop 1895 3_0_0 EXIST::FUNCTION:CRYPTO_MDEBUG,DEPRECATEDIN_3
|
||||
EVP_aes_192_cfb128 1896 3_0_0 EXIST::FUNCTION:
|
||||
OCSP_REQ_CTX_nbio 1897 3_0_0 EXIST::FUNCTION:OCSP
|
||||
EVP_CIPHER_CTX_copy 1898 3_0_0 EXIST::FUNCTION:
|
||||
@@ -2214,7 +2213,7 @@ EVP_PKEY_missing_parameters 2261 3_0_0 EXIST::FUNCTION:
|
||||
X509_REQ_INFO_new 2262 3_0_0 EXIST::FUNCTION:
|
||||
EVP_rc2_cfb64 2263 3_0_0 EXIST::FUNCTION:RC2
|
||||
PKCS7_get_smimecap 2264 3_0_0 EXIST::FUNCTION:
|
||||
ERR_get_state 2265 3_0_0 EXIST::FUNCTION:
|
||||
ERR_get_state 2265 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3
|
||||
d2i_DSAPrivateKey_bio 2266 3_0_0 EXIST::FUNCTION:DSA
|
||||
X509_PURPOSE_get_trust 2267 3_0_0 EXIST::FUNCTION:
|
||||
EC_GROUP_get_point_conversion_form 2268 3_0_0 EXIST::FUNCTION:EC
|
||||
@@ -3150,7 +3149,7 @@ CMS_RecipientInfo_get0_pkey_ctx 3215 3_0_0 EXIST::FUNCTION:CMS
|
||||
OCSP_REQINFO_free 3216 3_0_0 EXIST::FUNCTION:OCSP
|
||||
AUTHORITY_KEYID_new 3217 3_0_0 EXIST::FUNCTION:
|
||||
i2d_DIST_POINT_NAME 3218 3_0_0 EXIST::FUNCTION:
|
||||
OpenSSL_version_num 3219 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3
|
||||
OpenSSL_version_num 3219 3_0_0 EXIST::FUNCTION:
|
||||
OCSP_CERTID_free 3220 3_0_0 EXIST::FUNCTION:OCSP
|
||||
BIO_hex_string 3221 3_0_0 EXIST::FUNCTION:
|
||||
X509_REQ_sign_ctx 3222 3_0_0 EXIST::FUNCTION:
|
||||
@@ -4426,7 +4425,7 @@ EVP_MD_CTX_set_pkey_ctx 4531 3_0_0 EXIST::FUNCTION:
|
||||
EVP_PKEY_meth_set_digest_custom 4532 3_0_0 EXIST::FUNCTION:
|
||||
EVP_PKEY_meth_get_digest_custom 4533 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_CTX_new 4534 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_CTX_new_id 4535 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_CTX_new_id 4535 3_0_0 NOEXIST::FUNCTION:
|
||||
EVP_MAC_CTX_free 4536 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_CTX_dup 4537 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_CTX_mac 4538 3_0_0 EXIST::FUNCTION:
|
||||
@@ -4434,15 +4433,15 @@ EVP_MAC_size 4539 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_init 4540 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_update 4541 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_final 4542 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_ctrl 4543 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_vctrl 4544 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_ctrl_str 4545 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_str2ctrl 4546 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_hex2ctrl 4547 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_nid 4548 3_0_0 EXIST::FUNCTION:
|
||||
EVP_get_macbyname 4549 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_do_all 4550 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_do_all_sorted 4551 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_ctrl 4543 3_0_0 NOEXIST::FUNCTION:
|
||||
EVP_MAC_vctrl 4544 3_0_0 NOEXIST::FUNCTION:
|
||||
EVP_MAC_ctrl_str 4545 3_0_0 NOEXIST::FUNCTION:
|
||||
EVP_MAC_str2ctrl 4546 3_0_0 NOEXIST::FUNCTION:
|
||||
EVP_MAC_hex2ctrl 4547 3_0_0 NOEXIST::FUNCTION:
|
||||
EVP_MAC_nid 4548 3_0_0 NOEXIST::FUNCTION:
|
||||
EVP_get_macbyname 4549 3_0_0 NOEXIST::FUNCTION:
|
||||
EVP_MAC_do_all 4550 3_0_0 NOEXIST::FUNCTION:
|
||||
EVP_MAC_do_all_sorted 4551 3_0_0 NOEXIST::FUNCTION:
|
||||
EVP_str2ctrl 4552 3_0_0 EXIST::FUNCTION:
|
||||
EVP_hex2ctrl 4553 3_0_0 EXIST::FUNCTION:
|
||||
EVP_PKEY_supports_digest_nid 4554 3_0_0 EXIST::FUNCTION:
|
||||
@@ -4476,17 +4475,9 @@ ASYNC_WAIT_CTX_get_callback 4581 3_0_0 EXIST::FUNCTION:
|
||||
ASYNC_WAIT_CTX_set_callback 4582 3_0_0 EXIST::FUNCTION:
|
||||
ASYNC_WAIT_CTX_set_status 4583 3_0_0 EXIST::FUNCTION:
|
||||
ASYNC_WAIT_CTX_get_status 4584 3_0_0 EXIST::FUNCTION:
|
||||
CMS_add1_signing_cert 4585 3_0_0 EXIST::FUNCTION:CMS
|
||||
CMS_add1_signing_cert_v2 4586 3_0_0 EXIST::FUNCTION:CMS
|
||||
ESS_SIGNING_CERT_new_init 4587 3_0_0 EXIST::FUNCTION:
|
||||
ESS_SIGNING_CERT_V2_new_init 4588 3_0_0 EXIST::FUNCTION:
|
||||
ERR_load_ESS_strings 4589 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_CTX_new_id 4590 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_CTX_free 4591 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_reset 4592 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_ctrl 4593 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_vctrl 4594 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_ctrl_str 4595 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_size 4596 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_derive 4597 3_0_0 EXIST::FUNCTION:
|
||||
EC_GROUP_get0_field 4598 3_0_0 EXIST::FUNCTION:EC
|
||||
@@ -4508,7 +4499,7 @@ OSSL_trace_end 4613 3_0_0 EXIST::FUNCTION:
|
||||
OSSL_PROVIDER_load 4614 3_0_0 EXIST::FUNCTION:
|
||||
OSSL_PROVIDER_unload 4615 3_0_0 EXIST::FUNCTION:
|
||||
OSSL_PROVIDER_add_builtin 4616 3_0_0 EXIST::FUNCTION:
|
||||
OSSL_PROVIDER_get_param_types 4617 3_0_0 EXIST::FUNCTION:
|
||||
OSSL_PROVIDER_gettable_params 4617 3_0_0 EXIST::FUNCTION:
|
||||
OSSL_PROVIDER_get_params 4618 3_0_0 EXIST::FUNCTION:
|
||||
d2i_OSSL_CRMF_ENCRYPTEDVALUE 4619 3_0_0 EXIST::FUNCTION:CRMF
|
||||
i2d_OSSL_CRMF_ENCRYPTEDVALUE 4620 3_0_0 EXIST::FUNCTION:CRMF
|
||||
@@ -4636,8 +4627,6 @@ EVP_CIPHER_mode 4741 3_0_0 EXIST::FUNCTION:
|
||||
OPENSSL_info 4742 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_CTX_new 4743 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_CTX_kdf 4744 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_nid 4745 3_0_0 EXIST::FUNCTION:
|
||||
EVP_get_kdfbyname 4746 3_0_0 EXIST::FUNCTION:
|
||||
i2d_KeyParams 4747 3_0_0 EXIST::FUNCTION:
|
||||
d2i_KeyParams 4748 3_0_0 EXIST::FUNCTION:
|
||||
i2d_KeyParams_bio 4749 3_0_0 EXIST::FUNCTION:
|
||||
@@ -4678,4 +4667,101 @@ BN_rand_ex 4783 3_0_0 EXIST::FUNCTION:
|
||||
BN_priv_rand_ex 4784 3_0_0 EXIST::FUNCTION:
|
||||
BN_rand_range_ex 4785 3_0_0 EXIST::FUNCTION:
|
||||
BN_priv_rand_range_ex 4786 3_0_0 EXIST::FUNCTION:
|
||||
EVP_chacha20_poly1305_draft 4787 3_0_0 EXIST::FUNCTION:CHACHA,POLY1305
|
||||
BN_generate_prime_ex2 4787 3_0_0 EXIST::FUNCTION:
|
||||
EVP_PKEY_derive_init_ex 4788 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KEYEXCH_free 4789 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KEYEXCH_up_ref 4790 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KEYEXCH_fetch 4791 3_0_0 EXIST::FUNCTION:
|
||||
EVP_PKEY_CTX_set_dh_pad 4792 3_0_0 EXIST::FUNCTION:DH
|
||||
EVP_PKEY_CTX_set_params 4793 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KEYMGMT_fetch 4794 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KEYMGMT_up_ref 4795 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KEYMGMT_free 4796 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KEYMGMT_provider 4797 3_0_0 EXIST::FUNCTION:
|
||||
X509_PUBKEY_dup 4798 3_0_0 EXIST::FUNCTION:
|
||||
ERR_put_func_error 4799 3_0_0 NOEXIST::FUNCTION:
|
||||
EVP_MD_name 4800 3_0_0 EXIST::FUNCTION:
|
||||
EVP_CIPHER_name 4801 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MD_provider 4802 3_0_0 EXIST::FUNCTION:
|
||||
EVP_CIPHER_provider 4803 3_0_0 EXIST::FUNCTION:
|
||||
OSSL_PROVIDER_name 4804 3_0_0 EXIST::FUNCTION:
|
||||
EVP_CIPHER_do_all_ex 4805 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MD_do_all_ex 4806 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KEYEXCH_provider 4807 3_0_0 EXIST::FUNCTION:
|
||||
OSSL_PROVIDER_available 4808 3_0_0 EXIST::FUNCTION:
|
||||
ERR_new 4809 3_0_0 EXIST::FUNCTION:
|
||||
ERR_set_debug 4810 3_0_0 EXIST::FUNCTION:
|
||||
ERR_set_error 4811 3_0_0 EXIST::FUNCTION:
|
||||
ERR_vset_error 4812 3_0_0 EXIST::FUNCTION:
|
||||
X509_get0_authority_issuer 4813 3_0_0 EXIST::FUNCTION:
|
||||
X509_get0_authority_serial 4814 3_0_0 EXIST::FUNCTION:
|
||||
EC_GROUP_new_ex 4815 3_0_0 EXIST::FUNCTION:EC
|
||||
EC_GROUP_new_by_curve_name_ex 4816 3_0_0 EXIST::FUNCTION:EC
|
||||
EC_KEY_new_ex 4817 3_0_0 EXIST::FUNCTION:EC
|
||||
EC_KEY_new_by_curve_name_ex 4818 3_0_0 EXIST::FUNCTION:EC
|
||||
OPENSSL_hexstr2buf_ex 4819 3_0_0 EXIST::FUNCTION:
|
||||
OPENSSL_buf2hexstr_ex 4820 3_0_0 EXIST::FUNCTION:
|
||||
OSSL_PARAM_construct_from_text 4821 3_0_0 EXIST::FUNCTION:
|
||||
OSSL_PARAM_allocate_from_text 4822 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MD_gettable_params 4823 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MD_CTX_settable_params 4824 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MD_CTX_gettable_params 4825 3_0_0 EXIST::FUNCTION:
|
||||
EVP_CIPHER_get_params 4826 3_0_0 EXIST::FUNCTION:
|
||||
EVP_CIPHER_CTX_set_params 4827 3_0_0 EXIST::FUNCTION:
|
||||
EVP_CIPHER_CTX_get_params 4828 3_0_0 EXIST::FUNCTION:
|
||||
EVP_CIPHER_gettable_params 4829 3_0_0 EXIST::FUNCTION:
|
||||
EVP_CIPHER_CTX_settable_params 4830 3_0_0 EXIST::FUNCTION:
|
||||
EVP_CIPHER_CTX_gettable_params 4831 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MD_get_params 4832 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_fetch 4833 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_CTX_settable_params 4834 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_CTX_set_params 4835 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_CTX_get_params 4836 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_CTX_gettable_params 4837 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_free 4838 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_up_ref 4839 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_name 4840 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_get_params 4841 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_gettable_params 4842 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_provider 4843 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_do_all_ex 4844 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MD_free 4845 3_0_0 EXIST::FUNCTION:
|
||||
EVP_CIPHER_free 4846 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_up_ref 4847 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_free 4848 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_fetch 4849 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_CTX_dup 4850 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_name 4851 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_provider 4852 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_get_params 4853 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_CTX_get_params 4854 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_CTX_set_params 4855 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_gettable_params 4856 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_CTX_gettable_params 4857 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_CTX_settable_params 4858 3_0_0 EXIST::FUNCTION:
|
||||
EVP_KDF_do_all_ex 4859 3_0_0 EXIST::FUNCTION:
|
||||
EVP_SIGNATURE_free 4860 3_0_0 EXIST::FUNCTION:
|
||||
EVP_SIGNATURE_up_ref 4861 3_0_0 EXIST::FUNCTION:
|
||||
EVP_SIGNATURE_provider 4862 3_0_0 EXIST::FUNCTION:
|
||||
EVP_SIGNATURE_fetch 4863 3_0_0 EXIST::FUNCTION:
|
||||
EVP_PKEY_sign_init_ex 4864 3_0_0 EXIST::FUNCTION:
|
||||
EVP_PKEY_CTX_set_signature_md 4865 3_0_0 EXIST::FUNCTION:
|
||||
EVP_PKEY_verify_init_ex 4866 3_0_0 EXIST::FUNCTION:
|
||||
EVP_PKEY_verify_recover_init_ex 4867 3_0_0 EXIST::FUNCTION:
|
||||
EVP_PKEY_CTX_get_signature_md 4868 3_0_0 EXIST::FUNCTION:
|
||||
EVP_PKEY_CTX_get_params 4869 3_0_0 EXIST::FUNCTION:
|
||||
EVP_PKEY_CTX_gettable_params 4870 3_0_0 EXIST::FUNCTION:
|
||||
EVP_PKEY_CTX_settable_params 4871 3_0_0 EXIST::FUNCTION:
|
||||
EVP_CIPHER_CTX_tag_length 4872 3_0_0 EXIST::FUNCTION:
|
||||
ERR_get_error_func 4873 3_0_0 EXIST::FUNCTION:
|
||||
ERR_get_error_data 4874 3_0_0 EXIST::FUNCTION:
|
||||
ERR_get_error_all 4875 3_0_0 EXIST::FUNCTION:
|
||||
ERR_peek_error_func 4876 3_0_0 EXIST::FUNCTION:
|
||||
ERR_peek_error_data 4877 3_0_0 EXIST::FUNCTION:
|
||||
ERR_peek_error_all 4878 3_0_0 EXIST::FUNCTION:
|
||||
ERR_peek_last_error_func 4879 3_0_0 EXIST::FUNCTION:
|
||||
ERR_peek_last_error_data 4880 3_0_0 EXIST::FUNCTION:
|
||||
ERR_peek_last_error_all 4881 3_0_0 EXIST::FUNCTION:
|
||||
EVP_CIPHER_is_a 4882 3_0_0 EXIST::FUNCTION:
|
||||
EVP_MAC_is_a 4883 3_0_0 EXIST::FUNCTION:
|
||||
EVP_chacha20_poly1305_draft 4884 3_0_0 EXIST::FUNCTION:CHACHA,POLY1305
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
# in the file LICENSE in the source distribution or at
|
||||
# https://www.openssl.org/source/license.html
|
||||
|
||||
# Sometimes calls to XXXerr() are split into two lines, because the define'd
|
||||
# names are very long. This script looks for those lines and merges them.
|
||||
# It should be run before the "err-to-raise" script.
|
||||
|
||||
# Run this program like this:
|
||||
# perl -pi util/merge-err-lines files...
|
||||
# or
|
||||
# git grep -l '[A-Z0-9]err([^)]*$' | xargs perl -pi util/merge-err-lines
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
# Look for "{whitespace}XXXerr(no-close-paren{WHITESPACE}" lines
|
||||
if ( /^ *[_A-Z0-9]+err\([^)]+ *$/ ) {
|
||||
my $copy = $_;
|
||||
chop($copy);
|
||||
$copy =~ s/ +$//;
|
||||
my $next = <>;
|
||||
$next =~ s/^ +//;
|
||||
$_ = $copy . ' ' . $next;
|
||||
}
|
||||
@@ -458,7 +458,6 @@ ERR_load_ENGINE_strings
|
||||
ERR_load_ERR_strings
|
||||
ERR_load_ESS_strings
|
||||
ERR_load_EVP_strings
|
||||
ERR_load_KDF_strings
|
||||
ERR_load_OBJ_strings
|
||||
ERR_load_OCSP_strings
|
||||
ERR_load_OSSL_STORE_strings
|
||||
@@ -474,12 +473,6 @@ ERR_load_X509_strings
|
||||
ERR_load_strings_const
|
||||
ERR_set_error_data
|
||||
ERR_unload_strings
|
||||
ESS_CERT_ID_V2_dup
|
||||
ESS_CERT_ID_V2_free
|
||||
ESS_CERT_ID_V2_new
|
||||
ESS_SIGNING_CERT_V2_dup
|
||||
ESS_SIGNING_CERT_V2_free
|
||||
ESS_SIGNING_CERT_V2_new
|
||||
ESS_SIGNING_CERT_V2_new_init
|
||||
ESS_SIGNING_CERT_new_init
|
||||
EVP_CIPHER_CTX_buf_noconst
|
||||
@@ -1456,8 +1449,6 @@ b2i_PublicKey_bio
|
||||
conf_ssl_get
|
||||
conf_ssl_get_cmd
|
||||
conf_ssl_name_find
|
||||
d2i_ESS_CERT_ID_V2
|
||||
d2i_ESS_SIGNING_CERT_V2
|
||||
d2i_X509_bio
|
||||
d2i_X509_fp
|
||||
err_free_strings_int
|
||||
@@ -1469,8 +1460,6 @@ i2a_ASN1_STRING
|
||||
i2b_PVK_bio
|
||||
i2b_PrivateKey_bio
|
||||
i2b_PublicKey_bio
|
||||
i2d_ESS_CERT_ID_V2
|
||||
i2d_ESS_SIGNING_CERT_V2
|
||||
i2d_PrivateKey_bio
|
||||
i2d_PrivateKey_fp
|
||||
i2d_X509_bio
|
||||
|
||||
@@ -469,7 +469,6 @@ ERR_load_EC_strings
|
||||
ERR_load_ENGINE_strings
|
||||
ERR_load_ERR_strings
|
||||
ERR_load_EVP_strings
|
||||
ERR_load_KDF_strings
|
||||
ERR_load_OBJ_strings
|
||||
ERR_load_OCSP_strings
|
||||
ERR_load_OSSL_STORE_strings
|
||||
@@ -485,12 +484,6 @@ ERR_load_X509_strings
|
||||
ERR_load_strings_const
|
||||
ERR_set_error_data
|
||||
ERR_unload_strings
|
||||
ESS_CERT_ID_V2_dup
|
||||
ESS_CERT_ID_V2_free
|
||||
ESS_CERT_ID_V2_new
|
||||
ESS_SIGNING_CERT_V2_dup
|
||||
ESS_SIGNING_CERT_V2_free
|
||||
ESS_SIGNING_CERT_V2_new
|
||||
EVP_CIPHER_CTX_buf_noconst
|
||||
EVP_CIPHER_CTX_clear_flags
|
||||
EVP_CIPHER_CTX_copy
|
||||
@@ -1571,8 +1564,6 @@ b2i_PublicKey_bio
|
||||
conf_ssl_get
|
||||
conf_ssl_get_cmd
|
||||
conf_ssl_name_find
|
||||
d2i_ESS_CERT_ID_V2
|
||||
d2i_ESS_SIGNING_CERT_V2
|
||||
d2i_X509_bio
|
||||
d2i_X509_fp
|
||||
err_free_strings_int
|
||||
@@ -1584,8 +1575,6 @@ i2a_ASN1_STRING
|
||||
i2b_PVK_bio
|
||||
i2b_PrivateKey_bio
|
||||
i2b_PublicKey_bio
|
||||
i2d_ESS_CERT_ID_V2
|
||||
i2d_ESS_SIGNING_CERT_V2
|
||||
i2d_PrivateKey_bio
|
||||
i2d_PrivateKey_fp
|
||||
i2d_X509_bio
|
||||
|
||||
+17
-48
@@ -122,20 +122,22 @@ if ( $internal ) {
|
||||
}
|
||||
|
||||
# Data parsed out of the config and state files.
|
||||
# We always map function-code values to zero, so items marked below with
|
||||
# an asterisk could eventually be removed. TODO(4.0)
|
||||
my %hinc; # lib -> header
|
||||
my %libinc; # header -> lib
|
||||
my %cskip; # error_file -> lib
|
||||
my %errorfile; # lib -> error file name
|
||||
my %fmax; # lib -> max assigned function code
|
||||
my %fmax; # lib -> max assigned function code*
|
||||
my %rmax; # lib -> max assigned reason code
|
||||
my %fassigned; # lib -> colon-separated list of assigned function codes
|
||||
my %fassigned; # lib -> colon-separated list of assigned function codes*
|
||||
my %rassigned; # lib -> colon-separated list of assigned reason codes
|
||||
my %fnew; # lib -> count of new function codes
|
||||
my %fnew; # lib -> count of new function codes*
|
||||
my %rnew; # lib -> count of new reason codes
|
||||
my %rextra; # "extra" reason code -> lib
|
||||
my %rcodes; # reason-name -> value
|
||||
my %ftrans; # old name -> #define-friendly name (all caps)
|
||||
my %fcodes; # function-name -> value
|
||||
my %ftrans; # old name -> #define-friendly name (all caps)*
|
||||
my %fcodes; # function-name -> value*
|
||||
my $statefile; # state file with assigned reason and function codes
|
||||
my %strings; # define -> text
|
||||
|
||||
@@ -218,8 +220,6 @@ if ( ! $reindex && $statefile ) {
|
||||
}
|
||||
$rcodes{$name} = $code;
|
||||
} elsif ( $name =~ /^(?:OSSL_|OPENSSL_)?[A-Z0-9]{2,}_F_/ ) {
|
||||
die "$lib function code $code collision at $name\n"
|
||||
if $fassigned{$lib} =~ /:$code:/;
|
||||
$fassigned{$lib} .= "$code:";
|
||||
$fmax{$lib} = $code if $code > $fmax{$lib};
|
||||
$fcodes{$name} = $code;
|
||||
@@ -392,10 +392,6 @@ foreach my $file ( @source ) {
|
||||
$fnew{$2}++;
|
||||
}
|
||||
$ftrans{$3} = $func unless exists $ftrans{$3};
|
||||
if ( uc($func) ne $3 ) {
|
||||
print STDERR "ERROR: mismatch $file:$linenr $func:$3\n";
|
||||
$errors++;
|
||||
}
|
||||
print STDERR " Function $1 = $fcodes{$1}\n"
|
||||
if $debug;
|
||||
}
|
||||
@@ -454,9 +450,9 @@ foreach my $lib ( keys %errorfile ) {
|
||||
#ifndef HEADER_${lib}ERR_H
|
||||
# define HEADER_${lib}ERR_H
|
||||
|
||||
# ifndef HEADER_SYMHACKS_H
|
||||
# include <openssl/symhacks.h>
|
||||
# endif
|
||||
# include <openssl/opensslconf.h>
|
||||
# include <openssl/symhacks.h>
|
||||
|
||||
|
||||
EOF
|
||||
if ( $internal ) {
|
||||
@@ -480,7 +476,7 @@ int ERR_load_${lib}_strings(void);
|
||||
EOF
|
||||
} else {
|
||||
print OUT <<"EOF";
|
||||
# define ${lib}err(f, r) ERR_${lib}_error((f), (r), OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define ${lib}err(f, r) ERR_${lib}_error(0, (r), OPENSSL_FILE, OPENSSL_LINE)
|
||||
|
||||
EOF
|
||||
if ( ! $static ) {
|
||||
@@ -500,6 +496,7 @@ EOF
|
||||
}
|
||||
|
||||
print OUT "\n/*\n * $lib function codes.\n */\n";
|
||||
print OUT "# if !OPENSSL_API_3\n";
|
||||
foreach my $i ( @function ) {
|
||||
my $z = 48 - length($i);
|
||||
$z = 0 if $z < 0;
|
||||
@@ -514,8 +511,9 @@ EOF
|
||||
$fassigned{$lib} .= "$findcode:";
|
||||
print STDERR "New Function code $i\n" if $debug;
|
||||
}
|
||||
printf OUT "#${indent}define $i%s $fcodes{$i}\n", " " x $z;
|
||||
printf OUT "#${indent} define $i%s 0\n", " " x $z;
|
||||
}
|
||||
print OUT "# endif\n";
|
||||
|
||||
print OUT "\n/*\n * $lib reason codes.\n */\n";
|
||||
foreach my $i ( @reasons ) {
|
||||
@@ -575,32 +573,6 @@ EOF
|
||||
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
|
||||
static ${const}ERR_STRING_DATA ${lib}_str_functs[] = {
|
||||
EOF
|
||||
|
||||
# Add each function code: if a function name is found then use it.
|
||||
foreach my $i ( @function ) {
|
||||
my $fn;
|
||||
if ( exists $strings{$i} and $strings{$i} ne '' ) {
|
||||
$fn = $strings{$i};
|
||||
$fn = "" if $fn eq '*';
|
||||
} else {
|
||||
$i =~ /^${lib}_F_(\S+)$/;
|
||||
$fn = $1;
|
||||
$fn = $ftrans{$fn} if exists $ftrans{$fn};
|
||||
$strings{$i} = $fn;
|
||||
}
|
||||
my $short = " {ERR_PACK($pack_lib, $i, 0), \"$fn\"},";
|
||||
if ( length($short) <= 80 ) {
|
||||
print OUT "$short\n";
|
||||
} else {
|
||||
print OUT " {ERR_PACK($pack_lib, $i, 0),\n \"$fn\"},\n";
|
||||
}
|
||||
}
|
||||
print OUT <<"EOF";
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
static ${const}ERR_STRING_DATA ${lib}_str_reasons[] = {
|
||||
EOF
|
||||
|
||||
@@ -635,10 +607,8 @@ EOF
|
||||
int ERR_load_${lib}_strings(void)
|
||||
{
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
if (ERR_func_error_string(${lib}_str_functs[0].error) == NULL) {
|
||||
ERR_load_strings_const(${lib}_str_functs);
|
||||
if (ERR_reason_error_string(${lib}_str_reasons[0].error) == NULL)
|
||||
ERR_load_strings_const(${lib}_str_reasons);
|
||||
}
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
@@ -657,7 +627,6 @@ ${st}int ERR_load_${lib}_strings(void)
|
||||
|
||||
if (!error_loaded) {
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
ERR_load_strings(lib_code, ${lib}_str_functs);
|
||||
ERR_load_strings(lib_code, ${lib}_str_reasons);
|
||||
#endif
|
||||
error_loaded = 1;
|
||||
@@ -669,7 +638,6 @@ ${st}void ERR_unload_${lib}_strings(void)
|
||||
{
|
||||
if (error_loaded) {
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
ERR_unload_strings(lib_code, ${lib}_str_functs);
|
||||
ERR_unload_strings(lib_code, ${lib}_str_reasons);
|
||||
#endif
|
||||
error_loaded = 0;
|
||||
@@ -680,7 +648,8 @@ ${st}void ERR_${lib}_error(int function, int reason, char *file, int line)
|
||||
{
|
||||
if (lib_code == 0)
|
||||
lib_code = ERR_get_next_error_library();
|
||||
ERR_PUT_error(lib_code, function, reason, file, line);
|
||||
ERR_raise(lib_code, reason);
|
||||
ERR_set_debug(file, line, NULL);
|
||||
}
|
||||
EOF
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@ OPENSSL="${HERE}../apps/openssl"
|
||||
if [ -d "${HERE}../engines" -a "x$OPENSSL_ENGINES" = "x" ]; then
|
||||
OPENSSL_ENGINES="${HERE}../engines"; export OPENSSL_ENGINES
|
||||
fi
|
||||
if [ -d "${HERE}../providers" -a "x$OPENSSL_MODULES" = "x" ]; then
|
||||
OPENSSL_MODULES="${HERE}../providers"; export OPENSSL_MODULES
|
||||
fi
|
||||
|
||||
if [ -x "${OPENSSL}.exe" ]; then
|
||||
# The original reason for this script existence is to work around
|
||||
|
||||
@@ -0,0 +1,195 @@
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
# in the file LICENSE in the source distribution or at
|
||||
# https://www.openssl.org/source/license.html
|
||||
|
||||
# Implements the functionality to read one or more template files and run
|
||||
# them through Text::Template
|
||||
|
||||
package OpenSSL::Template;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
OpenSSL::Template - a private extension of Text::Template
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This provides exactly the functionality from Text::Template, with the
|
||||
following additions:
|
||||
|
||||
=over 4
|
||||
|
||||
=item -
|
||||
|
||||
The template perl code delimiters (given with the C<DELIMITER> option)
|
||||
are set to C<{-> and C<-}> by default.
|
||||
|
||||
=item -
|
||||
|
||||
A few extra functions are offered to be used by the template perl code, see
|
||||
L</Functions>.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
use File::Basename;
|
||||
use File::Spec::Functions;
|
||||
use Text::Template 1.46;
|
||||
|
||||
our @ISA = qw(Text::Template); # parent
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
|
||||
# Call the constructor of the parent class.
|
||||
my $self = $class->SUPER::new(DELIMITERS => [ '{-', '-}'],
|
||||
@_ );
|
||||
|
||||
# Add few more attributes
|
||||
$self->{_output_off} = 0; # Default to output hunks
|
||||
|
||||
return bless $self, $class;
|
||||
}
|
||||
|
||||
sub fill_in {
|
||||
my $self = shift;
|
||||
my %opts = @_;
|
||||
my %hash = ( %{$opts{HASH}} );
|
||||
delete $opts{HASH};
|
||||
|
||||
$self->SUPER::fill_in(HASH => { quotify1 => \"ify1,
|
||||
quotify_l => \"ify_l,
|
||||
output_on => sub { $self->output_on() },
|
||||
output_off => sub { $self->output_off() },
|
||||
%hash },
|
||||
%opts);
|
||||
}
|
||||
|
||||
=head2 Functions
|
||||
|
||||
=cut
|
||||
|
||||
# Override Text::Template's append_text_to_result, as recommended here:
|
||||
#
|
||||
# http://search.cpan.org/~mjd/Text-Template-1.46/lib/Text/Template.pm#Automatic_postprocessing_of_template_hunks
|
||||
sub append_text_to_output {
|
||||
my $self = shift;
|
||||
|
||||
if ($self->{_output_off} == 0) {
|
||||
$self->SUPER::append_text_to_output(@_);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
=begin comment
|
||||
|
||||
We lie about the OO nature of output_on() and output_off(), 'cause that's
|
||||
not how we pass them, see the HASH option used in fill_in() above
|
||||
|
||||
=end comment
|
||||
|
||||
=over 4
|
||||
|
||||
=item output_on()
|
||||
|
||||
=item output_off()
|
||||
|
||||
Switch on or off template output. Here's an example usage:
|
||||
|
||||
=over 4
|
||||
|
||||
{- output_off() if CONDITION -}
|
||||
whatever
|
||||
{- output_on() if CONDITION -}
|
||||
|
||||
=back
|
||||
|
||||
In this example, C<whatever> will only become part of the template output
|
||||
if C<CONDITION> is true.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
sub output_on {
|
||||
my $self = shift;
|
||||
if (--$self->{_output_off} < 0) {
|
||||
$self->{_output_off} = 0;
|
||||
}
|
||||
}
|
||||
|
||||
sub output_off {
|
||||
my $self = shift;
|
||||
$self->{_output_off}++;
|
||||
}
|
||||
|
||||
# Helper functions for the templates #################################
|
||||
|
||||
# It might be practical to quotify some strings and have them protected
|
||||
# from possible harm. These functions primarily quote things that might
|
||||
# be interpreted wrongly by a perl eval.
|
||||
|
||||
# NOTE THAT THESE AREN'T CLASS METHODS!
|
||||
|
||||
=over 4
|
||||
|
||||
=item quotify1 STRING
|
||||
|
||||
This adds quotes (") around the given string, and escapes any $, @, \,
|
||||
" and ' by prepending a \ to them.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
sub quotify1 {
|
||||
my $s = shift @_;
|
||||
$s =~ s/([\$\@\\"'])/\\$1/g;
|
||||
'"'.$s.'"';
|
||||
}
|
||||
|
||||
=over 4
|
||||
|
||||
=item quotify_l LIST
|
||||
|
||||
For each defined element in LIST (i.e. elements that aren't undef), have
|
||||
it quotified with 'quotify1'.
|
||||
Undefined elements are ignored.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
sub quotify_l {
|
||||
map {
|
||||
if (!defined($_)) {
|
||||
();
|
||||
} else {
|
||||
quotify1($_);
|
||||
}
|
||||
} @_;
|
||||
}
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<Text::Template>
|
||||
|
||||
=head1 AUTHORS
|
||||
|
||||
Richard Levitte E<lt>levitte@openssl.orgE<gt>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
this file except in compliance with the License. You can obtain a copy
|
||||
in the file LICENSE in the source distribution or at
|
||||
L<https://www.openssl.org/source/license.html>.
|
||||
|
||||
=cut
|
||||
+31
-18
@@ -446,16 +446,21 @@ sub run {
|
||||
die "OpenSSL::Test::run(): statusvar value not a scalar reference"
|
||||
if $opts{statusvar} && ref($opts{statusvar}) ne "SCALAR";
|
||||
|
||||
# In non-verbose, we want to shut up the command interpreter, in case
|
||||
# it has something to complain about. On VMS, it might complain both
|
||||
# on stdout and stderr
|
||||
# For some reason, program output, or even output from this function
|
||||
# somehow isn't caught by TAP::Harness (TAP::Parser?) on VMS, so we're
|
||||
# silencing it specifically there until further notice.
|
||||
my $save_STDOUT;
|
||||
my $save_STDERR;
|
||||
if ($ENV{HARNESS_ACTIVE} && !$ENV{HARNESS_VERBOSE}) {
|
||||
open $save_STDOUT, '>&', \*STDOUT or die "Can't dup STDOUT: $!";
|
||||
open $save_STDERR, '>&', \*STDERR or die "Can't dup STDERR: $!";
|
||||
open STDOUT, ">", devnull();
|
||||
open STDERR, ">", devnull();
|
||||
if ($^O eq 'VMS') {
|
||||
# In non-verbose, we want to shut up the command interpreter, in case
|
||||
# it has something to complain about. On VMS, it might complain both
|
||||
# on stdout and stderr
|
||||
if ($ENV{HARNESS_ACTIVE} && !$ENV{HARNESS_VERBOSE}) {
|
||||
open $save_STDOUT, '>&', \*STDOUT or die "Can't dup STDOUT: $!";
|
||||
open $save_STDERR, '>&', \*STDERR or die "Can't dup STDERR: $!";
|
||||
open STDOUT, ">", devnull();
|
||||
open STDERR, ">", devnull();
|
||||
}
|
||||
}
|
||||
|
||||
$ENV{HARNESS_OSSL_LEVEL} = $level + 1;
|
||||
@@ -489,15 +494,20 @@ sub run {
|
||||
${$opts{statusvar}} = $r;
|
||||
}
|
||||
|
||||
if ($ENV{HARNESS_ACTIVE} && !$ENV{HARNESS_VERBOSE}) {
|
||||
close STDOUT;
|
||||
close STDERR;
|
||||
open STDOUT, '>&', $save_STDOUT or die "Can't restore STDOUT: $!";
|
||||
open STDERR, '>&', $save_STDERR or die "Can't restore STDERR: $!";
|
||||
}
|
||||
# Restore STDOUT / STDERR on VMS
|
||||
if ($^O eq 'VMS') {
|
||||
if ($ENV{HARNESS_ACTIVE} && !$ENV{HARNESS_VERBOSE}) {
|
||||
close STDOUT;
|
||||
close STDERR;
|
||||
open STDOUT, '>&', $save_STDOUT or die "Can't restore STDOUT: $!";
|
||||
open STDERR, '>&', $save_STDERR or die "Can't restore STDERR: $!";
|
||||
}
|
||||
|
||||
print STDERR "$prefix$display_cmd => $e\n"
|
||||
if !$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE};
|
||||
print STDERR "$prefix$display_cmd => $e\n"
|
||||
if !$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE};
|
||||
} else {
|
||||
print STDERR "$prefix$display_cmd => $e\n";
|
||||
}
|
||||
|
||||
# At this point, $? stops being interesting, and unfortunately,
|
||||
# there are Test::More versions that get picky if we leave it
|
||||
@@ -1244,8 +1254,11 @@ sub __decorate_cmd {
|
||||
|
||||
my $display_cmd = "$cmdstr$stdin$stdout$stderr";
|
||||
|
||||
$stderr=" 2> ".$null
|
||||
unless $stderr || !$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE};
|
||||
# VMS program output escapes TAP::Parser
|
||||
if ($^O eq 'VMS') {
|
||||
$stderr=" 2> ".$null
|
||||
unless $stderr || !$ENV{HARNESS_ACTIVE} || $ENV{HARNESS_VERBOSE};
|
||||
}
|
||||
|
||||
$cmdstr .= "$stdin$stdout$stderr";
|
||||
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
# Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
# in the file LICENSE in the source distribution or at
|
||||
# https://www.openssl.org/source/license.html
|
||||
|
||||
=head1 NAME
|
||||
|
||||
OpenSSL::fallback - push directories to the end of @INC at compile time
|
||||
|
||||
=cut
|
||||
|
||||
package OpenSSL::fallback;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Carp;
|
||||
|
||||
our $VERSION = '0.01';
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use OpenSSL::fallback LIST;
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This small simple module simplifies the addition of fallback directories
|
||||
in @INC at compile time.
|
||||
|
||||
It is used to add extra directories at the end of perl's search path so
|
||||
that later "use" or "require" statements will find modules which are not
|
||||
located on perl's default search path.
|
||||
|
||||
This is similar to L<lib>, except the paths are I<appended> to @INC rather
|
||||
than prepended, thus allowing the use of a newer module on perl's default
|
||||
search path if there is one.
|
||||
|
||||
=head1 CAVEAT
|
||||
|
||||
Just like with B<lib>, this only works with Unix filepaths.
|
||||
Just like with L<lib>, this doesn't mean that it only works on Unix, but that
|
||||
non-Unix users must first translate their file paths to Unix conventions.
|
||||
|
||||
# VMS users wanting to put [.my.stuff] into their @INC should write:
|
||||
use fallback 'my/stuff';
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
If you try to add a file to @INC as follows, you will be warned, and the file
|
||||
will be ignored:
|
||||
|
||||
use fallback 'file.txt';
|
||||
|
||||
The sole exception is the file F<MODULES.txt>, which must contain a list of
|
||||
sub-directories relative to the location of that F<MODULES.txt> file.
|
||||
All these sub-directories will be appended to @INC.
|
||||
|
||||
=cut
|
||||
|
||||
# Forward declare
|
||||
sub glob;
|
||||
|
||||
use constant DEBUG => 0;
|
||||
|
||||
sub import {
|
||||
shift; # Skip module name
|
||||
|
||||
foreach (@_) {
|
||||
my $path = $_;
|
||||
|
||||
if ($path eq '') {
|
||||
carp "Empty compile time value given to use fallback";
|
||||
next;
|
||||
}
|
||||
|
||||
print STDERR "DEBUG: $path\n" if DEBUG;
|
||||
|
||||
unless (-e $path
|
||||
&& ($path =~ m/(?:^|\/)MODULES.txt/ || -d $path)) {
|
||||
croak "Parameter to use fallback must be a directory, not a file";
|
||||
next;
|
||||
}
|
||||
|
||||
my @dirs = ();
|
||||
if (-f $path) { # It's a MODULES.txt file
|
||||
(my $dir = $path) =~ s|/[^/]*$||; # quick dirname
|
||||
open my $fh, $path or die "Could not open $path: $!\n";
|
||||
while (my $l = <$fh>) {
|
||||
$l =~ s|\R$||; # Better chomp
|
||||
my $d = "$dir/$l";
|
||||
croak "All lines in $path must be a directory, not a file: $l"
|
||||
unless -e $d && -d $d;
|
||||
push @INC, $d;
|
||||
}
|
||||
} else { # It's a directory
|
||||
push @INC, $path;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<FindBin> - optional module which deals with paths relative to the source
|
||||
file.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Richard Levitte, 2019
|
||||
|
||||
=cut
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
# in the file LICENSE in the source distribution or at
|
||||
# https://www.openssl.org/source/license.html
|
||||
|
||||
use strict;
|
||||
|
||||
package TLSProxy::CertificateRequest;
|
||||
|
||||
use vars '@ISA';
|
||||
push @ISA, 'TLSProxy::Message';
|
||||
|
||||
sub new
|
||||
{
|
||||
my $class = shift;
|
||||
my ($server,
|
||||
$data,
|
||||
$records,
|
||||
$startoffset,
|
||||
$message_frag_lens) = @_;
|
||||
|
||||
my $self = $class->SUPER::new(
|
||||
$server,
|
||||
TLSProxy::Message::MT_CERTIFICATE_REQUEST,
|
||||
$data,
|
||||
$records,
|
||||
$startoffset,
|
||||
$message_frag_lens);
|
||||
|
||||
$self->{extension_data} = "";
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub parse
|
||||
{
|
||||
my $self = shift;
|
||||
my $ptr = 1;
|
||||
|
||||
if (TLSProxy::Proxy->is_tls13()) {
|
||||
my $request_ctx_len = unpack('C', $self->data);
|
||||
my $request_ctx = substr($self->data, $ptr, $request_ctx_len);
|
||||
$ptr += $request_ctx_len;
|
||||
|
||||
my $extensions_len = unpack('n', substr($self->data, $ptr));
|
||||
$ptr += 2;
|
||||
my $extension_data = substr($self->data, $ptr);
|
||||
if (length($extension_data) != $extensions_len) {
|
||||
die "Invalid extension length\n";
|
||||
}
|
||||
my %extensions = ();
|
||||
while (length($extension_data) >= 4) {
|
||||
my ($type, $size) = unpack("nn", $extension_data);
|
||||
my $extdata = substr($extension_data, 4, $size);
|
||||
$extension_data = substr($extension_data, 4 + $size);
|
||||
$extensions{$type} = $extdata;
|
||||
}
|
||||
$self->extension_data(\%extensions);
|
||||
|
||||
print " Extensions Len:".$extensions_len."\n";
|
||||
}
|
||||
# else parse TLSv1.2 version - we don't support that at the moment
|
||||
}
|
||||
|
||||
#Reconstruct the on-the-wire message data following changes
|
||||
sub set_message_contents
|
||||
{
|
||||
my $self = shift;
|
||||
my $data;
|
||||
my $extensions = "";
|
||||
|
||||
foreach my $key (keys %{$self->extension_data}) {
|
||||
my $extdata = ${$self->extension_data}{$key};
|
||||
$extensions .= pack("n", $key);
|
||||
$extensions .= pack("n", length($extdata));
|
||||
$extensions .= $extdata;
|
||||
}
|
||||
|
||||
$data = pack('n', length($extensions));
|
||||
$data .= $extensions;
|
||||
$self->data($data);
|
||||
}
|
||||
|
||||
#Read/write accessors
|
||||
sub extension_data
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{extension_data} = shift;
|
||||
}
|
||||
return $self->{extension_data};
|
||||
}
|
||||
sub set_extension
|
||||
{
|
||||
my ($self, $ext_type, $ext_data) = @_;
|
||||
$self->{extension_data}{$ext_type} = $ext_data;
|
||||
}
|
||||
sub delete_extension
|
||||
{
|
||||
my ($self, $ext_type) = @_;
|
||||
delete $self->{extension_data}{$ext_type};
|
||||
}
|
||||
1;
|
||||
@@ -129,6 +129,11 @@ use constant {
|
||||
CIPHER_TLS13_AES_256_GCM_SHA384 => 0x1302
|
||||
};
|
||||
|
||||
use constant {
|
||||
CLIENT => 0,
|
||||
SERVER => 1
|
||||
};
|
||||
|
||||
my $payload = "";
|
||||
my $messlen = -1;
|
||||
my $mt;
|
||||
@@ -338,6 +343,15 @@ sub create_message
|
||||
[@message_frag_lens]
|
||||
);
|
||||
$message->parse();
|
||||
} elsif ($mt == MT_CERTIFICATE_REQUEST) {
|
||||
$message = TLSProxy::CertificateRequest->new(
|
||||
$server,
|
||||
$data,
|
||||
[@message_rec_list],
|
||||
$startoffset,
|
||||
[@message_frag_lens]
|
||||
);
|
||||
$message->parse();
|
||||
} elsif ($mt == MT_CERTIFICATE_VERIFY) {
|
||||
$message = TLSProxy::CertificateVerify->new(
|
||||
$server,
|
||||
|
||||
@@ -19,6 +19,7 @@ use TLSProxy::ClientHello;
|
||||
use TLSProxy::ServerHello;
|
||||
use TLSProxy::EncryptedExtensions;
|
||||
use TLSProxy::Certificate;
|
||||
use TLSProxy::CertificateRequest;
|
||||
use TLSProxy::CertificateVerify;
|
||||
use TLSProxy::ServerKeyExchange;
|
||||
use TLSProxy::NewSessionTicket;
|
||||
|
||||
@@ -116,7 +116,8 @@ sub checkhandshake($$$$)
|
||||
&& $message->mt() != TLSProxy::Message::MT_SERVER_HELLO
|
||||
&& $message->mt() !=
|
||||
TLSProxy::Message::MT_ENCRYPTED_EXTENSIONS
|
||||
&& $message->mt() != TLSProxy::Message::MT_CERTIFICATE);
|
||||
&& $message->mt() != TLSProxy::Message::MT_CERTIFICATE
|
||||
&& $message->mt() != TLSProxy::Message::MT_CERTIFICATE_REQUEST);
|
||||
|
||||
next if $message->mt() == TLSProxy::Message::MT_CERTIFICATE
|
||||
&& !TLSProxy::Proxy::is_tls13();
|
||||
@@ -124,7 +125,7 @@ sub checkhandshake($$$$)
|
||||
my $extchnum = 1;
|
||||
my $extshnum = 1;
|
||||
for (my $extloop = 0;
|
||||
$extensions[$extloop][2] != 0;
|
||||
$extensions[$extloop][3] != 0;
|
||||
$extloop++) {
|
||||
$extchnum = 2 if $extensions[$extloop][0] != TLSProxy::Message::MT_CLIENT_HELLO
|
||||
&& TLSProxy::Proxy::is_tls13();
|
||||
@@ -135,6 +136,7 @@ sub checkhandshake($$$$)
|
||||
next if $extensions[$extloop][0] == TLSProxy::Message::MT_SERVER_HELLO
|
||||
&& $extshnum != $shnum;
|
||||
next if ($message->mt() != $extensions[$extloop][0]);
|
||||
next if ($message->server() != $extensions[$extloop][2]);
|
||||
$numtests++;
|
||||
}
|
||||
$numtests++;
|
||||
@@ -182,7 +184,8 @@ sub checkhandshake($$$$)
|
||||
&& $message->mt() != TLSProxy::Message::MT_SERVER_HELLO
|
||||
&& $message->mt() !=
|
||||
TLSProxy::Message::MT_ENCRYPTED_EXTENSIONS
|
||||
&& $message->mt() != TLSProxy::Message::MT_CERTIFICATE);
|
||||
&& $message->mt() != TLSProxy::Message::MT_CERTIFICATE
|
||||
&& $message->mt() != TLSProxy::Message::MT_CERTIFICATE_REQUEST);
|
||||
|
||||
next if $message->mt() == TLSProxy::Message::MT_CERTIFICATE
|
||||
&& !TLSProxy::Proxy::is_tls13();
|
||||
@@ -197,7 +200,7 @@ sub checkhandshake($$$$)
|
||||
my $msgexts = $message->extension_data();
|
||||
my $extchnum = 1;
|
||||
my $extshnum = 1;
|
||||
for (my $extloop = 0, $extcount = 0; $extensions[$extloop][2] != 0;
|
||||
for (my $extloop = 0, $extcount = 0; $extensions[$extloop][3] != 0;
|
||||
$extloop++) {
|
||||
#In TLSv1.3 we can have two ClientHellos if there has been a
|
||||
#HelloRetryRequest, and they may have different extensions. Skip
|
||||
@@ -211,12 +214,13 @@ sub checkhandshake($$$$)
|
||||
next if $extensions[$extloop][0] == TLSProxy::Message::MT_SERVER_HELLO
|
||||
&& $extshnum != $shnum;
|
||||
next if ($message->mt() != $extensions[$extloop][0]);
|
||||
ok (($extensions[$extloop][2] & $exttype) == 0
|
||||
next if ($message->server() != $extensions[$extloop][2]);
|
||||
ok (($extensions[$extloop][3] & $exttype) == 0
|
||||
|| defined ($msgexts->{$extensions[$extloop][1]}),
|
||||
"Extension presence check (Message: ".$message->mt()
|
||||
." Extension: ".($extensions[$extloop][2] & $exttype).", "
|
||||
." Extension: ".($extensions[$extloop][3] & $exttype).", "
|
||||
.$extloop.")");
|
||||
$extcount++ if (($extensions[$extloop][2] & $exttype) != 0);
|
||||
$extcount++ if (($extensions[$extloop][3] & $exttype) != 0);
|
||||
}
|
||||
ok($extcount == keys %$msgexts, "Extensions count mismatch ("
|
||||
.$extcount.", ".(keys %$msgexts)
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
# in the file LICENSE in the source distribution or at
|
||||
# https://www.openssl.org/source/license.html
|
||||
|
||||
package with_fallback;
|
||||
|
||||
sub import {
|
||||
shift;
|
||||
|
||||
use File::Basename;
|
||||
use File::Spec::Functions;
|
||||
foreach (@_) {
|
||||
eval "use $_";
|
||||
if ($@) {
|
||||
unshift @INC, catdir(dirname(__FILE__),
|
||||
"..", "..", "external", "perl");
|
||||
my $transfer = "transfer::$_";
|
||||
eval "use $transfer";
|
||||
shift @INC;
|
||||
warn $@ if $@;
|
||||
}
|
||||
}
|
||||
}
|
||||
1;
|
||||
+8
-4
@@ -24,6 +24,7 @@ CRYPTO_EX_new datatype
|
||||
DTLS_timer_cb datatype
|
||||
EVP_KDF datatype
|
||||
EVP_KDF_CTX datatype
|
||||
EVP_KEYMGMT datatype
|
||||
EVP_MAC datatype
|
||||
EVP_MAC_CTX datatype
|
||||
EVP_PKEY_gen_cb datatype
|
||||
@@ -194,12 +195,16 @@ ERR_GET_LIB define
|
||||
ERR_GET_REASON define
|
||||
ERR_PACK define
|
||||
ERR_free_strings define deprecated 1.1.0
|
||||
ERR_put_error define deprecated 3.0
|
||||
ERR_load_crypto_strings define deprecated 1.1.0
|
||||
ERR_raise define
|
||||
ERR_raise_data define
|
||||
EVP_DigestSignUpdate define
|
||||
EVP_DigestVerifyUpdate define
|
||||
EVP_KDF_name define
|
||||
EVP_MAC_name define
|
||||
EVP_MD_CTX_block_size define
|
||||
EVP_MD_CTX_name define
|
||||
EVP_MD_CTX_size define
|
||||
EVP_MD_CTX_type define
|
||||
EVP_OpenUpdate define
|
||||
@@ -289,8 +294,6 @@ EVP_get_digestbynid define
|
||||
EVP_get_digestbyobj define
|
||||
EVP_get_macbynid define
|
||||
EVP_get_macbyobj define
|
||||
EVP_get_kdfbynid define
|
||||
EVP_get_kdfbyobj define
|
||||
EVP_idea_cfb define
|
||||
EVP_rc2_cfb define
|
||||
EVP_rc5_32_12_16_cfb define
|
||||
@@ -311,8 +314,8 @@ OPENSSL_clear_realloc define
|
||||
OPENSSL_free define
|
||||
OPENSSL_malloc define
|
||||
OPENSSL_malloc_init define
|
||||
OPENSSL_mem_debug_pop define
|
||||
OPENSSL_mem_debug_push define
|
||||
OPENSSL_mem_debug_pop define deprecated 3.0.0
|
||||
OPENSSL_mem_debug_push define deprecated 3.0.0
|
||||
OPENSSL_memdup define
|
||||
OPENSSL_no_config define deprecated 1.1.0
|
||||
OPENSSL_realloc define
|
||||
@@ -445,6 +448,7 @@ SSL_get_secure_renegotiation_support define
|
||||
SSL_get_server_tmp_key define
|
||||
SSL_get_shared_curve define
|
||||
SSL_get_shared_group define
|
||||
SSL_get_negotiated_group define
|
||||
SSL_get_signature_nid define
|
||||
SSL_get_time define
|
||||
SSL_get_timeout define
|
||||
|
||||
Reference in New Issue
Block a user