Import OpenSSL 1.1.0f
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
perl util/perlpath.pl /usr/bin
|
||||
perl util/ssldir.pl /usr/local
|
||||
perl util/mk1mf.pl FreeBSD >Makefile.FreeBSD
|
||||
perl Configure FreeBSD
|
||||
242
util/TLSProxy/ClientHello.pm
Normal file
242
util/TLSProxy/ClientHello.pm
Normal file
@@ -0,0 +1,242 @@
|
||||
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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::ClientHello;
|
||||
|
||||
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,
|
||||
1,
|
||||
$data,
|
||||
$records,
|
||||
$startoffset,
|
||||
$message_frag_lens);
|
||||
|
||||
$self->{client_version} = 0;
|
||||
$self->{random} = [];
|
||||
$self->{session_id_len} = 0;
|
||||
$self->{session} = "";
|
||||
$self->{ciphersuite_len} = 0;
|
||||
$self->{ciphersuites} = [];
|
||||
$self->{comp_meth_len} = 0;
|
||||
$self->{comp_meths} = [];
|
||||
$self->{extensions_len} = 0;
|
||||
$self->{extension_data} = "";
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub parse
|
||||
{
|
||||
my $self = shift;
|
||||
my $ptr = 2;
|
||||
my ($client_version) = unpack('n', $self->data);
|
||||
my $random = substr($self->data, $ptr, 32);
|
||||
$ptr += 32;
|
||||
my $session_id_len = unpack('C', substr($self->data, $ptr));
|
||||
$ptr++;
|
||||
my $session = substr($self->data, $ptr, $session_id_len);
|
||||
$ptr += $session_id_len;
|
||||
my $ciphersuite_len = unpack('n', substr($self->data, $ptr));
|
||||
$ptr += 2;
|
||||
my @ciphersuites = unpack('n*', substr($self->data, $ptr,
|
||||
$ciphersuite_len));
|
||||
$ptr += $ciphersuite_len;
|
||||
my $comp_meth_len = unpack('C', substr($self->data, $ptr));
|
||||
$ptr++;
|
||||
my @comp_meths = unpack('C*', substr($self->data, $ptr, $comp_meth_len));
|
||||
$ptr += $comp_meth_len;
|
||||
my $extensions_len = unpack('n', substr($self->data, $ptr));
|
||||
$ptr += 2;
|
||||
#For now we just deal with this as a block of data. In the future we will
|
||||
#want to parse this
|
||||
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->client_version($client_version);
|
||||
$self->random($random);
|
||||
$self->session_id_len($session_id_len);
|
||||
$self->session($session);
|
||||
$self->ciphersuite_len($ciphersuite_len);
|
||||
$self->ciphersuites(\@ciphersuites);
|
||||
$self->comp_meth_len($comp_meth_len);
|
||||
$self->comp_meths(\@comp_meths);
|
||||
$self->extensions_len($extensions_len);
|
||||
$self->extension_data(\%extensions);
|
||||
|
||||
$self->process_extensions();
|
||||
|
||||
print " Client Version:".$client_version."\n";
|
||||
print " Session ID Len:".$session_id_len."\n";
|
||||
print " Ciphersuite len:".$ciphersuite_len."\n";
|
||||
print " Compression Method Len:".$comp_meth_len."\n";
|
||||
print " Extensions Len:".$extensions_len."\n";
|
||||
}
|
||||
|
||||
#Perform any actions necessary based on the extensions we've seen
|
||||
sub process_extensions
|
||||
{
|
||||
my $self = shift;
|
||||
my %extensions = %{$self->extension_data};
|
||||
|
||||
#Clear any state from a previous run
|
||||
TLSProxy::Record->etm(0);
|
||||
|
||||
if (exists $extensions{TLSProxy::Message::EXT_ENCRYPT_THEN_MAC}) {
|
||||
TLSProxy::Record->etm(1);
|
||||
}
|
||||
}
|
||||
|
||||
#Reconstruct the on-the-wire message data following changes
|
||||
sub set_message_contents
|
||||
{
|
||||
my $self = shift;
|
||||
my $data;
|
||||
my $extensions = "";
|
||||
|
||||
$data = pack('n', $self->client_version);
|
||||
$data .= $self->random;
|
||||
$data .= pack('C', $self->session_id_len);
|
||||
$data .= $self->session;
|
||||
$data .= pack('n', $self->ciphersuite_len);
|
||||
$data .= pack("n*", @{$self->ciphersuites});
|
||||
$data .= pack('C', $self->comp_meth_len);
|
||||
$data .= pack("C*", @{$self->comp_meths});
|
||||
|
||||
foreach my $key (keys %{$self->extension_data}) {
|
||||
my $extdata = ${$self->extension_data}{$key};
|
||||
$extensions .= pack("n", $key);
|
||||
$extensions .= pack("n", length($extdata));
|
||||
$extensions .= $extdata;
|
||||
if ($key == TLSProxy::Message::EXT_DUPLICATE_EXTENSION) {
|
||||
$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 client_version
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{client_version} = shift;
|
||||
}
|
||||
return $self->{client_version};
|
||||
}
|
||||
sub random
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{random} = shift;
|
||||
}
|
||||
return $self->{random};
|
||||
}
|
||||
sub session_id_len
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{session_id_len} = shift;
|
||||
}
|
||||
return $self->{session_id_len};
|
||||
}
|
||||
sub session
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{session} = shift;
|
||||
}
|
||||
return $self->{session};
|
||||
}
|
||||
sub ciphersuite_len
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{ciphersuite_len} = shift;
|
||||
}
|
||||
return $self->{ciphersuite_len};
|
||||
}
|
||||
sub ciphersuites
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{ciphersuites} = shift;
|
||||
}
|
||||
return $self->{ciphersuites};
|
||||
}
|
||||
sub comp_meth_len
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{comp_meth_len} = shift;
|
||||
}
|
||||
return $self->{comp_meth_len};
|
||||
}
|
||||
sub comp_meths
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{comp_meths} = shift;
|
||||
}
|
||||
return $self->{comp_meths};
|
||||
}
|
||||
sub extensions_len
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{extensions_len} = shift;
|
||||
}
|
||||
return $self->{extensions_len};
|
||||
}
|
||||
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;
|
||||
456
util/TLSProxy/Message.pm
Normal file
456
util/TLSProxy/Message.pm
Normal file
@@ -0,0 +1,456 @@
|
||||
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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::Message;
|
||||
|
||||
use constant TLS_MESSAGE_HEADER_LENGTH => 4;
|
||||
|
||||
#Message types
|
||||
use constant {
|
||||
MT_HELLO_REQUEST => 0,
|
||||
MT_CLIENT_HELLO => 1,
|
||||
MT_SERVER_HELLO => 2,
|
||||
MT_NEW_SESSION_TICKET => 4,
|
||||
MT_CERTIFICATE => 11,
|
||||
MT_SERVER_KEY_EXCHANGE => 12,
|
||||
MT_CERTIFICATE_REQUEST => 13,
|
||||
MT_SERVER_HELLO_DONE => 14,
|
||||
MT_CERTIFICATE_VERIFY => 15,
|
||||
MT_CLIENT_KEY_EXCHANGE => 16,
|
||||
MT_FINISHED => 20,
|
||||
MT_CERTIFICATE_STATUS => 22,
|
||||
MT_NEXT_PROTO => 67
|
||||
};
|
||||
|
||||
#Alert levels
|
||||
use constant {
|
||||
AL_LEVEL_WARN => 1,
|
||||
AL_LEVEL_FATAL => 2
|
||||
};
|
||||
|
||||
#Alert descriptions
|
||||
use constant {
|
||||
AL_DESC_CLOSE_NOTIFY => 0,
|
||||
AL_DESC_UNEXPECTED_MESSAGE => 10,
|
||||
AL_DESC_NO_RENEGOTIATION => 100
|
||||
};
|
||||
|
||||
my %message_type = (
|
||||
MT_HELLO_REQUEST, "HelloRequest",
|
||||
MT_CLIENT_HELLO, "ClientHello",
|
||||
MT_SERVER_HELLO, "ServerHello",
|
||||
MT_NEW_SESSION_TICKET, "NewSessionTicket",
|
||||
MT_CERTIFICATE, "Certificate",
|
||||
MT_SERVER_KEY_EXCHANGE, "ServerKeyExchange",
|
||||
MT_CERTIFICATE_REQUEST, "CertificateRequest",
|
||||
MT_SERVER_HELLO_DONE, "ServerHelloDone",
|
||||
MT_CERTIFICATE_VERIFY, "CertificateVerify",
|
||||
MT_CLIENT_KEY_EXCHANGE, "ClientKeyExchange",
|
||||
MT_FINISHED, "Finished",
|
||||
MT_CERTIFICATE_STATUS, "CertificateStatus",
|
||||
MT_NEXT_PROTO, "NextProto"
|
||||
);
|
||||
|
||||
use constant {
|
||||
EXT_STATUS_REQUEST => 5,
|
||||
EXT_ENCRYPT_THEN_MAC => 22,
|
||||
EXT_EXTENDED_MASTER_SECRET => 23,
|
||||
EXT_SESSION_TICKET => 35,
|
||||
# This extension does not exist and isn't recognised by OpenSSL.
|
||||
# We use it to test handling of duplicate extensions.
|
||||
EXT_DUPLICATE_EXTENSION => 1234
|
||||
};
|
||||
|
||||
my $payload = "";
|
||||
my $messlen = -1;
|
||||
my $mt;
|
||||
my $startoffset = -1;
|
||||
my $server = 0;
|
||||
my $success = 0;
|
||||
my $end = 0;
|
||||
my @message_rec_list = ();
|
||||
my @message_frag_lens = ();
|
||||
my $ciphersuite = 0;
|
||||
|
||||
sub clear
|
||||
{
|
||||
$payload = "";
|
||||
$messlen = -1;
|
||||
$startoffset = -1;
|
||||
$server = 0;
|
||||
$success = 0;
|
||||
$end = 0;
|
||||
@message_rec_list = ();
|
||||
@message_frag_lens = ();
|
||||
}
|
||||
|
||||
#Class method to extract messages from a record
|
||||
sub get_messages
|
||||
{
|
||||
my $class = shift;
|
||||
my $serverin = shift;
|
||||
my $record = shift;
|
||||
my @messages = ();
|
||||
my $message;
|
||||
|
||||
@message_frag_lens = ();
|
||||
|
||||
if ($serverin != $server && length($payload) != 0) {
|
||||
die "Changed peer, but we still have fragment data\n";
|
||||
}
|
||||
$server = $serverin;
|
||||
|
||||
if ($record->content_type == TLSProxy::Record::RT_CCS) {
|
||||
if ($payload ne "") {
|
||||
#We can't handle this yet
|
||||
die "CCS received before message data complete\n";
|
||||
}
|
||||
if ($server) {
|
||||
TLSProxy::Record->server_ccs_seen(1);
|
||||
} else {
|
||||
TLSProxy::Record->client_ccs_seen(1);
|
||||
}
|
||||
} elsif ($record->content_type == TLSProxy::Record::RT_HANDSHAKE) {
|
||||
if ($record->len == 0 || $record->len_real == 0) {
|
||||
print " Message truncated\n";
|
||||
} else {
|
||||
my $recoffset = 0;
|
||||
|
||||
if (length $payload > 0) {
|
||||
#We are continuing processing a message started in a previous
|
||||
#record. Add this record to the list associated with this
|
||||
#message
|
||||
push @message_rec_list, $record;
|
||||
|
||||
if ($messlen <= length($payload)) {
|
||||
#Shouldn't happen
|
||||
die "Internal error: invalid messlen: ".$messlen
|
||||
." payload length:".length($payload)."\n";
|
||||
}
|
||||
if (length($payload) + $record->decrypt_len >= $messlen) {
|
||||
#We can complete the message with this record
|
||||
$recoffset = $messlen - length($payload);
|
||||
$payload .= substr($record->decrypt_data, 0, $recoffset);
|
||||
push @message_frag_lens, $recoffset;
|
||||
$message = create_message($server, $mt, $payload,
|
||||
$startoffset);
|
||||
push @messages, $message;
|
||||
|
||||
$payload = "";
|
||||
} else {
|
||||
#This is just part of the total message
|
||||
$payload .= $record->decrypt_data;
|
||||
$recoffset = $record->decrypt_len;
|
||||
push @message_frag_lens, $record->decrypt_len;
|
||||
}
|
||||
print " Partial message data read: ".$recoffset." bytes\n";
|
||||
}
|
||||
|
||||
while ($record->decrypt_len > $recoffset) {
|
||||
#We are at the start of a new message
|
||||
if ($record->decrypt_len - $recoffset < 4) {
|
||||
#Whilst technically probably valid we can't cope with this
|
||||
die "End of record in the middle of a message header\n";
|
||||
}
|
||||
@message_rec_list = ($record);
|
||||
my $lenhi;
|
||||
my $lenlo;
|
||||
($mt, $lenhi, $lenlo) = unpack('CnC',
|
||||
substr($record->decrypt_data,
|
||||
$recoffset));
|
||||
$messlen = ($lenhi << 8) | $lenlo;
|
||||
print " Message type: $message_type{$mt}\n";
|
||||
print " Message Length: $messlen\n";
|
||||
$startoffset = $recoffset;
|
||||
$recoffset += 4;
|
||||
$payload = "";
|
||||
|
||||
if ($recoffset <= $record->decrypt_len) {
|
||||
#Some payload data is present in this record
|
||||
if ($record->decrypt_len - $recoffset >= $messlen) {
|
||||
#We can complete the message with this record
|
||||
$payload .= substr($record->decrypt_data, $recoffset,
|
||||
$messlen);
|
||||
$recoffset += $messlen;
|
||||
push @message_frag_lens, $messlen;
|
||||
$message = create_message($server, $mt, $payload,
|
||||
$startoffset);
|
||||
push @messages, $message;
|
||||
|
||||
$payload = "";
|
||||
} else {
|
||||
#This is just part of the total message
|
||||
$payload .= substr($record->decrypt_data, $recoffset,
|
||||
$record->decrypt_len - $recoffset);
|
||||
$recoffset = $record->decrypt_len;
|
||||
push @message_frag_lens, $recoffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} elsif ($record->content_type == TLSProxy::Record::RT_APPLICATION_DATA) {
|
||||
print " [ENCRYPTED APPLICATION DATA]\n";
|
||||
print " [".$record->decrypt_data."]\n";
|
||||
} elsif ($record->content_type == TLSProxy::Record::RT_ALERT) {
|
||||
my ($alertlev, $alertdesc) = unpack('CC', $record->decrypt_data);
|
||||
#A CloseNotify from the client indicates we have finished successfully
|
||||
#(we assume)
|
||||
if (!$end && !$server && $alertlev == AL_LEVEL_WARN
|
||||
&& $alertdesc == AL_DESC_CLOSE_NOTIFY) {
|
||||
$success = 1;
|
||||
}
|
||||
#All alerts end the test
|
||||
$end = 1;
|
||||
}
|
||||
|
||||
return @messages;
|
||||
}
|
||||
|
||||
#Function to work out which sub-class we need to create and then
|
||||
#construct it
|
||||
sub create_message
|
||||
{
|
||||
my ($server, $mt, $data, $startoffset) = @_;
|
||||
my $message;
|
||||
|
||||
#We only support ClientHello in this version...needs to be extended for
|
||||
#others
|
||||
if ($mt == MT_CLIENT_HELLO) {
|
||||
$message = TLSProxy::ClientHello->new(
|
||||
$server,
|
||||
$data,
|
||||
[@message_rec_list],
|
||||
$startoffset,
|
||||
[@message_frag_lens]
|
||||
);
|
||||
$message->parse();
|
||||
} elsif ($mt == MT_SERVER_HELLO) {
|
||||
$message = TLSProxy::ServerHello->new(
|
||||
$server,
|
||||
$data,
|
||||
[@message_rec_list],
|
||||
$startoffset,
|
||||
[@message_frag_lens]
|
||||
);
|
||||
$message->parse();
|
||||
} elsif ($mt == MT_SERVER_KEY_EXCHANGE) {
|
||||
$message = TLSProxy::ServerKeyExchange->new(
|
||||
$server,
|
||||
$data,
|
||||
[@message_rec_list],
|
||||
$startoffset,
|
||||
[@message_frag_lens]
|
||||
);
|
||||
$message->parse();
|
||||
} elsif ($mt == MT_NEW_SESSION_TICKET) {
|
||||
$message = TLSProxy::NewSessionTicket->new(
|
||||
$server,
|
||||
$data,
|
||||
[@message_rec_list],
|
||||
$startoffset,
|
||||
[@message_frag_lens]
|
||||
);
|
||||
$message->parse();
|
||||
} else {
|
||||
#Unknown message type
|
||||
$message = TLSProxy::Message->new(
|
||||
$server,
|
||||
$mt,
|
||||
$data,
|
||||
[@message_rec_list],
|
||||
$startoffset,
|
||||
[@message_frag_lens]
|
||||
);
|
||||
}
|
||||
|
||||
return $message;
|
||||
}
|
||||
|
||||
sub end
|
||||
{
|
||||
my $class = shift;
|
||||
return $end;
|
||||
}
|
||||
sub success
|
||||
{
|
||||
my $class = shift;
|
||||
return $success;
|
||||
}
|
||||
sub fail
|
||||
{
|
||||
my $class = shift;
|
||||
return !$success && $end;
|
||||
}
|
||||
sub new
|
||||
{
|
||||
my $class = shift;
|
||||
my ($server,
|
||||
$mt,
|
||||
$data,
|
||||
$records,
|
||||
$startoffset,
|
||||
$message_frag_lens) = @_;
|
||||
|
||||
my $self = {
|
||||
server => $server,
|
||||
data => $data,
|
||||
records => $records,
|
||||
mt => $mt,
|
||||
startoffset => $startoffset,
|
||||
message_frag_lens => $message_frag_lens
|
||||
};
|
||||
|
||||
return bless $self, $class;
|
||||
}
|
||||
|
||||
sub ciphersuite
|
||||
{
|
||||
my $class = shift;
|
||||
if (@_) {
|
||||
$ciphersuite = shift;
|
||||
}
|
||||
return $ciphersuite;
|
||||
}
|
||||
|
||||
#Update all the underlying records with the modified data from this message
|
||||
#Note: Does not currently support re-encrypting
|
||||
sub repack
|
||||
{
|
||||
my $self = shift;
|
||||
my $msgdata;
|
||||
|
||||
my $numrecs = $#{$self->records};
|
||||
|
||||
$self->set_message_contents();
|
||||
|
||||
my $lenhi;
|
||||
my $lenlo;
|
||||
|
||||
$lenlo = length($self->data) & 0xff;
|
||||
$lenhi = length($self->data) >> 8;
|
||||
$msgdata = pack('CnC', $self->mt, $lenhi, $lenlo).$self->data;
|
||||
|
||||
if ($numrecs == 0) {
|
||||
#The message is fully contained within one record
|
||||
my ($rec) = @{$self->records};
|
||||
my $recdata = $rec->decrypt_data;
|
||||
|
||||
my $old_length;
|
||||
|
||||
# We use empty message_frag_lens to indicates that pre-repacking,
|
||||
# the message wasn't present. The first fragment length doesn't include
|
||||
# the TLS header, so we need to check and compute the right length.
|
||||
if (@{$self->message_frag_lens}) {
|
||||
$old_length = ${$self->message_frag_lens}[0] +
|
||||
TLS_MESSAGE_HEADER_LENGTH;
|
||||
} else {
|
||||
$old_length = 0;
|
||||
}
|
||||
|
||||
my $prefix = substr($recdata, 0, $self->startoffset);
|
||||
my $suffix = substr($recdata, $self->startoffset + $old_length);
|
||||
|
||||
$rec->decrypt_data($prefix.($msgdata).($suffix));
|
||||
# TODO(openssl-team): don't keep explicit lengths.
|
||||
# (If a length override is ever needed to construct invalid packets,
|
||||
# use an explicit override field instead.)
|
||||
$rec->decrypt_len(length($rec->decrypt_data));
|
||||
$rec->len($rec->len + length($msgdata) - $old_length);
|
||||
# Don't support re-encryption.
|
||||
$rec->data($rec->decrypt_data);
|
||||
|
||||
#Update the fragment len in case we changed it above
|
||||
${$self->message_frag_lens}[0] = length($msgdata)
|
||||
- TLS_MESSAGE_HEADER_LENGTH;
|
||||
return;
|
||||
}
|
||||
|
||||
#Note we don't currently support changing a fragmented message length
|
||||
my $recctr = 0;
|
||||
my $datadone = 0;
|
||||
foreach my $rec (@{$self->records}) {
|
||||
my $recdata = $rec->decrypt_data;
|
||||
if ($recctr == 0) {
|
||||
#This is the first record
|
||||
my $remainlen = length($recdata) - $self->startoffset;
|
||||
$rec->data(substr($recdata, 0, $self->startoffset)
|
||||
.substr(($msgdata), 0, $remainlen));
|
||||
$datadone += $remainlen;
|
||||
} elsif ($recctr + 1 == $numrecs) {
|
||||
#This is the last record
|
||||
$rec->data(substr($msgdata, $datadone));
|
||||
} else {
|
||||
#This is a middle record
|
||||
$rec->data(substr($msgdata, $datadone, length($rec->data)));
|
||||
$datadone += length($rec->data);
|
||||
}
|
||||
$recctr++;
|
||||
}
|
||||
}
|
||||
|
||||
#To be overridden by sub-classes
|
||||
sub set_message_contents
|
||||
{
|
||||
}
|
||||
|
||||
#Read only accessors
|
||||
sub server
|
||||
{
|
||||
my $self = shift;
|
||||
return $self->{server};
|
||||
}
|
||||
|
||||
#Read/write accessors
|
||||
sub mt
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{mt} = shift;
|
||||
}
|
||||
return $self->{mt};
|
||||
}
|
||||
sub data
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{data} = shift;
|
||||
}
|
||||
return $self->{data};
|
||||
}
|
||||
sub records
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{records} = shift;
|
||||
}
|
||||
return $self->{records};
|
||||
}
|
||||
sub startoffset
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{startoffset} = shift;
|
||||
}
|
||||
return $self->{startoffset};
|
||||
}
|
||||
sub message_frag_lens
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{message_frag_lens} = shift;
|
||||
}
|
||||
return $self->{message_frag_lens};
|
||||
}
|
||||
sub encoded_length
|
||||
{
|
||||
my $self = shift;
|
||||
return TLS_MESSAGE_HEADER_LENGTH + length($self->data);
|
||||
}
|
||||
|
||||
1;
|
||||
81
util/TLSProxy/NewSessionTicket.pm
Normal file
81
util/TLSProxy/NewSessionTicket.pm
Normal file
@@ -0,0 +1,81 @@
|
||||
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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::NewSessionTicket;
|
||||
|
||||
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_NEW_SESSION_TICKET,
|
||||
$data,
|
||||
$records,
|
||||
$startoffset,
|
||||
$message_frag_lens);
|
||||
|
||||
$self->{ticket_lifetime_hint} = 0;
|
||||
$self->{ticket} = "";
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub parse
|
||||
{
|
||||
my $self = shift;
|
||||
|
||||
my $ticket_lifetime_hint = unpack('N', $self->data);
|
||||
my $ticket_len = unpack('n', $self->data);
|
||||
my $ticket = substr($self->data, 6, $ticket_len);
|
||||
|
||||
$self->ticket_lifetime_hint($ticket_lifetime_hint);
|
||||
$self->ticket($ticket);
|
||||
}
|
||||
|
||||
|
||||
#Reconstruct the on-the-wire message data following changes
|
||||
sub set_message_contents
|
||||
{
|
||||
my $self = shift;
|
||||
my $data;
|
||||
|
||||
$data = pack('N', $self->ticket_lifetime_hint);
|
||||
$data .= pack('n', length($self->ticket));
|
||||
$data .= $self->ticket;
|
||||
|
||||
$self->data($data);
|
||||
}
|
||||
|
||||
#Read/write accessors
|
||||
sub ticket_lifetime_hint
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{ticket_lifetime_hint} = shift;
|
||||
}
|
||||
return $self->{ticket_lifetime_hint};
|
||||
}
|
||||
sub ticket
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{ticket} = shift;
|
||||
}
|
||||
return $self->{ticket};
|
||||
}
|
||||
1;
|
||||
531
util/TLSProxy/Proxy.pm
Normal file
531
util/TLSProxy/Proxy.pm
Normal file
@@ -0,0 +1,531 @@
|
||||
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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;
|
||||
use POSIX ":sys_wait_h";
|
||||
|
||||
package TLSProxy::Proxy;
|
||||
|
||||
use File::Spec;
|
||||
use IO::Socket;
|
||||
use IO::Select;
|
||||
use TLSProxy::Record;
|
||||
use TLSProxy::Message;
|
||||
use TLSProxy::ClientHello;
|
||||
use TLSProxy::ServerHello;
|
||||
use TLSProxy::ServerKeyExchange;
|
||||
use TLSProxy::NewSessionTicket;
|
||||
|
||||
my $have_IPv6 = 0;
|
||||
my $IP_factory;
|
||||
|
||||
sub new
|
||||
{
|
||||
my $class = shift;
|
||||
my ($filter,
|
||||
$execute,
|
||||
$cert,
|
||||
$debug) = @_;
|
||||
|
||||
my $self = {
|
||||
#Public read/write
|
||||
proxy_addr => "localhost",
|
||||
proxy_port => 4453,
|
||||
server_addr => "localhost",
|
||||
server_port => 4443,
|
||||
filter => $filter,
|
||||
serverflags => "",
|
||||
clientflags => "",
|
||||
serverconnects => 1,
|
||||
serverpid => 0,
|
||||
reneg => 0,
|
||||
|
||||
#Public read
|
||||
execute => $execute,
|
||||
cert => $cert,
|
||||
debug => $debug,
|
||||
cipherc => "",
|
||||
ciphers => "AES128-SHA",
|
||||
flight => 0,
|
||||
record_list => [],
|
||||
message_list => [],
|
||||
};
|
||||
|
||||
# IO::Socket::IP is on the core module list, IO::Socket::INET6 isn't.
|
||||
# However, IO::Socket::INET6 is older and is said to be more widely
|
||||
# deployed for the moment, and may have less bugs, so we try the latter
|
||||
# first, then fall back on the code modules. Worst case scenario, we
|
||||
# fall back to IO::Socket::INET, only supports IPv4.
|
||||
eval {
|
||||
require IO::Socket::INET6;
|
||||
my $s = IO::Socket::INET6->new(
|
||||
LocalAddr => "::1",
|
||||
LocalPort => 0,
|
||||
Listen=>1,
|
||||
);
|
||||
$s or die "\n";
|
||||
$s->close();
|
||||
};
|
||||
if ($@ eq "") {
|
||||
$IP_factory = sub { IO::Socket::INET6->new(@_); };
|
||||
$have_IPv6 = 1;
|
||||
} else {
|
||||
eval {
|
||||
require IO::Socket::IP;
|
||||
my $s = IO::Socket::IP->new(
|
||||
LocalAddr => "::1",
|
||||
LocalPort => 0,
|
||||
Listen=>1,
|
||||
);
|
||||
$s or die "\n";
|
||||
$s->close();
|
||||
};
|
||||
if ($@ eq "") {
|
||||
$IP_factory = sub { IO::Socket::IP->new(@_); };
|
||||
$have_IPv6 = 1;
|
||||
} else {
|
||||
$IP_factory = sub { IO::Socket::INET->new(@_); };
|
||||
}
|
||||
}
|
||||
|
||||
return bless $self, $class;
|
||||
}
|
||||
|
||||
sub clearClient
|
||||
{
|
||||
my $self = shift;
|
||||
|
||||
$self->{cipherc} = "";
|
||||
$self->{flight} = 0;
|
||||
$self->{record_list} = [];
|
||||
$self->{message_list} = [];
|
||||
$self->{clientflags} = "";
|
||||
|
||||
TLSProxy::Message->clear();
|
||||
TLSProxy::Record->clear();
|
||||
}
|
||||
|
||||
sub clear
|
||||
{
|
||||
my $self = shift;
|
||||
|
||||
$self->clearClient;
|
||||
$self->{ciphers} = "AES128-SHA";
|
||||
$self->{serverflags} = "";
|
||||
$self->{serverconnects} = 1;
|
||||
$self->{serverpid} = 0;
|
||||
$self->{reneg} = 0;
|
||||
}
|
||||
|
||||
sub restart
|
||||
{
|
||||
my $self = shift;
|
||||
|
||||
$self->clear;
|
||||
$self->start;
|
||||
}
|
||||
|
||||
sub clientrestart
|
||||
{
|
||||
my $self = shift;
|
||||
|
||||
$self->clear;
|
||||
$self->clientstart;
|
||||
}
|
||||
|
||||
sub start
|
||||
{
|
||||
my ($self) = shift;
|
||||
my $pid;
|
||||
|
||||
$pid = fork();
|
||||
if ($pid == 0) {
|
||||
if (!$self->debug) {
|
||||
open(STDOUT, ">", File::Spec->devnull())
|
||||
or die "Failed to redirect stdout: $!";
|
||||
open(STDERR, ">&STDOUT");
|
||||
}
|
||||
my $execcmd = $self->execute
|
||||
." s_server -no_comp -rev -engine ossltest -accept "
|
||||
.($self->server_port)
|
||||
." -cert ".$self->cert." -naccept ".$self->serverconnects;
|
||||
if ($self->ciphers ne "") {
|
||||
$execcmd .= " -cipher ".$self->ciphers;
|
||||
}
|
||||
if ($self->serverflags ne "") {
|
||||
$execcmd .= " ".$self->serverflags;
|
||||
}
|
||||
if ($self->debug) {
|
||||
print STDERR "Server command: $execcmd\n";
|
||||
}
|
||||
exec($execcmd);
|
||||
}
|
||||
$self->serverpid($pid);
|
||||
|
||||
return $self->clientstart;
|
||||
}
|
||||
|
||||
sub clientstart
|
||||
{
|
||||
my ($self) = shift;
|
||||
my $oldstdout;
|
||||
|
||||
if(!$self->debug) {
|
||||
open DEVNULL, ">", File::Spec->devnull();
|
||||
$oldstdout = select(DEVNULL);
|
||||
}
|
||||
|
||||
# Create the Proxy socket
|
||||
my $proxaddr = $self->proxy_addr;
|
||||
$proxaddr =~ s/[\[\]]//g; # Remove [ and ]
|
||||
my $proxy_sock = $IP_factory->(
|
||||
LocalHost => $proxaddr,
|
||||
LocalPort => $self->proxy_port,
|
||||
Proto => "tcp",
|
||||
Listen => SOMAXCONN,
|
||||
ReuseAddr => 1
|
||||
);
|
||||
|
||||
if ($proxy_sock) {
|
||||
print "Proxy started on port ".$self->proxy_port."\n";
|
||||
} else {
|
||||
warn "Failed creating proxy socket (".$proxaddr.",".$self->proxy_port."): $!\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ($self->execute) {
|
||||
my $pid = fork();
|
||||
if ($pid == 0) {
|
||||
if (!$self->debug) {
|
||||
open(STDOUT, ">", File::Spec->devnull())
|
||||
or die "Failed to redirect stdout: $!";
|
||||
open(STDERR, ">&STDOUT");
|
||||
}
|
||||
my $echostr;
|
||||
if ($self->reneg()) {
|
||||
$echostr = "R";
|
||||
} else {
|
||||
$echostr = "test";
|
||||
}
|
||||
my $execcmd = "echo ".$echostr." | ".$self->execute
|
||||
." s_client -engine ossltest -connect "
|
||||
.($self->proxy_addr).":".($self->proxy_port);
|
||||
if ($self->cipherc ne "") {
|
||||
$execcmd .= " -cipher ".$self->cipherc;
|
||||
}
|
||||
if ($self->clientflags ne "") {
|
||||
$execcmd .= " ".$self->clientflags;
|
||||
}
|
||||
if ($self->debug) {
|
||||
print STDERR "Client command: $execcmd\n";
|
||||
}
|
||||
exec($execcmd);
|
||||
}
|
||||
}
|
||||
|
||||
# Wait for incoming connection from client
|
||||
my $client_sock;
|
||||
if(!($client_sock = $proxy_sock->accept())) {
|
||||
warn "Failed accepting incoming connection: $!\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
print "Connection opened\n";
|
||||
|
||||
# Now connect to the server
|
||||
my $retry = 3;
|
||||
my $server_sock;
|
||||
#We loop over this a few times because sometimes s_server can take a while
|
||||
#to start up
|
||||
do {
|
||||
my $servaddr = $self->server_addr;
|
||||
$servaddr =~ s/[\[\]]//g; # Remove [ and ]
|
||||
eval {
|
||||
$server_sock = $IP_factory->(
|
||||
PeerAddr => $servaddr,
|
||||
PeerPort => $self->server_port,
|
||||
MultiHomed => 1,
|
||||
Proto => 'tcp'
|
||||
);
|
||||
};
|
||||
|
||||
$retry--;
|
||||
#Some buggy IP factories can return a defined server_sock that hasn't
|
||||
#actually connected, so we check peerport too
|
||||
if ($@ || !defined($server_sock) || !defined($server_sock->peerport)) {
|
||||
$server_sock->close() if defined($server_sock);
|
||||
undef $server_sock;
|
||||
if ($retry) {
|
||||
#Sleep for a short while
|
||||
select(undef, undef, undef, 0.1);
|
||||
} else {
|
||||
warn "Failed to start up server (".$servaddr.",".$self->server_port."): $!\n";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
} while (!$server_sock);
|
||||
|
||||
my $sel = IO::Select->new($server_sock, $client_sock);
|
||||
my $indata;
|
||||
my @handles = ($server_sock, $client_sock);
|
||||
|
||||
#Wait for either the server socket or the client socket to become readable
|
||||
my @ready;
|
||||
while(!(TLSProxy::Message->end) && (@ready = $sel->can_read)) {
|
||||
foreach my $hand (@ready) {
|
||||
if ($hand == $server_sock) {
|
||||
$server_sock->sysread($indata, 16384) or goto END;
|
||||
$indata = $self->process_packet(1, $indata);
|
||||
$client_sock->syswrite($indata);
|
||||
} elsif ($hand == $client_sock) {
|
||||
$client_sock->sysread($indata, 16384) or goto END;
|
||||
$indata = $self->process_packet(0, $indata);
|
||||
$server_sock->syswrite($indata);
|
||||
} else {
|
||||
print "Err\n";
|
||||
goto END;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
END:
|
||||
print "Connection closed\n";
|
||||
if($server_sock) {
|
||||
$server_sock->close();
|
||||
}
|
||||
if($client_sock) {
|
||||
#Closing this also kills the child process
|
||||
$client_sock->close();
|
||||
}
|
||||
if($proxy_sock) {
|
||||
$proxy_sock->close();
|
||||
}
|
||||
if(!$self->debug) {
|
||||
select($oldstdout);
|
||||
}
|
||||
$self->serverconnects($self->serverconnects - 1);
|
||||
if ($self->serverconnects == 0) {
|
||||
die "serverpid is zero\n" if $self->serverpid == 0;
|
||||
print "Waiting for server process to close: "
|
||||
.$self->serverpid."\n";
|
||||
waitpid( $self->serverpid, 0);
|
||||
die "exit code $? from server process\n" if $? != 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub process_packet
|
||||
{
|
||||
my ($self, $server, $packet) = @_;
|
||||
my $len_real;
|
||||
my $decrypt_len;
|
||||
my $data;
|
||||
my $recnum;
|
||||
|
||||
if ($server) {
|
||||
print "Received server packet\n";
|
||||
} else {
|
||||
print "Received client packet\n";
|
||||
}
|
||||
|
||||
print "Packet length = ".length($packet)."\n";
|
||||
print "Processing flight ".$self->flight."\n";
|
||||
|
||||
#Return contains the list of record found in the packet followed by the
|
||||
#list of messages in those records
|
||||
my @ret = TLSProxy::Record->get_records($server, $self->flight, $packet);
|
||||
push @{$self->record_list}, @{$ret[0]};
|
||||
push @{$self->{message_list}}, @{$ret[1]};
|
||||
|
||||
print "\n";
|
||||
|
||||
#Finished parsing. Call user provided filter here
|
||||
if(defined $self->filter) {
|
||||
$self->filter->($self);
|
||||
}
|
||||
|
||||
#Reconstruct the packet
|
||||
$packet = "";
|
||||
foreach my $record (@{$self->record_list}) {
|
||||
#We only replay the records for the current flight
|
||||
if ($record->flight != $self->flight) {
|
||||
next;
|
||||
}
|
||||
$packet .= $record->reconstruct_record();
|
||||
}
|
||||
|
||||
$self->{flight} = $self->{flight} + 1;
|
||||
|
||||
print "Forwarded packet length = ".length($packet)."\n\n";
|
||||
|
||||
return $packet;
|
||||
}
|
||||
|
||||
#Read accessors
|
||||
sub execute
|
||||
{
|
||||
my $self = shift;
|
||||
return $self->{execute};
|
||||
}
|
||||
sub cert
|
||||
{
|
||||
my $self = shift;
|
||||
return $self->{cert};
|
||||
}
|
||||
sub debug
|
||||
{
|
||||
my $self = shift;
|
||||
return $self->{debug};
|
||||
}
|
||||
sub flight
|
||||
{
|
||||
my $self = shift;
|
||||
return $self->{flight};
|
||||
}
|
||||
sub record_list
|
||||
{
|
||||
my $self = shift;
|
||||
return $self->{record_list};
|
||||
}
|
||||
sub success
|
||||
{
|
||||
my $self = shift;
|
||||
return $self->{success};
|
||||
}
|
||||
sub end
|
||||
{
|
||||
my $self = shift;
|
||||
return $self->{end};
|
||||
}
|
||||
sub supports_IPv6
|
||||
{
|
||||
my $self = shift;
|
||||
return $have_IPv6;
|
||||
}
|
||||
|
||||
#Read/write accessors
|
||||
sub proxy_addr
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{proxy_addr} = shift;
|
||||
}
|
||||
return $self->{proxy_addr};
|
||||
}
|
||||
sub proxy_port
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{proxy_port} = shift;
|
||||
}
|
||||
return $self->{proxy_port};
|
||||
}
|
||||
sub server_addr
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{server_addr} = shift;
|
||||
}
|
||||
return $self->{server_addr};
|
||||
}
|
||||
sub server_port
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{server_port} = shift;
|
||||
}
|
||||
return $self->{server_port};
|
||||
}
|
||||
sub filter
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{filter} = shift;
|
||||
}
|
||||
return $self->{filter};
|
||||
}
|
||||
sub cipherc
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{cipherc} = shift;
|
||||
}
|
||||
return $self->{cipherc};
|
||||
}
|
||||
sub ciphers
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{ciphers} = shift;
|
||||
}
|
||||
return $self->{ciphers};
|
||||
}
|
||||
sub serverflags
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{serverflags} = shift;
|
||||
}
|
||||
return $self->{serverflags};
|
||||
}
|
||||
sub clientflags
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{clientflags} = shift;
|
||||
}
|
||||
return $self->{clientflags};
|
||||
}
|
||||
sub serverconnects
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{serverconnects} = shift;
|
||||
}
|
||||
return $self->{serverconnects};
|
||||
}
|
||||
# This is a bit ugly because the caller is responsible for keeping the records
|
||||
# in sync with the updated message list; simply updating the message list isn't
|
||||
# sufficient to get the proxy to forward the new message.
|
||||
# But it does the trick for the one test (test_sslsessiontick) that needs it.
|
||||
sub message_list
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{message_list} = shift;
|
||||
}
|
||||
return $self->{message_list};
|
||||
}
|
||||
sub serverpid
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{serverpid} = shift;
|
||||
}
|
||||
return $self->{serverpid};
|
||||
}
|
||||
|
||||
sub fill_known_data
|
||||
{
|
||||
my $length = shift;
|
||||
my $ret = "";
|
||||
for (my $i = 0; $i < $length; $i++) {
|
||||
$ret .= chr($i);
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
sub reneg
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{reneg} = shift;
|
||||
}
|
||||
return $self->{reneg};
|
||||
}
|
||||
|
||||
1;
|
||||
330
util/TLSProxy/Record.pm
Normal file
330
util/TLSProxy/Record.pm
Normal file
@@ -0,0 +1,330 @@
|
||||
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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;
|
||||
|
||||
use TLSProxy::Proxy;
|
||||
|
||||
package TLSProxy::Record;
|
||||
|
||||
my $server_ccs_seen = 0;
|
||||
my $client_ccs_seen = 0;
|
||||
my $etm = 0;
|
||||
|
||||
use constant TLS_RECORD_HEADER_LENGTH => 5;
|
||||
|
||||
#Record types
|
||||
use constant {
|
||||
RT_APPLICATION_DATA => 23,
|
||||
RT_HANDSHAKE => 22,
|
||||
RT_ALERT => 21,
|
||||
RT_CCS => 20,
|
||||
RT_UNKNOWN => 100
|
||||
};
|
||||
|
||||
my %record_type = (
|
||||
RT_APPLICATION_DATA, "APPLICATION DATA",
|
||||
RT_HANDSHAKE, "HANDSHAKE",
|
||||
RT_ALERT, "ALERT",
|
||||
RT_CCS, "CCS",
|
||||
RT_UNKNOWN, "UNKNOWN"
|
||||
);
|
||||
|
||||
use constant {
|
||||
VERS_TLS_1_3 => 772,
|
||||
VERS_TLS_1_2 => 771,
|
||||
VERS_TLS_1_1 => 770,
|
||||
VERS_TLS_1_0 => 769,
|
||||
VERS_SSL_3_0 => 768,
|
||||
VERS_SSL_LT_3_0 => 767
|
||||
};
|
||||
|
||||
my %tls_version = (
|
||||
VERS_TLS_1_3, "TLS1.3",
|
||||
VERS_TLS_1_2, "TLS1.2",
|
||||
VERS_TLS_1_1, "TLS1.1",
|
||||
VERS_TLS_1_0, "TLS1.0",
|
||||
VERS_SSL_3_0, "SSL3",
|
||||
VERS_SSL_LT_3_0, "SSL<3"
|
||||
);
|
||||
|
||||
#Class method to extract records from a packet of data
|
||||
sub get_records
|
||||
{
|
||||
my $class = shift;
|
||||
my $server = shift;
|
||||
my $flight = shift;
|
||||
my $packet = shift;
|
||||
my @record_list = ();
|
||||
my @message_list = ();
|
||||
my $data;
|
||||
my $content_type;
|
||||
my $version;
|
||||
my $len;
|
||||
my $len_real;
|
||||
my $decrypt_len;
|
||||
|
||||
my $recnum = 1;
|
||||
while (length ($packet) > 0) {
|
||||
print " Record $recnum";
|
||||
if ($server) {
|
||||
print " (server -> client)\n";
|
||||
} else {
|
||||
print " (client -> server)\n";
|
||||
}
|
||||
#Get the record header
|
||||
if (length($packet) < TLS_RECORD_HEADER_LENGTH) {
|
||||
print "Partial data : ".length($packet)." bytes\n";
|
||||
$packet = "";
|
||||
} else {
|
||||
($content_type, $version, $len) = unpack('CnnC*', $packet);
|
||||
$data = substr($packet, 5, $len);
|
||||
|
||||
print " Content type: ".$record_type{$content_type}."\n";
|
||||
print " Version: $tls_version{$version}\n";
|
||||
print " Length: $len";
|
||||
if ($len == length($data)) {
|
||||
print "\n";
|
||||
$decrypt_len = $len_real = $len;
|
||||
} else {
|
||||
print " (expected), ".length($data)." (actual)\n";
|
||||
$decrypt_len = $len_real = length($data);
|
||||
}
|
||||
|
||||
my $record = TLSProxy::Record->new(
|
||||
$flight,
|
||||
$content_type,
|
||||
$version,
|
||||
$len,
|
||||
0,
|
||||
$len_real,
|
||||
$decrypt_len,
|
||||
substr($packet, TLS_RECORD_HEADER_LENGTH, $len_real),
|
||||
substr($packet, TLS_RECORD_HEADER_LENGTH, $len_real)
|
||||
);
|
||||
|
||||
if (($server && $server_ccs_seen)
|
||||
|| (!$server && $client_ccs_seen)) {
|
||||
if ($etm) {
|
||||
$record->decryptETM();
|
||||
} else {
|
||||
$record->decrypt();
|
||||
}
|
||||
}
|
||||
|
||||
push @record_list, $record;
|
||||
|
||||
#Now figure out what messages are contained within this record
|
||||
my @messages = TLSProxy::Message->get_messages($server, $record);
|
||||
push @message_list, @messages;
|
||||
|
||||
$packet = substr($packet, TLS_RECORD_HEADER_LENGTH + $len_real);
|
||||
$recnum++;
|
||||
}
|
||||
}
|
||||
|
||||
return (\@record_list, \@message_list);
|
||||
}
|
||||
|
||||
sub clear
|
||||
{
|
||||
$server_ccs_seen = 0;
|
||||
$client_ccs_seen = 0;
|
||||
}
|
||||
|
||||
#Class level accessors
|
||||
sub server_ccs_seen
|
||||
{
|
||||
my $class = shift;
|
||||
if (@_) {
|
||||
$server_ccs_seen = shift;
|
||||
}
|
||||
return $server_ccs_seen;
|
||||
}
|
||||
sub client_ccs_seen
|
||||
{
|
||||
my $class = shift;
|
||||
if (@_) {
|
||||
$client_ccs_seen = shift;
|
||||
}
|
||||
return $client_ccs_seen;
|
||||
}
|
||||
#Enable/Disable Encrypt-then-MAC
|
||||
sub etm
|
||||
{
|
||||
my $class = shift;
|
||||
if (@_) {
|
||||
$etm = shift;
|
||||
}
|
||||
return $etm;
|
||||
}
|
||||
|
||||
sub new
|
||||
{
|
||||
my $class = shift;
|
||||
my ($flight,
|
||||
$content_type,
|
||||
$version,
|
||||
$len,
|
||||
$sslv2,
|
||||
$len_real,
|
||||
$decrypt_len,
|
||||
$data,
|
||||
$decrypt_data) = @_;
|
||||
|
||||
my $self = {
|
||||
flight => $flight,
|
||||
content_type => $content_type,
|
||||
version => $version,
|
||||
len => $len,
|
||||
sslv2 => $sslv2,
|
||||
len_real => $len_real,
|
||||
decrypt_len => $decrypt_len,
|
||||
data => $data,
|
||||
decrypt_data => $decrypt_data,
|
||||
orig_decrypt_data => $decrypt_data
|
||||
};
|
||||
|
||||
return bless $self, $class;
|
||||
}
|
||||
|
||||
#Decrypt using encrypt-then-MAC
|
||||
sub decryptETM
|
||||
{
|
||||
my ($self) = shift;
|
||||
|
||||
my $data = $self->data;
|
||||
|
||||
if($self->version >= VERS_TLS_1_1()) {
|
||||
#TLS1.1+ has an explicit IV. Throw it away
|
||||
$data = substr($data, 16);
|
||||
}
|
||||
|
||||
#Throw away the MAC (assumes MAC is 20 bytes for now. FIXME)
|
||||
$data = substr($data, 0, length($data) - 20);
|
||||
|
||||
#Find out what the padding byte is
|
||||
my $padval = unpack("C", substr($data, length($data) - 1));
|
||||
|
||||
#Throw away the padding
|
||||
$data = substr($data, 0, length($data) - ($padval + 1));
|
||||
|
||||
$self->decrypt_data($data);
|
||||
$self->decrypt_len(length($data));
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
#Standard decrypt
|
||||
sub decrypt()
|
||||
{
|
||||
my ($self) = shift;
|
||||
|
||||
my $data = $self->data;
|
||||
|
||||
if($self->version >= VERS_TLS_1_1()) {
|
||||
#TLS1.1+ has an explicit IV. Throw it away
|
||||
$data = substr($data, 16);
|
||||
}
|
||||
|
||||
#Find out what the padding byte is
|
||||
my $padval = unpack("C", substr($data, length($data) - 1));
|
||||
|
||||
#Throw away the padding
|
||||
$data = substr($data, 0, length($data) - ($padval + 1));
|
||||
|
||||
#Throw away the MAC (assumes MAC is 20 bytes for now. FIXME)
|
||||
$data = substr($data, 0, length($data) - 20);
|
||||
|
||||
$self->decrypt_data($data);
|
||||
$self->decrypt_len(length($data));
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
#Reconstruct the on-the-wire record representation
|
||||
sub reconstruct_record
|
||||
{
|
||||
my $self = shift;
|
||||
my $data;
|
||||
|
||||
if ($self->sslv2) {
|
||||
$data = pack('n', $self->len | 0x8000);
|
||||
} else {
|
||||
$data = pack('Cnn', $self->content_type, $self->version, $self->len);
|
||||
}
|
||||
$data .= $self->data;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
#Read only accessors
|
||||
sub flight
|
||||
{
|
||||
my $self = shift;
|
||||
return $self->{flight};
|
||||
}
|
||||
sub content_type
|
||||
{
|
||||
my $self = shift;
|
||||
return $self->{content_type};
|
||||
}
|
||||
sub version
|
||||
{
|
||||
my $self = shift;
|
||||
return $self->{version};
|
||||
}
|
||||
sub sslv2
|
||||
{
|
||||
my $self = shift;
|
||||
return $self->{sslv2};
|
||||
}
|
||||
sub len_real
|
||||
{
|
||||
my $self = shift;
|
||||
return $self->{len_real};
|
||||
}
|
||||
sub orig_decrypt_data
|
||||
{
|
||||
my $self = shift;
|
||||
return $self->{orig_decrypt_data};
|
||||
}
|
||||
|
||||
#Read/write accessors
|
||||
sub decrypt_len
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{decrypt_len} = shift;
|
||||
}
|
||||
return $self->{decrypt_len};
|
||||
}
|
||||
sub data
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{data} = shift;
|
||||
}
|
||||
return $self->{data};
|
||||
}
|
||||
sub decrypt_data
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{decrypt_data} = shift;
|
||||
}
|
||||
return $self->{decrypt_data};
|
||||
}
|
||||
sub len
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{len} = shift;
|
||||
}
|
||||
return $self->{len};
|
||||
}
|
||||
1;
|
||||
210
util/TLSProxy/ServerHello.pm
Normal file
210
util/TLSProxy/ServerHello.pm
Normal file
@@ -0,0 +1,210 @@
|
||||
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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::ServerHello;
|
||||
|
||||
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_SERVER_HELLO,
|
||||
$data,
|
||||
$records,
|
||||
$startoffset,
|
||||
$message_frag_lens);
|
||||
|
||||
$self->{server_version} = 0;
|
||||
$self->{random} = [];
|
||||
$self->{session_id_len} = 0;
|
||||
$self->{session} = "";
|
||||
$self->{ciphersuite} = 0;
|
||||
$self->{comp_meth} = 0;
|
||||
$self->{extension_data} = "";
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub parse
|
||||
{
|
||||
my $self = shift;
|
||||
my $ptr = 2;
|
||||
my ($server_version) = unpack('n', $self->data);
|
||||
my $random = substr($self->data, $ptr, 32);
|
||||
$ptr += 32;
|
||||
my $session_id_len = unpack('C', substr($self->data, $ptr));
|
||||
$ptr++;
|
||||
my $session = substr($self->data, $ptr, $session_id_len);
|
||||
$ptr += $session_id_len;
|
||||
my $ciphersuite = unpack('n', substr($self->data, $ptr));
|
||||
$ptr += 2;
|
||||
my $comp_meth = unpack('C', substr($self->data, $ptr));
|
||||
$ptr++;
|
||||
my $extensions_len = unpack('n', substr($self->data, $ptr));
|
||||
if (!defined $extensions_len) {
|
||||
$extensions_len = 0;
|
||||
} else {
|
||||
$ptr += 2;
|
||||
}
|
||||
#For now we just deal with this as a block of data. In the future we will
|
||||
#want to parse this
|
||||
my $extension_data;
|
||||
if ($extensions_len != 0) {
|
||||
$extension_data = substr($self->data, $ptr);
|
||||
|
||||
if (length($extension_data) != $extensions_len) {
|
||||
die "Invalid extension length\n";
|
||||
}
|
||||
} else {
|
||||
if (length($self->data) != $ptr) {
|
||||
die "Invalid extension length\n";
|
||||
}
|
||||
$extension_data = "";
|
||||
}
|
||||
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->server_version($server_version);
|
||||
$self->random($random);
|
||||
$self->session_id_len($session_id_len);
|
||||
$self->session($session);
|
||||
$self->ciphersuite($ciphersuite);
|
||||
$self->comp_meth($comp_meth);
|
||||
$self->extension_data(\%extensions);
|
||||
|
||||
$self->process_data();
|
||||
|
||||
print " Server Version:".$server_version."\n";
|
||||
print " Session ID Len:".$session_id_len."\n";
|
||||
print " Ciphersuite:".$ciphersuite."\n";
|
||||
print " Compression Method:".$comp_meth."\n";
|
||||
print " Extensions Len:".$extensions_len."\n";
|
||||
}
|
||||
|
||||
#Perform any actions necessary based on the data we've seen
|
||||
sub process_data
|
||||
{
|
||||
my $self = shift;
|
||||
|
||||
TLSProxy::Message->ciphersuite($self->ciphersuite);
|
||||
}
|
||||
|
||||
#Reconstruct the on-the-wire message data following changes
|
||||
sub set_message_contents
|
||||
{
|
||||
my $self = shift;
|
||||
my $data;
|
||||
my $extensions = "";
|
||||
|
||||
$data = pack('n', $self->server_version);
|
||||
$data .= $self->random;
|
||||
$data .= pack('C', $self->session_id_len);
|
||||
$data .= $self->session;
|
||||
$data .= pack('n', $self->ciphersuite);
|
||||
$data .= pack('C', $self->comp_meth);
|
||||
|
||||
foreach my $key (keys %{$self->extension_data}) {
|
||||
my $extdata = ${$self->extension_data}{$key};
|
||||
$extensions .= pack("n", $key);
|
||||
$extensions .= pack("n", length($extdata));
|
||||
$extensions .= $extdata;
|
||||
if ($key == TLSProxy::Message::EXT_DUPLICATE_EXTENSION) {
|
||||
$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 server_version
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{client_version} = shift;
|
||||
}
|
||||
return $self->{client_version};
|
||||
}
|
||||
sub random
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{random} = shift;
|
||||
}
|
||||
return $self->{random};
|
||||
}
|
||||
sub session_id_len
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{session_id_len} = shift;
|
||||
}
|
||||
return $self->{session_id_len};
|
||||
}
|
||||
sub session
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{session} = shift;
|
||||
}
|
||||
return $self->{session};
|
||||
}
|
||||
sub ciphersuite
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{ciphersuite} = shift;
|
||||
}
|
||||
return $self->{ciphersuite};
|
||||
}
|
||||
sub comp_meth
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{comp_meth} = shift;
|
||||
}
|
||||
return $self->{comp_meth};
|
||||
}
|
||||
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;
|
||||
134
util/TLSProxy/ServerKeyExchange.pm
Normal file
134
util/TLSProxy/ServerKeyExchange.pm
Normal file
@@ -0,0 +1,134 @@
|
||||
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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::ServerKeyExchange;
|
||||
|
||||
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_SERVER_KEY_EXCHANGE,
|
||||
$data,
|
||||
$records,
|
||||
$startoffset,
|
||||
$message_frag_lens);
|
||||
|
||||
#DHE
|
||||
$self->{p} = "";
|
||||
$self->{g} = "";
|
||||
$self->{pub_key} = "";
|
||||
$self->{sig} = "";
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub parse
|
||||
{
|
||||
my $self = shift;
|
||||
|
||||
#Minimal SKE parsing. Only supports DHE at the moment (if its not DHE
|
||||
#the parsing data will be trash...which is ok as long as we don't try to
|
||||
#use it)
|
||||
|
||||
my $p_len = unpack('n', $self->data);
|
||||
my $ptr = 2;
|
||||
my $p = substr($self->data, $ptr, $p_len);
|
||||
$ptr += $p_len;
|
||||
|
||||
my $g_len = unpack('n', substr($self->data, $ptr));
|
||||
$ptr += 2;
|
||||
my $g = substr($self->data, $ptr, $g_len);
|
||||
$ptr += $g_len;
|
||||
|
||||
my $pub_key_len = unpack('n', substr($self->data, $ptr));
|
||||
$ptr += 2;
|
||||
my $pub_key = substr($self->data, $ptr, $pub_key_len);
|
||||
$ptr += $pub_key_len;
|
||||
|
||||
#We assume its signed
|
||||
my $sig_len = unpack('n', substr($self->data, $ptr));
|
||||
my $sig = "";
|
||||
if (defined $sig_len) {
|
||||
$ptr += 2;
|
||||
$sig = substr($self->data, $ptr, $sig_len);
|
||||
$ptr += $sig_len;
|
||||
}
|
||||
|
||||
$self->p($p);
|
||||
$self->g($g);
|
||||
$self->pub_key($pub_key);
|
||||
$self->sig($sig);
|
||||
}
|
||||
|
||||
|
||||
#Reconstruct the on-the-wire message data following changes
|
||||
sub set_message_contents
|
||||
{
|
||||
my $self = shift;
|
||||
my $data;
|
||||
|
||||
$data = pack('n', length($self->p));
|
||||
$data .= $self->p;
|
||||
$data .= pack('n', length($self->g));
|
||||
$data .= $self->g;
|
||||
$data .= pack('n', length($self->pub_key));
|
||||
$data .= $self->pub_key;
|
||||
if (length($self->sig) > 0) {
|
||||
$data .= pack('n', length($self->sig));
|
||||
$data .= $self->sig;
|
||||
}
|
||||
|
||||
$self->data($data);
|
||||
}
|
||||
|
||||
#Read/write accessors
|
||||
#DHE
|
||||
sub p
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{p} = shift;
|
||||
}
|
||||
return $self->{p};
|
||||
}
|
||||
sub g
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{g} = shift;
|
||||
}
|
||||
return $self->{g};
|
||||
}
|
||||
sub pub_key
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{pub_key} = shift;
|
||||
}
|
||||
return $self->{pub_key};
|
||||
}
|
||||
sub sig
|
||||
{
|
||||
my $self = shift;
|
||||
if (@_) {
|
||||
$self->{sig} = shift;
|
||||
}
|
||||
return $self->{sig};
|
||||
}
|
||||
1;
|
||||
123
util/add_cr.pl
123
util/add_cr.pl
@@ -1,123 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
#
|
||||
# This adds a copyright message to a souce code file.
|
||||
# It also gets the file name correct.
|
||||
#
|
||||
# perl util/add_cr.pl *.[ch] */*.[ch] */*/*.[ch]
|
||||
#
|
||||
|
||||
foreach (@ARGV)
|
||||
{
|
||||
&dofile($_);
|
||||
}
|
||||
|
||||
sub dofile
|
||||
{
|
||||
local($file)=@_;
|
||||
|
||||
open(IN,"<$file") || die "unable to open $file:$!\n";
|
||||
|
||||
print STDERR "doing $file\n";
|
||||
@in=<IN>;
|
||||
|
||||
return(1) if ($in[0] =~ / NOCW /);
|
||||
|
||||
@out=();
|
||||
open(OUT,">$file.out") || die "unable to open $file.$$:$!\n";
|
||||
push(@out,"/* $file */\n");
|
||||
if (($in[1] !~ /^\/\* Copyright \(C\) [0-9-]+ Eric Young \(eay\@cryptsoft.com\)/))
|
||||
{
|
||||
push(@out,&Copyright);
|
||||
$i=2;
|
||||
@a=grep(/ Copyright \(C\) /,@in);
|
||||
if ($#a >= 0)
|
||||
{
|
||||
while (($i <= $#in) && ($in[$i] ne " */\n"))
|
||||
{ $i++; }
|
||||
$i++ if ($in[$i] eq " */\n");
|
||||
|
||||
while (($i <= $#in) && ($in[$i] =~ /^\s*$/))
|
||||
{ $i++; }
|
||||
|
||||
push(@out,"\n");
|
||||
for ( ; $i <= $#in; $i++)
|
||||
{ push(@out,$in[$i]); }
|
||||
}
|
||||
else
|
||||
{ push(@out,@in); }
|
||||
}
|
||||
else
|
||||
{
|
||||
shift(@in);
|
||||
push(@out,@in);
|
||||
}
|
||||
print OUT @out;
|
||||
close(IN);
|
||||
close(OUT);
|
||||
rename("$file","$file.orig") || die "unable to rename $file:$!\n";
|
||||
rename("$file.out",$file) || die "unable to rename $file.out:$!\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub Copyright
|
||||
{
|
||||
return <<'EOF';
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
* This package is an SSL implementation written
|
||||
* by Eric Young (eay@cryptsoft.com).
|
||||
* The implementation was written so as to conform with Netscapes SSL.
|
||||
*
|
||||
* This library is free for commercial and non-commercial use as long as
|
||||
* the following conditions are aheared to. The following conditions
|
||||
* apply to all code found in this distribution, be it the RC4, RSA,
|
||||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
|
||||
* included with this distribution is covered by the same copyright terms
|
||||
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
* Copyright remains Eric Young's, and as such any Copyright notices in
|
||||
* the code are not to be removed.
|
||||
* If this package is used in a product, Eric Young should be given attribution
|
||||
* as the author of the parts of the library used.
|
||||
* This can be in the form of a textual message at program startup or
|
||||
* in documentation (online or textual) provided with the package.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* "This product includes cryptographic software written by
|
||||
* Eric Young (eay@cryptsoft.com)"
|
||||
* The word 'cryptographic' can be left out if the rouines from the library
|
||||
* being used are not cryptographic related :-).
|
||||
* 4. If you include any Windows specific code (or a derivative thereof) from
|
||||
* the apps directory (application code) you must include an acknowledgement:
|
||||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* The licence and distribution terms for any publically available version or
|
||||
* derivative of this code cannot be changed. i.e. this code cannot simply be
|
||||
* copied and put under another distribution licence
|
||||
* [including the GNU Public Licence.]
|
||||
*/
|
||||
EOF
|
||||
}
|
||||
134
util/bat.sh
134
util/bat.sh
@@ -1,134 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
|
||||
$infile="/home/eay/ssl/SSLeay/MINFO";
|
||||
|
||||
open(IN,"<$infile") || die "unable to open $infile:$!\n";
|
||||
$_=<IN>;
|
||||
for (;;)
|
||||
{
|
||||
chop;
|
||||
|
||||
($key,$val)=/^([^=]+)=(.*)/;
|
||||
if ($key eq "RELATIVE_DIRECTORY")
|
||||
{
|
||||
if ($lib ne "")
|
||||
{
|
||||
$uc=$lib;
|
||||
$uc =~ s/^lib(.*)\.a/$1/;
|
||||
$uc =~ tr/a-z/A-Z/;
|
||||
$lib_nam{$uc}=$uc;
|
||||
$lib_obj{$uc}.=$libobj." ";
|
||||
}
|
||||
last if ($val eq "FINISHED");
|
||||
$lib="";
|
||||
$libobj="";
|
||||
$dir=$val;
|
||||
}
|
||||
|
||||
if ($key eq "TEST")
|
||||
{ $test.=&var_add($dir,$val); }
|
||||
|
||||
if (($key eq "PROGS") || ($key eq "E_OBJ"))
|
||||
{ $e_exe.=&var_add($dir,$val); }
|
||||
|
||||
if ($key eq "LIB")
|
||||
{
|
||||
$lib=$val;
|
||||
$lib =~ s/^.*\/([^\/]+)$/$1/;
|
||||
}
|
||||
|
||||
if ($key eq "EXHEADER")
|
||||
{ $exheader.=&var_add($dir,$val); }
|
||||
|
||||
if ($key eq "HEADER")
|
||||
{ $header.=&var_add($dir,$val); }
|
||||
|
||||
if ($key eq "LIBSRC")
|
||||
{ $libsrc.=&var_add($dir,$val); }
|
||||
|
||||
if (!($_=<IN>))
|
||||
{ $_="RELATIVE_DIRECTORY=FINISHED\n"; }
|
||||
}
|
||||
close(IN);
|
||||
|
||||
@a=split(/\s+/,$libsrc);
|
||||
foreach (@a)
|
||||
{
|
||||
print "${_}.c\n";
|
||||
}
|
||||
|
||||
sub var_add
|
||||
{
|
||||
local($dir,$val)=@_;
|
||||
local(@a,$_,$ret);
|
||||
|
||||
return("") if $no_engine && $dir =~ /\/engine/;
|
||||
return("") if $no_idea && $dir =~ /\/idea/;
|
||||
return("") if $no_rc2 && $dir =~ /\/rc2/;
|
||||
return("") if $no_rc4 && $dir =~ /\/rc4/;
|
||||
return("") if $no_rsa && $dir =~ /\/rsa/;
|
||||
return("") if $no_rsa && $dir =~ /^rsaref/;
|
||||
return("") if $no_dsa && $dir =~ /\/dsa/;
|
||||
return("") if $no_dh && $dir =~ /\/dh/;
|
||||
if ($no_des && $dir =~ /\/des/)
|
||||
{
|
||||
if ($val =~ /read_pwd/)
|
||||
{ return("$dir/read_pwd "); }
|
||||
else
|
||||
{ return(""); }
|
||||
}
|
||||
return("") if $no_mdc2 && $dir =~ /\/mdc2/;
|
||||
return("") if $no_sock && $dir =~ /\/proxy/;
|
||||
return("") if $no_bf && $dir =~ /\/bf/;
|
||||
return("") if $no_cast && $dir =~ /\/cast/;
|
||||
|
||||
$val =~ s/^\s*(.*)\s*$/$1/;
|
||||
@a=split(/\s+/,$val);
|
||||
grep(s/\.[och]$//,@a);
|
||||
|
||||
@a=grep(!/^e_.*_3d$/,@a) if $no_des;
|
||||
@a=grep(!/^e_.*_d$/,@a) if $no_des;
|
||||
@a=grep(!/^e_.*_i$/,@a) if $no_idea;
|
||||
@a=grep(!/^e_.*_r2$/,@a) if $no_rc2;
|
||||
@a=grep(!/^e_.*_bf$/,@a) if $no_bf;
|
||||
@a=grep(!/^e_.*_c$/,@a) if $no_cast;
|
||||
@a=grep(!/^e_rc4$/,@a) if $no_rc4;
|
||||
|
||||
@a=grep(!/(^s2_)|(^s23_)/,@a) if $no_ssl2;
|
||||
@a=grep(!/(^s3_)|(^s23_)/,@a) if $no_ssl3;
|
||||
|
||||
@a=grep(!/(_sock$)|(_acpt$)|(_conn$)|(^pxy_)/,@a) if $no_sock;
|
||||
|
||||
@a=grep(!/(^md2)|(_md2$)/,@a) if $no_md2;
|
||||
@a=grep(!/(^md5)|(_md5$)/,@a) if $no_md5;
|
||||
|
||||
@a=grep(!/(^d2i_r_)|(^i2d_r_)/,@a) if $no_rsa;
|
||||
@a=grep(!/(^p_open$)|(^p_seal$)/,@a) if $no_rsa;
|
||||
@a=grep(!/(^pem_seal$)/,@a) if $no_rsa;
|
||||
|
||||
@a=grep(!/(m_dss$)|(m_dss1$)/,@a) if $no_dsa;
|
||||
@a=grep(!/(^d2i_s_)|(^i2d_s_)|(_dsap$)/,@a) if $no_dsa;
|
||||
|
||||
@a=grep(!/^n_pkey$/,@a) if $no_rsa || $no_rc4;
|
||||
|
||||
@a=grep(!/_dhp$/,@a) if $no_dh;
|
||||
|
||||
@a=grep(!/(^sha[^1])|(_sha$)|(m_dss$)/,@a) if $no_sha;
|
||||
@a=grep(!/(^sha1)|(_sha1$)|(m_dss1$)/,@a) if $no_sha1;
|
||||
@a=grep(!/_mdc2$/,@a) if $no_mdc2;
|
||||
|
||||
@a=grep(!/^engine$/,@a) if $no_engine;
|
||||
@a=grep(!/(^rsa$)|(^genrsa$)|(^req$)|(^ca$)/,@a) if $no_rsa;
|
||||
@a=grep(!/(^dsa$)|(^gendsa$)|(^dsaparam$)/,@a) if $no_dsa;
|
||||
@a=grep(!/^gendsa$/,@a) if $no_sha1;
|
||||
@a=grep(!/(^dh$)|(^gendh$)/,@a) if $no_dh;
|
||||
|
||||
@a=grep(!/(^dh)|(_sha1$)|(m_dss1$)/,@a) if $no_sha1;
|
||||
|
||||
grep($_="$dir/$_",@a);
|
||||
@a=grep(!/(^|\/)s_/,@a) if $no_sock;
|
||||
@a=grep(!/(^|\/)bio_sock/,@a) if $no_sock;
|
||||
$ret=join(' ',@a)." ";
|
||||
return($ret);
|
||||
}
|
||||
|
||||
8
util/build.info
Normal file
8
util/build.info
Normal file
@@ -0,0 +1,8 @@
|
||||
IF[{- $target{build_scheme}->[1] eq "VMS" -}]
|
||||
SCRIPTS_NO_INST=local_shlib.com unlocal_shlib.com
|
||||
SOURCE[local_shlib.com]=local_shlib.com.in
|
||||
SOURCE[unlocal_shlib.com]=unlocal_shlib.com.in
|
||||
ELSIF[{- $target{build_scheme}->[1] eq "unix" -}]
|
||||
SCRIPTS_NO_INST=shlib_wrap.sh
|
||||
SOURCE[shlib_wrap.sh]=shlib_wrap.sh.in
|
||||
ENDIF
|
||||
@@ -1,5 +1,11 @@
|
||||
#!/usr/local/bin/perl
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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
|
||||
|
||||
# This is just a quick script to scan for cases where the 'error'
|
||||
# function name in a XXXerr() macro is wrong.
|
||||
#
|
||||
@@ -21,7 +27,7 @@ foreach $file (@ARGV)
|
||||
$func="";
|
||||
while (<IN>)
|
||||
{
|
||||
if (!/;$/ && /^\**([a-zA-Z].*[\s*])?([A-Za-z_0-9]+)\(.*([),]|$)/)
|
||||
if (!/;$/ && /^\**([a-zA-Z_].*[\s*])?([A-Za-z_0-9]+)\(.*([),]|$)/)
|
||||
{
|
||||
/^([^()]*(\([^()]*\)[^()]*)*)\(/;
|
||||
$1 =~ /([A-Za-z_0-9]*)$/;
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
#!/usr/local/bin/perl -w
|
||||
# Clean the dependency list in a makefile of standard includes...
|
||||
# Written by Ben Laurie <ben@algroup.co.uk> 19 Jan 1999
|
||||
|
||||
use strict;
|
||||
|
||||
while(<STDIN>) {
|
||||
print;
|
||||
last if /^# DO NOT DELETE THIS LINE/;
|
||||
}
|
||||
|
||||
my %files;
|
||||
|
||||
my $thisfile="";
|
||||
while(<STDIN>) {
|
||||
my ($dummy, $file,$deps)=/^((.*):)? (.*)$/;
|
||||
my $origfile="";
|
||||
$thisfile=$file if defined $file;
|
||||
next if !defined $deps;
|
||||
$origfile=$thisfile;
|
||||
$origfile=~s/\.o$/.c/;
|
||||
my @deps=split ' ',$deps;
|
||||
@deps=grep(!/^\//,@deps);
|
||||
@deps=grep(!/^\\$/,@deps);
|
||||
@deps=grep(!/^$origfile$/,@deps);
|
||||
# pull out the kludged kerberos header (if present).
|
||||
@deps=grep(!/^[.\/]+\/krb5.h/,@deps);
|
||||
push @{$files{$thisfile}},@deps;
|
||||
}
|
||||
|
||||
my $file;
|
||||
foreach $file (sort keys %files) {
|
||||
my $len=0;
|
||||
my $dep;
|
||||
my $origfile=$file;
|
||||
$origfile=~s/\.o$/.c/;
|
||||
$file=~s/^\.\///;
|
||||
push @{$files{$file}},$origfile;
|
||||
my $prevdep="";
|
||||
|
||||
# Remove leading ./ before sorting
|
||||
my @deps = map { $_ =~ s/^\.\///; $_ } @{$files{$file}};
|
||||
|
||||
foreach $dep (sort @deps) {
|
||||
$dep=~s/^\.\///;
|
||||
next if $prevdep eq $dep; # to exterminate duplicates...
|
||||
$prevdep = $dep;
|
||||
$len=0 if $len+length($dep)+1 >= 80;
|
||||
if($len == 0) {
|
||||
print "\n$file:";
|
||||
$len=length($file)+1;
|
||||
}
|
||||
print " $dep";
|
||||
$len+=length($dep)+1;
|
||||
}
|
||||
}
|
||||
|
||||
print "\n";
|
||||
@@ -1,78 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
|
||||
use strict;
|
||||
|
||||
use Fcntl;
|
||||
|
||||
# copy-if-different.pl
|
||||
|
||||
# Copy to the destination if the source is not the same as it.
|
||||
|
||||
my @filelist;
|
||||
|
||||
foreach my $arg (@ARGV) {
|
||||
$arg =~ s|\\|/|g; # compensate for bug/feature in cygwin glob...
|
||||
foreach (glob $arg)
|
||||
{
|
||||
push @filelist, $_;
|
||||
}
|
||||
}
|
||||
|
||||
my $fnum = @filelist;
|
||||
|
||||
if ($fnum <= 1)
|
||||
{
|
||||
die "Need at least two filenames";
|
||||
}
|
||||
|
||||
my $dest = pop @filelist;
|
||||
|
||||
if ($fnum > 2 && ! -d $dest)
|
||||
{
|
||||
die "Destination must be a directory";
|
||||
}
|
||||
|
||||
foreach (@filelist)
|
||||
{
|
||||
my $dfile;
|
||||
if (-d $dest)
|
||||
{
|
||||
$dfile = $_;
|
||||
$dfile =~ s|^.*[/\\]([^/\\]*)$|$1|;
|
||||
$dfile = "$dest/$dfile";
|
||||
}
|
||||
else
|
||||
{
|
||||
$dfile = $dest;
|
||||
}
|
||||
|
||||
my $buf;
|
||||
if (-f $dfile)
|
||||
{
|
||||
sysopen(IN, $_, O_RDONLY|O_BINARY) || die "Can't Open $_";
|
||||
sysopen(OUT, $dfile, O_RDONLY|O_BINARY)
|
||||
|| die "Can't Open $dfile";
|
||||
while (sysread IN, $buf, 10240)
|
||||
{
|
||||
my $b2;
|
||||
goto copy if !sysread(OUT, $b2, 10240) || $buf ne $b2;
|
||||
}
|
||||
goto copy if sysread(OUT, $buf, 1);
|
||||
close(IN);
|
||||
close(OUT);
|
||||
print "NOT copying: $_ to $dfile\n";
|
||||
next;
|
||||
}
|
||||
copy:
|
||||
sysopen(IN, $_, O_RDONLY|O_BINARY) || die "Can't Open $_";
|
||||
sysopen(OUT, $dfile, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY)
|
||||
|| die "Can't Open $dfile";
|
||||
while (sysread IN, $buf, 10240)
|
||||
{
|
||||
syswrite(OUT, $buf, length($buf));
|
||||
}
|
||||
close(IN);
|
||||
close(OUT);
|
||||
print "Copying: $_ to $dfile\n";
|
||||
}
|
||||
|
||||
11
util/copy.pl
11
util/copy.pl
@@ -1,4 +1,11 @@
|
||||
#!/usr/local/bin/perl
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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 Fcntl;
|
||||
|
||||
@@ -19,7 +26,7 @@ foreach $arg (@ARGV) {
|
||||
next;
|
||||
}
|
||||
$arg =~ s|\\|/|g; # compensate for bug/feature in cygwin glob...
|
||||
foreach (glob $arg)
|
||||
foreach (glob qq("$arg"))
|
||||
{
|
||||
push @filelist, $_;
|
||||
}
|
||||
|
||||
154
util/cygwin.sh
154
util/cygwin.sh
@@ -1,154 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This script configures, builds and packs the binary package for
|
||||
# the Cygwin net distribution version of OpenSSL
|
||||
#
|
||||
|
||||
# Uncomment when debugging
|
||||
#set -x
|
||||
|
||||
CONFIG_OPTIONS="--prefix=/usr shared zlib no-idea no-rc5"
|
||||
INSTALL_PREFIX=/tmp/install/INSTALL
|
||||
|
||||
VERSION=
|
||||
SHLIB_VERSION_NUMBER=
|
||||
SUBVERSION=$1
|
||||
|
||||
function cleanup()
|
||||
{
|
||||
rm -rf ${INSTALL_PREFIX}/etc
|
||||
rm -rf ${INSTALL_PREFIX}/usr
|
||||
}
|
||||
|
||||
function get_openssl_version()
|
||||
{
|
||||
eval `grep '^VERSION=' Makefile`
|
||||
if [ -z "${VERSION}" ]
|
||||
then
|
||||
echo "Error: Couldn't retrieve OpenSSL version from Makefile."
|
||||
echo " Check value of variable VERSION in Makefile."
|
||||
exit 1
|
||||
fi
|
||||
eval `grep '^SHLIB_VERSION_NUMBER=' Makefile`
|
||||
if [ -z "${SHLIB_VERSION_NUMBER}" ]
|
||||
then
|
||||
echo "Error: Couldn't retrieve OpenSSL shared lib version from Makefile."
|
||||
echo " Check value of variable SHLIB_VERSION_NUMBER in Makefile."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function base_install()
|
||||
{
|
||||
mkdir -p ${INSTALL_PREFIX}
|
||||
cleanup
|
||||
make install INSTALL_PREFIX="${INSTALL_PREFIX}"
|
||||
}
|
||||
|
||||
function doc_install()
|
||||
{
|
||||
DOC_DIR=${INSTALL_PREFIX}/usr/share/doc/openssl
|
||||
|
||||
mkdir -p ${DOC_DIR}
|
||||
cp CHANGES CHANGES.SSLeay INSTALL LICENSE NEWS README ${DOC_DIR}
|
||||
|
||||
create_cygwin_readme
|
||||
}
|
||||
|
||||
function certs_install()
|
||||
{
|
||||
CERTS_DIR=${INSTALL_PREFIX}/usr/ssl/certs
|
||||
|
||||
mkdir -p ${CERTS_DIR}
|
||||
cp -rp certs/* ${CERTS_DIR}
|
||||
}
|
||||
|
||||
function create_cygwin_readme()
|
||||
{
|
||||
README_DIR=${INSTALL_PREFIX}/usr/share/doc/Cygwin
|
||||
README_FILE=${README_DIR}/openssl-${VERSION}.README
|
||||
|
||||
mkdir -p ${README_DIR}
|
||||
cat > ${README_FILE} <<- EOF
|
||||
The Cygwin version has been built using the following configure:
|
||||
|
||||
./config ${CONFIG_OPTIONS}
|
||||
|
||||
The IDEA and RC5 algorithms are disabled due to patent and/or
|
||||
licensing issues.
|
||||
EOF
|
||||
}
|
||||
|
||||
function create_profile_files()
|
||||
{
|
||||
PROFILE_DIR=${INSTALL_PREFIX}/etc/profile.d
|
||||
|
||||
mkdir -p $PROFILE_DIR
|
||||
cat > ${PROFILE_DIR}/openssl.sh <<- "EOF"
|
||||
export MANPATH="${MANPATH}:/usr/ssl/man"
|
||||
EOF
|
||||
cat > ${PROFILE_DIR}/openssl.csh <<- "EOF"
|
||||
if ( $?MANPATH ) then
|
||||
setenv MANPATH "${MANPATH}:/usr/ssl/man"
|
||||
else
|
||||
setenv MANPATH ":/usr/ssl/man"
|
||||
endif
|
||||
EOF
|
||||
}
|
||||
|
||||
if [ -z "${SUBVERSION}" ]
|
||||
then
|
||||
echo "Usage: $0 subversion"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f config ]
|
||||
then
|
||||
echo "You must start this script in the OpenSSL toplevel source dir."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
./config ${CONFIG_OPTIONS}
|
||||
|
||||
get_openssl_version
|
||||
|
||||
make depend || exit 1
|
||||
|
||||
make || exit 1
|
||||
|
||||
base_install
|
||||
|
||||
doc_install
|
||||
|
||||
certs_install
|
||||
|
||||
create_cygwin_readme
|
||||
|
||||
create_profile_files
|
||||
|
||||
cd ${INSTALL_PREFIX}
|
||||
chmod u+w usr/lib/engines/*.so
|
||||
strip usr/bin/*.exe usr/bin/*.dll usr/lib/engines/*.so
|
||||
chmod u-w usr/lib/engines/*.so
|
||||
|
||||
# Runtime package
|
||||
tar cjf libopenssl${SHLIB_VERSION_NUMBER//[!0-9]/}-${VERSION}-${SUBVERSION}.tar.bz2 \
|
||||
usr/bin/cyg*dll
|
||||
# Base package
|
||||
find etc usr/bin/openssl.exe usr/bin/c_rehash usr/lib/engines usr/share/doc \
|
||||
usr/ssl/certs usr/ssl/man/man[157] usr/ssl/misc usr/ssl/openssl.cnf \
|
||||
usr/ssl/private \
|
||||
-empty -o \! -type d |
|
||||
tar cjfT openssl-${VERSION}-${SUBVERSION}.tar.bz2 -
|
||||
# Development package
|
||||
find usr/include usr/lib/*.a usr/lib/pkgconfig usr/ssl/man/man3 \
|
||||
-empty -o \! -type d |
|
||||
tar cjfT openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2 -
|
||||
|
||||
ls -l openssl-${VERSION}-${SUBVERSION}.tar.bz2
|
||||
ls -l openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2
|
||||
ls -l libopenssl${SHLIB_VERSION_NUMBER//[!0-9]/}-${VERSION}-${SUBVERSION}.tar.bz2
|
||||
|
||||
cleanup
|
||||
|
||||
exit 0
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
|
||||
while (<>)
|
||||
{
|
||||
print
|
||||
last if (/^# DO NOT DELETE THIS LINE/);
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
$! DELTREE.COM
|
||||
$
|
||||
$ call deltree 'p1'
|
||||
$ exit $status
|
||||
$
|
||||
$ deltree: subroutine ! P1 is a name of a directory
|
||||
$ on control_y then goto dt_STOP
|
||||
$ on warning then goto dt_exit
|
||||
$ _dt_def = f$trnlnm("SYS$DISK")+f$directory()
|
||||
$ if f$parse(p1) .eqs. "" then exit
|
||||
$ set default 'f$parse(p1,,,"DEVICE")''f$parse(p1,,,"DIRECTORY")'
|
||||
$ p1 = f$parse(p1,,,"NAME") + f$parse(p1,,,"TYPE")
|
||||
$ _fp = f$parse(".DIR",p1)
|
||||
$ dt_loop:
|
||||
$ _f = f$search(_fp)
|
||||
$ if _f .eqs. "" then goto dt_loopend
|
||||
$ call deltree [.'f$parse(_f,,,"NAME")']*.*
|
||||
$ goto dt_loop
|
||||
$ dt_loopend:
|
||||
$ _fp = f$parse(p1,".;*")
|
||||
$ if f$search(_fp) .eqs. "" then goto dt_exit
|
||||
$ set noon
|
||||
$ set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) '_fp'
|
||||
$ set on
|
||||
$ delete/nolog '_fp'
|
||||
$ dt_exit:
|
||||
$ set default '_dt_def'
|
||||
$ goto dt_end
|
||||
$ dt_STOP:
|
||||
$ set default '_dt_def'
|
||||
$ stop/id=""
|
||||
$ exit
|
||||
$ dt_end:
|
||||
$ endsubroutine
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
|
||||
if ($#ARGV < 0) {
|
||||
die "dirname.pl: too few arguments\n";
|
||||
} elsif ($#ARGV > 0) {
|
||||
die "dirname.pl: too many arguments\n";
|
||||
}
|
||||
|
||||
my $d = $ARGV[0];
|
||||
|
||||
if ($d =~ m|.*/.*|) {
|
||||
$d =~ s|/[^/]*$||;
|
||||
} else {
|
||||
$d = ".";
|
||||
}
|
||||
|
||||
print $d,"\n";
|
||||
exit(0);
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# generate the Microsoft makefiles and .def files
|
||||
#
|
||||
|
||||
PATH=util:../util:$PATH
|
||||
|
||||
# perl util/mk1mf.pl no-sock VC-MSDOS >ms/msdos.mak
|
||||
# perl util/mk1mf.pl VC-W31-32 >ms/w31.mak
|
||||
perl util/mk1mf.pl dll VC-WIN16 >ms/w31dll.mak
|
||||
# perl util/mk1mf.pl VC-WIN32 >ms/nt.mak
|
||||
perl util/mk1mf.pl dll VC-WIN32 >ms/ntdll.mak
|
||||
perl util/mk1mf.pl Mingw32 >ms/mingw32.mak
|
||||
perl util/mk1mf.pl Mingw32-files >ms/mingw32f.mak
|
||||
|
||||
perl util/mkdef.pl 16 libeay > ms/libeay16.def
|
||||
perl util/mkdef.pl 32 libeay > ms/libeay32.def
|
||||
perl util/mkdef.pl 16 ssleay > ms/ssleay16.def
|
||||
perl util/mkdef.pl 32 ssleay > ms/ssleay32.def
|
||||
206
util/dofile.pl
Normal file
206
util/dofile.pl
Normal file
@@ -0,0 +1,206 @@
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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
|
||||
|
||||
# Reads one or more template files and runs it through Text::Template
|
||||
#
|
||||
# It is assumed that this scripts is called with -Mconfigdata, a module
|
||||
# that holds configuration data in %config
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Getopt::Std;
|
||||
|
||||
# We actually expect to get the following hash tables from configdata:
|
||||
#
|
||||
# %config
|
||||
# %target
|
||||
# %withargs
|
||||
# %unified_info
|
||||
#
|
||||
# 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 catdir(dirname(__FILE__));
|
||||
use with_fallback qw(Text::Template);
|
||||
|
||||
#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 primarly 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 'quotofy1'
|
||||
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;
|
||||
}
|
||||
|
||||
# Check options ######################################################
|
||||
|
||||
my %opts = ();
|
||||
|
||||
# -o ORIGINATOR
|
||||
# declares ORIGINATOR as the originating script.
|
||||
getopt('o', \%opts);
|
||||
|
||||
my @autowarntext = ("WARNING: do not edit!",
|
||||
"Generated"
|
||||
. (defined($opts{o}) ? " by ".$opts{o} : "")
|
||||
. (scalar(@ARGV) > 0 ? " from ".join(", ",@ARGV) : ""));
|
||||
|
||||
# Template reading ###################################################
|
||||
|
||||
# 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 =
|
||||
@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>);
|
||||
|
||||
# Engage! ############################################################
|
||||
|
||||
# Load the full template (combination of files) into Text::Template
|
||||
# and fill it up with our data. Output goes directly to STDOUT
|
||||
|
||||
my $template = OpenSSL::Template->new(TYPE => 'STRING', SOURCE => $text );
|
||||
|
||||
sub output_reset_on {
|
||||
$template->output_reset_on();
|
||||
"";
|
||||
}
|
||||
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);
|
||||
46
util/domd
46
util/domd
@@ -1,46 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Do a makedepend, only leave out the standard headers
|
||||
# Written by Ben Laurie <ben@algroup.co.uk> 19 Jan 1999
|
||||
|
||||
TOP=$1
|
||||
shift
|
||||
if [ "$1" = "-MD" ]; then
|
||||
shift
|
||||
MAKEDEPEND=$1
|
||||
shift
|
||||
fi
|
||||
if [ "$MAKEDEPEND" = "" ]; then MAKEDEPEND=makedepend; fi
|
||||
|
||||
# Preserve Makefile timestamp by moving instead of copying (cp -p is GNU only)
|
||||
mv Makefile Makefile.save
|
||||
cp Makefile.save Makefile
|
||||
# fake the presence of Kerberos
|
||||
touch $TOP/krb5.h
|
||||
if ${MAKEDEPEND} --version 2>&1 | grep "clang" > /dev/null ||
|
||||
echo $MAKEDEPEND | grep "gcc" > /dev/null; then
|
||||
args=""
|
||||
while [ $# -gt 0 ]; do
|
||||
if [ "$1" != "--" ]; then args="$args $1"; fi
|
||||
shift
|
||||
done
|
||||
sed -e '/^# DO NOT DELETE.*/,$d' < Makefile > Makefile.tmp
|
||||
echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' >> Makefile.tmp
|
||||
${MAKEDEPEND} -Werror -D OPENSSL_DOING_MAKEDEPEND -M $args >> Makefile.tmp || exit 1
|
||||
${PERL} $TOP/util/clean-depend.pl < Makefile.tmp > Makefile.new
|
||||
RC=$?
|
||||
rm -f Makefile.tmp
|
||||
else
|
||||
${MAKEDEPEND} -D OPENSSL_DOING_MAKEDEPEND $@ && \
|
||||
${PERL} $TOP/util/clean-depend.pl < Makefile > Makefile.new
|
||||
RC=$?
|
||||
fi
|
||||
if ! cmp -s Makefile.save Makefile.new; then
|
||||
mv Makefile.new Makefile
|
||||
else
|
||||
mv Makefile.save Makefile
|
||||
rm -f Makefile.new
|
||||
fi
|
||||
# unfake the presence of Kerberos
|
||||
rm $TOP/krb5.h
|
||||
|
||||
exit $RC
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
#
|
||||
# tack error codes onto the end of a file
|
||||
#
|
||||
|
||||
open(ERR,$ARGV[0]) || die "unable to open error file '$ARGV[0]':$!\n";
|
||||
@err=<ERR>;
|
||||
close(ERR);
|
||||
|
||||
open(IN,$ARGV[1]) || die "unable to open header file '$ARGV[1]':$!\n";
|
||||
|
||||
@out="";
|
||||
while (<IN>)
|
||||
{
|
||||
push(@out,$_);
|
||||
last if /BEGIN ERROR CODES/;
|
||||
}
|
||||
close(IN);
|
||||
|
||||
open(OUT,">$ARGV[1]") || die "unable to open header file '$ARGV[1]':$1\n";
|
||||
print OUT @out;
|
||||
print OUT @err;
|
||||
print OUT <<"EOF";
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
EOF
|
||||
close(OUT);
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
$/ = ""; # Eat a paragraph at once.
|
||||
while(<STDIN>) {
|
||||
chop;
|
||||
s/\n/ /gm;
|
||||
if (/^=head1 /) {
|
||||
$name = 0;
|
||||
} elsif ($name) {
|
||||
if (/ - /) {
|
||||
s/ - .*//;
|
||||
s/,\s+/,/g;
|
||||
s/\s+,/,/g;
|
||||
s/^\s+//g;
|
||||
s/\s+$//g;
|
||||
s/\s/_/g;
|
||||
push @words, split ',';
|
||||
}
|
||||
}
|
||||
if (/^=head1 *NAME *$/) {
|
||||
$name = 1;
|
||||
}
|
||||
}
|
||||
|
||||
print join("\n", @words),"\n";
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
while(<STDIN>) {
|
||||
if (/=for\s+comment\s+openssl_manual_section:(\S+)/)
|
||||
{
|
||||
print "$1\n";
|
||||
exit 0;
|
||||
}
|
||||
}
|
||||
|
||||
print "$ARGV[0]\n";
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
#
|
||||
# used to generate the file MINFO for use by util/mk1mf.pl
|
||||
# It is basically a list of all variables from the passed makefile
|
||||
#
|
||||
|
||||
while ($ARGV[0] =~ /^(\S+)\s*=(.*)$/)
|
||||
{
|
||||
$sym{$1} = $2;
|
||||
shift;
|
||||
}
|
||||
|
||||
$s="";
|
||||
while (<>)
|
||||
{
|
||||
chop;
|
||||
s/#.*//;
|
||||
if (/^(\S+)\s*=\s*(.*)$/)
|
||||
{
|
||||
$o="";
|
||||
($s,$b)=($1,$2);
|
||||
for (;;)
|
||||
{
|
||||
if ($b =~ /\\$/)
|
||||
{
|
||||
chop($b);
|
||||
$o.=$b." ";
|
||||
$b=<>;
|
||||
chop($b);
|
||||
}
|
||||
else
|
||||
{
|
||||
$o.=$b." ";
|
||||
last;
|
||||
}
|
||||
}
|
||||
$o =~ s/^\s+//;
|
||||
$o =~ s/\s+$//;
|
||||
$o =~ s/\s+/ /g;
|
||||
|
||||
$o =~ s/\$[({]([^)}]+)[)}]/$sym{$1}/g;
|
||||
$sym{$s}=$o if !exists $sym{$s};
|
||||
}
|
||||
}
|
||||
|
||||
$pwd=`pwd`; chop($pwd);
|
||||
|
||||
if ($sym{'TOP'} eq ".")
|
||||
{
|
||||
$n=0;
|
||||
$dir=".";
|
||||
}
|
||||
else {
|
||||
$n=split(/\//,$sym{'TOP'});
|
||||
@_=split(/\//,$pwd);
|
||||
$z=$#_-$n+1;
|
||||
foreach $i ($z .. $#_) { $dir.=$_[$i]."/"; }
|
||||
chop($dir);
|
||||
}
|
||||
|
||||
print "RELATIVE_DIRECTORY=$dir\n";
|
||||
|
||||
foreach (sort keys %sym)
|
||||
{
|
||||
print "$_=$sym{$_}\n";
|
||||
}
|
||||
print "RELATIVE_DIRECTORY=\n";
|
||||
82
util/find-undoc-api.pl
Normal file
82
util/find-undoc-api.pl
Normal file
@@ -0,0 +1,82 @@
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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;
|
||||
use warnings;
|
||||
|
||||
use File::Spec::Functions;
|
||||
use File::Basename;
|
||||
#use File::Copy;
|
||||
#use File::Path;
|
||||
use lib catdir(dirname($0), "perl");
|
||||
use OpenSSL::Util::Pod;
|
||||
|
||||
my %dups;
|
||||
|
||||
sub parsenum()
|
||||
{
|
||||
my $file = shift;
|
||||
my @apis;
|
||||
|
||||
open my $IN, '<', $file
|
||||
or die "Can't open $file, $!, stopped";
|
||||
|
||||
while ( <$IN> ) {
|
||||
next if /\sNOEXIST/;
|
||||
next if /EXPORT_VAR_AS_FUNC/;
|
||||
push @apis, $1 if /([^\s]+).\s/;
|
||||
}
|
||||
|
||||
close $IN;
|
||||
|
||||
print "# Found ", scalar(@apis), " in $file\n";
|
||||
return sort @apis;
|
||||
}
|
||||
|
||||
sub getdocced()
|
||||
{
|
||||
my $dir = shift;
|
||||
my %return;
|
||||
|
||||
foreach my $pod ( glob("$dir/*.pod") ) {
|
||||
next if $pod eq 'doc/crypto/crypto.pod';
|
||||
next if $pod eq 'doc/ssl/ssl.pod';
|
||||
my %podinfo = extract_pod_info($pod);
|
||||
foreach my $n ( @{$podinfo{names}} ) {
|
||||
$return{$n} = $pod;
|
||||
print "# Duplicate $n in $pod and $dups{$n}\n"
|
||||
if defined $dups{$n};
|
||||
$dups{$n} = $pod;
|
||||
}
|
||||
}
|
||||
|
||||
return %return;
|
||||
}
|
||||
|
||||
sub printem()
|
||||
{
|
||||
my $docdir = shift;
|
||||
my $numfile = shift;
|
||||
my %docced = &getdocced($docdir);
|
||||
my $count = 0;
|
||||
|
||||
foreach my $func ( &parsenum($numfile) ) {
|
||||
next if $docced{$func};
|
||||
|
||||
# Skip ASN1 utilities
|
||||
next if $func =~ /^ASN1_/;
|
||||
|
||||
print $func, "\n";
|
||||
$count++;
|
||||
}
|
||||
print "# Found $count missing from $numfile\n\n";
|
||||
}
|
||||
|
||||
|
||||
&printem('doc/crypto', 'util/libcrypto.num');
|
||||
&printem('doc/ssl', 'util/libssl.num');
|
||||
35
util/find-unused-errs
Normal file
35
util/find-unused-errs
Normal file
@@ -0,0 +1,35 @@
|
||||
#! /bin/bash
|
||||
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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
|
||||
|
||||
# Find unused error function-names and reason-codes, and edit them
|
||||
# out of the source. Doesn't handle line-wrapping, might have to do
|
||||
# some manual cleanups to fix compile errors.
|
||||
|
||||
export X1=/tmp/f.1.$$
|
||||
export X2=/tmp/f.2.$$
|
||||
|
||||
cd include/openssl || exit 1
|
||||
grep '_[RF]_' * | awk '{print $3;}' | sort -u >$X1
|
||||
cd ../..
|
||||
|
||||
for F in `cat $X1` ; do
|
||||
git grep -l --full-name -F $F >$X2
|
||||
NUM=`wc -l <$X2`
|
||||
test $NUM -gt 2 && continue
|
||||
if grep -q $F crypto/err/openssl.ec ; then
|
||||
echo Possibly unused $F found in openssl.ec
|
||||
continue
|
||||
fi
|
||||
echo $F
|
||||
for FILE in `cat $X2` ; do
|
||||
grep -v -w $F <$FILE >$FILE.new
|
||||
mv $FILE.new $FILE
|
||||
done
|
||||
done
|
||||
|
||||
rm $X1 $X2
|
||||
115
util/fipslink.pl
Normal file
115
util/fipslink.pl
Normal file
@@ -0,0 +1,115 @@
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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
|
||||
|
||||
sub check_env
|
||||
{
|
||||
my @ret;
|
||||
foreach (@_)
|
||||
{
|
||||
die "Environment variable $_ not defined!\n" unless exists $ENV{$_};
|
||||
push @ret, $ENV{$_};
|
||||
}
|
||||
return @ret;
|
||||
}
|
||||
|
||||
|
||||
my ($fips_cc,$fips_cc_args, $fips_link,$fips_target, $fips_libdir, $sha1_exe)
|
||||
= check_env("FIPS_CC", "FIPS_CC_ARGS", "FIPS_LINK", "FIPS_TARGET",
|
||||
"FIPSLIB_D", "FIPS_SHA1_EXE");
|
||||
|
||||
|
||||
|
||||
if (exists $ENV{"PREMAIN_DSO_EXE"})
|
||||
{
|
||||
$fips_premain_dso = $ENV{"PREMAIN_DSO_EXE"};
|
||||
}
|
||||
else
|
||||
{
|
||||
$fips_premain_dso = "";
|
||||
}
|
||||
|
||||
check_hash($sha1_exe, "fips_premain.c");
|
||||
check_hash($sha1_exe, "fipscanister.lib");
|
||||
|
||||
|
||||
print "Integrity check OK\n";
|
||||
|
||||
if (is_premain_linked(@ARGV)) {
|
||||
print "$fips_cc $fips_cc_args $fips_libdir/fips_premain.c\n";
|
||||
system "$fips_cc $fips_cc_args $fips_libdir/fips_premain.c";
|
||||
die "First stage Compile failure" if $? != 0;
|
||||
} elsif (!defined($ENV{FIPS_SIG})) {
|
||||
die "no fips_premain.obj linked";
|
||||
}
|
||||
|
||||
print "$fips_link @ARGV\n";
|
||||
system "$fips_link @ARGV";
|
||||
die "First stage Link failure" if $? != 0;
|
||||
|
||||
if (defined($ENV{FIPS_SIG})) {
|
||||
print "$ENV{FIPS_SIG} $fips_target\n";
|
||||
system "$ENV{FIPS_SIG} $fips_target";
|
||||
die "$ENV{FIPS_SIG} $fips_target failed" if $? != 0;
|
||||
exit;
|
||||
}
|
||||
|
||||
print "$fips_premain_dso $fips_target\n";
|
||||
system("$fips_premain_dso $fips_target >$fips_target.sha1");
|
||||
die "Get hash failure" if $? != 0;
|
||||
open my $sha1_res, '<', $fips_target.".sha1" or die "Get hash failure";
|
||||
$fips_hash=<$sha1_res>;
|
||||
close $sha1_res;
|
||||
unlink $fips_target.".sha1";
|
||||
$fips_hash =~ s|\R$||; # Better chomp
|
||||
die "Get hash failure" if $? != 0;
|
||||
|
||||
|
||||
print "$fips_cc -DHMAC_SHA1_SIG=\\\"$fips_hash\\\" $fips_cc_args $fips_libdir/fips_premain.c\n";
|
||||
system "$fips_cc -DHMAC_SHA1_SIG=\\\"$fips_hash\\\" $fips_cc_args $fips_libdir/fips_premain.c";
|
||||
die "Second stage Compile failure" if $? != 0;
|
||||
|
||||
|
||||
print "$fips_link @ARGV\n";
|
||||
system "$fips_link @ARGV";
|
||||
die "Second stage Link failure" if $? != 0;
|
||||
|
||||
sub is_premain_linked
|
||||
{
|
||||
return 1 if (grep /fips_premain\.obj/,@_);
|
||||
foreach (@_)
|
||||
{
|
||||
if (/^@(.*)/ && -f $1)
|
||||
{
|
||||
open FD,$1 or die "can't open $1";
|
||||
my $ret = (grep /fips_premain\.obj/,<FD>)?1:0;
|
||||
close FD;
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub check_hash
|
||||
{
|
||||
my ($sha1_exe, $filename) = @_;
|
||||
my ($hashfile, $hashval);
|
||||
|
||||
open(IN, "${fips_libdir}/${filename}.sha1") || die "Cannot open file hash file ${fips_libdir}/${filename}.sha1";
|
||||
$hashfile = <IN>;
|
||||
close IN;
|
||||
$hashval = `$sha1_exe ${fips_libdir}/$filename`;
|
||||
$hashfile =~ s|\R$||; # Better chomp
|
||||
$hashval =~ s|\R$||; # Better chomp
|
||||
$hashfile =~ s/^.*=\s+//;
|
||||
$hashval =~ s/^.*=\s+//;
|
||||
die "Invalid hash syntax in file" if (length($hashfile) != 40);
|
||||
die "Invalid hash received for file" if (length($hashval) != 40);
|
||||
die "***HASH VALUE MISMATCH FOR FILE $filename ***" if ($hashval ne $hashfile);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# clean up the mess that NT makes of my source tree
|
||||
#
|
||||
|
||||
if [ -f makefile -a ! -f Makefile ]; then
|
||||
/bin/mv makefile Makefile
|
||||
fi
|
||||
chmod +x Configure util/*
|
||||
echo cleaning
|
||||
/bin/rm -f `find . -name '*.$$$' -print` 2>/dev/null >/dev/null
|
||||
echo 'removing those damn ^M'
|
||||
perl -pi -e 's/\015//' `find . -type 'f' -print |grep -v '.obj$' |grep -v '.der$' |grep -v '.gz'`
|
||||
make -f Makefile links
|
||||
454
util/incore
Normal file
454
util/incore
Normal file
@@ -0,0 +1,454 @@
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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
|
||||
|
||||
# The script embeds fingerprint into ELF executable object, either
|
||||
# application binary or shared library.
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# ELF symbol table parser by <appro@openssl.org>. The table entries
|
||||
# are extended with offset within executable file...
|
||||
#
|
||||
{ package ELF;
|
||||
use FileHandle;
|
||||
|
||||
sub dup { my %copy=map {$_} @_; return \%copy; }
|
||||
|
||||
sub Load {
|
||||
my $class = shift;
|
||||
my $self = {};
|
||||
my $FD = FileHandle->new(); # autoclose
|
||||
|
||||
bless $self,$class;
|
||||
|
||||
sysopen($FD,shift,0) or die "$!";
|
||||
binmode($FD);
|
||||
|
||||
#################################################
|
||||
# read and parse elf_ehdr.e_ident...
|
||||
#
|
||||
read($FD,my $elf,16) or die "$!";
|
||||
|
||||
my %e_ident;
|
||||
@e_ident{magic,class,data,version,osabi,abiver,pad}=
|
||||
unpack("a4C*",$elf);
|
||||
|
||||
$!=42; # signal fipsld to revert to two-step link
|
||||
die "not ELF file" if ($e_ident{magic} ne chr(0177)."ELF");
|
||||
|
||||
my $elf_bits = $e_ident{class}*32; # 32 or 64
|
||||
my $big_endian = $e_ident{data}-1; # 0 or 1
|
||||
|
||||
if ($elf_bits==64) {
|
||||
if (!(((1<<31)<<1) && $big_endian==(unpack("L",pack("N",1))==1))) {
|
||||
die "ELF64 is supported only natively";
|
||||
}
|
||||
}
|
||||
|
||||
#################################################
|
||||
# read and parse remainder of elf_ehdr...
|
||||
#
|
||||
read($FD,my $elfhdr,64) or die "$!";
|
||||
|
||||
my %elf_ehdr;
|
||||
@elf_ehdr{e_type,e_machine,e_version,
|
||||
e_entry,e_phoff,e_shoff,e_flags,e_ehsize,
|
||||
e_phentsize,e_phnum,e_shentsize,e_shnum,e_shstrndx} =
|
||||
$elf_bits==32 ?
|
||||
unpack($big_endian?"nnN5n6":"vvV5v6",$elfhdr)
|
||||
: unpack("SSLQ3LS6",$elfhdr);
|
||||
|
||||
# put aside e_machine in case one has to treat specific
|
||||
# platforms differently, see EM_ constants in elf.h for
|
||||
# assortment...
|
||||
$self->{e_machine} = $elf_ehdr{e_machine};
|
||||
|
||||
#################################################
|
||||
# read and parse elf_shdr table...
|
||||
#
|
||||
my ($i,$sz,$symtab_idx,$blob,$strings);
|
||||
|
||||
seek($FD,$elf_ehdr{e_shoff},0) or die "$!";
|
||||
read($FD,$blob,$elf_ehdr{e_shentsize}*$elf_ehdr{e_shnum}) or die "$!";
|
||||
|
||||
my @sections;
|
||||
my $elf_shdr_struct=($elf_bits==32?($big_endian?"N10":"V10"):"L2Q4L2Q2");
|
||||
for ($sz=$elf_ehdr{e_shentsize},$i=0;$i<length($blob);$i+=$sz) {
|
||||
my %elf_shdr;
|
||||
|
||||
@elf_shdr{sh_name,sh_type,sh_flags,
|
||||
sh_addr,sh_offset,sh_size,
|
||||
sh_link,sh_info,sh_addalign,sh_entsize} =
|
||||
unpack($elf_shdr_struct,substr($blob,$i,$sz));
|
||||
|
||||
push(@sections,dup(%elf_shdr));
|
||||
|
||||
# note SHT_SYMTAB or SHT_DYNSYM for future reference
|
||||
if ($elf_shdr{sh_type}==2 || $elf_shdr{sh_type}==11) {
|
||||
$symtab_idx = $#sections;
|
||||
}
|
||||
}
|
||||
|
||||
# read strings table and map section names...
|
||||
seek($FD,@sections[$elf_ehdr{e_shstrndx}]->{sh_offset},0) or die "$!";
|
||||
read($FD,$strings,@sections[$elf_ehdr{e_shstrndx}]->{sh_size}) or die "$!";
|
||||
for (@sections) {
|
||||
$_->{sh_name}=(split(chr(0),substr($strings,$_->{sh_name},64)))[0];
|
||||
}
|
||||
|
||||
#################################################
|
||||
# read symbol strings table...
|
||||
#
|
||||
$i=@sections[$symtab_idx]->{sh_link};
|
||||
seek($FD,@sections[$i]->{sh_offset},0) or die "$!";
|
||||
read($FD,$strings,@sections[$i]->{sh_size}) or die "$!";
|
||||
|
||||
#################################################
|
||||
# read and parse elf_sym table...
|
||||
#
|
||||
seek($FD,@sections[$symtab_idx]->{sh_offset},0) or die "$!";
|
||||
read($FD,my $blob,@sections[$symtab_idx]->{sh_size}) or die "$!";
|
||||
|
||||
for ($sz=@sections[$symtab_idx]->{sh_entsize},$i=0;$i<length($blob);$i+=$sz) {
|
||||
my %elf_sym;
|
||||
|
||||
if ($elf_bits==32) {
|
||||
@elf_sym{st_name,st_value,st_size,st_info,st_other,st_shndx} =
|
||||
unpack($big_endian?"N3CCn":"V3CCv",substr($blob,$i,$sz));
|
||||
} else {
|
||||
@elf_sym{st_name,st_info,st_other,st_shndx,st_value,st_size} =
|
||||
unpack("LCCSQQ",substr($blob,$i,$sz));
|
||||
}
|
||||
|
||||
my $st_type = $elf_sym{st_info}&0xf;
|
||||
my $st_bind = $elf_sym{st_info}>>4;
|
||||
my $st_secn = $elf_sym{st_shndx};
|
||||
my $name;
|
||||
# (STT_OBJECT || STT_FUNC)
|
||||
if ($st_bind<3 && ($st_type==1 || $st_type==2)
|
||||
&& $st_secn <= $#sections # sane st_shndx
|
||||
&& @sections[$st_secn]->{sh_type} # not SHN_UNDEF
|
||||
&& ($name=(split(chr(0),substr($strings,$elf_sym{st_name},128)))[0])
|
||||
) {
|
||||
# synthesize st_offset, ...
|
||||
$elf_sym{st_offset} = $elf_sym{st_value}
|
||||
- @sections[$st_secn]->{sh_addr}
|
||||
+ @sections[$st_secn]->{sh_offset};
|
||||
$elf_sym{st_name} = $name;
|
||||
$elf_sym{st_section} = @sections[$st_secn]->{sh_name};
|
||||
# ... and add to lookup table
|
||||
$self->{symbols}{$name} = dup(%elf_sym);
|
||||
}
|
||||
}
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub Lookup {
|
||||
my $self = shift;
|
||||
my $name = shift;
|
||||
return $self->{symbols}{$name};
|
||||
}
|
||||
|
||||
sub Traverse {
|
||||
my $self = shift;
|
||||
my $code = shift;
|
||||
|
||||
if (ref($code) eq 'CODE') {
|
||||
for (keys(%{$self->{symbols}})) { &$code($self->{symbols}{$_}); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# SHA1 and HMAC in Perl by <appro@openssl.org>.
|
||||
#
|
||||
{ package SHA1;
|
||||
use integer;
|
||||
|
||||
{
|
||||
################################### SHA1 block code generator
|
||||
my @V = ('$A','$B','$C','$D','$E');
|
||||
my $i;
|
||||
|
||||
sub XUpdate {
|
||||
my $ret;
|
||||
$ret="(\$T=\$W[($i-16)%16]^\$W[($i-14)%16]^\$W[($i-8)%16]^\$W[($i-3)%16],\n\t";
|
||||
if ((1<<31)<<1) {
|
||||
$ret.=" \$W[$i%16]=((\$T<<1)|(\$T>>31))&0xffffffff)\n\t ";
|
||||
} else {
|
||||
$ret.=" \$W[$i%16]=(\$T<<1)|((\$T>>31)&1))\n\t ";
|
||||
}
|
||||
}
|
||||
sub tail {
|
||||
my ($a,$b,$c,$d,$e)=@V;
|
||||
my $ret;
|
||||
if ((1<<31)<<1) {
|
||||
$ret.="(($a<<5)|($a>>27));\n\t";
|
||||
$ret.="$b=($b<<30)|($b>>2); $e&=0xffffffff; #$b&=0xffffffff;\n\t";
|
||||
} else {
|
||||
$ret.="(($a<<5)|($a>>27)&0x1f);\n\t";
|
||||
$ret.="$b=($b<<30)|($b>>2)&0x3fffffff;\n\t";
|
||||
}
|
||||
$ret;
|
||||
}
|
||||
sub BODY_00_15 {
|
||||
my ($a,$b,$c,$d,$e)=@V;
|
||||
"$e+=\$W[$i]+0x5a827999+((($c^$d)&$b)^$d)+".tail();
|
||||
}
|
||||
sub BODY_16_19 {
|
||||
my ($a,$b,$c,$d,$e)=@V;
|
||||
"$e+=".XUpdate()."+0x5a827999+((($c^$d)&$b)^$d)+".tail();
|
||||
}
|
||||
sub BODY_20_39 {
|
||||
my ($a,$b,$c,$d,$e)=@V;
|
||||
"$e+=".XUpdate()."+0x6ed9eba1+($b^$c^$d)+".tail();
|
||||
}
|
||||
sub BODY_40_59 {
|
||||
my ($a,$b,$c,$d,$e)=@V;
|
||||
"$e+=".XUpdate()."+0x8f1bbcdc+(($b&$c)|(($b|$c)&$d))+".tail();
|
||||
}
|
||||
sub BODY_60_79 {
|
||||
my ($a,$b,$c,$d,$e)=@V;
|
||||
"$e+=".XUpdate()."+0xca62c1d6+($b^$c^$d)+".tail();
|
||||
}
|
||||
|
||||
my $sha1_impl =
|
||||
'sub block {
|
||||
my $self = @_[0];
|
||||
my @W = unpack("N16",@_[1]);
|
||||
my ($A,$B,$C,$D,$E,$T) = @{$self->{H}};
|
||||
';
|
||||
|
||||
$sha1_impl.='
|
||||
$A &= 0xffffffff;
|
||||
$B &= 0xffffffff;
|
||||
' if ((1<<31)<<1);
|
||||
|
||||
for($i=0;$i<16;$i++){ $sha1_impl.=BODY_00_15(); unshift(@V,pop(@V)); }
|
||||
for(;$i<20;$i++) { $sha1_impl.=BODY_16_19(); unshift(@V,pop(@V)); }
|
||||
for(;$i<40;$i++) { $sha1_impl.=BODY_20_39(); unshift(@V,pop(@V)); }
|
||||
for(;$i<60;$i++) { $sha1_impl.=BODY_40_59(); unshift(@V,pop(@V)); }
|
||||
for(;$i<80;$i++) { $sha1_impl.=BODY_60_79(); unshift(@V,pop(@V)); }
|
||||
|
||||
$sha1_impl.='
|
||||
$self->{H}[0]+=$A; $self->{H}[1]+=$B; $self->{H}[2]+=$C;
|
||||
$self->{H}[3]+=$D; $self->{H}[4]+=$E; }';
|
||||
|
||||
#print $sha1_impl,"\n";
|
||||
eval($sha1_impl); # generate code
|
||||
}
|
||||
|
||||
sub Init {
|
||||
my $class = shift; # multiple instances...
|
||||
my $self = {};
|
||||
|
||||
bless $self,$class;
|
||||
$self->{H} = [0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0];
|
||||
$self->{N} = 0;
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub Update {
|
||||
my $self = shift;
|
||||
my $msg;
|
||||
|
||||
foreach $msg (@_) {
|
||||
my $len = length($msg);
|
||||
my $num = length($self->{buf});
|
||||
my $off = 0;
|
||||
|
||||
$self->{N} += $len;
|
||||
|
||||
if (($num+$len)<64)
|
||||
{ $self->{buf} .= $msg; next; }
|
||||
elsif ($num)
|
||||
{ $self->{buf} .= substr($msg,0,($off=64-$num));
|
||||
$self->block($self->{buf});
|
||||
}
|
||||
|
||||
while(($off+64) <= $len)
|
||||
{ $self->block(substr($msg,$off,64));
|
||||
$off += 64;
|
||||
}
|
||||
|
||||
$self->{buf} = substr($msg,$off);
|
||||
}
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub Final {
|
||||
my $self = shift;
|
||||
my $num = length($self->{buf});
|
||||
|
||||
$self->{buf} .= chr(0x80); $num++;
|
||||
if ($num>56)
|
||||
{ $self->{buf} .= chr(0)x(64-$num);
|
||||
$self->block($self->{buf});
|
||||
$self->{buf}=undef;
|
||||
$num=0;
|
||||
}
|
||||
$self->{buf} .= chr(0)x(56-$num);
|
||||
$self->{buf} .= pack("N2",($self->{N}>>29)&0x7,$self->{N}<<3);
|
||||
$self->block($self->{buf});
|
||||
|
||||
return pack("N*",@{$self->{H}});
|
||||
}
|
||||
|
||||
sub Selftest {
|
||||
my $hash;
|
||||
|
||||
$hash=SHA1->Init()->Update('abc')->Final();
|
||||
die "SHA1 test#1" if (unpack("H*",$hash) ne 'a9993e364706816aba3e25717850c26c9cd0d89d');
|
||||
|
||||
$hash=SHA1->Init()->Update('abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq')->Final();
|
||||
die "SHA1 test#2" if (unpack("H*",$hash) ne '84983e441c3bd26ebaae4aa1f95129e5e54670f1');
|
||||
|
||||
#$hash=SHA1->Init()->Update('a'x1000000)->Final();
|
||||
#die "SHA1 test#3" if (unpack("H*",$hash) ne '34aa973cd4c4daa4f61eeb2bdbad27316534016f');
|
||||
}
|
||||
}
|
||||
|
||||
{ package HMAC;
|
||||
|
||||
sub Init {
|
||||
my $class = shift;
|
||||
my $key = shift;
|
||||
my $self = {};
|
||||
|
||||
bless $self,$class;
|
||||
|
||||
if (length($key)>64) {
|
||||
$key = SHA1->Init()->Update($key)->Final();
|
||||
}
|
||||
$key .= chr(0x00)x(64-length($key));
|
||||
|
||||
my @ikey = map($_^=0x36,unpack("C*",$key));
|
||||
($self->{hash} = SHA1->Init())->Update(pack("C*",@ikey));
|
||||
$self->{okey} = pack("C*",map($_^=0x36^0x5c,@ikey));
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub Update {
|
||||
my $self = shift;
|
||||
$self->{hash}->Update(@_);
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub Final {
|
||||
my $self = shift;
|
||||
my $ihash = $self->{hash}->Final();
|
||||
return SHA1->Init()->Update($self->{okey},$ihash)->Final();
|
||||
}
|
||||
|
||||
sub Selftest {
|
||||
my $hmac;
|
||||
|
||||
$hmac = HMAC->Init('0123456789:;<=>?@ABC')->Update('Sample #2')->Final();
|
||||
die "HMAC test" if (unpack("H*",$hmac) ne '0922d3405faa3d194f82a45830737d5cc6c75d24');
|
||||
}
|
||||
}
|
||||
|
||||
######################################################################
|
||||
#
|
||||
# main()
|
||||
#
|
||||
my $legacy_mode;
|
||||
|
||||
if ($ARGV<0 || ($#ARGV>0 && !($legacy_mode=(@ARGV[0] =~ /^\-(dso|exe)$/)))) {
|
||||
print STDERR "usage: $0 [-dso|-exe] elfbinary\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$exe = ELF->Load(@ARGV[$#ARGV]);
|
||||
|
||||
$FIPS_text_start = $exe->Lookup("FIPS_text_start") or die;
|
||||
$FIPS_text_end = $exe->Lookup("FIPS_text_end") or die;
|
||||
$FIPS_rodata_start = $exe->Lookup("FIPS_rodata_start") or die;
|
||||
$FIPS_rodata_end = $exe->Lookup("FIPS_rodata_end") or die;
|
||||
$FIPS_signature = $exe->Lookup("FIPS_signature") or die;
|
||||
|
||||
# new cross-compile support
|
||||
$FIPS_text_startX = $exe->Lookup("FIPS_text_startX");
|
||||
$FIPS_text_endX = $exe->Lookup("FIPS_text_endX");
|
||||
|
||||
if (!$legacy_mode) {
|
||||
if (!$FIPS_text_startX || !$FIPS_text_endX) {
|
||||
print STDERR "@ARGV[$#ARGV] is not cross-compiler aware.\n";
|
||||
exit(42); # signal fipsld to revert to two-step link
|
||||
}
|
||||
|
||||
$FINGERPRINT_ascii_value
|
||||
= $exe->Lookup("FINGERPRINT_ascii_value");
|
||||
|
||||
}
|
||||
if ($FIPS_text_startX && $FIPS_text_endX) {
|
||||
$FIPS_text_start = $FIPS_text_startX;
|
||||
$FIPS_text_end = $FIPS_text_endX;
|
||||
}
|
||||
|
||||
sysopen(FD,@ARGV[$#ARGV],$legacy_mode?0:2) or die "$!"; # 2 is read/write
|
||||
binmode(FD);
|
||||
|
||||
sub HMAC_Update {
|
||||
my ($hmac,$off,$len) = @_;
|
||||
my $blob;
|
||||
|
||||
seek(FD,$off,0) or die "$!";
|
||||
read(FD,$blob,$len) or die "$!";
|
||||
$$hmac->Update($blob);
|
||||
}
|
||||
|
||||
# fips/fips.c:FIPS_incore_fingerprint's Perl twin
|
||||
#
|
||||
sub FIPS_incore_fingerprint {
|
||||
my $p1 = $FIPS_text_start->{st_offset};
|
||||
my $p2 = $FIPS_text_end->{st_offset};
|
||||
my $p3 = $FIPS_rodata_start->{st_offset};
|
||||
my $p4 = $FIPS_rodata_end->{st_offset};
|
||||
my $sig = $FIPS_signature->{st_offset};
|
||||
my $ctx = HMAC->Init("etaonrishdlcupfm");
|
||||
|
||||
# detect overlapping regions
|
||||
if ($p1<=$p3 && $p2>=$p3) {
|
||||
$p3 = $p1; $p4 = $p2>$p4?$p2:$p4; $p1 = 0; $p2 = 0;
|
||||
} elsif ($p3<=$p1 && $p4>=$p1) {
|
||||
$p3 = $p3; $p4 = $p2>$p4?$p2:$p4; $p1 = 0; $p2 = 0;
|
||||
}
|
||||
|
||||
if ($p1) {
|
||||
HMAC_Update (\$ctx,$p1,$p2-$p1);
|
||||
}
|
||||
|
||||
if ($sig>=$p3 && $sig<$p4) {
|
||||
# "punch" hole
|
||||
HMAC_Update(\$ctx,$p3,$sig-$p3);
|
||||
$p3 = $sig+20;
|
||||
HMAC_Update(\$ctx,$p3,$p4-$p3);
|
||||
} else {
|
||||
HMAC_Update(\$ctx,$p3,$p4-$p3);
|
||||
}
|
||||
|
||||
return $ctx->Final();
|
||||
}
|
||||
|
||||
$fingerprint = FIPS_incore_fingerprint();
|
||||
|
||||
if ($legacy_mode) {
|
||||
print unpack("H*",$fingerprint);
|
||||
} elsif (defined($FINGERPRINT_ascii_value)) {
|
||||
seek(FD,$FINGERPRINT_ascii_value->{st_offset},0) or die "$!";
|
||||
print FD unpack("H*",$fingerprint) or die "$!";
|
||||
} else {
|
||||
seek(FD,$FIPS_signature->{st_offset},0) or die "$!";
|
||||
print FD $fingerprint or die "$!";
|
||||
}
|
||||
|
||||
close (FD);
|
||||
120
util/indent.pro
120
util/indent.pro
@@ -14,7 +14,7 @@
|
||||
-i4
|
||||
-il1
|
||||
-ip0
|
||||
-l78
|
||||
-l80
|
||||
-lp
|
||||
-nbad
|
||||
-nbc
|
||||
@@ -35,24 +35,6 @@
|
||||
-ts0
|
||||
-T ACCESS_DESCRIPTION
|
||||
-T ADDED_OBJ
|
||||
-T AEP_BBOOL
|
||||
-T AEP_CHAR
|
||||
-T AEP_CHAR_PTR
|
||||
-T AEP_CONNECTION_ENTRY
|
||||
-T AEP_CONNECTION_HNDL
|
||||
-T AEP_CONNECTION_HNDL_PTR
|
||||
-T AEP_FLAGS
|
||||
-T AEP_RV
|
||||
-T AEP_TRANSACTION_ID
|
||||
-T AEP_TRANSACTION_ID_PTR
|
||||
-T AEP_U16
|
||||
-T AEP_U32
|
||||
-T AEP_U32_PTR
|
||||
-T AEP_U64_PTR
|
||||
-T AEP_U8
|
||||
-T AEP_U8_PTR
|
||||
-T AEP_VOID_PTR
|
||||
-T AEP_VOID_PTR_PTR
|
||||
-T AES_KEY
|
||||
-T APP_INFO
|
||||
-T ARGS
|
||||
@@ -107,6 +89,7 @@
|
||||
-T BIGNUM
|
||||
-T BIO
|
||||
-T BIO_ACCEPT
|
||||
-T BIO_ADDR
|
||||
-T BIO_ASN1_BUF_CTX
|
||||
-T BIO_ASN1_EX_FUNCS
|
||||
-T BIO_B64_CTX
|
||||
@@ -187,10 +170,7 @@
|
||||
-T CRYPTO_EX_DATA_FUNCS
|
||||
-T CRYPTO_EX_DATA_IMPL
|
||||
-T CRYPTO_EX_dup
|
||||
-T CRYPTO_EX_dup
|
||||
-T CRYPTO_EX_free
|
||||
-T CRYPTO_EX_free
|
||||
-T CRYPTO_EX_new
|
||||
-T CRYPTO_EX_new
|
||||
-T CRYPTO_MEM_LEAK_CB
|
||||
-T CRYPTO_THREADID
|
||||
@@ -251,7 +231,6 @@
|
||||
-T ENGINE_SSL_CLIENT_CERT_PTR
|
||||
-T ENGINE_TABLE
|
||||
-T ENUMERATED_NAMES
|
||||
-T ERR_FNS
|
||||
-T ERR_STATE
|
||||
-T ERR_STRING_DATA
|
||||
-T ESS_CERT_ID
|
||||
@@ -288,34 +267,13 @@
|
||||
-T HEAPLIST32
|
||||
-T HEARTBEAT_TEST_FIXTURE
|
||||
-T HMAC_CTX
|
||||
-T ICA_KEY_RSA_CRT
|
||||
-T ICA_KEY_RSA_CRT_REC
|
||||
-T ICA_KEY_RSA_MODEXPO
|
||||
-T ICA_KEY_RSA_MODEXPO_REC
|
||||
-T IDEA_KEY_SCHEDULE
|
||||
-T IPAddrBlocks
|
||||
-T IPAddressFamily
|
||||
-T IPAddressOrRange
|
||||
-T IPAddressOrRanges
|
||||
-T ISSUING_DIST_POINT
|
||||
-T JPAKE_CTX
|
||||
-T JPAKE_STEP1
|
||||
-T JPAKE_STEP2
|
||||
-T JPAKE_STEP3A
|
||||
-T JPAKE_STEP3B
|
||||
-T JPAKE_STEP_PART
|
||||
-T JPAKE_ZKP
|
||||
-T KEY_TABLE_TYPE
|
||||
-T KRB5_APREQBODY
|
||||
-T KRB5_AUTHDATA
|
||||
-T KRB5_AUTHENTBODY
|
||||
-T KRB5_CHECKSUM
|
||||
-T KRB5_ENCDATA
|
||||
-T KRB5_ENCKEY
|
||||
-T KRB5_PRINCNAME
|
||||
-T KRB5_TKTBODY
|
||||
-T KSSL_CTX
|
||||
-T KSSL_ERR
|
||||
-T LHASH
|
||||
-T LHASH_COMP_FN_TYPE
|
||||
-T LHASH_DOALL_ARG_FN_TYPE
|
||||
@@ -382,7 +340,7 @@
|
||||
-T OPENSSL_ITEM
|
||||
-T OPENSSL_PSTRING
|
||||
-T OPENSSL_STRING
|
||||
-T OPENSSL_STRING
|
||||
-T OSSL_ASYNC_FD
|
||||
-T OTHERNAME
|
||||
-T P256_POINT
|
||||
-T P256_POINT_AFFINE
|
||||
@@ -453,8 +411,6 @@
|
||||
-T SSL
|
||||
-T SSL2_STATE
|
||||
-T SSL3_BUFFER
|
||||
-T SSL3_BUF_FREELIST
|
||||
-T SSL3_BUF_FREELIST_ENTRY
|
||||
-T SSL3_COMP
|
||||
-T SSL3_ENC_METHOD
|
||||
-T SSL3_RECORD
|
||||
@@ -463,48 +419,12 @@
|
||||
-T SSL_COMP
|
||||
-T SSL_CONF_CTX
|
||||
-T SSL_CTX
|
||||
-T SSL_DANE
|
||||
-T SSL_EXCERT
|
||||
-T SSL_METHOD
|
||||
-T SSL_SESSION
|
||||
-T SSL_SESSION_ASN1
|
||||
-T STACK_OF
|
||||
-T STORE
|
||||
-T STORE_ATTR_INFO
|
||||
-T STORE_ATTR_TYPES
|
||||
-T STORE_CERTIFICATE_STATUS
|
||||
-T STORE_CLEANUP_FUNC_PTR
|
||||
-T STORE_CTRL_FUNC_PTR
|
||||
-T STORE_END_OBJECT_FUNC_PTR
|
||||
-T STORE_GENERATE_OBJECT_FUNC_PTR
|
||||
-T STORE_GENERIC_FUNC_PTR
|
||||
-T STORE_GET_OBJECT_FUNC_PTR
|
||||
-T STORE_HANDLE_OBJECT_FUNC_PTR
|
||||
-T STORE_INITIALISE_FUNC_PTR
|
||||
-T STORE_METHOD
|
||||
-T STORE_MODIFY_OBJECT_FUNC_PTR
|
||||
-T STORE_NEXT_OBJECT_FUNC_PTR
|
||||
-T STORE_OBJECT
|
||||
-T STORE_OBJECT_TYPES
|
||||
-T STORE_PARAM_TYPES
|
||||
-T STORE_START_OBJECT_FUNC_PTR
|
||||
-T STORE_STORE_OBJECT_FUNC_PTR
|
||||
-T SW_ALGTYPE
|
||||
-T SW_BYTE
|
||||
-T SW_COMMAND_BITMAP
|
||||
-T SW_COMMAND_CODE
|
||||
-T SW_CONTEXT_HANDLE
|
||||
-T SW_CRT
|
||||
-T SW_DSA
|
||||
-T SW_EXP
|
||||
-T SW_LARGENUMBER
|
||||
-T SW_NVDATA
|
||||
-T SW_OSHANDLE
|
||||
-T SW_PARAM
|
||||
-T SW_STATE
|
||||
-T SW_STATUS
|
||||
-T SW_U16
|
||||
-T SW_U32
|
||||
-T SW_U64
|
||||
-T SXNET
|
||||
-T SXNETID
|
||||
-T TCHAR
|
||||
@@ -592,6 +512,7 @@
|
||||
-T asn1_ps_func
|
||||
-T bio_dgram_data
|
||||
-T bio_info_cb
|
||||
-T BIO_callack_fn
|
||||
-T char_io
|
||||
-T conf_finish_func
|
||||
-T conf_init_func
|
||||
@@ -653,9 +574,6 @@
|
||||
-T STACK_OF_GENERAL_SUBTREE_
|
||||
-T STACK_OF_IPAddressFamily_
|
||||
-T STACK_OF_IPAddressOrRange_
|
||||
-T STACK_OF_KRB5_APREQBODY_
|
||||
-T STACK_OF_KRB5_AUTHENTBODY_
|
||||
-T STACK_OF_KRB5_TKTBODY_
|
||||
-T STACK_OF_MEM_OBJECT_DATA_
|
||||
-T STACK_OF_MIME_HEADER_
|
||||
-T STACK_OF_MIME_PARAM_
|
||||
@@ -682,7 +600,6 @@
|
||||
-T STACK_OF_SRTP_PROTECTION_PROFILE_
|
||||
-T STACK_OF_SSL_CIPHER_
|
||||
-T STACK_OF_SSL_COMP_
|
||||
-T STACK_OF_STORE_ATTR_INFO_
|
||||
-T STACK_OF_STRING_
|
||||
-T STACK_OF_SXNETID_
|
||||
-T STACK_OF_SingleResponse_
|
||||
@@ -722,26 +639,6 @@
|
||||
-T clock_t
|
||||
-T custom_ext_methods
|
||||
-T hm_fragment
|
||||
-T krb5_auth_context
|
||||
-T krb5_authdata
|
||||
-T KRB5_CALLCONV
|
||||
-T krb5_ccache
|
||||
-T krb5_context
|
||||
-T krb5_creds
|
||||
-T krb5_data
|
||||
-T krb5_deltat
|
||||
-T krb5_flags
|
||||
-T krb5_int32
|
||||
-T krb5_keyblock
|
||||
-T krb5_keytab
|
||||
-T krb5_keytab_entry
|
||||
-T krb5_octet
|
||||
-T krb5_principal
|
||||
-T krb5_principal_data
|
||||
-T krb5_rcache
|
||||
-T krb5_ticket
|
||||
-T krb5_ticket_times
|
||||
-T krb5_timestamp
|
||||
-T record_pqueue
|
||||
-T ssl_ctx_st
|
||||
-T ssl_flag_tbl
|
||||
@@ -765,3 +662,10 @@
|
||||
-T SH_LIST
|
||||
-T PACKET
|
||||
-T RECORD_LAYER
|
||||
-T ASYNC_FIBRE
|
||||
-T ASYNC_CTX
|
||||
-T ASYNC_JOB
|
||||
-T intmax_t
|
||||
-T uintmax_t
|
||||
-T pqueue
|
||||
-T danetls_record
|
||||
|
||||
108
util/install.sh
108
util/install.sh
@@ -1,108 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5; it is not part of GNU.
|
||||
#
|
||||
# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
#
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
doit="${DOITPROG:-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG:-mv}"
|
||||
cpprog="${CPPROG:-cp}"
|
||||
chmodprog="${CHMODPROG:-chmod}"
|
||||
chownprog="${CHOWNPROG:-chown}"
|
||||
chgrpprog="${CHGRPPROG:-chgrp}"
|
||||
stripprog="${STRIPPROG:-strip}"
|
||||
rmprog="${RMPROG:-rm}"
|
||||
|
||||
instcmd="$mvprog"
|
||||
chmodcmd=""
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
src=""
|
||||
dst=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# if destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
fi
|
||||
|
||||
|
||||
# get rid of the old one and mode the new one in
|
||||
|
||||
$doit $rmcmd $dst
|
||||
$doit $instcmd $src $dst
|
||||
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; fi
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; fi
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; fi
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; fi
|
||||
|
||||
exit 0
|
||||
4232
util/libcrypto.num
Normal file
4232
util/libcrypto.num
Normal file
File diff suppressed because it is too large
Load Diff
4418
util/libeay.num
4418
util/libeay.num
File diff suppressed because it is too large
Load Diff
407
util/libssl.num
Normal file
407
util/libssl.num
Normal file
@@ -0,0 +1,407 @@
|
||||
SSL_get_selected_srtp_profile 1 1_1_0 EXIST::FUNCTION:SRTP
|
||||
SSL_set_read_ahead 2 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_accept_state 3 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_cipher_list 4 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_client_pwd_callback 5 1_1_0 EXIST::FUNCTION:SRP
|
||||
SSL_copy_session_id 6 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_password 7 1_1_0 EXIST::FUNCTION:SRP
|
||||
SSL_shutdown 8 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_msg_callback 9 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SESSION_get0_ticket 11 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get1_supported_ciphers 12 1_1_0 EXIST::FUNCTION:
|
||||
SSL_state_string_long 13 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_get0_certificate 14 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SESSION_set_ex_data 15 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_verify_depth 16 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get0_dane 17 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_sess_get_get_cb 18 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_get_default_passwd_cb_userdata 19 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_tmp_dh_callback 20 1_1_0 EXIST::FUNCTION:DH
|
||||
SSL_CTX_get_verify_depth 21 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_use_RSAPrivateKey_file 22 1_1_0 EXIST::FUNCTION:RSA
|
||||
SSL_use_PrivateKey_file 23 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_generate_session_id 24 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_ex_data_X509_STORE_CTX_idx 25 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_quiet_shutdown 26 1_1_0 EXIST::FUNCTION:
|
||||
SSL_dane_enable 27 1_1_0 EXIST::FUNCTION:
|
||||
SSL_COMP_add_compression_method 28 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_use_RSAPrivateKey 29 1_1_0 EXIST::FUNCTION:RSA
|
||||
SSL_CTX_sess_get_new_cb 30 1_1_0 EXIST::FUNCTION:
|
||||
d2i_SSL_SESSION 31 1_1_0 EXIST::FUNCTION:
|
||||
SSL_use_PrivateKey_ASN1 32 1_1_0 EXIST::FUNCTION:
|
||||
PEM_write_SSL_SESSION 33 1_1_0 EXIST::FUNCTION:STDIO
|
||||
SSL_CTX_set_session_id_context 34 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CIPHER_get_cipher_nid 35 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_srp_g 36 1_1_0 EXIST::FUNCTION:SRP
|
||||
SSL_want 37 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_cipher_list 38 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_verify_result 39 1_1_0 EXIST::FUNCTION:
|
||||
SSL_renegotiate 40 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_privatekey 41 1_1_0 EXIST::FUNCTION:
|
||||
SSL_peek 42 1_1_0 EXIST::FUNCTION:
|
||||
SRP_Calc_A_param 43 1_1_0 EXIST::FUNCTION:SRP
|
||||
SSL_SESSION_get_ticket_lifetime_hint 44 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SRP_CTX_free 45 1_1_0 EXIST::FUNCTION:SRP
|
||||
SSL_CTX_set_client_CA_list 46 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_next_proto_select_cb 47 1_1_0 EXIST::FUNCTION:NEXTPROTONEG
|
||||
BIO_ssl_copy_session_id 48 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_security_callback 49 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CONF_cmd_value_type 50 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_remove_session 51 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SESSION_new 52 1_1_0 EXIST::FUNCTION:
|
||||
TLSv1_2_server_method 53 1_1_0 EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_2_METHOD
|
||||
BIO_new_buffer_ssl_connect 54 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set0_security_ex_data 55 1_1_0 EXIST::FUNCTION:
|
||||
SSL_alert_desc_string 56 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get0_dane_authority 57 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_purpose 58 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_use_PrivateKey_file 59 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_rfd 60 1_1_0 EXIST::FUNCTION:
|
||||
DTLSv1_listen 61 1_1_0 EXIST::FUNCTION:SOCK
|
||||
SSL_set_ssl_method 62 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get0_security_ex_data 63 1_1_0 EXIST::FUNCTION:
|
||||
SSLv3_client_method 64 1_1_0 EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SSL3_METHOD
|
||||
SSL_set_security_level 65 1_1_0 EXIST::FUNCTION:
|
||||
DTLSv1_2_method 66 1_1_0 EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_2_METHOD
|
||||
SSL_get_fd 67 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get1_session 68 1_1_0 EXIST::FUNCTION:
|
||||
SSL_use_RSAPrivateKey 69 1_1_0 EXIST::FUNCTION:RSA
|
||||
SSL_CTX_set_srp_cb_arg 70 1_1_0 EXIST::FUNCTION:SRP
|
||||
SSL_CTX_add_session 71 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_srp_N 72 1_1_0 EXIST::FUNCTION:SRP
|
||||
SSL_has_matching_session_id 73 1_1_0 EXIST::FUNCTION:
|
||||
PEM_read_SSL_SESSION 74 1_1_0 EXIST::FUNCTION:STDIO
|
||||
SSL_get_shared_ciphers 75 1_1_0 EXIST::FUNCTION:
|
||||
SSL_add1_host 76 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CONF_cmd_argv 77 1_1_0 EXIST::FUNCTION:
|
||||
SSL_version 78 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SESSION_print 79 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_client_ciphers 80 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_srtp_profiles 81 1_1_0 EXIST::FUNCTION:SRTP
|
||||
SSL_use_certificate_ASN1 82 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_peer_certificate 83 1_1_0 EXIST::FUNCTION:
|
||||
DTLSv1_2_server_method 84 1_1_0 EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_2_METHOD
|
||||
SSL_set_cert_cb 85 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_cookie_verify_cb 86 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_shared_sigalgs 87 1_1_0 EXIST::FUNCTION:
|
||||
SSL_config 88 1_1_0 EXIST::FUNCTION:
|
||||
TLSv1_1_client_method 89 1_1_0 EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_1_METHOD
|
||||
SSL_CIPHER_standard_name 90 1_1_0 EXIST::FUNCTION:SSL_TRACE
|
||||
SSL_CTX_get_verify_mode 91 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_all_async_fds 92 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_check_private_key 93 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_wfd 94 1_1_0 EXIST::FUNCTION:SOCK
|
||||
SSL_get_client_CA_list 95 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_set_flags 96 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_username_callback 97 1_1_0 EXIST::FUNCTION:SRP
|
||||
SSL_connect 98 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_psk_identity 99 1_1_0 EXIST::FUNCTION:PSK
|
||||
SSL_CTX_use_certificate_file 100 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_session_ticket_ext 101 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_psk_server_callback 102 1_1_0 EXIST::FUNCTION:PSK
|
||||
SSL_get_sigalgs 103 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_next_protos_advertised_cb 104 1_1_0 EXIST::FUNCTION:NEXTPROTONEG
|
||||
SSL_CTX_set_trust 105 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_verify 106 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_rfd 107 1_1_0 EXIST::FUNCTION:SOCK
|
||||
SSL_SESSION_set_timeout 108 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_psk_client_callback 109 1_1_0 EXIST::FUNCTION:PSK
|
||||
SSL_get_client_random 110 1_1_0 EXIST::FUNCTION:
|
||||
TLS_method 111 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_clear_flags 112 1_1_0 EXIST::FUNCTION:
|
||||
TLSv1_client_method 113 1_1_0 EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_METHOD
|
||||
SSL_CIPHER_get_bits 114 1_1_0 EXIST::FUNCTION:
|
||||
SSL_test_functions 115 1_1_0 EXIST::FUNCTION:UNIT_TEST
|
||||
SSL_get_SSL_CTX 116 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_session 117 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_callback_ctrl 118 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_finished 119 1_1_0 EXIST::FUNCTION:
|
||||
SSL_add_dir_cert_subjects_to_stack 120 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_state 121 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_finish 122 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_add_server_custom_ext 123 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SESSION_get_ex_data 124 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_srp_username 125 1_1_0 EXIST::FUNCTION:SRP
|
||||
SSL_CTX_set_purpose 126 1_1_0 EXIST::FUNCTION:
|
||||
SSL_clear 127 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_cert_store 128 1_1_0 EXIST::FUNCTION:
|
||||
TLSv1_2_method 129 1_1_0 EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_2_METHOD
|
||||
SSL_session_reused 130 1_1_0 EXIST::FUNCTION:
|
||||
SSL_free 131 1_1_0 EXIST::FUNCTION:
|
||||
BIO_ssl_shutdown 132 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_get_client_CA_list 133 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_sessions 134 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_options 135 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_verify_depth 136 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_error 137 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_servername 138 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_version 139 1_1_0 EXIST::FUNCTION:
|
||||
SSL_state_string 140 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SESSION_get_timeout 141 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_sess_get_remove_cb 142 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_current_cipher 143 1_1_0 EXIST::FUNCTION:
|
||||
SSL_up_ref 144 1_1_0 EXIST::FUNCTION:
|
||||
SSL_export_keying_material 145 1_1_0 EXIST::FUNCTION:
|
||||
SSL_callback_ctrl 146 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_security_callback 147 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SRP_CTX_init 148 1_1_0 EXIST::FUNCTION:SRP
|
||||
ERR_load_SSL_strings 149 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_SRP_CTX_init 150 1_1_0 EXIST::FUNCTION:SRP
|
||||
SSL_SESSION_set_time 151 1_1_0 EXIST::FUNCTION:
|
||||
i2d_SSL_SESSION 152 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SESSION_get_master_key 153 1_1_0 EXIST::FUNCTION:
|
||||
SSL_COMP_get_compression_methods 154 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_alpn_select_cb 155 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_tmp_dh_callback 156 1_1_0 EXIST::FUNCTION:DH
|
||||
SSL_CTX_get_default_passwd_cb 157 1_1_0 EXIST::FUNCTION:
|
||||
TLSv1_server_method 158 1_1_0 EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_METHOD
|
||||
DTLS_server_method 159 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set0_rbio 160 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_options 161 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_msg_callback 162 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_free 163 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_get_ssl_method 164 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_server_random 165 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_shutdown 166 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_add_client_CA 167 1_1_0 EXIST::FUNCTION:
|
||||
TLSv1_1_server_method 168 1_1_0 EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_1_METHOD
|
||||
PEM_write_bio_SSL_SESSION 169 1_1_0 EXIST::FUNCTION:
|
||||
SSL_write 170 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set1_host 171 1_1_0 EXIST::FUNCTION:
|
||||
SSL_use_RSAPrivateKey_file 172 1_1_0 EXIST::FUNCTION:RSA
|
||||
SSL_CTX_get_info_callback 173 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get0_peername 174 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_srp_server_param 175 1_1_0 EXIST::FUNCTION:SRP
|
||||
TLS_server_method 176 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_psk_identity_hint 177 1_1_0 EXIST::FUNCTION:PSK
|
||||
SSL_set_session 178 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get0_param 179 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_default_passwd_cb 180 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_read_ahead 181 1_1_0 EXIST::FUNCTION:
|
||||
SSL_dup_CA_list 182 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_verify_callback 183 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_default_passwd_cb 184 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_servername_type 185 1_1_0 EXIST::FUNCTION:
|
||||
TLSv1_2_client_method 186 1_1_0 EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_2_METHOD
|
||||
SSL_add_client_CA 187 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_get0_security_ex_data 188 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_ex_data 189 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_flush_sessions 190 1_1_0 EXIST::FUNCTION:
|
||||
SSL_use_PrivateKey 191 1_1_0 EXIST::FUNCTION:
|
||||
DTLSv1_client_method 192 1_1_0 EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_METHOD
|
||||
SSL_CTX_dane_mtype_set 193 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_wfd 194 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_ssl_method 195 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_verify_result 196 1_1_0 EXIST::FUNCTION:
|
||||
SSL_use_RSAPrivateKey_ASN1 197 1_1_0 EXIST::FUNCTION:RSA
|
||||
SSL_CIPHER_get_name 198 1_1_0 EXIST::FUNCTION:
|
||||
OPENSSL_init_ssl 199 1_1_0 EXIST::FUNCTION:
|
||||
SSL_dup 200 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_use_serverinfo 201 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_use_serverinfo_file 202 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_options 203 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_default_verify_dir 204 1_1_0 EXIST::FUNCTION:
|
||||
SSL_do_handshake 205 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_get_ex_data 206 1_1_0 EXIST::FUNCTION:
|
||||
SSL_is_init_finished 207 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_default_verify_file 208 1_1_0 EXIST::FUNCTION:
|
||||
SSLv3_method 209 1_1_0 EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SSL3_METHOD
|
||||
SSL_CTX_set_cookie_generate_cb 210 1_1_0 EXIST::FUNCTION:
|
||||
SSL_certs_clear 211 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_connect_state 212 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_ex_data 213 1_1_0 EXIST::FUNCTION:
|
||||
SSL_rstate_string 214 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SESSION_get0_peer 215 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SESSION_get_compress_id 216 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_peer_cert_chain 217 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_cert_cb 218 1_1_0 EXIST::FUNCTION:
|
||||
PEM_read_bio_SSL_SESSION 219 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_info_callback 220 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_sess_set_new_cb 221 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_get_security_level 222 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_ctrl 223 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_alpn_protos 224 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_ex_data 225 1_1_0 EXIST::FUNCTION:
|
||||
SSL_rstate_string_long 226 1_1_0 EXIST::FUNCTION:
|
||||
SSL_ctrl 227 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_current_compression 228 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SESSION_has_ticket 229 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_cert_verify_callback 230 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_session_secret_cb 231 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_client_cert_engine 232 1_1_0 EXIST::FUNCTION:ENGINE
|
||||
SSL_CTX_get0_param 233 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set1_param 234 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_certificate 235 1_1_0 EXIST::FUNCTION:
|
||||
DTLSv1_server_method 236 1_1_0 EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_METHOD
|
||||
SSL_set_fd 237 1_1_0 EXIST::FUNCTION:SOCK
|
||||
SSL_use_certificate 238 1_1_0 EXIST::FUNCTION:
|
||||
DTLSv1_method 239 1_1_0 EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_METHOD
|
||||
SSL_set0_wbio 240 1_1_0 EXIST::FUNCTION:
|
||||
SSL_read 241 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_get_options 242 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_ssl_version 243 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_SSL_CTX 244 1_1_0 EXIST::FUNCTION:
|
||||
SSL_renegotiate_abbreviated 245 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_verify_mode 246 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CIPHER_get_id 247 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SESSION_print_keylog 248 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_psk_client_callback 249 1_1_0 EXIST::FUNCTION:PSK
|
||||
SSL_SESSION_get_time 250 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_debug 251 1_1_0 EXIST::FUNCTION:DEPRECATEDIN_1_1_0
|
||||
SSL_get_security_level 252 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CIPHER_description 253 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_default_passwd_cb_userdata 254 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_srp_userinfo 255 1_1_0 EXIST::FUNCTION:SRP
|
||||
SSL_extension_supported 256 1_1_0 EXIST::FUNCTION:
|
||||
SSL_dane_tlsa_add 257 1_1_0 EXIST::FUNCTION:
|
||||
SSL_srp_server_param_with_username 258 1_1_0 EXIST::FUNCTION:SRP
|
||||
SSL_CIPHER_get_version 259 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get0_verified_chain 260 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CIPHER_find 261 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_rbio 262 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_set_ssl 263 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_verify_depth 264 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_ciphers 265 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_config 266 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_set_ssl_ctx 267 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CONF_cmd 268 1_1_0 EXIST::FUNCTION:
|
||||
SSL_add_ssl_module 269 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_get_verify_callback 270 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set1_param 271 1_1_0 EXIST::FUNCTION:
|
||||
SSL_use_certificate_file 272 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_changed_async_fds 273 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_client_cert_cb 274 1_1_0 EXIST::FUNCTION:
|
||||
DTLS_client_method 275 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_trust 276 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_get_security_callback 277 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_clear_options 278 1_1_0 EXIST::FUNCTION:
|
||||
SSL_check_chain 279 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_sess_set_remove_cb 280 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_info_callback 281 1_1_0 EXIST::FUNCTION:
|
||||
SSL_pending 282 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_bio 283 1_1_0 EXIST::FUNCTION:
|
||||
BIO_new_ssl_connect 284 1_1_0 EXIST::FUNCTION:
|
||||
SSL_waiting_for_async 285 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_strength 286 1_1_0 EXIST::FUNCTION:SRP
|
||||
SSL_CTX_get_quiet_shutdown 287 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_use_certificate_chain_file 288 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_dane_enable 289 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_new 290 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get0_alpn_selected 291 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get0_next_proto_negotiated 292 1_1_0 EXIST::FUNCTION:NEXTPROTONEG
|
||||
SSL_set0_security_ex_data 293 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_tlsext_use_srtp 294 1_1_0 EXIST::FUNCTION:SRTP
|
||||
SSL_COMP_set0_compression_methods 295 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_not_resumable_session_callback 296 1_1_0 EXIST::FUNCTION:
|
||||
SSL_accept 297 1_1_0 EXIST::FUNCTION:
|
||||
SSL_use_psk_identity_hint 298 1_1_0 EXIST::FUNCTION:PSK
|
||||
SSL_trace 299 1_1_0 EXIST::FUNCTION:SSL_TRACE
|
||||
DTLS_method 300 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_verify_param_callback 301 1_1_0 EXIST::FUNCTION:SRP
|
||||
SSL_CTX_set_timeout 302 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_security_level 303 1_1_0 EXIST::FUNCTION:
|
||||
TLS_client_method 304 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_quiet_shutdown 305 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_up_ref 306 1_1_0 EXIST::FUNCTION:
|
||||
SSL_check_private_key 307 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_quiet_shutdown 308 1_1_0 EXIST::FUNCTION:
|
||||
SSL_select_next_proto 309 1_1_0 EXIST::FUNCTION:
|
||||
SSL_load_client_CA_file 310 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_srp_server_param_pw 311 1_1_0 EXIST::FUNCTION:SRP
|
||||
SSL_renegotiate_pending 312 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_new 313 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_session_ticket_ext_cb 314 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_get_timeout 315 1_1_0 EXIST::FUNCTION:
|
||||
SSL_use_certificate_chain_file 316 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_not_resumable_session_callback 317 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_SRP_CTX_free 318 1_1_0 EXIST::FUNCTION:SRP
|
||||
SSL_get_current_expansion 319 1_1_0 EXIST::FUNCTION:
|
||||
SSL_clear_options 320 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_use_PrivateKey 321 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_info_callback 322 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_use_psk_identity_hint 323 1_1_0 EXIST::FUNCTION:PSK
|
||||
SSL_CTX_use_RSAPrivateKey_ASN1 324 1_1_0 EXIST::FUNCTION:RSA
|
||||
SSL_CTX_use_PrivateKey_ASN1 325 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_get0_privatekey 326 1_1_0 EXIST::FUNCTION:
|
||||
BIO_f_ssl 327 1_1_0 EXIST::FUNCTION:
|
||||
SSLv3_server_method 328 1_1_0 EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SSL3_METHOD
|
||||
SSL_SESSION_free 329 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_shutdown 330 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_peer_finished 331 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_tlsext_use_srtp 332 1_1_0 EXIST::FUNCTION:SRTP
|
||||
TLSv1_method 333 1_1_0 EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_METHOD
|
||||
SSL_set_psk_server_callback 334 1_1_0 EXIST::FUNCTION:PSK
|
||||
SSL_CTX_set_alpn_protos 335 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_default_verify_paths 336 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_sess_set_get_cb 337 1_1_0 EXIST::FUNCTION:
|
||||
SSL_add_file_cert_subjects_to_stack 338 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_default_passwd_cb_userdata 339 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_security_callback 340 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_username 341 1_1_0 EXIST::FUNCTION:SRP
|
||||
SSL_COMP_get_name 342 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_default_passwd_cb_userdata 343 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_verify 344 1_1_0 EXIST::FUNCTION:
|
||||
SSL_in_before 345 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CIPHER_get_digest_nid 346 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_add_client_custom_ext 347 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_use_certificate 348 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_cipher_list 349 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_wbio 350 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_hostflags 351 1_1_0 EXIST::FUNCTION:
|
||||
SSL_alert_desc_string_long 352 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_default_timeout 353 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_session_id_context 354 1_1_0 EXIST::FUNCTION:
|
||||
SSL_new 355 1_1_0 EXIST::FUNCTION:
|
||||
TLSv1_1_method 356 1_1_0 EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_1_METHOD
|
||||
SSL_CTX_get_cert_store 357 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_load_verify_locations 358 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SESSION_print_fp 359 1_1_0 EXIST::FUNCTION:STDIO
|
||||
SSL_get0_dane_tlsa 360 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_generate_session_id 361 1_1_0 EXIST::FUNCTION:
|
||||
SSL_alert_type_string_long 362 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_set1_prefix 363 1_1_0 EXIST::FUNCTION:
|
||||
SSL_in_init 364 1_1_0 EXIST::FUNCTION:
|
||||
BIO_new_ssl 365 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_get_client_cert_cb 366 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_use_certificate_ASN1 367 1_1_0 EXIST::FUNCTION:
|
||||
SSL_set_client_CA_list 368 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_free 369 1_1_0 EXIST::FUNCTION:
|
||||
SSL_get_default_passwd_cb 370 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SESSION_get_id 371 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SESSION_set1_id_context 372 1_1_0 EXIST::FUNCTION:
|
||||
SSL_is_server 373 1_1_0 EXIST::FUNCTION:
|
||||
SSL_alert_type_string 374 1_1_0 EXIST::FUNCTION:
|
||||
DTLSv1_2_client_method 375 1_1_0 EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_2_METHOD
|
||||
SSL_CTX_set_ctlog_list_file 376 1_1_0 EXIST::FUNCTION:CT
|
||||
SSL_set_ct_validation_callback 377 1_1_0 EXIST::FUNCTION:CT
|
||||
SSL_CTX_set_default_ctlog_list_file 378 1_1_0 EXIST::FUNCTION:CT
|
||||
SSL_CTX_has_client_custom_ext 379 1_1_0 EXIST::FUNCTION:
|
||||
SSL_ct_is_enabled 380 1_1_0 EXIST::FUNCTION:CT
|
||||
SSL_get0_peer_scts 381 1_1_0 EXIST::FUNCTION:CT
|
||||
SSL_CTX_set_ct_validation_callback 382 1_1_0 EXIST::FUNCTION:CT
|
||||
SSL_CTX_ct_is_enabled 383 1_1_0 EXIST::FUNCTION:CT
|
||||
SSL_set_default_read_buffer_len 384 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set_default_read_buffer_len 385 1_1_0 EXIST::FUNCTION:
|
||||
SSL_has_pending 386 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CIPHER_get_auth_nid 387 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CIPHER_get_kx_nid 388 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CIPHER_is_aead 389 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SESSION_up_ref 390 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_set0_ctlog_store 391 1_1_0 EXIST::FUNCTION:CT
|
||||
SSL_CTX_get0_ctlog_store 392 1_1_0 EXIST::FUNCTION:CT
|
||||
SSL_enable_ct 393 1_1_0 EXIST::FUNCTION:CT
|
||||
SSL_CTX_enable_ct 394 1_1_0 EXIST::FUNCTION:CT
|
||||
SSL_CTX_get_ciphers 395 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SESSION_get0_hostname 396 1_1_0 EXIST::FUNCTION:
|
||||
SSL_client_version 397 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SESSION_get_protocol_version 398 1_1_0 EXIST::FUNCTION:
|
||||
SSL_is_dtls 399 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_dane_set_flags 400 1_1_0 EXIST::FUNCTION:
|
||||
SSL_dane_set_flags 401 1_1_0 EXIST::FUNCTION:
|
||||
SSL_CTX_dane_clear_flags 402 1_1_0 EXIST::FUNCTION:
|
||||
SSL_dane_clear_flags 403 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SESSION_get0_cipher 404 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SESSION_get0_id_context 405 1_1_0 EXIST::FUNCTION:
|
||||
SSL_SESSION_set1_id 406 1_1_0 EXIST::FUNCTION:
|
||||
SSL_COMP_get_id 412 1_1_0d EXIST::FUNCTION:
|
||||
SSL_COMP_get0_name 413 1_1_0d EXIST::FUNCTION:
|
||||
30
util/local_shlib.com.in
Normal file
30
util/local_shlib.com.in
Normal file
@@ -0,0 +1,30 @@
|
||||
${-
|
||||
use File::Spec::Functions qw(rel2abs);
|
||||
|
||||
my $bldtop = rel2abs($config{builddir});
|
||||
our %names = ( map { $_ => $bldtop.$_.".EXE" }
|
||||
map { $unified_info{sharednames}->{$_} || () }
|
||||
@{$unified_info{libraries}} );
|
||||
"" -}
|
||||
$ ! Create a local environment with the shared library logical names
|
||||
$ ! properly set. Undo this with unlocal_shlib.com
|
||||
$
|
||||
$ OPENSSL_NAMES := OPENSSL_NAMES_'F$GETJPI("","PID")'
|
||||
$ CREATE/NAME_TABLE/PARENT_TABLE=LNM$PROCESS_DIRECTORY 'OPENSSL_NAMES'
|
||||
$ DEFINE/TABLE='OPENSSL_NAMES' OSSL_FLAG YES
|
||||
$
|
||||
$ NAMES := {- join(",", keys %names); -}
|
||||
{-
|
||||
join("\n", map { "\$ __$_ = \"".$names{$_}."\"" } keys %names);
|
||||
-}
|
||||
$ I = 0
|
||||
$ LOOP:
|
||||
$ E = F$ELEMENT(I,",",NAMES)
|
||||
$ I = I + 1
|
||||
$ IF E .EQS. "," THEN GOTO ENDLOOP
|
||||
$ EV = __'E'
|
||||
$ OLDV = F$TRNLNM(E,"LNM$PROCESS")
|
||||
$ IF OLDV .NES. "" THEN DEFINE/TABLE='OPENSSL_NAMES' 'E' 'OLDV'
|
||||
$ DEFINE 'E' 'EV'
|
||||
$ GOTO LOOP
|
||||
$ ENDLOOP:
|
||||
1327
util/mk1mf.pl
1327
util/mk1mf.pl
File diff suppressed because it is too large
Load Diff
@@ -1,35 +1,41 @@
|
||||
#!/usr/local/bin/perl
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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
|
||||
|
||||
|
||||
my ($cflags, $platform) = @ARGV;
|
||||
|
||||
$cflags = "compiler: $cflags";
|
||||
$date = localtime();
|
||||
print <<"END_OUTPUT";
|
||||
#ifndef MK1MF_BUILD
|
||||
/* auto-generated by util/mkbuildinf.pl for crypto/cversion.c */
|
||||
#define CFLAGS cflags
|
||||
/*
|
||||
* Generate CFLAGS as an array of individual characters. This is a
|
||||
* workaround for the situation where CFLAGS gets too long for a C90 string
|
||||
* literal
|
||||
*/
|
||||
static const char cflags[] = {
|
||||
/* auto-generated by util/mkbuildinf.pl for crypto/cversion.c */
|
||||
#define CFLAGS cflags
|
||||
/*
|
||||
* Generate CFLAGS as an array of individual characters. This is a
|
||||
* workaround for the situation where CFLAGS gets too long for a C90 string
|
||||
* literal
|
||||
*/
|
||||
static const char cflags[] = {
|
||||
END_OUTPUT
|
||||
my $ctr = 0;
|
||||
foreach my $c (split //, $cflags) {
|
||||
# Max 18 characters per line
|
||||
if (($ctr++ % 18) == 0) {
|
||||
$c =~ s|([\\'])|\\$1|;
|
||||
# Max 16 characters per line
|
||||
if (($ctr++ % 16) == 0) {
|
||||
if ($ctr != 1) {
|
||||
print "\n";
|
||||
}
|
||||
print " ";
|
||||
print " ";
|
||||
}
|
||||
print "'$c',";
|
||||
}
|
||||
print <<"END_OUTPUT";
|
||||
'\\0'
|
||||
};
|
||||
#define PLATFORM "platform: $platform"
|
||||
#define DATE "built on: $date"
|
||||
#endif
|
||||
};
|
||||
#define PLATFORM "platform: $platform"
|
||||
#define DATE "built on: $date"
|
||||
END_OUTPUT
|
||||
|
||||
@@ -18,7 +18,7 @@ CONF="-config ../apps/openssl.cnf"
|
||||
# create pca request.
|
||||
echo creating $CAbits bit PCA cert request
|
||||
$SSLEAY req $CONF \
|
||||
-new -md5 -newkey $CAbits \
|
||||
-new -sha256 -newkey $CAbits \
|
||||
-keyout pca-key.pem \
|
||||
-out pca-req.pem -nodes >/dev/null <<EOF
|
||||
AU
|
||||
@@ -40,7 +40,7 @@ fi
|
||||
#sign it.
|
||||
echo
|
||||
echo self signing PCA
|
||||
$SSLEAY x509 -md5 -days 1461 \
|
||||
$SSLEAY x509 -sha256 -days 36525 \
|
||||
-req -signkey pca-key.pem \
|
||||
-CAcreateserial -CAserial pca-cert.srl \
|
||||
-in pca-req.pem -out pca-cert.pem
|
||||
@@ -54,7 +54,7 @@ echo
|
||||
# create ca request.
|
||||
echo creating $CAbits bit CA cert request
|
||||
$SSLEAY req $CONF \
|
||||
-new -md5 -newkey $CAbits \
|
||||
-new -sha256 -newkey $CAbits \
|
||||
-keyout ca-key.pem \
|
||||
-out ca-req.pem -nodes >/dev/null <<EOF
|
||||
AU
|
||||
@@ -76,7 +76,7 @@ fi
|
||||
#sign it.
|
||||
echo
|
||||
echo signing CA
|
||||
$SSLEAY x509 -md5 -days 1461 \
|
||||
$SSLEAY x509 -sha256 -days 36525 \
|
||||
-req \
|
||||
-CAcreateserial -CAserial pca-cert.srl \
|
||||
-CA pca-cert.pem -CAkey pca-key.pem \
|
||||
@@ -91,7 +91,7 @@ echo
|
||||
# create server request.
|
||||
echo creating 512 bit server cert request
|
||||
$SSLEAY req $CONF \
|
||||
-new -md5 -newkey 512 \
|
||||
-new -sha256 -newkey 512 \
|
||||
-keyout s512-key.pem \
|
||||
-out s512-req.pem -nodes >/dev/null <<EOF
|
||||
AU
|
||||
@@ -113,7 +113,7 @@ fi
|
||||
#sign it.
|
||||
echo
|
||||
echo signing 512 bit server cert
|
||||
$SSLEAY x509 -md5 -days 365 \
|
||||
$SSLEAY x509 -sha256 -days 36525 \
|
||||
-req \
|
||||
-CAcreateserial -CAserial ca-cert.srl \
|
||||
-CA ca-cert.pem -CAkey ca-key.pem \
|
||||
@@ -128,7 +128,7 @@ echo
|
||||
# create 1024 bit server request.
|
||||
echo creating 1024 bit server cert request
|
||||
$SSLEAY req $CONF \
|
||||
-new -md5 -newkey 1024 \
|
||||
-new -sha256 -newkey 1024 \
|
||||
-keyout s1024key.pem \
|
||||
-out s1024req.pem -nodes >/dev/null <<EOF
|
||||
AU
|
||||
@@ -150,7 +150,7 @@ fi
|
||||
#sign it.
|
||||
echo
|
||||
echo signing 1024 bit server cert
|
||||
$SSLEAY x509 -md5 -days 365 \
|
||||
$SSLEAY x509 -sha256 -days 36525 \
|
||||
-req \
|
||||
-CAcreateserial -CAserial ca-cert.srl \
|
||||
-CA ca-cert.pem -CAkey ca-key.pem \
|
||||
@@ -165,7 +165,7 @@ echo
|
||||
# create 512 bit client request.
|
||||
echo creating 512 bit client cert request
|
||||
$SSLEAY req $CONF \
|
||||
-new -md5 -newkey 512 \
|
||||
-new -sha256 -newkey 512 \
|
||||
-keyout c512-key.pem \
|
||||
-out c512-req.pem -nodes >/dev/null <<EOF
|
||||
AU
|
||||
@@ -187,7 +187,7 @@ fi
|
||||
#sign it.
|
||||
echo
|
||||
echo signing 512 bit client cert
|
||||
$SSLEAY x509 -md5 -days 365 \
|
||||
$SSLEAY x509 -sha256 -days 36525 \
|
||||
-req \
|
||||
-CAcreateserial -CAserial ca-cert.srl \
|
||||
-CA ca-cert.pem -CAkey ca-key.pem \
|
||||
|
||||
984
util/mkdef.pl
984
util/mkdef.pl
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,10 @@
|
||||
#!/usr/local/bin/perl
|
||||
|
||||
# mkdir-p.pl
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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
|
||||
|
||||
# On some systems, the -p option to mkdir (= also create any missing parent
|
||||
# directories) is not available.
|
||||
@@ -29,6 +33,12 @@ sub do_mkdir_p {
|
||||
do_mkdir_p($parent);
|
||||
}
|
||||
|
||||
mkdir($dir, 0777) || die "Cannot create directory $dir: $!\n";
|
||||
unless (mkdir($dir, 0777)) {
|
||||
if (-d $dir) {
|
||||
# We raced against another instance doing the same thing.
|
||||
return;
|
||||
}
|
||||
die "Cannot create directory $dir: $!\n";
|
||||
}
|
||||
print "created directory `$dir'\n";
|
||||
}
|
||||
|
||||
188
util/mkerr.pl
188
util/mkerr.pl
@@ -1,14 +1,22 @@
|
||||
#!/usr/local/bin/perl -w
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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
|
||||
|
||||
my $config = "crypto/err/openssl.ec";
|
||||
my $hprefix = "openssl/";
|
||||
my $debug = 0;
|
||||
my $unref = 0;
|
||||
my $rebuild = 0;
|
||||
my $static = 1;
|
||||
my $recurse = 0;
|
||||
my $reindex = 0;
|
||||
my $dowrite = 0;
|
||||
my $staticloader = "";
|
||||
my @t = localtime();
|
||||
my $YEAR = @t[5] + 1900;
|
||||
|
||||
my $pack_errcode;
|
||||
my $load_errcode;
|
||||
@@ -26,6 +34,7 @@ while (@ARGV) {
|
||||
$hprefix = shift @ARGV;
|
||||
} elsif($arg eq "-debug") {
|
||||
$debug = 1;
|
||||
$unref = 1;
|
||||
shift @ARGV;
|
||||
} elsif($arg eq "-rebuild") {
|
||||
$rebuild = 1;
|
||||
@@ -42,6 +51,9 @@ while (@ARGV) {
|
||||
} elsif($arg eq "-staticloader") {
|
||||
$staticloader = "static ";
|
||||
shift @ARGV;
|
||||
} elsif($arg eq "-unref") {
|
||||
$unref = 1;
|
||||
shift @ARGV;
|
||||
} elsif($arg eq "-write") {
|
||||
$dowrite = 1;
|
||||
shift @ARGV;
|
||||
@@ -57,6 +69,8 @@ Options:
|
||||
-hprefix P Prepend the filenames in generated #include <header>
|
||||
statements with prefix P. Default: 'openssl/' (without
|
||||
the quotes, naturally)
|
||||
NOTE: not used any more because our include directory
|
||||
structure has changed.
|
||||
|
||||
-debug Turn on debugging verbose output on stderr.
|
||||
|
||||
@@ -89,7 +103,7 @@ Options:
|
||||
void ERR_load_<LIB>_strings(void);
|
||||
void ERR_unload_<LIB>_strings(void);
|
||||
void ERR_<LIB>_error(int f, int r, char *fn, int ln);
|
||||
#define <LIB>err(f,r) ERR_<LIB>_error(f,r,__FILE__,__LINE__)
|
||||
#define <LIB>err(f,r) ERR_<LIB>_error(f,r,OPENSSL_FILE,OPENSSL_LINE)
|
||||
while the code facilitates the use of these in an environment
|
||||
where the error support routines are dynamically loaded at
|
||||
runtime.
|
||||
@@ -98,6 +112,8 @@ Options:
|
||||
-staticloader Prefix generated functions with the 'static' scope modifier.
|
||||
Default: don't write any scope modifier prefix.
|
||||
|
||||
-unref Print out unreferenced function and reason codes.
|
||||
|
||||
-write Actually (over)write the generated code to the header and C
|
||||
source files as assigned to each library through the config
|
||||
file.
|
||||
@@ -116,7 +132,7 @@ EOF
|
||||
}
|
||||
|
||||
if($recurse) {
|
||||
@source = (<crypto/*.c>, <crypto/*/*.c>, <ssl/*.c>);
|
||||
@source = ( <crypto/*.c>, <crypto/*/*.c>, <ssl/*.c>, <ssl/*/*.c> )
|
||||
} else {
|
||||
@source = @ARGV;
|
||||
}
|
||||
@@ -328,9 +344,18 @@ foreach $file (@source) {
|
||||
next if exists $cskip{$file};
|
||||
print STDERR "File loaded: ".$file."\r" if $debug;
|
||||
open(IN, "<$file") || die "Can't open source file $file\n";
|
||||
my $func;
|
||||
my $linenr = 0;
|
||||
while(<IN>) {
|
||||
# skip obsoleted source files entirely!
|
||||
last if(/^#error\s+obsolete/);
|
||||
$linenr++;
|
||||
if (!/;$/ && /^\**([a-zA-Z_].*[\s*])?([A-Za-z_0-9]+)\(.*([),]|$)/)
|
||||
{
|
||||
/^([^()]*(\([^()]*\)[^()]*)*)\(/;
|
||||
$1 =~ /([A-Za-z_0-9]*)$/;
|
||||
$func = $1;
|
||||
}
|
||||
|
||||
if(/(([A-Z0-9]+)_F_([A-Z0-9_]+))/) {
|
||||
next unless exists $csrc{$2};
|
||||
@@ -340,7 +365,11 @@ foreach $file (@source) {
|
||||
$fcodes{$1} = "X";
|
||||
$fnew{$2}++;
|
||||
}
|
||||
$notrans{$1} = 1 unless exists $ftrans{$3};
|
||||
$ftrans{$3} = $func unless exists $ftrans{$3};
|
||||
if (uc $func ne $3) {
|
||||
print STDERR "ERROR: mismatch $file:$linenr $func:$3\n";
|
||||
$errcount++;
|
||||
}
|
||||
print STDERR "Function: $1\t= $fcodes{$1} (lib: $2, name: $3)\n" if $debug;
|
||||
}
|
||||
if(/(([A-Z0-9]+)_R_[A-Z0-9_]+)/) {
|
||||
@@ -364,7 +393,6 @@ foreach $lib (keys %csrc)
|
||||
my $hfile = $hinc{$lib};
|
||||
my $cfile = $csrc{$lib};
|
||||
if(!$fnew{$lib} && !$rnew{$lib}) {
|
||||
print STDERR "$lib:\t\tNo new error codes\n";
|
||||
next unless $rebuild;
|
||||
} else {
|
||||
print STDERR "$lib:\t\t$fnew{$lib} New Functions,";
|
||||
@@ -398,58 +426,13 @@ foreach $lib (keys %csrc)
|
||||
$cpp = 1;
|
||||
$cplusplus = 1;
|
||||
push @out,
|
||||
"/* ====================================================================\n",
|
||||
" * Copyright (c) 2001-$year The OpenSSL Project. All rights reserved.\n",
|
||||
" *\n",
|
||||
" * Redistribution and use in source and binary forms, with or without\n",
|
||||
" * modification, are permitted provided that the following conditions\n",
|
||||
" * are met:\n",
|
||||
" *\n",
|
||||
" * 1. Redistributions of source code must retain the above copyright\n",
|
||||
" * notice, this list of conditions and the following disclaimer. \n",
|
||||
" *\n",
|
||||
" * 2. Redistributions in binary form must reproduce the above copyright\n",
|
||||
" * notice, this list of conditions and the following disclaimer in\n",
|
||||
" * the documentation and/or other materials provided with the\n",
|
||||
" * distribution.\n",
|
||||
" *\n",
|
||||
" * 3. All advertising materials mentioning features or use of this\n",
|
||||
" * software must display the following acknowledgment:\n",
|
||||
" * \"This product includes software developed by the OpenSSL Project\n",
|
||||
" * for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n",
|
||||
" *\n",
|
||||
" * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n",
|
||||
" * endorse or promote products derived from this software without\n",
|
||||
" * prior written permission. For written permission, please contact\n",
|
||||
" * openssl-core\@openssl.org.\n",
|
||||
" *\n",
|
||||
" * 5. Products derived from this software may not be called \"OpenSSL\"\n",
|
||||
" * nor may \"OpenSSL\" appear in their names without prior written\n",
|
||||
" * permission of the OpenSSL Project.\n",
|
||||
" *\n",
|
||||
" * 6. Redistributions of any form whatsoever must retain the following\n",
|
||||
" * acknowledgment:\n",
|
||||
" * \"This product includes software developed by the OpenSSL Project\n",
|
||||
" * for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n",
|
||||
" *\n",
|
||||
" * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n",
|
||||
" * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n",
|
||||
" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n",
|
||||
" * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR\n",
|
||||
" * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n",
|
||||
" * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n",
|
||||
" * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n",
|
||||
" * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n",
|
||||
" * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n",
|
||||
" * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n",
|
||||
" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n",
|
||||
" * OF THE POSSIBILITY OF SUCH DAMAGE.\n",
|
||||
" * ====================================================================\n",
|
||||
" *\n",
|
||||
" * This product includes cryptographic software written by Eric Young\n",
|
||||
" * (eay\@cryptsoft.com). This product includes software written by Tim\n",
|
||||
" * Hudson (tjh\@cryptsoft.com).\n",
|
||||
"/*\n",
|
||||
" * Copyright 1995-$YEAR The OpenSSL Project Authors. All Rights Reserved.\n",
|
||||
" *\n",
|
||||
" * Licensed under the OpenSSL license (the \"License\"). You may not use\n",
|
||||
" * this file except in compliance with the License. You can obtain a copy\n",
|
||||
" * in the file LICENSE in the source distribution or at\n",
|
||||
" * https://www.openssl.org/source/license.html\n",
|
||||
" */\n",
|
||||
"\n",
|
||||
"#ifndef HEADER_${lib}_ERR_H\n",
|
||||
@@ -474,15 +457,15 @@ foreach $lib (keys %csrc)
|
||||
EOF
|
||||
if($static) {
|
||||
print OUT <<"EOF";
|
||||
${staticloader}void ERR_load_${lib}_strings(void);
|
||||
${staticloader}int ERR_load_${lib}_strings(void);
|
||||
|
||||
EOF
|
||||
} else {
|
||||
print OUT <<"EOF";
|
||||
${staticloader}void ERR_load_${lib}_strings(void);
|
||||
${staticloader}int ERR_load_${lib}_strings(void);
|
||||
${staticloader}void ERR_unload_${lib}_strings(void);
|
||||
${staticloader}void ERR_${lib}_error(int function, int reason, char *file, int line);
|
||||
# define ${lib}err(f,r) ERR_${lib}_error((f),(r),__FILE__,__LINE__)
|
||||
# define ${lib}err(f,r) ERR_${lib}_error((f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
|
||||
EOF
|
||||
}
|
||||
@@ -551,7 +534,7 @@ EOF
|
||||
if (open(IN,"<$cfile")) {
|
||||
my $line = "";
|
||||
while (<IN>) {
|
||||
chomp;
|
||||
s|\R$||; # Better chomp
|
||||
$_ = $line . $_;
|
||||
$line = "";
|
||||
if (/{ERR_(FUNC|REASON)\(/) {
|
||||
@@ -574,8 +557,12 @@ EOF
|
||||
my $hincf;
|
||||
if($static) {
|
||||
$hincf = $hfile;
|
||||
$hincf =~ s|.*/||g;
|
||||
$hincf = "<${hprefix}${hincf}>";
|
||||
$hincf =~ s|.*include/||;
|
||||
if ($hincf =~ m|^openssl/|) {
|
||||
$hincf = "<${hincf}>";
|
||||
} else {
|
||||
$hincf = "\"${hincf}\"";
|
||||
}
|
||||
} else {
|
||||
$hincf = "\"$hfile\"";
|
||||
}
|
||||
@@ -598,65 +585,14 @@ EOF
|
||||
open (OUT,">$cfile") || die "Can't open $cfile for writing";
|
||||
|
||||
print OUT <<"EOF";
|
||||
/* $cfile */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999-$year The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* openssl-core\@OpenSSL.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay\@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh\@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* NOTE: this file was auto generated by the mkerr.pl script: any changes
|
||||
* made to it will be overwritten when the script next updates this file,
|
||||
* only reason strings will be preserved.
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-$YEAR The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (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
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -716,7 +652,7 @@ if($static) {
|
||||
|
||||
#endif
|
||||
|
||||
${staticloader}void ERR_load_${lib}_strings(void)
|
||||
${staticloader}int ERR_load_${lib}_strings(void)
|
||||
{
|
||||
#ifndef OPENSSL_NO_ERR
|
||||
|
||||
@@ -725,6 +661,7 @@ ${staticloader}void ERR_load_${lib}_strings(void)
|
||||
ERR_load_strings($load_errcode, ${lib}_str_reasons);
|
||||
}
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
EOF
|
||||
} else {
|
||||
@@ -744,7 +681,7 @@ static ERR_STRING_DATA ${lib}_lib_name[] = {
|
||||
static int ${lib}_lib_error_code = 0;
|
||||
static int ${lib}_error_init = 1;
|
||||
|
||||
${staticloader}void ERR_load_${lib}_strings(void)
|
||||
${staticloader}int ERR_load_${lib}_strings(void)
|
||||
{
|
||||
if (${lib}_lib_error_code == 0)
|
||||
${lib}_lib_error_code = ERR_get_next_error_library();
|
||||
@@ -761,6 +698,7 @@ ${staticloader}void ERR_load_${lib}_strings(void)
|
||||
ERR_load_strings(0, ${lib}_lib_name);
|
||||
#endif
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
${staticloader}void ERR_unload_${lib}_strings(void)
|
||||
@@ -810,7 +748,7 @@ foreach (keys %rcodes) {
|
||||
push (@runref, $_) unless exists $urcodes{$_};
|
||||
}
|
||||
|
||||
if($debug && @funref) {
|
||||
if($unref && @funref) {
|
||||
print STDERR "The following function codes were not referenced:\n";
|
||||
foreach(sort @funref)
|
||||
{
|
||||
@@ -818,7 +756,7 @@ if($debug && @funref) {
|
||||
}
|
||||
}
|
||||
|
||||
if($debug && @runref) {
|
||||
if($unref && @runref) {
|
||||
print STDERR "The following reason codes were not referenced:\n";
|
||||
foreach(sort @runref)
|
||||
{
|
||||
|
||||
143
util/mkfiles.pl
143
util/mkfiles.pl
@@ -1,143 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
#
|
||||
# This is a hacked version of files.pl for systems that can't do a 'make files'.
|
||||
# Do a perl util/mkminfo.pl >MINFO to build MINFO
|
||||
# Written by Steve Henson 1999.
|
||||
|
||||
# List of directories to process
|
||||
|
||||
my @dirs = (
|
||||
".",
|
||||
"crypto",
|
||||
"crypto/md2",
|
||||
"crypto/md4",
|
||||
"crypto/md5",
|
||||
"crypto/sha",
|
||||
"crypto/mdc2",
|
||||
"crypto/hmac",
|
||||
"crypto/cmac",
|
||||
"crypto/ripemd",
|
||||
"crypto/des",
|
||||
"crypto/rc2",
|
||||
"crypto/rc4",
|
||||
"crypto/rc5",
|
||||
"crypto/idea",
|
||||
"crypto/bf",
|
||||
"crypto/cast",
|
||||
"crypto/aes",
|
||||
"crypto/camellia",
|
||||
"crypto/seed",
|
||||
"crypto/modes",
|
||||
"crypto/bn",
|
||||
"crypto/rsa",
|
||||
"crypto/dsa",
|
||||
"crypto/dso",
|
||||
"crypto/dh",
|
||||
"crypto/ec",
|
||||
"crypto/ecdh",
|
||||
"crypto/ecdsa",
|
||||
"crypto/buffer",
|
||||
"crypto/bio",
|
||||
"crypto/stack",
|
||||
"crypto/lhash",
|
||||
"crypto/rand",
|
||||
"crypto/err",
|
||||
"crypto/objects",
|
||||
"crypto/evp",
|
||||
"crypto/asn1",
|
||||
"crypto/pem",
|
||||
"crypto/x509",
|
||||
"crypto/x509v3",
|
||||
"crypto/cms",
|
||||
"crypto/conf",
|
||||
"crypto/jpake",
|
||||
"crypto/txt_db",
|
||||
"crypto/pkcs7",
|
||||
"crypto/pkcs12",
|
||||
"crypto/comp",
|
||||
"crypto/engine",
|
||||
"crypto/ocsp",
|
||||
"crypto/ui",
|
||||
"crypto/krb5",
|
||||
#"crypto/store",
|
||||
"crypto/pqueue",
|
||||
"crypto/whrlpool",
|
||||
"crypto/ts",
|
||||
"crypto/srp",
|
||||
"ssl",
|
||||
"apps",
|
||||
"engines",
|
||||
"engines/ccgost",
|
||||
"test",
|
||||
"tools"
|
||||
);
|
||||
|
||||
%top;
|
||||
|
||||
foreach (@dirs) {
|
||||
&files_dir ($_, "Makefile");
|
||||
}
|
||||
|
||||
exit(0);
|
||||
|
||||
sub files_dir
|
||||
{
|
||||
my ($dir, $makefile) = @_;
|
||||
|
||||
my %sym;
|
||||
|
||||
open (IN, "$dir/$makefile") || die "Can't open $dir/$makefile";
|
||||
|
||||
my $s="";
|
||||
|
||||
while (<IN>)
|
||||
{
|
||||
chop;
|
||||
s/#.*//;
|
||||
if (/^(\S+)\s*=\s*(.*)$/)
|
||||
{
|
||||
$o="";
|
||||
($s,$b)=($1,$2);
|
||||
for (;;)
|
||||
{
|
||||
if ($b =~ /\\$/)
|
||||
{
|
||||
chop($b);
|
||||
$o.=$b." ";
|
||||
$b=<IN>;
|
||||
chop($b);
|
||||
}
|
||||
else
|
||||
{
|
||||
$o.=$b." ";
|
||||
last;
|
||||
}
|
||||
}
|
||||
$o =~ s/^\s+//;
|
||||
$o =~ s/\s+$//;
|
||||
$o =~ s/\s+/ /g;
|
||||
|
||||
$o =~ s/\$[({]([^)}]+)[)}]/$top{$1} or $sym{$1}/ge;
|
||||
$sym{$s}=($top{$s} or $o);
|
||||
}
|
||||
}
|
||||
|
||||
print "RELATIVE_DIRECTORY=$dir\n";
|
||||
|
||||
foreach (sort keys %sym)
|
||||
{
|
||||
print "$_=$sym{$_}\n";
|
||||
}
|
||||
if ($dir eq "." && defined($sym{"BUILDENV"}))
|
||||
{
|
||||
foreach (split(' ',$sym{"BUILDENV"}))
|
||||
{
|
||||
/^(.+)=/;
|
||||
$top{$1}=$sym{$1};
|
||||
}
|
||||
}
|
||||
|
||||
print "RELATIVE_DIRECTORY=\n";
|
||||
|
||||
close (IN);
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
|
||||
# mklink.pl
|
||||
|
||||
# The first command line argument is a non-empty relative path
|
||||
# specifying the "from" directory.
|
||||
# Each other argument is a file name not containing / and
|
||||
# names a file in the current directory.
|
||||
#
|
||||
# For each of these files, we create in the "from" directory a link
|
||||
# of the same name pointing to the local file.
|
||||
#
|
||||
# We assume that the directory structure is a tree, i.e. that it does
|
||||
# not contain symbolic links and that the parent of / is never referenced.
|
||||
# Apart from this, this script should be able to handle even the most
|
||||
# pathological cases.
|
||||
|
||||
use Cwd;
|
||||
|
||||
my $from = shift;
|
||||
my @files = @ARGV;
|
||||
|
||||
my @from_path = split(/[\\\/]/, $from);
|
||||
my $pwd = getcwd();
|
||||
chomp($pwd);
|
||||
my @pwd_path = split(/[\\\/]/, $pwd);
|
||||
|
||||
my @to_path = ();
|
||||
|
||||
my $dirname;
|
||||
foreach $dirname (@from_path) {
|
||||
|
||||
# In this loop, @to_path always is a relative path from
|
||||
# @pwd_path (interpreted is an absolute path) to the original pwd.
|
||||
|
||||
# At the end, @from_path (as a relative path from the original pwd)
|
||||
# designates the same directory as the absolute path @pwd_path,
|
||||
# which means that @to_path then is a path from there to the original pwd.
|
||||
|
||||
next if ($dirname eq "" || $dirname eq ".");
|
||||
|
||||
if ($dirname eq "..") {
|
||||
@to_path = (pop(@pwd_path), @to_path);
|
||||
} else {
|
||||
@to_path = ("..", @to_path);
|
||||
push(@pwd_path, $dirname);
|
||||
}
|
||||
}
|
||||
|
||||
my $to = join('/', @to_path);
|
||||
|
||||
my $file;
|
||||
$symlink_exists=eval {symlink("",""); 1};
|
||||
if ($^O eq "msys") { $symlink_exists=0 };
|
||||
foreach $file (@files) {
|
||||
my $err = "";
|
||||
if ($symlink_exists) {
|
||||
if (!-l "$from/$file") {
|
||||
unlink "$from/$file";
|
||||
symlink("$to/$file", "$from/$file") or $err = " [$!]";
|
||||
}
|
||||
} elsif (-d "$from" && (!-f "$from/$file" || ((stat("$file"))[9] > (stat("$from/$file"))[9]))) {
|
||||
unlink "$from/$file";
|
||||
open (OLD, "<$file") or die "Can't open $file: $!";
|
||||
open (NEW, ">$from/$file") or die "Can't open $from/$file: $!";
|
||||
binmode(OLD);
|
||||
binmode(NEW);
|
||||
while (<OLD>) {
|
||||
print NEW $_;
|
||||
}
|
||||
close (OLD) or die "Can't close $file: $!";
|
||||
close (NEW) or die "Can't close $from/$file: $!";
|
||||
}
|
||||
print $file . " => $from/$file$err\n";
|
||||
}
|
||||
18
util/mkrc.pl
18
util/mkrc.pl
@@ -1,6 +1,18 @@
|
||||
#!/bin/env perl
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
open FD,"crypto/opensslv.h";
|
||||
# Licensed under the OpenSSL license (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 lib ".";
|
||||
use configdata;
|
||||
use File::Spec::Functions;
|
||||
|
||||
my $versionfile = catfile($config{sourcedir},"include/openssl/opensslv.h");
|
||||
|
||||
open FD, $versionfile or die "Couldn't open include/openssl/opensslv.h: $!\n";
|
||||
while(<FD>) {
|
||||
if (/OPENSSL_VERSION_NUMBER\s+(0x[0-9a-f]+)/i) {
|
||||
$ver = hex($1);
|
||||
@@ -57,7 +69,7 @@ BEGIN
|
||||
VALUE "ProductVersion", "$version\\0"
|
||||
// Optional:
|
||||
//VALUE "Comments", "\\0"
|
||||
VALUE "LegalCopyright", "Copyright © 1998-2006 The OpenSSL Project. Copyright © 1995-1998 Eric A. Young, Tim J. Hudson. All rights reserved.\\0"
|
||||
VALUE "LegalCopyright", "Copyright 1998-2016 The OpenSSL Authors. All rights reserved.\\0"
|
||||
//VALUE "LegalTrademarks", "\\0"
|
||||
//VALUE "PrivateBuild", "\\0"
|
||||
//VALUE "SpecialBuild", "\\0"
|
||||
|
||||
194
util/mkstack.pl
194
util/mkstack.pl
@@ -1,194 +0,0 @@
|
||||
#!/usr/local/bin/perl -w
|
||||
|
||||
# This is a utility that searches out "DECLARE_STACK_OF()"
|
||||
# declarations in .h and .c files, and updates/creates/replaces
|
||||
# the corresponding macro declarations in crypto/stack/safestack.h.
|
||||
# As it's not generally possible to have macros that generate macros,
|
||||
# we need to control this from the "outside", here in this script.
|
||||
#
|
||||
# Geoff Thorpe, June, 2000 (with massive Perl-hacking
|
||||
# help from Steve Robb)
|
||||
|
||||
my $safestack = "crypto/stack/safestack";
|
||||
|
||||
my $do_write;
|
||||
while (@ARGV) {
|
||||
my $arg = $ARGV[0];
|
||||
if($arg eq "-write") {
|
||||
$do_write = 1;
|
||||
}
|
||||
shift @ARGV;
|
||||
}
|
||||
|
||||
|
||||
@source = (<crypto/*.[ch]>, <crypto/*/*.[ch]>, <ssl/*.[ch]>, <apps/*.[ch]>);
|
||||
foreach $file (@source) {
|
||||
next if -l $file;
|
||||
|
||||
# Open the .c/.h file for reading
|
||||
open(IN, "< $file") || die "Can't open $file for reading: $!";
|
||||
|
||||
while(<IN>) {
|
||||
if (/^DECLARE_STACK_OF\(([^)]+)\)/) {
|
||||
push @stacklst, $1;
|
||||
}
|
||||
if (/^DECLARE_SPECIAL_STACK_OF\(([^,\s]+)\s*,\s*([^>\s]+)\)/) {
|
||||
push @sstacklst, [$1, $2];
|
||||
}
|
||||
if (/^DECLARE_ASN1_SET_OF\(([^)]+)\)/) {
|
||||
push @asn1setlst, $1;
|
||||
}
|
||||
if (/^DECLARE_PKCS12_STACK_OF\(([^)]+)\)/) {
|
||||
push @p12stklst, $1;
|
||||
}
|
||||
if (/^DECLARE_LHASH_OF\(([^)]+)\)/) {
|
||||
push @lhashlst, $1;
|
||||
}
|
||||
}
|
||||
close(IN);
|
||||
}
|
||||
|
||||
|
||||
|
||||
my $old_stackfile = "";
|
||||
my $new_stackfile = "";
|
||||
my $inside_block = 0;
|
||||
my $type_thing;
|
||||
|
||||
open(IN, "< $safestack.h") || die "Can't open input file: $!";
|
||||
while(<IN>) {
|
||||
$old_stackfile .= $_;
|
||||
|
||||
if (m|^/\* This block of defines is updated by util/mkstack.pl, please do not touch! \*/|) {
|
||||
$inside_block = 1;
|
||||
}
|
||||
if (m|^/\* End of util/mkstack.pl block, you may now edit :-\) \*/|) {
|
||||
$inside_block = 0;
|
||||
} elsif ($inside_block == 0) {
|
||||
$new_stackfile .= $_;
|
||||
}
|
||||
next if($inside_block != 1);
|
||||
$new_stackfile .= "/* This block of defines is updated by util/mkstack.pl, please do not touch! */";
|
||||
|
||||
foreach $type_thing (sort @stacklst) {
|
||||
$new_stackfile .= <<EOF;
|
||||
|
||||
#define sk_${type_thing}_new(cmp) SKM_sk_new($type_thing, (cmp))
|
||||
#define sk_${type_thing}_new_null() SKM_sk_new_null($type_thing)
|
||||
#define sk_${type_thing}_free(st) SKM_sk_free($type_thing, (st))
|
||||
#define sk_${type_thing}_num(st) SKM_sk_num($type_thing, (st))
|
||||
#define sk_${type_thing}_value(st, i) SKM_sk_value($type_thing, (st), (i))
|
||||
#define sk_${type_thing}_set(st, i, val) SKM_sk_set($type_thing, (st), (i), (val))
|
||||
#define sk_${type_thing}_zero(st) SKM_sk_zero($type_thing, (st))
|
||||
#define sk_${type_thing}_push(st, val) SKM_sk_push($type_thing, (st), (val))
|
||||
#define sk_${type_thing}_unshift(st, val) SKM_sk_unshift($type_thing, (st), (val))
|
||||
#define sk_${type_thing}_find(st, val) SKM_sk_find($type_thing, (st), (val))
|
||||
#define sk_${type_thing}_find_ex(st, val) SKM_sk_find_ex($type_thing, (st), (val))
|
||||
#define sk_${type_thing}_delete(st, i) SKM_sk_delete($type_thing, (st), (i))
|
||||
#define sk_${type_thing}_delete_ptr(st, ptr) SKM_sk_delete_ptr($type_thing, (st), (ptr))
|
||||
#define sk_${type_thing}_insert(st, val, i) SKM_sk_insert($type_thing, (st), (val), (i))
|
||||
#define sk_${type_thing}_set_cmp_func(st, cmp) SKM_sk_set_cmp_func($type_thing, (st), (cmp))
|
||||
#define sk_${type_thing}_dup(st) SKM_sk_dup($type_thing, st)
|
||||
#define sk_${type_thing}_pop_free(st, free_func) SKM_sk_pop_free($type_thing, (st), (free_func))
|
||||
#define sk_${type_thing}_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy($type_thing, (st), (copy_func), (free_func))
|
||||
#define sk_${type_thing}_shift(st) SKM_sk_shift($type_thing, (st))
|
||||
#define sk_${type_thing}_pop(st) SKM_sk_pop($type_thing, (st))
|
||||
#define sk_${type_thing}_sort(st) SKM_sk_sort($type_thing, (st))
|
||||
#define sk_${type_thing}_is_sorted(st) SKM_sk_is_sorted($type_thing, (st))
|
||||
EOF
|
||||
}
|
||||
|
||||
foreach $type_thing (sort { $a->[0] cmp $b->[0]} @sstacklst) {
|
||||
my $t1 = $type_thing->[0];
|
||||
my $t2 = $type_thing->[1];
|
||||
$new_stackfile .= <<EOF;
|
||||
|
||||
#define sk_${t1}_new(cmp) ((STACK_OF($t1) *)sk_new(CHECKED_SK_CMP_FUNC($t2, cmp)))
|
||||
#define sk_${t1}_new_null() ((STACK_OF($t1) *)sk_new_null())
|
||||
#define sk_${t1}_push(st, val) sk_push(CHECKED_STACK_OF($t1, st), CHECKED_PTR_OF($t2, val))
|
||||
#define sk_${t1}_find(st, val) sk_find(CHECKED_STACK_OF($t1, st), CHECKED_PTR_OF($t2, val))
|
||||
#define sk_${t1}_value(st, i) (($t1)sk_value(CHECKED_STACK_OF($t1, st), i))
|
||||
#define sk_${t1}_num(st) SKM_sk_num($t1, st)
|
||||
#define sk_${t1}_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF($t1, st), CHECKED_SK_FREE_FUNC($t2, free_func))
|
||||
#define sk_${t1}_deep_copy(st, copy_func, free_func) ((STACK_OF($t1) *)sk_deep_copy(CHECKED_STACK_OF($t1, st), CHECKED_SK_COPY_FUNC($t2, copy_func), CHECKED_SK_FREE_FUNC($t2, free_func)))
|
||||
#define sk_${t1}_insert(st, val, i) sk_insert(CHECKED_STACK_OF($t1, st), CHECKED_PTR_OF($t2, val), i)
|
||||
#define sk_${t1}_free(st) SKM_sk_free(${t1}, st)
|
||||
#define sk_${t1}_set(st, i, val) sk_set(CHECKED_STACK_OF($t1, st), i, CHECKED_PTR_OF($t2, val))
|
||||
#define sk_${t1}_zero(st) SKM_sk_zero($t1, (st))
|
||||
#define sk_${t1}_unshift(st, val) sk_unshift(CHECKED_STACK_OF($t1, st), CHECKED_PTR_OF($t2, val))
|
||||
#define sk_${t1}_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF($t1), st), CHECKED_CONST_PTR_OF($t2, val))
|
||||
#define sk_${t1}_delete(st, i) SKM_sk_delete($t1, (st), (i))
|
||||
#define sk_${t1}_delete_ptr(st, ptr) ($t1 *)sk_delete_ptr(CHECKED_STACK_OF($t1, st), CHECKED_PTR_OF($t2, ptr))
|
||||
#define sk_${t1}_set_cmp_func(st, cmp) \\
|
||||
((int (*)(const $t2 * const *,const $t2 * const *)) \\
|
||||
sk_set_cmp_func(CHECKED_STACK_OF($t1, st), CHECKED_SK_CMP_FUNC($t2, cmp)))
|
||||
#define sk_${t1}_dup(st) SKM_sk_dup($t1, st)
|
||||
#define sk_${t1}_shift(st) SKM_sk_shift($t1, (st))
|
||||
#define sk_${t1}_pop(st) ($t2 *)sk_pop(CHECKED_STACK_OF($t1, st))
|
||||
#define sk_${t1}_sort(st) SKM_sk_sort($t1, (st))
|
||||
#define sk_${t1}_is_sorted(st) SKM_sk_is_sorted($t1, (st))
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
foreach $type_thing (sort @asn1setlst) {
|
||||
$new_stackfile .= <<EOF;
|
||||
|
||||
#define d2i_ASN1_SET_OF_${type_thing}(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\
|
||||
SKM_ASN1_SET_OF_d2i($type_thing, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
|
||||
#define i2d_ASN1_SET_OF_${type_thing}(st, pp, i2d_func, ex_tag, ex_class, is_set) \\
|
||||
SKM_ASN1_SET_OF_i2d($type_thing, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
|
||||
#define ASN1_seq_pack_${type_thing}(st, i2d_func, buf, len) \\
|
||||
SKM_ASN1_seq_pack($type_thing, (st), (i2d_func), (buf), (len))
|
||||
#define ASN1_seq_unpack_${type_thing}(buf, len, d2i_func, free_func) \\
|
||||
SKM_ASN1_seq_unpack($type_thing, (buf), (len), (d2i_func), (free_func))
|
||||
EOF
|
||||
}
|
||||
foreach $type_thing (sort @p12stklst) {
|
||||
$new_stackfile .= <<EOF;
|
||||
|
||||
#define PKCS12_decrypt_d2i_${type_thing}(algor, d2i_func, free_func, pass, passlen, oct, seq) \\
|
||||
SKM_PKCS12_decrypt_d2i($type_thing, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq))
|
||||
EOF
|
||||
}
|
||||
|
||||
foreach $type_thing (sort @lhashlst) {
|
||||
my $lc_tt = lc $type_thing;
|
||||
$new_stackfile .= <<EOF;
|
||||
|
||||
#define lh_${type_thing}_new() LHM_lh_new(${type_thing},${lc_tt})
|
||||
#define lh_${type_thing}_insert(lh,inst) LHM_lh_insert(${type_thing},lh,inst)
|
||||
#define lh_${type_thing}_retrieve(lh,inst) LHM_lh_retrieve(${type_thing},lh,inst)
|
||||
#define lh_${type_thing}_delete(lh,inst) LHM_lh_delete(${type_thing},lh,inst)
|
||||
#define lh_${type_thing}_doall(lh,fn) LHM_lh_doall(${type_thing},lh,fn)
|
||||
#define lh_${type_thing}_doall_arg(lh,fn,arg_type,arg) \\
|
||||
LHM_lh_doall_arg(${type_thing},lh,fn,arg_type,arg)
|
||||
#define lh_${type_thing}_error(lh) LHM_lh_error(${type_thing},lh)
|
||||
#define lh_${type_thing}_num_items(lh) LHM_lh_num_items(${type_thing},lh)
|
||||
#define lh_${type_thing}_down_load(lh) LHM_lh_down_load(${type_thing},lh)
|
||||
#define lh_${type_thing}_node_stats_bio(lh,out) \\
|
||||
LHM_lh_node_stats_bio(${type_thing},lh,out)
|
||||
#define lh_${type_thing}_node_usage_stats_bio(lh,out) \\
|
||||
LHM_lh_node_usage_stats_bio(${type_thing},lh,out)
|
||||
#define lh_${type_thing}_stats_bio(lh,out) \\
|
||||
LHM_lh_stats_bio(${type_thing},lh,out)
|
||||
#define lh_${type_thing}_free(lh) LHM_lh_free(${type_thing},lh)
|
||||
EOF
|
||||
}
|
||||
|
||||
$new_stackfile .= "/* End of util/mkstack.pl block, you may now edit :-) */\n";
|
||||
$inside_block = 2;
|
||||
}
|
||||
|
||||
|
||||
if ($new_stackfile eq $old_stackfile) {
|
||||
print "No changes to $safestack.h.\n";
|
||||
exit 0; # avoid unnecessary rebuild
|
||||
}
|
||||
|
||||
if ($do_write) {
|
||||
print "Writing new $safestack.h.\n";
|
||||
open OUT, ">$safestack.h" || die "Can't open output file";
|
||||
print OUT $new_stackfile;
|
||||
close OUT;
|
||||
}
|
||||
@@ -1,4 +1,12 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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
|
||||
|
||||
#
|
||||
# openssl-format-source
|
||||
# - format source tree according to OpenSSL coding style using indent
|
||||
@@ -21,6 +29,9 @@ HERE="`dirname $0`"
|
||||
|
||||
set -e
|
||||
|
||||
INDENT=indent
|
||||
uname -s | grep BSD > /dev/null && type gindent > /dev/null 2>&1 && INDENT=gindent
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "usage: $0 [-v] [-n] [-c] [sourcefile|sourcedir] ..." >&2
|
||||
exit 1
|
||||
@@ -30,6 +41,7 @@ VERBOSE=false
|
||||
DONT=false
|
||||
STOPARGS=false
|
||||
COMMENTS=false
|
||||
CHANGED=false
|
||||
DEBUG=""
|
||||
|
||||
# for this exercise, we want to force the openssl style, so we roll
|
||||
@@ -82,10 +94,6 @@ do
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$VERBOSE" = "true" ]; then
|
||||
echo "$j"
|
||||
fi
|
||||
|
||||
if [ "$DONT" = "false" ]; then
|
||||
tmp=$(mktemp /tmp/indent.XXXXXX)
|
||||
trap 'rm -f "$tmp"' HUP INT TERM EXIT
|
||||
@@ -114,20 +122,20 @@ do
|
||||
-e 's/(STACK_OF|LHASH_OF)\(([^ \t,\)]+)\)( |\n)/$1_$2_$3/g;' \
|
||||
| \
|
||||
perl -np \
|
||||
-e 's/^([ \t]*)\/\*([ \t]+.*)\*\/[ \t]*$/if (length("$1$2")<75) {$c="-"}else{$c=""}; "$1\/*$c$2*\/"/e;' \
|
||||
-e 's/^([ \t]*)\/\*([ \t]+.*)\*\/[ \t]*$/my ($x1,$x2) = ($1, $2); if (length("$x1$x2")<75 && $x2 !~ m#^\s*\*INDENT-(ON|OFF)\*\s*$#) {$c="-"}else{$c=""}; "$x1\/*$c$x2*\/"/e;' \
|
||||
-e 's/^\/\* ((Copyright|=|----).*)$/\/*-$1/;' \
|
||||
-e 's/^((DECLARE|IMPLEMENT)_(EXTERN_ASN1|ASN1|ADB|STACK_OF|PKCS12_STACK_OF).*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \
|
||||
-e 's/^((DECLARE|IMPLEMENT)_.*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \
|
||||
-e 's/^([ \t]*(make_dh|make_dh_bn|make_rfc5114_td)\(.*\)[ \t,]*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \
|
||||
-e 's/^(ASN1_ADB_TEMPLATE\(.*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \
|
||||
-e 's/^((ASN1|ADB)_.*_(end|END)\(.*[\){=,;]+[ \t]*)$/$1\n\/**INDENT-ON**\//;' \
|
||||
-e '/ASN1_(ITEM_ref|ITEM_ptr|ITEM_rptr|PCTX)/ || s/^((ASN1|ADB)_[^\*]*[){=,]+[ \t]*)$/\/**INDENT-OFF**\/\n$1/;' \
|
||||
-e 's/^(} (ASN1|ADB)_[^\*]*[\){=,;]+)$/$1\n\/**INDENT-ON**\//;' \
|
||||
| \
|
||||
$DEBUG indent $INDENT_ARGS | \
|
||||
$DEBUG $INDENT $INDENT_ARGS | \
|
||||
perl -np \
|
||||
-e 's/^([ \t]*)\/\*-(.*)\*\/[ \t]*$/$1\/*$2*\//;' \
|
||||
-e 's/^\/\*-((Copyright|=|----).*)$/\/* $1/;' \
|
||||
| indent | \
|
||||
| $INDENT | \
|
||||
perl -0 -np \
|
||||
-e 's/\/\*\*INDENT-(ON|OFF)\*\*\/\n//g;' \
|
||||
| perl -np \
|
||||
@@ -136,9 +144,20 @@ do
|
||||
| perl "$HERE"/su-filter.pl \
|
||||
> "$tmp"
|
||||
else
|
||||
expand "$j" | indent $INDENT_ARGS > "$tmp"
|
||||
expand "$j" | $INDENT $INDENT_ARGS > "$tmp"
|
||||
fi;
|
||||
mv "$tmp" "$j"
|
||||
if cmp -s "$tmp" "$j"; then
|
||||
if [ "$VERBOSE" = "true" ]; then
|
||||
echo "$j unchanged"
|
||||
fi
|
||||
rm "$tmp"
|
||||
else
|
||||
if [ "$VERBOSE" = "true" ]; then
|
||||
echo "$j changed"
|
||||
fi
|
||||
CHANGED=true
|
||||
mv "$tmp" "$j"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
@@ -146,3 +165,11 @@ do
|
||||
done
|
||||
|
||||
|
||||
if [ "$VERBOSE" = "true" ]; then
|
||||
echo
|
||||
if [ "$CHANGED" = "true" ]; then
|
||||
echo "SOURCE WAS MODIFIED"
|
||||
else
|
||||
echo "SOURCE WAS NOT MODIFIED"
|
||||
fi
|
||||
fi
|
||||
|
||||
158
util/perl/OpenSSL/Util/Pod.pm
Normal file
158
util/perl/OpenSSL/Util/Pod.pm
Normal file
@@ -0,0 +1,158 @@
|
||||
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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 OpenSSL::Util::Pod;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Exporter;
|
||||
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
|
||||
$VERSION = "0.1";
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(extract_pod_info);
|
||||
@EXPORT_OK = qw();
|
||||
|
||||
=head1 NAME
|
||||
|
||||
OpenSSL::Util::Pod - utilities to manipulate .pod files
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use OpenSSL::Util::Pod;
|
||||
|
||||
my %podinfo = extract_pod_info("foo.pod");
|
||||
|
||||
# or if the file is already opened... Note that this consumes the
|
||||
# remainder of the file.
|
||||
|
||||
my %podinfo = extract_pod_info(\*STDIN);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
=over
|
||||
|
||||
=item B<extract_pod_info "FILENAME", HASHREF>
|
||||
|
||||
=item B<extract_pod_info "FILENAME">
|
||||
|
||||
=item B<extract_pod_info GLOB, HASHREF>
|
||||
|
||||
=item B<extract_pod_info GLOB>
|
||||
|
||||
Extracts information from a .pod file, given a STRING (file name) or a
|
||||
GLOB (a file handle). The result is given back as a hash table.
|
||||
|
||||
The additional hash is for extra parameters:
|
||||
|
||||
=over
|
||||
|
||||
=item B<section =E<gt> N>
|
||||
|
||||
The value MUST be a number, and will be the default man section number
|
||||
to be used with the given .pod file. This number can be altered if
|
||||
the .pod file has a line like this:
|
||||
|
||||
=for comment openssl_manual_section: 4
|
||||
|
||||
=item B<debug =E<gt> 0|1>
|
||||
|
||||
If set to 1, extra debug text will be printed on STDERR
|
||||
|
||||
=back
|
||||
|
||||
=back
|
||||
|
||||
=head1 RETURN VALUES
|
||||
|
||||
=over
|
||||
|
||||
=item B<extract_pod_info> returns a hash table with the following
|
||||
items:
|
||||
|
||||
=over
|
||||
|
||||
=item B<section =E<gt> N>
|
||||
|
||||
The man section number this .pod file belongs to. Often the same as
|
||||
was given as input.
|
||||
|
||||
=item B<names =E<gt> [ "name", ... ]>
|
||||
|
||||
All the names extracted from the NAME section.
|
||||
|
||||
=back
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
sub extract_pod_info {
|
||||
my $input = shift;
|
||||
my $defaults_ref = shift || {};
|
||||
my %defaults = ( debug => 0, section => 0, %$defaults_ref );
|
||||
my $fh = undef;
|
||||
my $filename = undef;
|
||||
|
||||
# If not a file handle, then it's assume to be a file path (a string)
|
||||
unless (ref $input eq "GLOB") {
|
||||
$filename = $input;
|
||||
open $fh, $input or die "Trying to read $filename: $!\n";
|
||||
print STDERR "DEBUG: Reading $input\n" if $defaults{debug};
|
||||
$input = $fh;
|
||||
}
|
||||
|
||||
my %podinfo = ( section => $defaults{section});
|
||||
while(<$input>) {
|
||||
s|\R$||;
|
||||
if (m|^=for\s+comment\s+openssl_manual_section:\s*([0-9])\s*$|) {
|
||||
print STDERR "DEBUG: Found man section number $1\n"
|
||||
if $defaults{debug};
|
||||
$podinfo{section} = $1;
|
||||
}
|
||||
|
||||
# Stop reading when we have reached past the NAME section.
|
||||
last if (m|^=head1|
|
||||
&& defined $podinfo{lastsect}
|
||||
&& $podinfo{lastsect} eq "NAME");
|
||||
|
||||
# Collect the section name
|
||||
if (m|^=head1\s*(.*)|) {
|
||||
$podinfo{lastsect} = $1;
|
||||
$podinfo{lastsect} =~ s/\s+$//;
|
||||
print STDERR "DEBUG: Found new pod section $1\n"
|
||||
if $defaults{debug};
|
||||
print STDERR "DEBUG: Clearing pod section text\n"
|
||||
if $defaults{debug};
|
||||
$podinfo{lastsecttext} = "";
|
||||
}
|
||||
|
||||
next if (m|^=| || m|^\s*$|);
|
||||
|
||||
# Collect the section text
|
||||
print STDERR "DEBUG: accumulating pod section text \"$_\"\n"
|
||||
if $defaults{debug};
|
||||
$podinfo{lastsecttext} .= " " if $podinfo{lastsecttext};
|
||||
$podinfo{lastsecttext} .= $_;
|
||||
}
|
||||
|
||||
|
||||
if (defined $fh) {
|
||||
close $fh;
|
||||
print STDERR "DEBUG: Done reading $filename\n" if $defaults{debug};
|
||||
}
|
||||
|
||||
$podinfo{lastsecttext} =~ s| - .*$||;
|
||||
|
||||
my @names =
|
||||
map { s|\s+||g; $_ }
|
||||
split(m|,|, $podinfo{lastsecttext});
|
||||
|
||||
return ( section => $podinfo{section}, names => [ @names ] );
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
#
|
||||
# modify the '#!/usr/local/bin/perl'
|
||||
# line in all scripts that rely on perl.
|
||||
#
|
||||
|
||||
require "find.pl";
|
||||
|
||||
$#ARGV == 0 || print STDERR "usage: perlpath newpath (eg /usr/bin)\n";
|
||||
&find(".");
|
||||
|
||||
sub wanted
|
||||
{
|
||||
return unless /\.pl$/ || /^[Cc]onfigur/;
|
||||
|
||||
open(IN,"<$_") || die "unable to open $dir/$_:$!\n";
|
||||
@a=<IN>;
|
||||
close(IN);
|
||||
|
||||
if (-d $ARGV[0]) {
|
||||
$a[0]="#!$ARGV[0]/perl\n";
|
||||
}
|
||||
else {
|
||||
$a[0]="#!$ARGV[0]\n";
|
||||
}
|
||||
|
||||
# Playing it safe...
|
||||
$new="$_.new";
|
||||
open(OUT,">$new") || die "unable to open $dir/$new:$!\n";
|
||||
print OUT @a;
|
||||
close(OUT);
|
||||
|
||||
rename($new,$_) || die "unable to rename $dir/$new:$!\n";
|
||||
chmod(0755,$_) || die "unable to chmod $dir/$new:$!\n";
|
||||
}
|
||||
139
util/pl/BC-32.pl
139
util/pl/BC-32.pl
@@ -1,139 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
# Borland C++ builder 3 and 4 -- Janez Jere <jj@void.si>
|
||||
#
|
||||
|
||||
$ssl= "ssleay32";
|
||||
$crypto="libeay32";
|
||||
|
||||
$o='\\';
|
||||
$cp='copy';
|
||||
$rm='del';
|
||||
|
||||
# C compiler stuff
|
||||
$cc='bcc32';
|
||||
$lflags="-ap -Tpe -x -Gn ";
|
||||
$mlflags='';
|
||||
|
||||
$out_def="out32";
|
||||
$tmp_def="tmp32";
|
||||
$inc_def="inc32";
|
||||
#enable max error messages, disable most common warnings
|
||||
$cflags="-DWIN32_LEAN_AND_MEAN -q -w-ccc -w-rch -w-pia -w-aus -w-par -w-inl -c -tWC -tWM -DOPENSSL_SYSNAME_WIN32 -DL_ENDIAN -DDSO_WIN32 -D_stricmp=stricmp -D_strnicmp=strnicmp ";
|
||||
if ($debug)
|
||||
{
|
||||
$cflags.="-Od -y -v -vi- -D_DEBUG";
|
||||
$mlflags.=' ';
|
||||
}
|
||||
else
|
||||
{
|
||||
$cflags.="-O2 -ff -fp";
|
||||
}
|
||||
|
||||
$obj='.obj';
|
||||
$ofile="-o";
|
||||
|
||||
# EXE linking stuff
|
||||
$link="ilink32";
|
||||
$efile="";
|
||||
$exep='.exe';
|
||||
if ($no_sock)
|
||||
{ $ex_libs=""; }
|
||||
else { $ex_libs="cw32mt.lib import32.lib crypt32.lib ws2_32.lib"; }
|
||||
|
||||
# static library stuff
|
||||
$mklib='tlib /P64';
|
||||
$ranlib='';
|
||||
$plib="";
|
||||
$libp=".lib";
|
||||
$shlibp=($shlib)?".dll":".lib";
|
||||
$lfile='';
|
||||
|
||||
$shlib_ex_obj="";
|
||||
$app_ex_obj="c0x32.obj";
|
||||
|
||||
$asm=(`nasm -v 2>NUL` ge `nasmw -v 2>NUL`?"nasm":"nasmw")." -f obj -d__omf__";
|
||||
$asm.=" -g" if $debug;
|
||||
$afile='-o';
|
||||
|
||||
$bn_mulw_obj='';
|
||||
$bn_mulw_src='';
|
||||
$des_enc_obj='';
|
||||
$des_enc_src='';
|
||||
$bf_enc_obj='';
|
||||
$bf_enc_src='';
|
||||
|
||||
if (!$no_asm)
|
||||
{
|
||||
$bn_mulw_obj='crypto\bn\asm\bn_win32.obj';
|
||||
$bn_mulw_src='crypto\bn\asm\bn_win32.asm';
|
||||
$des_enc_obj='crypto\des\asm\d_win32.obj crypto\des\asm\y_win32.obj';
|
||||
$des_enc_src='crypto\des\asm\d_win32.asm crypto\des\asm\y_win32.asm';
|
||||
$bf_enc_obj='crypto\bf\asm\b_win32.obj';
|
||||
$bf_enc_src='crypto\bf\asm\b_win32.asm';
|
||||
$cast_enc_obj='crypto\cast\asm\c_win32.obj';
|
||||
$cast_enc_src='crypto\cast\asm\c_win32.asm';
|
||||
$rc4_enc_obj='crypto\rc4\asm\r4_win32.obj';
|
||||
$rc4_enc_src='crypto\rc4\asm\r4_win32.asm';
|
||||
$rc5_enc_obj='crypto\rc5\asm\r5_win32.obj';
|
||||
$rc5_enc_src='crypto\rc5\asm\r5_win32.asm';
|
||||
$md5_asm_obj='crypto\md5\asm\m5_win32.obj';
|
||||
$md5_asm_src='crypto\md5\asm\m5_win32.asm';
|
||||
$sha1_asm_obj='crypto\sha\asm\s1_win32.obj';
|
||||
$sha1_asm_src='crypto\sha\asm\s1_win32.asm';
|
||||
$rmd160_asm_obj='crypto\ripemd\asm\rm_win32.obj';
|
||||
$rmd160_asm_src='crypto\ripemd\asm\rm_win32.asm';
|
||||
$cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DRMD160_ASM";
|
||||
}
|
||||
|
||||
if ($shlib)
|
||||
{
|
||||
$mlflags.=" $lflags /dll";
|
||||
# $cflags =~ s| /MD| /MT|;
|
||||
$lib_cflag=" /GD -D_WINDLL -D_DLL";
|
||||
$out_def="out32dll";
|
||||
$tmp_def="tmp32dll";
|
||||
}
|
||||
|
||||
sub do_lib_rule
|
||||
{
|
||||
local($objs,$target,$name,$shlib)=@_;
|
||||
local($ret,$Name);
|
||||
|
||||
$taget =~ s/\//$o/g if $o ne '/';
|
||||
($Name=$name) =~ tr/a-z/A-Z/;
|
||||
|
||||
# $target="\$(LIB_D)$o$target";
|
||||
$ret.="$target: $objs\n";
|
||||
if (!$shlib)
|
||||
{
|
||||
$ret.=<<___;
|
||||
-\$(RM) $lfile$target
|
||||
\$(MKLIB) $lfile$target \@&&!
|
||||
+\$(**: = &^
|
||||
+)
|
||||
!
|
||||
___
|
||||
}
|
||||
else
|
||||
{
|
||||
local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':'';
|
||||
$ex.=' ws2_32.lib gdi32.lib';
|
||||
$ret.="\t\$(LINK_CMD) \$(MLFLAGS) $efile$target /def:ms/${Name}.def @<<\n \$(SHLIB_EX_OBJ) $objs $ex\n<<\n";
|
||||
}
|
||||
$ret.="\n";
|
||||
return($ret);
|
||||
}
|
||||
|
||||
sub do_link_rule
|
||||
{
|
||||
local($target,$files,$dep_libs,$libs)=@_;
|
||||
local($ret,$_);
|
||||
|
||||
$file =~ s/\//$o/g if $o ne '/';
|
||||
$n=&bname($target);
|
||||
$ret.="$target: $files $dep_libs\n";
|
||||
$ret.="\t\$(LINK_CMD) \$(LFLAGS) $files \$(APP_EX_OBJ), $target,, $libs\n\n";
|
||||
return($ret);
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,104 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
#
|
||||
# Mingw32.pl -- Mingw
|
||||
#
|
||||
|
||||
$o='/';
|
||||
$cp='cp';
|
||||
$rm='rm -f';
|
||||
$mkdir='gmkdir';
|
||||
|
||||
$o='\\';
|
||||
$cp='copy';
|
||||
$rm='del';
|
||||
$mkdir='mkdir';
|
||||
|
||||
# C compiler stuff
|
||||
|
||||
$cc='gcc';
|
||||
if ($debug)
|
||||
{ $cflags="-DL_ENDIAN -DDSO_WIN32 -g2 -ggdb"; }
|
||||
else
|
||||
{ $cflags="-DL_ENDIAN -DDSO_WIN32 -fomit-frame-pointer -O3 -mcpu=i486 -Wall"; }
|
||||
|
||||
if ($gaswin and !$no_asm)
|
||||
{
|
||||
$bn_asm_obj='$(OBJ_D)\bn-win32.o';
|
||||
$bn_asm_src='crypto/bn/asm/bn-win32.s';
|
||||
$bnco_asm_obj='$(OBJ_D)\co-win32.o';
|
||||
$bnco_asm_src='crypto/bn/asm/co-win32.s';
|
||||
$des_enc_obj='$(OBJ_D)\d-win32.o $(OBJ_D)\y-win32.o';
|
||||
$des_enc_src='crypto/des/asm/d-win32.s crypto/des/asm/y-win32.s';
|
||||
$bf_enc_obj='$(OBJ_D)\b-win32.o';
|
||||
$bf_enc_src='crypto/bf/asm/b-win32.s';
|
||||
# $cast_enc_obj='$(OBJ_D)\c-win32.o';
|
||||
# $cast_enc_src='crypto/cast/asm/c-win32.s';
|
||||
$rc4_enc_obj='$(OBJ_D)\r4-win32.o';
|
||||
$rc4_enc_src='crypto/rc4/asm/r4-win32.s';
|
||||
$rc5_enc_obj='$(OBJ_D)\r5-win32.o';
|
||||
$rc5_enc_src='crypto/rc5/asm/r5-win32.s';
|
||||
$md5_asm_obj='$(OBJ_D)\m5-win32.o';
|
||||
$md5_asm_src='crypto/md5/asm/m5-win32.s';
|
||||
$rmd160_asm_obj='$(OBJ_D)\rm-win32.o';
|
||||
$rmd160_asm_src='crypto/ripemd/asm/rm-win32.s';
|
||||
$sha1_asm_obj='$(OBJ_D)\s1-win32.o';
|
||||
$sha1_asm_src='crypto/sha/asm/s1-win32.s';
|
||||
$cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DOPENSSL_BN_ASM_PART_WORDS";
|
||||
}
|
||||
|
||||
|
||||
$obj='.o';
|
||||
$ofile='-o ';
|
||||
|
||||
# EXE linking stuff
|
||||
$link='${CC}';
|
||||
$lflags='${CFLAGS}';
|
||||
$efile='-o ';
|
||||
$exep='';
|
||||
$ex_libs="-lws2_32 -lgdi32";
|
||||
|
||||
# static library stuff
|
||||
$mklib='ar r';
|
||||
$mlflags='';
|
||||
$ranlib='ranlib';
|
||||
$plib='lib';
|
||||
$libp=".a";
|
||||
$shlibp=".a";
|
||||
$lfile='';
|
||||
|
||||
$asm='as';
|
||||
$afile='-o ';
|
||||
#$bn_asm_obj="";
|
||||
#$bn_asm_src="";
|
||||
#$des_enc_obj="";
|
||||
#$des_enc_src="";
|
||||
#$bf_enc_obj="";
|
||||
#$bf_enc_src="";
|
||||
|
||||
sub do_lib_rule
|
||||
{
|
||||
local($obj,$target,$name,$shlib)=@_;
|
||||
local($ret,$_,$Name);
|
||||
|
||||
$target =~ s/\//$o/g if $o ne '/';
|
||||
$target="$target";
|
||||
($Name=$name) =~ tr/a-z/A-Z/;
|
||||
|
||||
$ret.="$target: \$(${Name}OBJ)\n";
|
||||
$ret.="\tif exist $target \$(RM) $target\n";
|
||||
$ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n";
|
||||
$ret.="\t\$(RANLIB) $target\n\n";
|
||||
}
|
||||
|
||||
sub do_link_rule
|
||||
{
|
||||
local($target,$files,$dep_libs,$libs)=@_;
|
||||
local($ret,$_);
|
||||
|
||||
$file =~ s/\//$o/g if $o ne '/';
|
||||
$n=&bname($target);
|
||||
$ret.="$target: $files $dep_libs\n";
|
||||
$ret.="\t\$(LINK_CMD) ${efile}$target \$(LFLAGS) $files $libs\n\n";
|
||||
return($ret);
|
||||
}
|
||||
1;
|
||||
@@ -1,120 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
#
|
||||
# OS2-EMX.pl - for EMX GCC on OS/2
|
||||
#
|
||||
|
||||
$o='/';
|
||||
$cp='cp';
|
||||
$rm='rm -f';
|
||||
|
||||
$preamble = "SHELL=sh\n";
|
||||
|
||||
# C compiler stuff
|
||||
|
||||
$cc='gcc';
|
||||
$cflags="-DL_ENDIAN -O3 -fomit-frame-pointer -m486 -Zmtd -Wall ";
|
||||
$cflags.="-Zomf " if $shlib;
|
||||
$shl_cflag="-Zdll";
|
||||
|
||||
if ($debug) {
|
||||
$cflags.="-g ";
|
||||
}
|
||||
|
||||
$obj=$shlib ? '.obj' : '.o';
|
||||
$ofile='-o ';
|
||||
|
||||
# EXE linking stuff
|
||||
$link='${CC}';
|
||||
$lflags='${CFLAGS} -Zbsd-signals -s';
|
||||
$efile='-o ';
|
||||
$exep='.exe';
|
||||
$ex_libs="-lsocket";
|
||||
|
||||
# static library stuff
|
||||
$mklib='ar r';
|
||||
$mlflags='';
|
||||
$ranlib="ar s";
|
||||
$plib='';
|
||||
$libp=$shlib ? ".lib" : ".a";
|
||||
$shlibp=$shlib ? ".dll" : ".a";
|
||||
$lfile='';
|
||||
|
||||
$asm=$shlib ? 'as -Zomf' : 'as';
|
||||
$afile='-o ';
|
||||
$bn_asm_obj="";
|
||||
$bn_asm_src="";
|
||||
$des_enc_obj="";
|
||||
$des_enc_src="";
|
||||
$bf_enc_obj="";
|
||||
$bf_enc_src="";
|
||||
|
||||
if (!$no_asm)
|
||||
{
|
||||
$bn_asm_obj="crypto/bn/asm/bn-os2$obj crypto/bn/asm/co-os2$obj";
|
||||
$bn_asm_src="crypto/bn/asm/bn-os2.asm crypto/bn/asm/co-os2.asm";
|
||||
$des_enc_obj="crypto/des/asm/d-os2$obj crypto/des/asm/y-os2$obj";
|
||||
$des_enc_src="crypto/des/asm/d-os2.asm crypto/des/asm/y-os2.asm";
|
||||
$bf_enc_obj="crypto/bf/asm/b-os2$obj";
|
||||
$bf_enc_src="crypto/bf/asm/b-os2.asm";
|
||||
$cast_enc_obj="crypto/cast/asm/c-os2$obj";
|
||||
$cast_enc_src="crypto/cast/asm/c-os2.asm";
|
||||
$rc4_enc_obj="crypto/rc4/asm/r4-os2$obj";
|
||||
$rc4_enc_src="crypto/rc4/asm/r4-os2.asm";
|
||||
$rc5_enc_obj="crypto/rc5/asm/r5-os2$obj";
|
||||
$rc5_enc_src="crypto/rc5/asm/r5-os2.asm";
|
||||
$md5_asm_obj="crypto/md5/asm/m5-os2$obj";
|
||||
$md5_asm_src="crypto/md5/asm/m5-os2.asm";
|
||||
$sha1_asm_obj="crypto/sha/asm/s1-os2$obj";
|
||||
$sha1_asm_src="crypto/sha/asm/s1-os2.asm";
|
||||
$rmd160_asm_obj="crypto/ripemd/asm/rm-os2$obj";
|
||||
$rmd160_asm_src="crypto/ripemd/asm/rm-os2.asm";
|
||||
$cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DOPENSSL_BN_ASM_PART_WORDS";
|
||||
}
|
||||
|
||||
if ($shlib)
|
||||
{
|
||||
$mlflags.=" $lflags -Zdll";
|
||||
$lib_cflag=" -D_DLL";
|
||||
$out_def="out_dll";
|
||||
$tmp_def="tmp_dll";
|
||||
}
|
||||
|
||||
sub do_lib_rule
|
||||
{
|
||||
local($obj,$target,$name,$shlib)=@_;
|
||||
local($ret,$_,$Name);
|
||||
|
||||
$target =~ s/\//$o/g if $o ne '/';
|
||||
$target="$target";
|
||||
($Name=$name) =~ tr/a-z/A-Z/;
|
||||
|
||||
$ret.="$target: \$(${Name}OBJ)\n";
|
||||
if (!$shlib)
|
||||
{
|
||||
$ret.="\t\$(RM) $target\n";
|
||||
$ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n";
|
||||
$ret.="\t\$(RANLIB) $target\n\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':'';
|
||||
$ex.=' -lsocket';
|
||||
$ret.="\t\$(LINK_CMD) \$(SHLIB_CFLAGS) \$(MLFLAGS) $efile$target \$(SHLIB_EX_OBJ) \$(${Name}OBJ) $ex os2/${Name}.def\n";
|
||||
$ret.="\temximp -o $out_def/$name.a os2/${Name}.def\n";
|
||||
$ret.="\temximp -o $out_def/$name.lib os2/${Name}.def\n\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub do_link_rule
|
||||
{
|
||||
local($target,$files,$dep_libs,$libs)=@_;
|
||||
local($ret,$_);
|
||||
|
||||
$file =~ s/\//$o/g if $o ne '/';
|
||||
$n=&bname($target);
|
||||
$ret.="$target: $files $dep_libs\n";
|
||||
$ret.="\t\$(LINK_CMD) ${efile}$target \$(CFLAG) \$(LFLAGS) $files $libs\n\n";
|
||||
return($ret);
|
||||
}
|
||||
|
||||
1;
|
||||
423
util/pl/VC-32.pl
423
util/pl/VC-32.pl
@@ -1,423 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
# VC-32.pl - unified script for Microsoft Visual C++, covering Win32,
|
||||
# Win64 and WinCE [follow $FLAVOR variable to trace the differences].
|
||||
#
|
||||
|
||||
$ssl= "ssleay32";
|
||||
$crypto="libeay32";
|
||||
|
||||
if ($fips && !$shlib)
|
||||
{
|
||||
$crypto="libeayfips32";
|
||||
$crypto_compat = "libeaycompat32.lib";
|
||||
}
|
||||
else
|
||||
{
|
||||
$crypto="libeay32";
|
||||
}
|
||||
|
||||
$o='\\';
|
||||
$cp='$(PERL) util/copy.pl';
|
||||
$mkdir='$(PERL) util/mkdir-p.pl';
|
||||
$rm='del /Q';
|
||||
|
||||
$zlib_lib="zlib1.lib";
|
||||
|
||||
# Santize -L options for ms link
|
||||
$l_flags =~ s/-L("\[^"]+")/\/libpath:$1/g;
|
||||
$l_flags =~ s/-L(\S+)/\/libpath:$1/g;
|
||||
|
||||
my $ff = "";
|
||||
|
||||
# C compiler stuff
|
||||
$cc='cl';
|
||||
if ($FLAVOR =~ /WIN64/)
|
||||
{
|
||||
# Note that we currently don't have /WX on Win64! There is a lot of
|
||||
# warnings, but only of two types:
|
||||
#
|
||||
# C4344: conversion from '__int64' to 'int/long', possible loss of data
|
||||
# C4267: conversion from 'size_t' to 'int/long', possible loss of data
|
||||
#
|
||||
# Amount of latter type is minimized by aliasing strlen to function of
|
||||
# own desing and limiting its return value to 2GB-1 (see e_os.h). As
|
||||
# per 0.9.8 release remaining warnings were explicitly examined and
|
||||
# considered safe to ignore.
|
||||
#
|
||||
$base_cflags= " $mf_cflag";
|
||||
my $f = $shlib || $fips ?' /MD':' /MT';
|
||||
$opt_cflags=$f.' /Ox';
|
||||
$dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG';
|
||||
$lflags="/nologo /subsystem:console /opt:ref";
|
||||
|
||||
*::perlasm_compile_target = sub {
|
||||
my ($target,$source,$bname)=@_;
|
||||
my $ret;
|
||||
|
||||
$bname =~ s/(.*)\.[^\.]$/$1/;
|
||||
$ret=<<___;
|
||||
\$(TMP_D)$o$bname.asm: $source
|
||||
set ASM=\$(ASM)
|
||||
\$(PERL) $source \$\@
|
||||
|
||||
$target: \$(TMP_D)$o$bname.asm
|
||||
\$(ASM) $afile\$\@ \$(TMP_D)$o$bname.asm
|
||||
|
||||
___
|
||||
}
|
||||
}
|
||||
elsif ($FLAVOR =~ /CE/)
|
||||
{
|
||||
# sanity check
|
||||
die '%OSVERSION% is not defined' if (!defined($ENV{'OSVERSION'}));
|
||||
die '%PLATFORM% is not defined' if (!defined($ENV{'PLATFORM'}));
|
||||
die '%TARGETCPU% is not defined' if (!defined($ENV{'TARGETCPU'}));
|
||||
|
||||
#
|
||||
# Idea behind this is to mimic flags set by eVC++ IDE...
|
||||
#
|
||||
$wcevers = $ENV{'OSVERSION'}; # WCENNN
|
||||
die '%OSVERSION% value is insane' if ($wcevers !~ /^WCE([1-9])([0-9]{2})$/);
|
||||
$wcecdefs = "-D_WIN32_WCE=$1$2 -DUNDER_CE=$1$2"; # -D_WIN32_WCE=NNN
|
||||
$wcelflag = "/subsystem:windowsce,$1.$2"; # ...,N.NN
|
||||
|
||||
$wceplatf = $ENV{'PLATFORM'};
|
||||
$wceplatf =~ tr/a-z0-9 /A-Z0-9_/d;
|
||||
$wcecdefs .= " -DWCE_PLATFORM_$wceplatf";
|
||||
|
||||
$wcetgt = $ENV{'TARGETCPU'}; # just shorter name...
|
||||
SWITCH: for($wcetgt) {
|
||||
/^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
|
||||
$wcelflag.=" /machine:X86"; last; };
|
||||
/^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
|
||||
$wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/);
|
||||
$wcecdefs.=" -QRarch4T -QRinterwork-return";
|
||||
$wcelflag.=" /machine:THUMB"; last; };
|
||||
/^ARM/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
|
||||
$wcelflag.=" /machine:ARM"; last; };
|
||||
/^MIPSIV/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
|
||||
$wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32";
|
||||
$wcelflag.=" /machine:MIPSFPU"; last; };
|
||||
/^MIPS16/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
|
||||
$wcecdefs.=" -DMIPSII -QMmips16";
|
||||
$wcelflag.=" /machine:MIPS16"; last; };
|
||||
/^MIPSII/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
|
||||
$wcecdefs.=" -QMmips2";
|
||||
$wcelflag.=" /machine:MIPS"; last; };
|
||||
/^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000";
|
||||
$wcelflag.=" /machine:MIPS"; last; };
|
||||
/^SH[0-9]/ && do { $wcecdefs.=" -D$wcetgt -D_$wcetgt_ -DSHx";
|
||||
$wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/);
|
||||
$wcelflag.=" /machine:$wcetgt"; last; };
|
||||
{ $wcecdefs.=" -D$wcetgt -D_$wcetgt_";
|
||||
$wcelflag.=" /machine:$wcetgt"; last; };
|
||||
}
|
||||
|
||||
$cc=($ENV{CC} or "cl");
|
||||
$base_cflags=' /W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT';
|
||||
$base_cflags.=" $wcecdefs";
|
||||
$base_cflags.=' -I$(WCECOMPAT)/include' if (defined($ENV{'WCECOMPAT'}));
|
||||
$base_cflags.=' -I$(PORTSDK_LIBPATH)/../../include' if (defined($ENV{'PORTSDK_LIBPATH'}));
|
||||
if (`$cc 2>&1` =~ /Version ([0-9]+)\./ && $1>=14) {
|
||||
$base_cflags.=$shlib?' /MD':' /MT';
|
||||
} else {
|
||||
$base_cflags.=' /MC';
|
||||
}
|
||||
$opt_cflags=' /O1i'; # optimize for space, but with intrinsics...
|
||||
$dbg_cflags=' /Od -DDEBUG -D_DEBUG';
|
||||
$lflags="/nologo /opt:ref $wcelflag";
|
||||
}
|
||||
else # Win32
|
||||
{
|
||||
$base_cflags= " $mf_cflag";
|
||||
my $f = $shlib || $fips ?' /MD':' /MT';
|
||||
$ff = "/fixed";
|
||||
$opt_cflags=$f.' /Ox /O2 /Ob2';
|
||||
$dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG';
|
||||
$lflags="/nologo /subsystem:console /opt:ref";
|
||||
}
|
||||
$lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib
|
||||
$mlflags='';
|
||||
|
||||
$out_def ="out32"; $out_def.="dll" if ($shlib);
|
||||
$out_def.='_$(TARGETCPU)' if ($FLAVOR =~ /CE/);
|
||||
$tmp_def ="tmp32"; $tmp_def.="dll" if ($shlib);
|
||||
$tmp_def.='_$(TARGETCPU)' if ($FLAVOR =~ /CE/);
|
||||
$inc_def="inc32";
|
||||
|
||||
if ($debug)
|
||||
{
|
||||
$cflags=$dbg_cflags.$base_cflags;
|
||||
}
|
||||
else
|
||||
{
|
||||
$cflags=$opt_cflags.$base_cflags;
|
||||
}
|
||||
|
||||
# generate symbols.pdb unconditionally
|
||||
$app_cflag.=" /Zi /Fd\$(TMP_D)/app";
|
||||
$lib_cflag.=" /Zi /Fd\$(TMP_D)/lib";
|
||||
$lflags.=" /debug";
|
||||
|
||||
$obj='.obj';
|
||||
$asm_suffix='.asm';
|
||||
$ofile="/Fo";
|
||||
|
||||
# EXE linking stuff
|
||||
$link="link";
|
||||
$rsc="rc";
|
||||
$efile="/out:";
|
||||
$exep='.exe';
|
||||
if ($no_sock) { $ex_libs=''; }
|
||||
elsif ($FLAVOR =~ /CE/) { $ex_libs='ws2.lib'; }
|
||||
else { $ex_libs='ws2_32.lib'; }
|
||||
|
||||
if ($FLAVOR =~ /CE/)
|
||||
{
|
||||
$ex_libs.=' crypt32.lib'; # for e_capi.c
|
||||
if (defined($ENV{WCECOMPAT}))
|
||||
{
|
||||
$ex_libs.= ' $(WCECOMPAT)/lib';
|
||||
if (-f "$ENV{WCECOMPAT}/lib/$ENV{TARGETCPU}/wcecompatex.lib")
|
||||
{
|
||||
$ex_libs.='/$(TARGETCPU)/wcecompatex.lib';
|
||||
}
|
||||
else
|
||||
{
|
||||
$ex_libs.='/wcecompatex.lib';
|
||||
}
|
||||
}
|
||||
$ex_libs.=' $(PORTSDK_LIBPATH)/portlib.lib' if (defined($ENV{'PORTSDK_LIBPATH'}));
|
||||
$ex_libs.=' /nodefaultlib coredll.lib corelibc.lib' if ($ENV{'TARGETCPU'} eq "X86");
|
||||
}
|
||||
else
|
||||
{
|
||||
$ex_libs.=' gdi32.lib advapi32.lib crypt32.lib user32.lib';
|
||||
$ex_libs.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/ and `cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
|
||||
# WIN32 UNICODE build gets linked with unicows.lib for
|
||||
# backward compatibility with Win9x.
|
||||
$ex_libs="unicows.lib $ex_libs" if ($FLAVOR =~ /WIN32/ and $cflags =~ /\-DUNICODE/);
|
||||
}
|
||||
|
||||
# static library stuff
|
||||
$mklib='lib /nologo';
|
||||
$ranlib='';
|
||||
$plib="";
|
||||
$libp=".lib";
|
||||
$shlibp=($shlib)?".dll":".lib";
|
||||
$lfile='/out:';
|
||||
|
||||
$shlib_ex_obj="";
|
||||
$app_ex_obj="setargv.obj" if ($FLAVOR !~ /CE/);
|
||||
if ($FLAVOR =~ /WIN64A/) {
|
||||
if (`nasm -v 2>NUL` =~ /NASM version ([0-9]+\.[0-9]+)/ && $1 >= 2.0) {
|
||||
$asm='nasm -f win64 -DNEAR -Ox -g';
|
||||
$afile='-o ';
|
||||
} else {
|
||||
$asm='ml64 /c /Cp /Cx /Zi';
|
||||
$afile='/Fo';
|
||||
}
|
||||
} elsif ($FLAVOR =~ /WIN64I/) {
|
||||
$asm='ias -d debug';
|
||||
$afile="-o ";
|
||||
} elsif ($nasm) {
|
||||
my $ver=`nasm -v 2>NUL`;
|
||||
my $vew=`nasmw -v 2>NUL`;
|
||||
# pick newest version
|
||||
$asm=($ver ge $vew?"nasm":"nasmw")." -f win32";
|
||||
$asmtype="win32n";
|
||||
$afile='-o ';
|
||||
} else {
|
||||
$asm='ml /nologo /Cp /coff /c /Cx /Zi';
|
||||
$afile='/Fo';
|
||||
$asmtype="win32";
|
||||
}
|
||||
|
||||
$bn_asm_obj='';
|
||||
$bn_asm_src='';
|
||||
$des_enc_obj='';
|
||||
$des_enc_src='';
|
||||
$bf_enc_obj='';
|
||||
$bf_enc_src='';
|
||||
|
||||
if (!$no_asm)
|
||||
{
|
||||
win32_import_asm($mf_bn_asm, "bn", \$bn_asm_obj, \$bn_asm_src);
|
||||
win32_import_asm($mf_aes_asm, "aes", \$aes_asm_obj, \$aes_asm_src);
|
||||
win32_import_asm($mf_des_asm, "des", \$des_enc_obj, \$des_enc_src);
|
||||
win32_import_asm($mf_bf_asm, "bf", \$bf_enc_obj, \$bf_enc_src);
|
||||
win32_import_asm($mf_cast_asm, "cast", \$cast_enc_obj, \$cast_enc_src);
|
||||
win32_import_asm($mf_rc4_asm, "rc4", \$rc4_enc_obj, \$rc4_enc_src);
|
||||
win32_import_asm($mf_rc5_asm, "rc5", \$rc5_enc_obj, \$rc5_enc_src);
|
||||
win32_import_asm($mf_md5_asm, "md5", \$md5_asm_obj, \$md5_asm_src);
|
||||
win32_import_asm($mf_sha_asm, "sha", \$sha1_asm_obj, \$sha1_asm_src);
|
||||
win32_import_asm($mf_rmd_asm, "ripemd", \$rmd160_asm_obj, \$rmd160_asm_src);
|
||||
win32_import_asm($mf_wp_asm, "whrlpool", \$whirlpool_asm_obj, \$whirlpool_asm_src);
|
||||
win32_import_asm($mf_cpuid_asm, "", \$cpuid_asm_obj, \$cpuid_asm_src);
|
||||
$perl_asm = 1;
|
||||
}
|
||||
|
||||
if ($shlib && $FLAVOR !~ /CE/)
|
||||
{
|
||||
$mlflags.=" $lflags /dll";
|
||||
$lib_cflag.=" -D_WINDLL";
|
||||
#
|
||||
# Engage Applink...
|
||||
#
|
||||
$app_ex_obj.=" \$(OBJ_D)\\applink.obj /implib:\$(TMP_D)\\junk.lib";
|
||||
$cflags.=" -DOPENSSL_USE_APPLINK -I.";
|
||||
# I'm open for better suggestions than overriding $banner...
|
||||
$banner=<<'___';
|
||||
@echo Building OpenSSL
|
||||
|
||||
$(OBJ_D)\applink.obj: ms\applink.c
|
||||
$(CC) /Fo$(OBJ_D)\applink.obj $(APP_CFLAGS) -c ms\applink.c
|
||||
$(OBJ_D)\uplink.obj: ms\uplink.c ms\applink.c
|
||||
$(CC) /Fo$(OBJ_D)\uplink.obj $(SHLIB_CFLAGS) -c ms\uplink.c
|
||||
$(INCO_D)\applink.c: ms\applink.c
|
||||
$(CP) ms\applink.c $(INCO_D)\applink.c
|
||||
|
||||
EXHEADER= $(EXHEADER) $(INCO_D)\applink.c
|
||||
|
||||
LIBS_DEP=$(LIBS_DEP) $(OBJ_D)\applink.obj
|
||||
CRYPTOOBJ=$(OBJ_D)\uplink.obj $(CRYPTOOBJ)
|
||||
___
|
||||
$banner.=<<'___' if ($FLAVOR =~ /WIN64/);
|
||||
CRYPTOOBJ=ms\uptable.obj $(CRYPTOOBJ)
|
||||
___
|
||||
}
|
||||
elsif ($shlib && $FLAVOR =~ /CE/)
|
||||
{
|
||||
$mlflags.=" $lflags /dll";
|
||||
$lflags.=' /entry:mainCRTstartup' if(defined($ENV{'PORTSDK_LIBPATH'}));
|
||||
$lib_cflag.=" -D_WINDLL -D_DLL";
|
||||
}
|
||||
|
||||
sub do_lib_rule
|
||||
{
|
||||
my($objs,$target,$name,$shlib,$ign,$base_addr) = @_;
|
||||
local($ret);
|
||||
|
||||
$taget =~ s/\//$o/g if $o ne '/';
|
||||
my $base_arg;
|
||||
if ($base_addr ne "")
|
||||
{
|
||||
$base_arg= " /base:$base_addr";
|
||||
}
|
||||
else
|
||||
{
|
||||
$base_arg = "";
|
||||
}
|
||||
if ($name ne "")
|
||||
{
|
||||
$name =~ tr/a-z/A-Z/;
|
||||
$name = "/def:ms/${name}.def";
|
||||
}
|
||||
|
||||
# $target="\$(LIB_D)$o$target";
|
||||
# $ret.="$target: $objs\n";
|
||||
if (!$shlib)
|
||||
{
|
||||
# $ret.="\t\$(RM) \$(O_$Name)\n";
|
||||
$ret.="$target: $objs\n";
|
||||
$ret.="\t\$(MKLIB) $lfile$target @<<\n $objs\n<<\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
local($ex)=($target =~ /O_CRYPTO/)?'':' $(L_CRYPTO)';
|
||||
$ex.=" $zlib_lib" if $zlib_opt == 1 && $target =~ /O_CRYPTO/;
|
||||
|
||||
if ($fips && $target =~ /O_CRYPTO/)
|
||||
{
|
||||
$ret.="$target: $objs \$(PREMAIN_DSO_EXE)";
|
||||
$ret.="\n\tSET FIPS_LINK=\$(LINK_CMD)\n";
|
||||
$ret.="\tSET FIPS_CC=\$(CC)\n";
|
||||
$ret.="\tSET FIPS_CC_ARGS=/Fo\$(OBJ_D)${o}fips_premain.obj \$(SHLIB_CFLAGS) -c\n";
|
||||
$ret.="\tSET PREMAIN_DSO_EXE=\$(PREMAIN_DSO_EXE)\n";
|
||||
$ret.="\tSET FIPS_SHA1_EXE=\$(FIPS_SHA1_EXE)\n";
|
||||
$ret.="\tSET FIPS_TARGET=$target\n";
|
||||
$ret.="\tSET FIPSLIB_D=\$(FIPSLIB_D)\n";
|
||||
$ret.="\t\$(FIPSLINK) \$(MLFLAGS) $ff /map $base_arg $efile$target ";
|
||||
$ret.="$name @<<\n \$(SHLIB_EX_OBJ) $objs \$(EX_LIBS) ";
|
||||
$ret.="\$(OBJ_D)${o}fips_premain.obj $ex\n<<\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret.="$target: $objs";
|
||||
$ret.="\n\t\$(LINK_CMD) \$(MLFLAGS) $efile$target $name @<<\n \$(SHLIB_EX_OBJ) $objs $ex \$(EX_LIBS)\n<<\n";
|
||||
}
|
||||
$ret.="\tIF EXIST \$@.manifest mt -nologo -manifest \$@.manifest -outputresource:\$@;2\n\n";
|
||||
}
|
||||
$ret.="\n";
|
||||
return($ret);
|
||||
}
|
||||
|
||||
sub do_link_rule
|
||||
{
|
||||
my($target,$files,$dep_libs,$libs,$standalone)=@_;
|
||||
local($ret,$_);
|
||||
$file =~ s/\//$o/g if $o ne '/';
|
||||
$n=&bname($target);
|
||||
$ret.="$target: $files $dep_libs";
|
||||
if ($standalone == 1)
|
||||
{
|
||||
$ret.=" \$(OBJ_D)${o}applink.obj" if $shlib;
|
||||
$ret.="\n";
|
||||
$ret.=" \$(LINK_CMD) \$(LFLAGS) $efile$target @<<\n\t";
|
||||
if ($files =~ /O_FIPSCANISTER/ && !$fipscanisterbuild) {
|
||||
$ret.= "\$(EX_LIBS) ";
|
||||
$ret.= "\$(OBJ_D)${o}applink.obj " if $shlib;
|
||||
}
|
||||
$ret.="$files $libs\n<<\n";
|
||||
}
|
||||
elsif ($standalone == 2)
|
||||
{
|
||||
$ret.="\n";
|
||||
$ret.="\tSET FIPS_LINK=\$(LINK_CMD)\n";
|
||||
$ret.="\tSET FIPS_CC=\$(CC)\n";
|
||||
$ret.="\tSET FIPS_CC_ARGS=/Fo\$(OBJ_D)${o}fips_premain.obj \$(SHLIB_CFLAGS) -c\n";
|
||||
$ret.="\tSET PREMAIN_DSO_EXE=\n";
|
||||
$ret.="\tSET FIPS_TARGET=$target\n";
|
||||
$ret.="\tSET FIPS_SHA1_EXE=\$(FIPS_SHA1_EXE)\n";
|
||||
$ret.="\tSET FIPSLIB_D=\$(FIPSLIB_D)\n";
|
||||
$ret.="\t\$(FIPSLINK) \$(LFLAGS) $ff /map $efile$target @<<\n";
|
||||
$ret.="\t\$(APP_EX_OBJ) $files \$(OBJ_D)${o}fips_premain.obj $libs\n<<\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret.="\n";
|
||||
$ret.="\t\$(LINK_CMD) \$(LFLAGS) $efile$target @<<\n";
|
||||
$ret.="\t\$(APP_EX_OBJ) $files $libs\n<<\n";
|
||||
}
|
||||
$ret.="\tIF EXIST \$@.manifest mt -nologo -manifest \$@.manifest -outputresource:\$@;1\n\n";
|
||||
return($ret);
|
||||
}
|
||||
|
||||
sub win32_import_asm
|
||||
{
|
||||
my ($mf_var, $asm_name, $oref, $sref) = @_;
|
||||
my $asm_dir;
|
||||
if ($asm_name eq "")
|
||||
{
|
||||
$asm_dir = "crypto\\";
|
||||
}
|
||||
else
|
||||
{
|
||||
$asm_dir = "crypto\\$asm_name\\asm\\";
|
||||
}
|
||||
|
||||
$$oref = "";
|
||||
$mf_var =~ s/\.o$/.obj/g;
|
||||
|
||||
foreach (split(/ /, $mf_var))
|
||||
{
|
||||
$$oref .= $asm_dir . $_ . " ";
|
||||
}
|
||||
$$oref =~ s/ $//;
|
||||
$$sref = $$oref;
|
||||
$$sref =~ s/\.obj/.asm/g;
|
||||
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
104
util/pl/linux.pl
104
util/pl/linux.pl
@@ -1,104 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
#
|
||||
# linux.pl - the standard unix makefile stuff.
|
||||
#
|
||||
|
||||
$o='/';
|
||||
$cp='/bin/cp';
|
||||
$rm='/bin/rm -f';
|
||||
|
||||
# C compiler stuff
|
||||
|
||||
$cc='gcc';
|
||||
if ($debug)
|
||||
{ $cflags="-g2 -ggdb -DREF_CHECK -DCRYPTO_MDEBUG"; }
|
||||
elsif ($profile)
|
||||
{ $cflags="-pg -O3"; }
|
||||
else
|
||||
{ $cflags="-O3 -fomit-frame-pointer"; }
|
||||
|
||||
if (!$no_asm)
|
||||
{
|
||||
$bn_asm_obj='$(OBJ_D)/bn86-elf.o';
|
||||
$bn_asm_src='crypto/bn/asm/bn86unix.cpp';
|
||||
$bnco_asm_obj='$(OBJ_D)/co86-elf.o';
|
||||
$bnco_asm_src='crypto/bn/asm/co86unix.cpp';
|
||||
$des_enc_obj='$(OBJ_D)/dx86-elf.o $(OBJ_D)/yx86-elf.o';
|
||||
$des_enc_src='crypto/des/asm/dx86unix.cpp crypto/des/asm/yx86unix.cpp';
|
||||
$bf_enc_obj='$(OBJ_D)/bx86-elf.o';
|
||||
$bf_enc_src='crypto/bf/asm/bx86unix.cpp';
|
||||
$cast_enc_obj='$(OBJ_D)/cx86-elf.o';
|
||||
$cast_enc_src='crypto/cast/asm/cx86unix.cpp';
|
||||
$rc4_enc_obj='$(OBJ_D)/rx86-elf.o';
|
||||
$rc4_enc_src='crypto/rc4/asm/rx86unix.cpp';
|
||||
$rc5_enc_obj='$(OBJ_D)/r586-elf.o';
|
||||
$rc5_enc_src='crypto/rc5/asm/r586unix.cpp';
|
||||
$md5_asm_obj='$(OBJ_D)/mx86-elf.o';
|
||||
$md5_asm_src='crypto/md5/asm/mx86unix.cpp';
|
||||
$rmd160_asm_obj='$(OBJ_D)/rm86-elf.o';
|
||||
$rmd160_asm_src='crypto/ripemd/asm/rm86unix.cpp';
|
||||
$sha1_asm_obj='$(OBJ_D)/sx86-elf.o';
|
||||
$sha1_asm_src='crypto/sha/asm/sx86unix.cpp';
|
||||
$cflags.=" -DBN_ASM -DMD5_ASM -DSHA1_ASM -DOPENSSL_BN_ASM_PART_WORDS";
|
||||
}
|
||||
|
||||
$cflags.=" -DTERMIO -DL_ENDIAN -m486 -Wall";
|
||||
|
||||
if ($shlib)
|
||||
{
|
||||
$shl_cflag=" -DPIC -fpic";
|
||||
$shlibp=".so.$ssl_version";
|
||||
$so_shlibp=".so";
|
||||
}
|
||||
|
||||
sub do_shlib_rule
|
||||
{
|
||||
local($obj,$target,$name,$shlib,$so_name)=@_;
|
||||
local($ret,$_,$Name);
|
||||
|
||||
$target =~ s/\//$o/g if $o ne '/';
|
||||
($Name=$name) =~ tr/a-z/A-Z/;
|
||||
|
||||
$ret.="$target: \$(${Name}OBJ)\n";
|
||||
$ret.="\t\$(RM) target\n";
|
||||
$ret.="\tgcc \${CFLAGS} -shared -Wl,-soname,$target -o $target \$(${Name}OBJ)\n";
|
||||
($t=$target) =~ s/(^.*)\/[^\/]*$/$1/;
|
||||
if ($so_name ne "")
|
||||
{
|
||||
$ret.="\t\$(RM) \$(LIB_D)$o$so_name\n";
|
||||
$ret.="\tln -s $target \$(LIB_D)$o$so_name\n\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub do_link_rule
|
||||
{
|
||||
local($target,$files,$dep_libs,$libs)=@_;
|
||||
local($ret,$_);
|
||||
|
||||
$file =~ s/\//$o/g if $o ne '/';
|
||||
$n=&bname($target);
|
||||
$ret.="$target: $files $dep_libs\n";
|
||||
$ret.="\t\$(LINK_CMD) ${efile}$target \$(LFLAGS) $files $libs\n\n";
|
||||
return($ret);
|
||||
}
|
||||
|
||||
sub do_asm_rule
|
||||
{
|
||||
local($target,$src)=@_;
|
||||
local($ret,@s,@t,$i);
|
||||
|
||||
$target =~ s/\//$o/g if $o ne "/";
|
||||
$src =~ s/\//$o/g if $o ne "/";
|
||||
|
||||
@s=split(/\s+/,$src);
|
||||
@t=split(/\s+/,$target);
|
||||
|
||||
for ($i=0; $i<=$#s; $i++)
|
||||
{
|
||||
$ret.="$t[$i]: $s[$i]\n";
|
||||
$ret.="\tgcc -E -DELF \$(SRC_D)$o$s[$i]|\$(AS) $afile$t[$i]\n\n";
|
||||
}
|
||||
return($ret);
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,532 +0,0 @@
|
||||
# Metrowerks Codewarrior or gcc / nlmconv for NetWare
|
||||
#
|
||||
|
||||
$version_header = "crypto/opensslv.h";
|
||||
open(IN, "$version_header") or die "Couldn't open $version_header: $!";
|
||||
while (<IN>) {
|
||||
if (/^#define[\s\t]+OPENSSL_VERSION_NUMBER[\s\t]+0x(\d)(\d{2})(\d{2})(\d{2})/)
|
||||
{
|
||||
# die "OpenSSL version detected: $1.$2.$3.$4\n";
|
||||
#$nlmvernum = "$1,$2,$3";
|
||||
$nlmvernum = "$1,".($2*10+$3).",".($4*1);
|
||||
#$nlmverstr = "$1.".($2*1).".".($3*1).($4?(chr(96+$4)):"");
|
||||
break;
|
||||
}
|
||||
}
|
||||
close(IN) or die "Couldn't close $version_header: $!";
|
||||
|
||||
$readme_file = "README";
|
||||
open(IN, $readme_file) or die "Couldn't open $readme_file: $!";
|
||||
while (<IN>) {
|
||||
if (/^[\s\t]+OpenSSL[\s\t]+(\d)\.(\d{1,2})\.(\d{1,2})([a-z])(.*)/)
|
||||
{
|
||||
#$nlmvernum = "$1,$2,$3";
|
||||
#$nlmvernum = "$1,".($2*10+$3).",".($4*1);
|
||||
$nlmverstr = "$1.$2.$3$4$5";
|
||||
}
|
||||
elsif (/^[\s\t]+(Copyright \(c\) \d{4}\-\d{4} The OpenSSL Project)$/)
|
||||
{
|
||||
$nlmcpystr = $1;
|
||||
}
|
||||
break if ($nlmvernum && $nlmcpystr);
|
||||
}
|
||||
close(IN) or die "Couldn't close $readme_file: $!";
|
||||
|
||||
# Define stacksize here
|
||||
$nlmstack = "32768";
|
||||
|
||||
# some default settings here in case we failed to find them in README
|
||||
$nlmvernum = "1,0,0" if (!$nlmvernum);
|
||||
$nlmverstr = "OpenSSL" if (!$nlmverstr);
|
||||
$nlmcpystr = "Copyright (c) 1998-now The OpenSSL Project" if (!$nlmcpystr);
|
||||
|
||||
# die "OpenSSL copyright: $nlmcpystr\nOpenSSL verstring: $nlmverstr\nOpenSSL vernumber: $nlmvernum\n";
|
||||
|
||||
# The import files and other misc imports needed to link
|
||||
@misc_imports = ("GetProcessSwitchCount", "RunningProcess",
|
||||
"GetSuperHighResolutionTimer");
|
||||
if ($LIBC)
|
||||
{
|
||||
@import_files = ("libc.imp");
|
||||
@module_files = ("libc");
|
||||
$libarch = "LIBC";
|
||||
}
|
||||
else
|
||||
{
|
||||
# clib build
|
||||
@import_files = ("clib.imp");
|
||||
push(@import_files, "socklib.imp") if ($BSDSOCK);
|
||||
@module_files = ("clib");
|
||||
# push(@misc_imports, "_rt_modu64%16", "_rt_divu64%16");
|
||||
$libarch = "CLIB";
|
||||
}
|
||||
if ($BSDSOCK)
|
||||
{
|
||||
$libarch .= "-BSD";
|
||||
}
|
||||
else
|
||||
{
|
||||
$libarch .= "-WS2";
|
||||
push(@import_files, "ws2nlm.imp");
|
||||
}
|
||||
|
||||
# The "IMPORTS" environment variable must be set and point to the location
|
||||
# where import files (*.imp) can be found.
|
||||
# Example: set IMPORTS=c:\ndk\nwsdk\imports
|
||||
$import_path = $ENV{"IMPORTS"} || die ("IMPORTS environment variable not set\n");
|
||||
|
||||
|
||||
# The "PRELUDE" environment variable must be set and point to the location
|
||||
# and name of the prelude source to link with ( nwpre.obj is recommended ).
|
||||
# Example: set PRELUDE=c:\codewar\novell support\metrowerks support\libraries\runtime\nwpre.obj
|
||||
$prelude = $ENV{"PRELUDE"} || die ("PRELUDE environment variable not set\n");
|
||||
|
||||
# The "INCLUDES" environment variable must be set and point to the location
|
||||
# where import files (*.imp) can be found.
|
||||
$include_path = $ENV{"INCLUDE"} || die ("INCLUDES environment variable not set\n");
|
||||
$include_path =~ s/\\/\//g;
|
||||
$include_path = join(" -I", split(/;/, $include_path));
|
||||
|
||||
# check for gcc compiler
|
||||
$gnuc = $ENV{"GNUC"};
|
||||
|
||||
#$ssl= "ssleay32";
|
||||
#$crypto="libeay32";
|
||||
|
||||
if ($gnuc)
|
||||
{
|
||||
# C compiler
|
||||
$cc='gcc';
|
||||
# Linker
|
||||
$link='nlmconv';
|
||||
# librarian
|
||||
$mklib='ar';
|
||||
$o='/';
|
||||
# cp command
|
||||
$cp='cp -af';
|
||||
# rm command
|
||||
$rm='rm -f';
|
||||
# mv command
|
||||
$mv='mv -f';
|
||||
# mkdir command
|
||||
$mkdir='gmkdir';
|
||||
#$ranlib='ranlib';
|
||||
}
|
||||
else
|
||||
{
|
||||
# C compiler
|
||||
$cc='mwccnlm';
|
||||
# Linker
|
||||
$link='mwldnlm';
|
||||
# librarian
|
||||
$mklib='mwldnlm';
|
||||
# Path separator
|
||||
$o='\\';
|
||||
# cp command
|
||||
$cp='copy >nul:';
|
||||
# rm command
|
||||
$rm='del /f /q';
|
||||
}
|
||||
|
||||
# assembler
|
||||
if ($nw_nasm)
|
||||
{
|
||||
$asm=(`nasm -v 2>NUL` gt `nasmw -v 2>NUL`?"nasm":"nasmw");
|
||||
if ($gnuc)
|
||||
{
|
||||
$asm.=" -s -f elf";
|
||||
}
|
||||
else
|
||||
{
|
||||
$asm.=" -s -f coff -d __coff__";
|
||||
}
|
||||
$afile="-o ";
|
||||
$asm.=" -g" if $debug;
|
||||
}
|
||||
elsif ($nw_mwasm)
|
||||
{
|
||||
$asm="mwasmnlm -maxerrors 20";
|
||||
$afile="-o ";
|
||||
$asm.=" -g" if $debug;
|
||||
}
|
||||
elsif ($nw_masm)
|
||||
{
|
||||
# masm assembly settings - it should be possible to use masm but haven't
|
||||
# got it working.
|
||||
# $asm='ml /Cp /coff /c /Cx';
|
||||
# $asm.=" /Zi" if $debug;
|
||||
# $afile='/Fo';
|
||||
die("Support for masm assembler not yet functional\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
$asm="";
|
||||
$afile="";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($gnuc)
|
||||
{
|
||||
# compile flags for GNUC
|
||||
# additional flags based upon debug | non-debug
|
||||
if ($debug)
|
||||
{
|
||||
$cflags="-g -DDEBUG";
|
||||
}
|
||||
else
|
||||
{
|
||||
$cflags="-O2";
|
||||
}
|
||||
$cflags.=" -nostdinc -I$include_path \\
|
||||
-fno-builtin -fpcc-struct-return -fno-strict-aliasing \\
|
||||
-funsigned-char -Wall -Wno-unused -Wno-uninitialized";
|
||||
|
||||
# link flags
|
||||
$lflags="-T";
|
||||
}
|
||||
else
|
||||
{
|
||||
# compile flags for CodeWarrior
|
||||
# additional flags based upon debug | non-debug
|
||||
if ($debug)
|
||||
{
|
||||
$cflags="-opt off -g -sym internal -DDEBUG";
|
||||
}
|
||||
else
|
||||
{
|
||||
# CodeWarrior compiler has a problem with optimizations for floating
|
||||
# points - no optimizations until further investigation
|
||||
# $cflags="-opt all";
|
||||
}
|
||||
|
||||
# NOTES: Several c files in the crypto subdirectory include headers from
|
||||
# their local directories. Metrowerks wouldn't find these h files
|
||||
# without adding individual include directives as compile flags
|
||||
# or modifying the c files. Instead of adding individual include
|
||||
# paths for each subdirectory a recursive include directive
|
||||
# is used ( -ir crypto ).
|
||||
#
|
||||
# A similar issue exists for the engines and apps subdirectories.
|
||||
#
|
||||
# Turned off the "possible" warnings ( -w nopossible ). Metrowerks
|
||||
# complained a lot about various stuff. May want to turn back
|
||||
# on for further development.
|
||||
$cflags.=" -nostdinc -ir crypto -ir ssl -ir engines -ir apps -I$include_path \\
|
||||
-msgstyle gcc -align 4 -processor pentium -char unsigned \\
|
||||
-w on -w nolargeargs -w nopossible -w nounusedarg -w nounusedexpr \\
|
||||
-w noimplicitconv -relax_pointers -nosyspath -maxerrors 20";
|
||||
|
||||
# link flags
|
||||
$lflags="-msgstyle gcc -zerobss -nostdlib -sym internal -commandfile";
|
||||
}
|
||||
|
||||
# common defines
|
||||
$cflags.=" -DL_ENDIAN -DOPENSSL_SYSNAME_NETWARE -U_WIN32";
|
||||
|
||||
# If LibC build add in NKS_LIBC define and set the entry/exit
|
||||
# routines - The default entry/exit routines are for CLib and don't exist
|
||||
# in LibC
|
||||
if ($LIBC)
|
||||
{
|
||||
$cflags.=" -DNETWARE_LIBC";
|
||||
$nlmstart = "_LibCPrelude";
|
||||
$nlmexit = "_LibCPostlude";
|
||||
@nlm_flags = ("pseudopreemption", "flag_on 64");
|
||||
}
|
||||
else
|
||||
{
|
||||
$cflags.=" -DNETWARE_CLIB";
|
||||
$nlmstart = "_Prelude";
|
||||
$nlmexit = "_Stop";
|
||||
}
|
||||
|
||||
# If BSD Socket support is requested, set a define for the compiler
|
||||
if ($BSDSOCK)
|
||||
{
|
||||
$cflags.=" -DNETWARE_BSDSOCK";
|
||||
if (!$LIBC)
|
||||
{
|
||||
$cflags.=" -DNETDB_USE_INTERNET";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# linking stuff
|
||||
# for the output directories use the mk1mf.pl values with "_nw" appended
|
||||
if ($shlib)
|
||||
{
|
||||
if ($LIBC)
|
||||
{
|
||||
$out_def.="_nw_libc_nlm";
|
||||
$tmp_def.="_nw_libc_nlm";
|
||||
$inc_def.="_nw_libc_nlm";
|
||||
}
|
||||
else # NETWARE_CLIB
|
||||
{
|
||||
$out_def.="_nw_clib_nlm";
|
||||
$tmp_def.="_nw_clib_nlm";
|
||||
$inc_def.="_nw_clib_nlm";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($gnuc) # GNUC Tools
|
||||
{
|
||||
$libp=".a";
|
||||
$shlibp=".a";
|
||||
$lib_flags="-cr";
|
||||
}
|
||||
else # CodeWarrior
|
||||
{
|
||||
$libp=".lib";
|
||||
$shlibp=".lib";
|
||||
$lib_flags="-nodefaults -type library -o";
|
||||
}
|
||||
if ($LIBC)
|
||||
{
|
||||
$out_def.="_nw_libc";
|
||||
$tmp_def.="_nw_libc";
|
||||
$inc_def.="_nw_libc";
|
||||
}
|
||||
else # NETWARE_CLIB
|
||||
{
|
||||
$out_def.="_nw_clib";
|
||||
$tmp_def.="_nw_clib";
|
||||
$inc_def.="_nw_clib";
|
||||
}
|
||||
}
|
||||
|
||||
# used by mk1mf.pl
|
||||
$obj='.o';
|
||||
$ofile='-o ';
|
||||
$efile='';
|
||||
$exep='.nlm';
|
||||
$ex_libs='';
|
||||
|
||||
if (!$no_asm)
|
||||
{
|
||||
$bn_asm_obj="\$(OBJ_D)${o}bn-nw${obj}";
|
||||
$bn_asm_src="crypto${o}bn${o}asm${o}bn-nw.asm";
|
||||
$bnco_asm_obj="\$(OBJ_D)${o}co-nw${obj}";
|
||||
$bnco_asm_src="crypto${o}bn${o}asm${o}co-nw.asm";
|
||||
$aes_asm_obj="\$(OBJ_D)${o}a-nw${obj}";
|
||||
$aes_asm_src="crypto${o}aes${o}asm${o}a-nw.asm";
|
||||
$des_enc_obj="\$(OBJ_D)${o}d-nw${obj} \$(OBJ_D)${o}y-nw${obj}";
|
||||
$des_enc_src="crypto${o}des${o}asm${o}d-nw.asm crypto${o}des${o}asm${o}y-nw.asm";
|
||||
$bf_enc_obj="\$(OBJ_D)${o}b-nw${obj}";
|
||||
$bf_enc_src="crypto${o}bf${o}asm${o}b-nw.asm";
|
||||
$cast_enc_obj="\$(OBJ_D)${o}c-nw${obj}";
|
||||
$cast_enc_src="crypto${o}cast${o}asm${o}c-nw.asm";
|
||||
$rc4_enc_obj="\$(OBJ_D)${o}r4-nw${obj}";
|
||||
$rc4_enc_src="crypto${o}rc4${o}asm${o}r4-nw.asm";
|
||||
$rc5_enc_obj="\$(OBJ_D)${o}r5-nw${obj}";
|
||||
$rc5_enc_src="crypto${o}rc5${o}asm${o}r5-nw.asm";
|
||||
$md5_asm_obj="\$(OBJ_D)${o}m5-nw${obj}";
|
||||
$md5_asm_src="crypto${o}md5${o}asm${o}m5-nw.asm";
|
||||
$sha1_asm_obj="\$(OBJ_D)${o}s1-nw${obj} \$(OBJ_D)${o}sha256-nw${obj} \$(OBJ_D)${o}sha512-nw${obj}";
|
||||
$sha1_asm_src="crypto${o}sha${o}asm${o}s1-nw.asm crypto${o}sha${o}asm${o}sha256-nw.asm crypto${o}sha${o}asm${o}sha512-nw.asm";
|
||||
$rmd160_asm_obj="\$(OBJ_D)${o}rm-nw${obj}";
|
||||
$rmd160_asm_src="crypto${o}ripemd${o}asm${o}rm-nw.asm";
|
||||
$whirlpool_asm_obj="\$(OBJ_D)${o}wp-nw${obj}";
|
||||
$whirlpool_asm_src="crypto${o}whrlpool${o}asm${o}wp-nw.asm";
|
||||
$cpuid_asm_obj="\$(OBJ_D)${o}x86cpuid-nw${obj}";
|
||||
$cpuid_asm_src="crypto${o}x86cpuid-nw.asm";
|
||||
$cflags.=" -DOPENSSL_CPUID_OBJ -DBN_ASM -DOPENSSL_BN_ASM_PART_WORDS -DMD5_ASM -DWHIRLPOOL_ASM";
|
||||
$cflags.=" -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM";
|
||||
$cflags.=" -DAES_ASM -DRMD160_ASM";
|
||||
}
|
||||
else
|
||||
{
|
||||
$bn_asm_obj='';
|
||||
$bn_asm_src='';
|
||||
$bnco_asm_obj='';
|
||||
$bnco_asm_src='';
|
||||
$aes_asm_obj='';
|
||||
$aes_asm_src='';
|
||||
$des_enc_obj='';
|
||||
$des_enc_src='';
|
||||
$bf_enc_obj='';
|
||||
$bf_enc_src='';
|
||||
$cast_enc_obj='';
|
||||
$cast_enc_src='';
|
||||
$rc4_enc_obj='';
|
||||
$rc4_enc_src='';
|
||||
$rc5_enc_obj='';
|
||||
$rc5_enc_src='';
|
||||
$md5_asm_obj='';
|
||||
$md5_asm_src='';
|
||||
$sha1_asm_obj='';
|
||||
$sha1_asm_src='';
|
||||
$rmd160_asm_obj='';
|
||||
$rmd160_asm_src='';
|
||||
$whirlpool_asm_obj='';
|
||||
$whirlpool_asm_src='';
|
||||
$cpuid_asm_obj='';
|
||||
$cpuid_asm_src='';
|
||||
}
|
||||
|
||||
# create the *.def linker command files in \openssl\netware\ directory
|
||||
sub do_def_file
|
||||
{
|
||||
# strip off the leading path
|
||||
my($target) = bname(shift);
|
||||
my($i);
|
||||
|
||||
if ($target =~ /(.*).nlm/)
|
||||
{
|
||||
$target = $1;
|
||||
}
|
||||
|
||||
# special case for openssl - the mk1mf.pl defines E_EXE = openssl
|
||||
if ($target =~ /E_EXE/)
|
||||
{
|
||||
$target =~ s/\$\(E_EXE\)/openssl/;
|
||||
}
|
||||
|
||||
# Note: originally tried to use full path ( \openssl\netware\$target.def )
|
||||
# Metrowerks linker choked on this with an assertion failure. bug???
|
||||
#
|
||||
my($def_file) = "netware${o}$target.def";
|
||||
|
||||
open(DEF_OUT, ">$def_file") || die("unable to open file $def_file\n");
|
||||
|
||||
print( DEF_OUT "# command file generated by netware.pl for NLM target.\n" );
|
||||
print( DEF_OUT "# do not edit this file - all your changes will be lost!!\n" );
|
||||
print( DEF_OUT "#\n");
|
||||
print( DEF_OUT "DESCRIPTION \"$target ($libarch) - OpenSSL $nlmverstr\"\n");
|
||||
print( DEF_OUT "COPYRIGHT \"$nlmcpystr\"\n");
|
||||
print( DEF_OUT "VERSION $nlmvernum\n");
|
||||
print( DEF_OUT "STACK $nlmstack\n");
|
||||
print( DEF_OUT "START $nlmstart\n");
|
||||
print( DEF_OUT "EXIT $nlmexit\n");
|
||||
|
||||
# special case for openssl
|
||||
if ($target eq "openssl")
|
||||
{
|
||||
print( DEF_OUT "SCREENNAME \"OpenSSL $nlmverstr\"\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
print( DEF_OUT "SCREENNAME \"DEFAULT\"\n");
|
||||
}
|
||||
|
||||
foreach $i (@misc_imports)
|
||||
{
|
||||
print( DEF_OUT "IMPORT $i\n");
|
||||
}
|
||||
|
||||
foreach $i (@import_files)
|
||||
{
|
||||
print( DEF_OUT "IMPORT \@$import_path${o}$i\n");
|
||||
}
|
||||
|
||||
foreach $i (@module_files)
|
||||
{
|
||||
print( DEF_OUT "MODULE $i\n");
|
||||
}
|
||||
|
||||
foreach $i (@nlm_flags)
|
||||
{
|
||||
print( DEF_OUT "$i\n");
|
||||
}
|
||||
|
||||
if ($gnuc)
|
||||
{
|
||||
if ($target =~ /openssl/)
|
||||
{
|
||||
print( DEF_OUT "INPUT ${tmp_def}${o}openssl${obj}\n");
|
||||
print( DEF_OUT "INPUT ${tmp_def}${o}openssl${libp}\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
print( DEF_OUT "INPUT ${tmp_def}${o}${target}${obj}\n");
|
||||
}
|
||||
print( DEF_OUT "INPUT $prelude\n");
|
||||
print( DEF_OUT "INPUT ${out_def}${o}${ssl}${libp} ${out_def}${o}${crypto}${libp}\n");
|
||||
print( DEF_OUT "OUTPUT $target.nlm\n");
|
||||
}
|
||||
|
||||
close(DEF_OUT);
|
||||
return($def_file);
|
||||
}
|
||||
|
||||
sub do_lib_rule
|
||||
{
|
||||
my($objs,$target,$name,$shlib)=@_;
|
||||
my($ret);
|
||||
|
||||
$ret.="$target: $objs\n";
|
||||
if (!$shlib)
|
||||
{
|
||||
$ret.="\t\@echo Building Lib: $name\n";
|
||||
$ret.="\t\$(MKLIB) $lib_flags $target $objs\n";
|
||||
$ret.="\t\@echo .\n"
|
||||
}
|
||||
else
|
||||
{
|
||||
die( "Building as NLM not currently supported!" );
|
||||
}
|
||||
|
||||
$ret.="\n";
|
||||
return($ret);
|
||||
}
|
||||
|
||||
sub do_link_rule
|
||||
{
|
||||
my($target,$files,$dep_libs,$libs)=@_;
|
||||
my($ret);
|
||||
my($def_file) = do_def_file($target);
|
||||
|
||||
$ret.="$target: $files $dep_libs\n";
|
||||
|
||||
# NOTE: When building the test nlms no screen name is given
|
||||
# which causes the console screen to be used. By using the console
|
||||
# screen there is no "<press any key to continue>" message which
|
||||
# requires user interaction. The test script ( do_tests.pl ) needs
|
||||
# to be able to run the tests without requiring user interaction.
|
||||
#
|
||||
# However, the sample program "openssl.nlm" is used by the tests and is
|
||||
# a interactive sample so a screen is desired when not be run by the
|
||||
# tests. To solve the problem, two versions of the program are built:
|
||||
# openssl2 - no screen used by tests
|
||||
# openssl - default screen - use for normal interactive modes
|
||||
#
|
||||
|
||||
# special case for openssl - the mk1mf.pl defines E_EXE = openssl
|
||||
if ($target =~ /E_EXE/)
|
||||
{
|
||||
my($target2) = $target;
|
||||
|
||||
$target2 =~ s/\(E_EXE\)/\(E_EXE\)2/;
|
||||
|
||||
# openssl2
|
||||
my($def_file2) = do_def_file($target2);
|
||||
|
||||
if ($gnuc)
|
||||
{
|
||||
$ret.="\t\$(MKLIB) $lib_flags \$(TMP_D)${o}\$(E_EXE).a \$(filter-out \$(TMP_D)${o}\$(E_EXE)${obj},$files)\n";
|
||||
$ret.="\t\$(LINK_CMD) \$(LFLAGS) $def_file2\n";
|
||||
$ret.="\t\@$mv \$(E_EXE)2.nlm \$(TEST_D)\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret.="\t\$(LINK_CMD) \$(LFLAGS) $def_file2 $files \"$prelude\" $libs -o $target2\n";
|
||||
}
|
||||
}
|
||||
if ($gnuc)
|
||||
{
|
||||
$ret.="\t\$(LINK_CMD) \$(LFLAGS) $def_file\n";
|
||||
$ret.="\t\@$mv \$(\@F) \$(TEST_D)\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret.="\t\$(LINK_CMD) \$(LFLAGS) $def_file $files \"$prelude\" $libs -o $target\n";
|
||||
}
|
||||
|
||||
$ret.="\n";
|
||||
return($ret);
|
||||
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
#
|
||||
# linux.pl - the standard unix makefile stuff.
|
||||
#
|
||||
|
||||
$o='/';
|
||||
$cp='/bin/cp';
|
||||
$rm='/bin/rm -f';
|
||||
|
||||
# C compiler stuff
|
||||
|
||||
$cc='cc';
|
||||
if ($debug)
|
||||
{ $cflags="-g -DREF_CHECK -DCRYPTO_MDEBUG"; }
|
||||
else
|
||||
{ $cflags="-O2"; }
|
||||
|
||||
$cflags.=" -std1 -DL_ENDIAN";
|
||||
|
||||
if (!$no_asm)
|
||||
{
|
||||
$bn_asm_obj='$(OBJ_D)/mips1.o';
|
||||
$bn_asm_src='crypto/bn/asm/mips1.s';
|
||||
}
|
||||
|
||||
sub do_link_rule
|
||||
{
|
||||
local($target,$files,$dep_libs,$libs)=@_;
|
||||
local($ret,$_);
|
||||
|
||||
$file =~ s/\//$o/g if $o ne '/';
|
||||
$n=&bname($target);
|
||||
$ret.="$target: $files $dep_libs\n";
|
||||
$ret.="\t\$(LINK_CMD) ${efile}$target \$(LFLAGS) $files $libs\n\n";
|
||||
return($ret);
|
||||
}
|
||||
|
||||
1;
|
||||
442
util/pl/unix.pl
442
util/pl/unix.pl
@@ -1,442 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
#
|
||||
# unix.pl - the standard unix makefile stuff.
|
||||
#
|
||||
|
||||
$o='/';
|
||||
$cp='/bin/cp';
|
||||
$rm='/bin/rm -f';
|
||||
|
||||
# C compiler stuff
|
||||
|
||||
if ($gcc)
|
||||
{
|
||||
$cc='gcc';
|
||||
if ($debug)
|
||||
{ $cflags="-g2 -ggdb"; }
|
||||
else
|
||||
{ $cflags="-O3 -fomit-frame-pointer"; }
|
||||
}
|
||||
else
|
||||
{
|
||||
$cc='cc';
|
||||
if ($debug)
|
||||
{ $cflags="-g"; }
|
||||
else
|
||||
{ $cflags="-O"; }
|
||||
}
|
||||
$obj='.o';
|
||||
$asm_suffix='.s';
|
||||
$ofile='-o ';
|
||||
|
||||
# EXE linking stuff
|
||||
$link='${CC}';
|
||||
$lflags='${CFLAG}';
|
||||
$efile='-o ';
|
||||
$exep='';
|
||||
$ex_libs="";
|
||||
|
||||
# static library stuff
|
||||
$mklib='ar r';
|
||||
$mlflags='';
|
||||
$ranlib=&which("ranlib") or $ranlib="true";
|
||||
$plib='lib';
|
||||
$libp=".a";
|
||||
$shlibp=".a";
|
||||
$lfile='';
|
||||
|
||||
$asm='as';
|
||||
$afile='-o ';
|
||||
$bn_asm_obj="";
|
||||
$bn_asm_src="";
|
||||
$des_enc_obj="";
|
||||
$des_enc_src="";
|
||||
$bf_enc_obj="";
|
||||
$bf_enc_src="";
|
||||
|
||||
%perl1 = (
|
||||
'md5-x86_64' => 'crypto/md5',
|
||||
'x86_64-mont' => 'crypto/bn',
|
||||
'x86_64-mont5' => 'crypto/bn',
|
||||
'x86_64-gf2m' => 'crypto/bn',
|
||||
'aes-x86_64' => 'crypto/aes',
|
||||
'vpaes-x86_64' => 'crypto/aes',
|
||||
'bsaes-x86_64' => 'crypto/aes',
|
||||
'aesni-x86_64' => 'crypto/aes',
|
||||
'aesni-sha1-x86_64' => 'crypto/aes',
|
||||
'sha1-x86_64' => 'crypto/sha',
|
||||
'e_padlock-x86_64' => 'engines',
|
||||
'rc4-x86_64' => 'crypto/rc4',
|
||||
'rc4-md5-x86_64' => 'crypto/rc4',
|
||||
'ghash-x86_64' => 'crypto/modes',
|
||||
'aesni-gcm-x86_64' => 'crypto/modes',
|
||||
'aesni-sha256-x86_64' => 'crypto/aes',
|
||||
'rsaz-x86_64' => 'crypto/bn',
|
||||
'rsaz-avx2' => 'crypto/bn',
|
||||
'aesni-mb-x86_64' => 'crypto/aes',
|
||||
'sha1-mb-x86_64' => 'crypto/sha',
|
||||
'sha256-mb-x86_64' => 'crypto/sha',
|
||||
'ecp_nistz256-x86_64' => 'crypto/ec',
|
||||
);
|
||||
|
||||
# If I were feeling more clever, these could probably be extracted
|
||||
# from makefiles.
|
||||
sub platform_perlasm_compile_target
|
||||
{
|
||||
local($target, $source, $bname) = @_;
|
||||
|
||||
for $p (keys %perl1)
|
||||
{
|
||||
if ($target eq "\$(OBJ_D)/$p.o")
|
||||
{
|
||||
return << "EOF";
|
||||
\$(TMP_D)/$p.s: $perl1{$p}/asm/$p.pl
|
||||
\$(PERL) $perl1{$p}/asm/$p.pl \$(PERLASM_SCHEME) > \$@
|
||||
EOF
|
||||
}
|
||||
}
|
||||
if ($target eq '$(OBJ_D)/x86_64cpuid.o')
|
||||
{
|
||||
return << 'EOF';
|
||||
$(TMP_D)/x86_64cpuid.s: crypto/x86_64cpuid.pl
|
||||
$(PERL) crypto/x86_64cpuid.pl $(PERLASM_SCHEME) > $@
|
||||
EOF
|
||||
}
|
||||
elsif ($target eq '$(OBJ_D)/sha256-x86_64.o')
|
||||
{
|
||||
return << 'EOF';
|
||||
$(TMP_D)/sha256-x86_64.s: crypto/sha/asm/sha512-x86_64.pl
|
||||
$(PERL) crypto/sha/asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
|
||||
EOF
|
||||
}
|
||||
elsif ($target eq '$(OBJ_D)/sha512-x86_64.o')
|
||||
{
|
||||
return << 'EOF';
|
||||
$(TMP_D)/sha512-x86_64.s: crypto/sha/asm/sha512-x86_64.pl
|
||||
$(PERL) crypto/sha/asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
|
||||
EOF
|
||||
}
|
||||
elsif ($target eq '$(OBJ_D)/sha512-x86_64.o')
|
||||
{
|
||||
return << 'EOF';
|
||||
$(TMP_D)/sha512-x86_64.s: crypto/sha/asm/sha512-x86_64.pl
|
||||
$(PERL) crypto/sha/asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
|
||||
EOF
|
||||
}
|
||||
|
||||
die $target;
|
||||
}
|
||||
|
||||
sub special_compile_target
|
||||
{
|
||||
local($target) = @_;
|
||||
|
||||
if ($target eq 'crypto/bn/x86_64-gcc')
|
||||
{
|
||||
return << "EOF";
|
||||
\$(TMP_D)/x86_64-gcc.o: crypto/bn/asm/x86_64-gcc.c
|
||||
\$(CC) \$(CFLAGS) -c -o \$@ crypto/bn/asm/x86_64-gcc.c
|
||||
EOF
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub do_lib_rule
|
||||
{
|
||||
local($obj,$target,$name,$shlib)=@_;
|
||||
local($ret,$_,$Name);
|
||||
|
||||
$target =~ s/\//$o/g if $o ne '/';
|
||||
$target="$target";
|
||||
($Name=$name) =~ tr/a-z/A-Z/;
|
||||
|
||||
$ret.="$target: \$(${Name}OBJ)\n";
|
||||
$ret.="\t\$(RM) $target\n";
|
||||
$ret.="\t\$(MKLIB) $target \$(${Name}OBJ)\n";
|
||||
$ret.="\t\$(RANLIB) $target\n\n";
|
||||
}
|
||||
|
||||
sub do_link_rule
|
||||
{
|
||||
local($target,$files,$dep_libs,$libs)=@_;
|
||||
local($ret,$_);
|
||||
|
||||
$file =~ s/\//$o/g if $o ne '/';
|
||||
$n=&bname($target);
|
||||
$ret.="$target: $files $dep_libs\n";
|
||||
$ret.="\t\$(LINK_CMD) ${efile}$target \$(LFLAGS) $files $libs\n\n";
|
||||
return($ret);
|
||||
}
|
||||
|
||||
sub which
|
||||
{
|
||||
my ($name)=@_;
|
||||
my $path;
|
||||
foreach $path (split /:/, $ENV{PATH})
|
||||
{
|
||||
if (-x "$path/$name")
|
||||
{
|
||||
return "$path/$name";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub fixtests
|
||||
{
|
||||
my ($str, $tests) = @_;
|
||||
|
||||
foreach my $t (keys %$tests)
|
||||
{
|
||||
$str =~ s/(\.\/)?\$\($t\)/\$(TEST_D)\/$tests->{$t}/g;
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
sub fixdeps
|
||||
{
|
||||
my ($str, $fakes) = @_;
|
||||
|
||||
my @t = split(/\s+/, $str);
|
||||
$str = '';
|
||||
foreach my $t (@t)
|
||||
{
|
||||
$str .= ' ' if $str ne '';
|
||||
if (exists($fakes->{$t}))
|
||||
{
|
||||
$str .= $fakes->{$t};
|
||||
next;
|
||||
}
|
||||
if ($t =~ /^[^\/]+$/)
|
||||
{
|
||||
$str .= '$(TEST_D)/' . $t;
|
||||
}
|
||||
else
|
||||
{
|
||||
$str .= $t;
|
||||
}
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
sub fixrules
|
||||
{
|
||||
my ($str) = @_;
|
||||
|
||||
# Compatible with -j...
|
||||
$str =~ s/^(\s+@?)/$1cd \$(TEST_D) && /;
|
||||
return $str;
|
||||
|
||||
# Compatible with not -j.
|
||||
my @t = split("\n", $str);
|
||||
$str = '';
|
||||
my $prev;
|
||||
foreach my $t (@t)
|
||||
{
|
||||
$t =~ s/^\s+//;
|
||||
if (!$prev)
|
||||
{
|
||||
if ($t =~ /^@/)
|
||||
{
|
||||
$t =~ s/^@/\@cd \$(TEST_D) && /;
|
||||
}
|
||||
elsif ($t !~ /^\s*#/)
|
||||
{
|
||||
$t = 'cd $(TEST_D) && ' . $t;
|
||||
}
|
||||
}
|
||||
$str .= "\t$t\n";
|
||||
$prev = $t =~/\\$/;
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
|
||||
sub copy_scripts
|
||||
{
|
||||
my ($sed, $src, @targets) = @_;
|
||||
|
||||
my $s = '';
|
||||
foreach my $t (@targets)
|
||||
{
|
||||
# Copy first so we get file modes...
|
||||
$s .= "\$(TEST_D)/$t: \$(SRC_D)/$src/$t\n\tcp \$(SRC_D)/$src/$t \$(TEST_D)/$t\n";
|
||||
$s .= "\tsed -e 's/\\.\\.\\/apps/..\\/\$(OUT_D)/' -e 's/\\.\\.\\/util/..\\/\$(TEST_D)/' < \$(SRC_D)/$src/$t > \$(TEST_D)/$t\n" if $sed;
|
||||
$s .= "\n";
|
||||
}
|
||||
return $s;
|
||||
}
|
||||
|
||||
sub get_tests
|
||||
{
|
||||
my ($makefile) = @_;
|
||||
|
||||
open(M, $makefile) || die "Can't open $makefile: $!";
|
||||
my %targets;
|
||||
my %deps;
|
||||
my %tests;
|
||||
my %alltests;
|
||||
my %fakes;
|
||||
while (my $line = <M>)
|
||||
{
|
||||
chomp $line;
|
||||
while ($line =~ /^(.*)\\$/)
|
||||
{
|
||||
$line = $1 . <M>;
|
||||
}
|
||||
|
||||
if ($line =~ /^alltests:(.*)$/)
|
||||
{
|
||||
my @t = split(/\s+/, $1);
|
||||
foreach my $t (@t)
|
||||
{
|
||||
$targets{$t} = '';
|
||||
$alltests{$t} = undef;
|
||||
}
|
||||
}
|
||||
|
||||
if (($line =~ /^(?<t>\S+):(?<d>.*)$/ && exists $targets{$1})
|
||||
|| $line =~ /^(?<t>test_(ss|gen) .*):(?<d>.*)/)
|
||||
{
|
||||
my $t = $+{t};
|
||||
my $d = $+{d};
|
||||
# If there are multiple targets stupid FreeBSD make runs the
|
||||
# rules once for each dependency that matches one of the
|
||||
# targets. Running the same rule twice concurrently causes
|
||||
# breakage, so replace with a fake target.
|
||||
if ($t =~ /\s/)
|
||||
{
|
||||
++$fake;
|
||||
my @targets = split /\s+/, $t;
|
||||
$t = "_fake$fake";
|
||||
foreach my $f (@targets)
|
||||
{
|
||||
$fakes{$f} = $t;
|
||||
}
|
||||
}
|
||||
$deps{$t} = $d;
|
||||
$deps{$t} =~ s/#.*$//;
|
||||
for (;;)
|
||||
{
|
||||
$line = <M>;
|
||||
chomp $line;
|
||||
last if $line eq '';
|
||||
$targets{$t} .= "$line\n";
|
||||
}
|
||||
next;
|
||||
}
|
||||
|
||||
if ($line =~ /^(\S+TEST)=\s*(\S+)$/)
|
||||
{
|
||||
$tests{$1} = $2;
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
delete $alltests{test_jpake} if $no_jpake;
|
||||
delete $targets{test_ige} if $no_ige;
|
||||
delete $alltests{test_md2} if $no_md2;
|
||||
delete $alltests{test_rc5} if $no_rc5;
|
||||
|
||||
my $tests;
|
||||
foreach my $t (keys %tests)
|
||||
{
|
||||
$tests .= "$t = $tests{$t}\n";
|
||||
}
|
||||
|
||||
my $each;
|
||||
foreach my $t (keys %targets)
|
||||
{
|
||||
next if $t eq '';
|
||||
|
||||
my $d = $deps{$t};
|
||||
$d =~ s/\.\.\/apps/\$(BIN_D)/g;
|
||||
$d =~ s/\.\.\/util/\$(TEST_D)/g;
|
||||
$d = fixtests($d, \%tests);
|
||||
$d = fixdeps($d, \%fakes);
|
||||
|
||||
my $r = $targets{$t};
|
||||
$r =~ s/\.\.\/apps/..\/\$(BIN_D)/g;
|
||||
$r =~ s/\.\.\/util/..\/\$(TEST_D)/g;
|
||||
$r =~ s/\.\.\/(\S+)/\$(SRC_D)\/$1/g;
|
||||
$r = fixrules($r);
|
||||
|
||||
next if $r eq '';
|
||||
|
||||
$t =~ s/\s+/ \$(TEST_D)\//g;
|
||||
|
||||
$each .= "$t: test_scripts $d\n\t\@echo '$t test started'\n$r\t\@echo '$t test done'\n\n";
|
||||
}
|
||||
|
||||
# FIXME: Might be a clever way to figure out what needs copying
|
||||
my @copies = ( 'bctest',
|
||||
'testgen',
|
||||
'cms-test.pl',
|
||||
'tx509',
|
||||
'test.cnf',
|
||||
'testenc',
|
||||
'tocsp',
|
||||
'testca',
|
||||
'CAss.cnf',
|
||||
'testtsa',
|
||||
'CAtsa.cnf',
|
||||
'Uss.cnf',
|
||||
'P1ss.cnf',
|
||||
'P2ss.cnf',
|
||||
'tcrl',
|
||||
'tsid',
|
||||
'treq',
|
||||
'tpkcs7',
|
||||
'tpkcs7d',
|
||||
'testcrl.pem',
|
||||
'testx509.pem',
|
||||
'v3-cert1.pem',
|
||||
'v3-cert2.pem',
|
||||
'testreq2.pem',
|
||||
'testp7.pem',
|
||||
'pkcs7-1.pem',
|
||||
'trsa',
|
||||
'testrsa.pem',
|
||||
'testsid.pem',
|
||||
'testss',
|
||||
'testssl',
|
||||
'testsslproxy',
|
||||
'serverinfo.pem',
|
||||
);
|
||||
my $copies = copy_scripts(1, 'test', @copies);
|
||||
$copies .= copy_scripts(0, 'test', ('smcont.txt'));
|
||||
|
||||
my @utils = ( 'shlib_wrap.sh',
|
||||
'opensslwrap.sh',
|
||||
);
|
||||
$copies .= copy_scripts(1, 'util', @utils);
|
||||
|
||||
my @apps = ( 'CA.sh',
|
||||
'openssl.cnf',
|
||||
'server2.pem',
|
||||
);
|
||||
$copies .= copy_scripts(1, 'apps', @apps);
|
||||
|
||||
$copies .= copy_scripts(1, 'crypto/evp', ('evptests.txt'));
|
||||
|
||||
$scripts = "test_scripts: \$(TEST_D)/CA.sh \$(TEST_D)/opensslwrap.sh \$(TEST_D)/openssl.cnf \$(TEST_D)/shlib_wrap.sh ocsp smime\n";
|
||||
$scripts .= "\nocsp:\n\tcp -R test/ocsp-tests \$(TEST_D)\n";
|
||||
$scripts .= "\smime:\n\tcp -R test/smime-certs \$(TEST_D)\n";
|
||||
|
||||
my $all = 'test:';
|
||||
foreach my $t (keys %alltests)
|
||||
{
|
||||
if (exists($fakes{$t}))
|
||||
{
|
||||
$all .= " $fakes{$t}";
|
||||
}
|
||||
else
|
||||
{
|
||||
$all .= " $t";
|
||||
}
|
||||
}
|
||||
|
||||
return "$scripts\n$copies\n$tests\n$all\n\n$each";
|
||||
}
|
||||
|
||||
1;
|
||||
1184
util/pod2man.pl
1184
util/pod2man.pl
File diff suppressed because it is too large
Load Diff
@@ -1,58 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This script is used by test/Makefile to check whether a sane 'pod2man'
|
||||
# is installed.
|
||||
# ('make install' should not try to run 'pod2man' if it does not exist or if
|
||||
# it is a broken 'pod2man' version that is known to cause trouble. if we find
|
||||
# the system 'pod2man' to be broken, we use our own copy instead)
|
||||
#
|
||||
# In any case, output an appropriate command line for running (or not
|
||||
# running) pod2man.
|
||||
|
||||
|
||||
IFS=:
|
||||
if test "$OSTYPE" = "msdosdjgpp"; then IFS=";"; fi
|
||||
|
||||
try_without_dir=true
|
||||
# First we try "pod2man", then "$dir/pod2man" for each item in $PATH.
|
||||
for dir in dummy${IFS}$PATH; do
|
||||
if [ "$try_without_dir" = true ]; then
|
||||
# first iteration
|
||||
pod2man=pod2man
|
||||
try_without_dir=false
|
||||
else
|
||||
# second and later iterations
|
||||
pod2man="$dir/pod2man"
|
||||
if [ ! -f "$pod2man" ]; then # '-x' is not available on Ultrix
|
||||
pod2man=''
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! "$pod2man" = '' ]; then
|
||||
failure=none
|
||||
|
||||
if "$pod2man" --section=1 --center=OpenSSL --release=dev pod2mantest.pod | fgrep OpenSSL >/dev/null; then
|
||||
:
|
||||
else
|
||||
failure=BasicTest
|
||||
fi
|
||||
|
||||
if [ "$failure" = none ]; then
|
||||
if "$pod2man" --section=1 --center=OpenSSL --release=dev pod2mantest.pod | grep '^MARKER - ' >/dev/null; then
|
||||
failure=MultilineTest
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ "$failure" = none ]; then
|
||||
echo "$pod2man"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "$pod2man does not work properly ('$failure' failed). Looking for another pod2man ..." >&2
|
||||
fi
|
||||
done
|
||||
|
||||
echo "No working pod2man found. Consider installing a new version." >&2
|
||||
echo "As a workaround, we'll use a bundled old copy of pod2man.pl." >&2
|
||||
echo "$1 ../../util/pod2man.pl"
|
||||
@@ -1,15 +0,0 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
foo, bar,
|
||||
MARKER - test of multiline name section
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This is a test .pod file to see if we have a buggy pod2man or not.
|
||||
If we have a buggy implementation, we will get a line matching the
|
||||
regular expression "^ +MARKER - test of multiline name section *$"
|
||||
at the end of the resulting document.
|
||||
|
||||
=cut
|
||||
246
util/process_docs.pl
Normal file
246
util/process_docs.pl
Normal file
@@ -0,0 +1,246 @@
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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;
|
||||
use warnings;
|
||||
|
||||
use File::Spec::Functions;
|
||||
use File::Basename;
|
||||
use File::Copy;
|
||||
use File::Path;
|
||||
use if $^O ne "VMS", 'File::Glob' => qw/glob/;
|
||||
use Getopt::Long;
|
||||
use Pod::Usage;
|
||||
|
||||
use lib '.';
|
||||
use configdata;
|
||||
|
||||
# We know we are in the 'util' directory and that our perl modules are
|
||||
# in util/perl
|
||||
use lib catdir(dirname($0), "perl");
|
||||
use OpenSSL::Util::Pod;
|
||||
|
||||
my %options = ();
|
||||
GetOptions(\%options,
|
||||
'sourcedir=s', # Source directory
|
||||
'subdir=s%', # Subdirectories to look through,
|
||||
# with associated section numbers
|
||||
'destdir=s', # Destination directory
|
||||
#'in=s@', # Explicit files to process (ignores sourcedir)
|
||||
#'section=i', # Default section used for --in files
|
||||
'type=s', # The result type, 'man' or 'html'
|
||||
'suffix:s', # Suffix to add to the extension.
|
||||
# Only used with type=man
|
||||
'remove', # To remove files rather than writing them
|
||||
'dry-run|n', # Only output file names on STDOUT
|
||||
'debug|D+',
|
||||
);
|
||||
|
||||
unless ($options{subdir}) {
|
||||
$options{subdir} = { apps => '1',
|
||||
crypto => '3',
|
||||
ssl => '3' };
|
||||
}
|
||||
unless ($options{sourcedir}) {
|
||||
$options{sourcedir} = catdir($config{sourcedir}, "doc");
|
||||
}
|
||||
pod2usage(1) unless ( defined $options{subdir}
|
||||
&& defined $options{sourcedir}
|
||||
&& defined $options{destdir}
|
||||
&& defined $options{type}
|
||||
&& ($options{type} eq 'man'
|
||||
|| $options{type} eq 'html') );
|
||||
pod2usage(1) if ( $options{type} eq 'html'
|
||||
&& defined $options{suffix} );
|
||||
|
||||
if ($options{debug}) {
|
||||
print STDERR "DEBUG: options:\n";
|
||||
print STDERR "DEBUG: --sourcedir = $options{sourcedir}\n"
|
||||
if defined $options{sourcedir};
|
||||
print STDERR "DEBUG: --destdir = $options{destdir}\n"
|
||||
if defined $options{destdir};
|
||||
print STDERR "DEBUG: --type = $options{type}\n"
|
||||
if defined $options{type};
|
||||
print STDERR "DEBUG: --suffix = $options{suffix}\n"
|
||||
if defined $options{suffix};
|
||||
foreach (keys %{$options{subdir}}) {
|
||||
print STDERR "DEBUG: --subdir = $_=$options{subdir}->{$_}\n";
|
||||
}
|
||||
print STDERR "DEBUG: --remove = $options{remove}\n"
|
||||
if defined $options{remove};
|
||||
print STDERR "DEBUG: --debug = $options{debug}\n"
|
||||
if defined $options{debug};
|
||||
print STDERR "DEBUG: --dry-run = $options{\"dry-run\"}\n"
|
||||
if defined $options{"dry-run"};
|
||||
}
|
||||
|
||||
my $symlink_exists = eval { symlink("",""); 1 };
|
||||
|
||||
foreach my $subdir (keys %{$options{subdir}}) {
|
||||
my $section = $options{subdir}->{$subdir};
|
||||
my $podsourcedir = catfile($options{sourcedir}, $subdir);
|
||||
my $podglob = catfile($podsourcedir, "*.pod");
|
||||
|
||||
foreach my $podfile (glob $podglob) {
|
||||
my $podname = basename($podfile, ".pod");
|
||||
my $podpath = catfile($podfile);
|
||||
my %podinfo = extract_pod_info($podpath,
|
||||
{ debug => $options{debug},
|
||||
section => $section });
|
||||
my @podfiles = grep { $_ ne $podname } @{$podinfo{names}};
|
||||
|
||||
my $updir = updir();
|
||||
my $name = uc $podname;
|
||||
my $suffix = { man => ".$podinfo{section}".($options{suffix} // ""),
|
||||
html => ".html" } -> {$options{type}};
|
||||
my $generate = { man => "pod2man --name=$name --section=$podinfo{section} --center=OpenSSL --release=$config{version} \"$podpath\"",
|
||||
html => "pod2html \"--podroot=$options{sourcedir}\" --htmldir=$updir --podpath=apps:crypto:ssl \"--infile=$podpath\" \"--title=$podname\""
|
||||
} -> {$options{type}};
|
||||
my $output_dir = catdir($options{destdir}, "man$podinfo{section}");
|
||||
my $output_file = $podname . $suffix;
|
||||
my $output_path = catfile($output_dir, $output_file);
|
||||
|
||||
if (! $options{remove}) {
|
||||
my @output;
|
||||
print STDERR "DEBUG: Processing, using \"$generate\"\n"
|
||||
if $options{debug};
|
||||
unless ($options{"dry-run"}) {
|
||||
@output = `$generate`;
|
||||
map { s|href="http://man\.he\.net/(man\d/[^"]+)(?:\.html)?"|href="../$1.html|g; } @output
|
||||
if $options{type} eq "html";
|
||||
}
|
||||
print STDERR "DEBUG: Done processing\n" if $options{debug};
|
||||
|
||||
if (! -d $output_dir) {
|
||||
print STDERR "DEBUG: Creating directory $output_dir\n" if $options{debug};
|
||||
unless ($options{"dry-run"}) {
|
||||
mkpath $output_dir
|
||||
or die "Trying to create directory $output_dir: $!\n";
|
||||
}
|
||||
}
|
||||
print STDERR "DEBUG: Writing $output_path\n" if $options{debug};
|
||||
unless ($options{"dry-run"}) {
|
||||
open my $output_fh, '>', $output_path
|
||||
or die "Trying to write to $output_path: $!\n";
|
||||
foreach (@output) {
|
||||
print $output_fh $_;
|
||||
}
|
||||
close $output_fh;
|
||||
}
|
||||
print STDERR "DEBUG: Done writing $output_path\n" if $options{debug};
|
||||
} else {
|
||||
print STDERR "DEBUG: Removing $output_path\n" if $options{debug};
|
||||
unless ($options{"dry-run"}) {
|
||||
while (unlink $output_path) {}
|
||||
}
|
||||
}
|
||||
print "$output_path\n";
|
||||
|
||||
foreach (@podfiles) {
|
||||
my $link_file = $_ . $suffix;
|
||||
my $link_path = catfile($output_dir, $link_file);
|
||||
if (! $options{remove}) {
|
||||
if ($symlink_exists) {
|
||||
print STDERR "DEBUG: Linking $link_path -> $output_file\n"
|
||||
if $options{debug};
|
||||
unless ($options{"dry-run"}) {
|
||||
symlink $output_file, $link_path;
|
||||
}
|
||||
} else {
|
||||
print STDERR "DEBUG: Copying $output_path to link_path\n"
|
||||
if $options{debug};
|
||||
unless ($options{"dry-run"}) {
|
||||
copy $output_path, $link_path;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
print STDERR "DEBUG: Removing $link_path\n" if $options{debug};
|
||||
unless ($options{"dry-run"}) {
|
||||
while (unlink $link_path) {}
|
||||
}
|
||||
}
|
||||
print "$link_path -> $output_path\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
__END__
|
||||
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
process_docs.pl - A script to process OpenSSL docs
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<process_docs.pl>
|
||||
[B<--sourcedir>=I<dir>]
|
||||
B<--destdir>=I<dir>
|
||||
B<--type>=B<man>|B<html>
|
||||
[B<--suffix>=I<suffix>]
|
||||
[B<--remove>]
|
||||
[B<--dry-run>|B<-n>]
|
||||
[B<--debug>|B<-D>]
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This script looks for .pod files in the subdirectories 'apps', 'crypto'
|
||||
and 'ssl' under the given source directory.
|
||||
|
||||
The OpenSSL configuration data file F<configdata.pm> I<must> reside in
|
||||
the current directory, I<or> perl must have the directory it resides in
|
||||
in its inclusion array. For the latter variant, a call like this would
|
||||
work:
|
||||
|
||||
perl -I../foo util/process_docs.pl {options ...}
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<--sourcedir>=I<dir>
|
||||
|
||||
Top directory where the source files are found.
|
||||
|
||||
=item B<--destdir>=I<dir>
|
||||
|
||||
Top directory where the resulting files should end up
|
||||
|
||||
=item B<--type>=B<man>|B<html>
|
||||
|
||||
Type of output to produce. Currently supported are man pages and HTML files.
|
||||
|
||||
=item B<--suffix>=I<suffix>
|
||||
|
||||
A suffix added to the extension. Only valid with B<--type>=B<man>
|
||||
|
||||
=item B<--remove>
|
||||
|
||||
Instead of writing the files, remove them.
|
||||
|
||||
=item B<--dry-run>|B<-n>
|
||||
|
||||
Do not perform any file writing, directory creation or file removal.
|
||||
|
||||
=item B<--debug>|B<-D>
|
||||
|
||||
Print extra debugging output.
|
||||
|
||||
=back
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
Licensed under the OpenSSL license (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
|
||||
|
||||
=cut
|
||||
@@ -1,7 +1,12 @@
|
||||
#!/usr/local/bin/perl -w
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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 the test suite and generate a report
|
||||
#
|
||||
|
||||
if (! -f "Configure") {
|
||||
print "Please run perl util/selftest.pl in the OpenSSL directory.\n";
|
||||
@@ -54,7 +59,7 @@ $cversion=`$cc -V |head -1` if $cversion =~ "Error";
|
||||
$cversion=`$cc --version` if $cversion eq "";
|
||||
$cversion =~ s/Reading specs.*\n//;
|
||||
$cversion =~ s/usage.*\n//;
|
||||
chomp $cversion;
|
||||
$cversion =~ s|\R$||;
|
||||
|
||||
if (open(IN,"<CHANGES")) {
|
||||
while(<IN>) {
|
||||
|
||||
@@ -81,6 +81,7 @@ SunOS|IRIX*)
|
||||
;;
|
||||
esac
|
||||
|
||||
{- output_off() if $config{ex_libs} !~ /,-rpath,/; ""; -}
|
||||
if [ -f "$LIBCRYPTOSO" -a -z "$preload_var" ]; then
|
||||
# Following three lines are major excuse for isolating them into
|
||||
# this wrapper script. Original reason for setting LD_PRELOAD
|
||||
@@ -96,8 +97,9 @@ if [ -f "$LIBCRYPTOSO" -a -z "$preload_var" ]; then
|
||||
DYLD_INSERT_LIBRARIES="$LIBCRYPTOSO:$LIBSSLSO" # MacOS X
|
||||
export LD_PRELOAD _RLD_LIST DYLD_INSERT_LIBRARIES
|
||||
fi
|
||||
{- output_on() if $config{ex_libs} !~ /,-rpath,/; ""; -}
|
||||
|
||||
cmd="$1${EXE_EXT}"
|
||||
cmd="$1"; [ -x "$cmd" ] || cmd="$cmd${EXE_EXT}"
|
||||
shift
|
||||
if [ $# -eq 0 ]; then
|
||||
exec "$cmd" # old sh, such as Tru64 4.x, fails to expand empty "$@"
|
||||
@@ -1,80 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
#
|
||||
# This file takes as input, the files that have been output from
|
||||
# ssleay speed.
|
||||
# It prints a table of the relative differences with %100 being 'no difference'
|
||||
#
|
||||
|
||||
($#ARGV == 1) || die "$0 speedout1 speedout2\n";
|
||||
|
||||
%one=&loadfile($ARGV[0]);
|
||||
%two=&loadfile($ARGV[1]);
|
||||
|
||||
$line=0;
|
||||
foreach $a ("md2","md4","md5","sha","sha1","rc4","des cfb","des cbc","des ede3",
|
||||
"idea cfb","idea cbc","rc2 cfb","rc2 cbc","blowfish cbc","cast cbc")
|
||||
{
|
||||
if (defined($one{$a,8}) && defined($two{$a,8}))
|
||||
{
|
||||
print "type 8 byte% 64 byte% 256 byte% 1024 byte% 8192 byte%\n"
|
||||
unless $line;
|
||||
$line++;
|
||||
printf "%-12s ",$a;
|
||||
foreach $b (8,64,256,1024,8192)
|
||||
{
|
||||
$r=$two{$a,$b}/$one{$a,$b}*100;
|
||||
printf "%12.2f",$r;
|
||||
}
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
foreach $a (
|
||||
"rsa 512","rsa 1024","rsa 2048","rsa 4096",
|
||||
"dsa 512","dsa 1024","dsa 2048",
|
||||
)
|
||||
{
|
||||
if (defined($one{$a,1}) && defined($two{$a,1}))
|
||||
{
|
||||
$r1=($one{$a,1}/$two{$a,1})*100;
|
||||
$r2=($one{$a,2}/$two{$a,2})*100;
|
||||
printf "$a bits %% %6.2f %% %6.2f\n",$r1,$r2;
|
||||
}
|
||||
}
|
||||
|
||||
sub loadfile
|
||||
{
|
||||
local($file)=@_;
|
||||
local($_,%ret);
|
||||
|
||||
open(IN,"<$file") || die "unable to open '$file' for input\n";
|
||||
$header=1;
|
||||
while (<IN>)
|
||||
{
|
||||
$header=0 if /^[dr]sa/;
|
||||
if (/^type/) { $header=0; next; }
|
||||
next if $header;
|
||||
chop;
|
||||
@a=split;
|
||||
if ($a[0] =~ /^[dr]sa$/)
|
||||
{
|
||||
($n,$t1,$t2)=($_ =~ /^([dr]sa\s+\d+)\s+bits\s+([.\d]+)s\s+([.\d]+)/);
|
||||
$ret{$n,1}=$t1;
|
||||
$ret{$n,2}=$t2;
|
||||
}
|
||||
else
|
||||
{
|
||||
$n=join(' ',grep(/[^k]$/,@a));
|
||||
@k=grep(s/k$//,@a);
|
||||
|
||||
$ret{$n, 8}=$k[0];
|
||||
$ret{$n, 64}=$k[1];
|
||||
$ret{$n, 256}=$k[2];
|
||||
$ret{$n,1024}=$k[3];
|
||||
$ret{$n,8192}=$k[4];
|
||||
}
|
||||
}
|
||||
close(IN);
|
||||
return(%ret);
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# This is a ugly script use, in conjuction with editing the 'b'
|
||||
# configuration in the $(TOP)/Configure script which will
|
||||
# output when finished a file called speed.log which is the
|
||||
# timings of SSLeay with various options turned on or off.
|
||||
#
|
||||
# from the $(TOP) directory
|
||||
# Edit Configure, modifying things to do with the b/bl-4c-2c etc
|
||||
# configurations.
|
||||
#
|
||||
|
||||
make clean
|
||||
perl Configure b
|
||||
make
|
||||
apps/ssleay version -v -b -f >speed.1
|
||||
apps/ssleay speed >speed.1l
|
||||
|
||||
perl Configure bl-4c-2c
|
||||
/bin/rm -f crypto/rc4/*.o crypto/bn/bn*.o crypto/md2/md2_dgst.o
|
||||
make
|
||||
apps/ssleay speed rc4 rsa md2 >speed.2l
|
||||
|
||||
perl Configure bl-4c-ri
|
||||
/bin/rm -f crypto/rc4/rc4*.o
|
||||
make
|
||||
apps/ssleay speed rc4 >speed.3l
|
||||
|
||||
perl Configure b2-is-ri-dp
|
||||
/bin/rm -f crypto/idea/i_*.o crypto/rc4/*.o crypto/des/ecb_enc.o crypto/bn/bn*.o
|
||||
apps/ssleay speed rsa rc4 idea des >speed.4l
|
||||
|
||||
cat speed.1 >speed.log
|
||||
cat speed.1l >>speed.log
|
||||
perl util/sp-diff.pl speed.1l speed.2l >>speed.log
|
||||
perl util/sp-diff.pl speed.1l speed.3l >>speed.log
|
||||
perl util/sp-diff.pl speed.1l speed.4l >>speed.log
|
||||
|
||||
147
util/src-dep.pl
147
util/src-dep.pl
@@ -1,147 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
|
||||
# we make up an array of
|
||||
# $file{function_name}=filename;
|
||||
# $unres{filename}="func1 func2 ...."
|
||||
$debug=1;
|
||||
#$nm_func="parse_linux";
|
||||
$nm_func="parse_solaris";
|
||||
|
||||
foreach (@ARGV)
|
||||
{
|
||||
&$nm_func($_);
|
||||
}
|
||||
|
||||
foreach $file (sort keys %unres)
|
||||
{
|
||||
@a=split(/\s+/,$unres{$file});
|
||||
%ff=();
|
||||
foreach $func (@a)
|
||||
{
|
||||
$f=$file{$func};
|
||||
$ff{$f}=1 if $f ne "";
|
||||
}
|
||||
|
||||
foreach $a (keys %ff)
|
||||
{ $we_need{$file}.="$a "; }
|
||||
}
|
||||
|
||||
foreach $file (sort keys %we_need)
|
||||
{
|
||||
# print " $file $we_need{$file}\n";
|
||||
foreach $bit (split(/\s+/,$we_need{$file}))
|
||||
{ push(@final,&walk($bit)); }
|
||||
|
||||
foreach (@final) { $fin{$_}=1; }
|
||||
@final="";
|
||||
foreach (sort keys %fin)
|
||||
{ push(@final,$_); }
|
||||
|
||||
print "$file: @final\n";
|
||||
}
|
||||
|
||||
sub walk
|
||||
{
|
||||
local($f)=@_;
|
||||
local(@a,%seen,@ret,$r);
|
||||
|
||||
@ret="";
|
||||
$f =~ s/^\s+//;
|
||||
$f =~ s/\s+$//;
|
||||
return "" if ($f =~ "^\s*$");
|
||||
|
||||
return(split(/\s/,$done{$f})) if defined ($done{$f});
|
||||
|
||||
return if $in{$f} > 0;
|
||||
$in{$f}++;
|
||||
push(@ret,$f);
|
||||
foreach $r (split(/\s+/,$we_need{$f}))
|
||||
{
|
||||
push(@ret,&walk($r));
|
||||
}
|
||||
$in{$f}--;
|
||||
$done{$f}=join(" ",@ret);
|
||||
return(@ret);
|
||||
}
|
||||
|
||||
sub parse_linux
|
||||
{
|
||||
local($name)=@_;
|
||||
|
||||
open(IN,"nm $name|") || die "unable to run 'nn $name':$!\n";
|
||||
while (<IN>)
|
||||
{
|
||||
chop;
|
||||
next if /^\s*$/;
|
||||
if (/^[^[](.*):$/)
|
||||
{
|
||||
$file=$1;
|
||||
$file="$1.c" if /\[(.*).o\]/;
|
||||
print STDERR "$file\n";
|
||||
$we_need{$file}=" ";
|
||||
next;
|
||||
}
|
||||
|
||||
@a=split(/\s*\|\s*/);
|
||||
next unless $#a == 7;
|
||||
next unless $a[4] eq "GLOB";
|
||||
if ($a[6] eq "UNDEF")
|
||||
{
|
||||
$unres{$file}.=$a[7]." ";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($file{$a[7]} ne "")
|
||||
{
|
||||
print STDERR "duplicate definition of $a[7],\n$file{$a[7]} and $file \n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$file{$a[7]}=$file;
|
||||
}
|
||||
}
|
||||
}
|
||||
close(IN);
|
||||
}
|
||||
|
||||
sub parse_solaris
|
||||
{
|
||||
local($name)=@_;
|
||||
|
||||
open(IN,"nm $name|") || die "unable to run 'nn $name':$!\n";
|
||||
while (<IN>)
|
||||
{
|
||||
chop;
|
||||
next if /^\s*$/;
|
||||
if (/^(\S+):$/)
|
||||
{
|
||||
$file=$1;
|
||||
#$file="$1.c" if $file =~ /^(.*).o$/;
|
||||
print STDERR "$file\n";
|
||||
$we_need{$file}=" ";
|
||||
next;
|
||||
}
|
||||
@a=split(/\s*\|\s*/);
|
||||
next unless $#a == 7;
|
||||
next unless $a[4] eq "GLOB";
|
||||
if ($a[6] eq "UNDEF")
|
||||
{
|
||||
$unres{$file}.=$a[7]." ";
|
||||
print STDERR "$file needs $a[7]\n" if $debug;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($file{$a[7]} ne "")
|
||||
{
|
||||
print STDERR "duplicate definition of $a[7],\n$file{$a[7]} and $file \n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$file{$a[7]}=$file;
|
||||
print STDERR "$file has $a[7]\n" if $debug;
|
||||
}
|
||||
}
|
||||
}
|
||||
close(IN);
|
||||
}
|
||||
|
||||
370
util/ssleay.num
370
util/ssleay.num
@@ -1,370 +0,0 @@
|
||||
ERR_load_SSL_strings 1 EXIST::FUNCTION:
|
||||
SSL_CIPHER_description 2 EXIST::FUNCTION:
|
||||
SSL_CTX_add_client_CA 3 EXIST::FUNCTION:
|
||||
SSL_CTX_add_session 4 EXIST::FUNCTION:
|
||||
SSL_CTX_check_private_key 5 EXIST::FUNCTION:
|
||||
SSL_CTX_ctrl 6 EXIST::FUNCTION:
|
||||
SSL_CTX_flush_sessions 7 EXIST::FUNCTION:
|
||||
SSL_CTX_free 8 EXIST::FUNCTION:
|
||||
SSL_CTX_get_client_CA_list 9 EXIST::FUNCTION:
|
||||
SSL_CTX_get_verify_callback 10 EXIST::FUNCTION:
|
||||
SSL_CTX_get_verify_mode 11 EXIST::FUNCTION:
|
||||
SSL_CTX_new 12 EXIST::FUNCTION:
|
||||
SSL_CTX_remove_session 13 EXIST::FUNCTION:
|
||||
SSL_CTX_set_cipher_list 15 EXIST::FUNCTION:
|
||||
SSL_CTX_set_client_CA_list 16 EXIST::FUNCTION:
|
||||
SSL_CTX_set_default_passwd_cb 17 EXIST::FUNCTION:
|
||||
SSL_CTX_set_ssl_version 19 EXIST::FUNCTION:
|
||||
SSL_CTX_set_verify 21 EXIST::FUNCTION:
|
||||
SSL_CTX_use_PrivateKey 22 EXIST::FUNCTION:
|
||||
SSL_CTX_use_PrivateKey_ASN1 23 EXIST::FUNCTION:
|
||||
SSL_CTX_use_PrivateKey_file 24 EXIST::FUNCTION:STDIO
|
||||
SSL_CTX_use_RSAPrivateKey 25 EXIST::FUNCTION:RSA
|
||||
SSL_CTX_use_RSAPrivateKey_ASN1 26 EXIST::FUNCTION:RSA
|
||||
SSL_CTX_use_RSAPrivateKey_file 27 EXIST::FUNCTION:RSA,STDIO
|
||||
SSL_CTX_use_certificate 28 EXIST::FUNCTION:
|
||||
SSL_CTX_use_certificate_ASN1 29 EXIST::FUNCTION:
|
||||
SSL_CTX_use_certificate_file 30 EXIST::FUNCTION:STDIO
|
||||
SSL_SESSION_free 31 EXIST::FUNCTION:
|
||||
SSL_SESSION_new 32 EXIST::FUNCTION:
|
||||
SSL_SESSION_print 33 EXIST::FUNCTION:BIO
|
||||
SSL_SESSION_print_fp 34 EXIST::FUNCTION:FP_API
|
||||
SSL_accept 35 EXIST::FUNCTION:
|
||||
SSL_add_client_CA 36 EXIST::FUNCTION:
|
||||
SSL_alert_desc_string 37 EXIST::FUNCTION:
|
||||
SSL_alert_desc_string_long 38 EXIST::FUNCTION:
|
||||
SSL_alert_type_string 39 EXIST::FUNCTION:
|
||||
SSL_alert_type_string_long 40 EXIST::FUNCTION:
|
||||
SSL_check_private_key 41 EXIST::FUNCTION:
|
||||
SSL_clear 42 EXIST::FUNCTION:
|
||||
SSL_connect 43 EXIST::FUNCTION:
|
||||
SSL_copy_session_id 44 EXIST::FUNCTION:
|
||||
SSL_ctrl 45 EXIST::FUNCTION:
|
||||
SSL_dup 46 EXIST::FUNCTION:
|
||||
SSL_dup_CA_list 47 EXIST::FUNCTION:
|
||||
SSL_free 48 EXIST::FUNCTION:
|
||||
SSL_get_certificate 49 EXIST::FUNCTION:
|
||||
SSL_get_cipher_list 52 EXIST::FUNCTION:
|
||||
SSL_get_ciphers 55 EXIST::FUNCTION:
|
||||
SSL_get_client_CA_list 56 EXIST::FUNCTION:
|
||||
SSL_get_default_timeout 57 EXIST::FUNCTION:
|
||||
SSL_get_error 58 EXIST::FUNCTION:
|
||||
SSL_get_fd 59 EXIST::FUNCTION:
|
||||
SSL_get_peer_cert_chain 60 EXIST::FUNCTION:
|
||||
SSL_get_peer_certificate 61 EXIST::FUNCTION:
|
||||
SSL_get_rbio 63 EXIST::FUNCTION:BIO
|
||||
SSL_get_read_ahead 64 EXIST::FUNCTION:
|
||||
SSL_get_shared_ciphers 65 EXIST::FUNCTION:
|
||||
SSL_get_ssl_method 66 EXIST::FUNCTION:
|
||||
SSL_get_verify_callback 69 EXIST::FUNCTION:
|
||||
SSL_get_verify_mode 70 EXIST::FUNCTION:
|
||||
SSL_get_version 71 EXIST::FUNCTION:
|
||||
SSL_get_wbio 72 EXIST::FUNCTION:BIO
|
||||
SSL_load_client_CA_file 73 EXIST::FUNCTION:STDIO
|
||||
SSL_load_error_strings 74 EXIST::FUNCTION:
|
||||
SSL_new 75 EXIST::FUNCTION:
|
||||
SSL_peek 76 EXIST::FUNCTION:
|
||||
SSL_pending 77 EXIST::FUNCTION:
|
||||
SSL_read 78 EXIST::FUNCTION:
|
||||
SSL_renegotiate 79 EXIST::FUNCTION:
|
||||
SSL_rstate_string 80 EXIST::FUNCTION:
|
||||
SSL_rstate_string_long 81 EXIST::FUNCTION:
|
||||
SSL_set_accept_state 82 EXIST::FUNCTION:
|
||||
SSL_set_bio 83 EXIST::FUNCTION:BIO
|
||||
SSL_set_cipher_list 84 EXIST::FUNCTION:
|
||||
SSL_set_client_CA_list 85 EXIST::FUNCTION:
|
||||
SSL_set_connect_state 86 EXIST::FUNCTION:
|
||||
SSL_set_fd 87 EXIST::FUNCTION:SOCK
|
||||
SSL_set_read_ahead 88 EXIST::FUNCTION:
|
||||
SSL_set_rfd 89 EXIST::FUNCTION:SOCK
|
||||
SSL_set_session 90 EXIST::FUNCTION:
|
||||
SSL_set_ssl_method 91 EXIST::FUNCTION:
|
||||
SSL_set_verify 94 EXIST::FUNCTION:
|
||||
SSL_set_wfd 95 EXIST::FUNCTION:SOCK
|
||||
SSL_shutdown 96 EXIST::FUNCTION:
|
||||
SSL_state_string 97 EXIST::FUNCTION:
|
||||
SSL_state_string_long 98 EXIST::FUNCTION:
|
||||
SSL_use_PrivateKey 99 EXIST::FUNCTION:
|
||||
SSL_use_PrivateKey_ASN1 100 EXIST::FUNCTION:
|
||||
SSL_use_PrivateKey_file 101 EXIST::FUNCTION:STDIO
|
||||
SSL_use_RSAPrivateKey 102 EXIST::FUNCTION:RSA
|
||||
SSL_use_RSAPrivateKey_ASN1 103 EXIST::FUNCTION:RSA
|
||||
SSL_use_RSAPrivateKey_file 104 EXIST::FUNCTION:RSA,STDIO
|
||||
SSL_use_certificate 105 EXIST::FUNCTION:
|
||||
SSL_use_certificate_ASN1 106 EXIST::FUNCTION:
|
||||
SSL_use_certificate_file 107 EXIST::FUNCTION:STDIO
|
||||
SSL_write 108 EXIST::FUNCTION:
|
||||
SSLeay_add_ssl_algorithms 109 NOEXIST::FUNCTION:
|
||||
SSLv23_client_method 110 EXIST::FUNCTION:RSA
|
||||
SSLv23_method 111 EXIST::FUNCTION:RSA
|
||||
SSLv23_server_method 112 EXIST::FUNCTION:RSA
|
||||
SSLv2_client_method 113 EXIST::FUNCTION:RSA,SSL2_METHOD
|
||||
SSLv2_method 114 EXIST::FUNCTION:RSA,SSL2_METHOD
|
||||
SSLv2_server_method 115 EXIST::FUNCTION:RSA,SSL2_METHOD
|
||||
SSLv3_client_method 116 EXIST::FUNCTION:SSL3_METHOD
|
||||
SSLv3_method 117 EXIST::FUNCTION:SSL3_METHOD
|
||||
SSLv3_server_method 118 EXIST::FUNCTION:SSL3_METHOD
|
||||
d2i_SSL_SESSION 119 EXIST::FUNCTION:
|
||||
i2d_SSL_SESSION 120 EXIST::FUNCTION:
|
||||
BIO_f_ssl 121 EXIST::FUNCTION:BIO
|
||||
BIO_new_ssl 122 EXIST::FUNCTION:BIO
|
||||
BIO_proxy_ssl_copy_session_id 123 NOEXIST::FUNCTION:
|
||||
BIO_ssl_copy_session_id 124 EXIST::FUNCTION:BIO
|
||||
SSL_do_handshake 125 EXIST::FUNCTION:
|
||||
SSL_get_privatekey 126 EXIST::FUNCTION:
|
||||
SSL_get_current_cipher 127 EXIST::FUNCTION:
|
||||
SSL_CIPHER_get_bits 128 EXIST::FUNCTION:
|
||||
SSL_CIPHER_get_version 129 EXIST::FUNCTION:
|
||||
SSL_CIPHER_get_name 130 EXIST::FUNCTION:
|
||||
BIO_ssl_shutdown 131 EXIST::FUNCTION:BIO
|
||||
SSL_SESSION_cmp 132 NOEXIST::FUNCTION:
|
||||
SSL_SESSION_hash 133 NOEXIST::FUNCTION:
|
||||
SSL_SESSION_get_time 134 EXIST::FUNCTION:
|
||||
SSL_SESSION_set_time 135 EXIST::FUNCTION:
|
||||
SSL_SESSION_get_timeout 136 EXIST::FUNCTION:
|
||||
SSL_SESSION_set_timeout 137 EXIST::FUNCTION:
|
||||
SSL_CTX_get_ex_data 138 EXIST::FUNCTION:
|
||||
SSL_CTX_get_quiet_shutdown 140 EXIST::FUNCTION:
|
||||
SSL_CTX_load_verify_locations 141 EXIST::FUNCTION:
|
||||
SSL_CTX_set_default_verify_paths 142 EXIST:!VMS:FUNCTION:
|
||||
SSL_CTX_set_def_verify_paths 142 EXIST:VMS:FUNCTION:
|
||||
SSL_CTX_set_ex_data 143 EXIST::FUNCTION:
|
||||
SSL_CTX_set_quiet_shutdown 145 EXIST::FUNCTION:
|
||||
SSL_SESSION_get_ex_data 146 EXIST::FUNCTION:
|
||||
SSL_SESSION_set_ex_data 148 EXIST::FUNCTION:
|
||||
SSL_get_SSL_CTX 150 EXIST::FUNCTION:
|
||||
SSL_get_ex_data 151 EXIST::FUNCTION:
|
||||
SSL_get_quiet_shutdown 153 EXIST::FUNCTION:
|
||||
SSL_get_session 154 EXIST::FUNCTION:
|
||||
SSL_get_shutdown 155 EXIST::FUNCTION:
|
||||
SSL_get_verify_result 157 EXIST::FUNCTION:
|
||||
SSL_set_ex_data 158 EXIST::FUNCTION:
|
||||
SSL_set_info_callback 160 EXIST::FUNCTION:
|
||||
SSL_set_quiet_shutdown 161 EXIST::FUNCTION:
|
||||
SSL_set_shutdown 162 EXIST::FUNCTION:
|
||||
SSL_set_verify_result 163 EXIST::FUNCTION:
|
||||
SSL_version 164 EXIST::FUNCTION:
|
||||
SSL_get_info_callback 165 EXIST::FUNCTION:
|
||||
SSL_state 166 EXIST::FUNCTION:
|
||||
SSL_CTX_get_ex_new_index 167 EXIST::FUNCTION:
|
||||
SSL_SESSION_get_ex_new_index 168 EXIST::FUNCTION:
|
||||
SSL_get_ex_new_index 169 EXIST::FUNCTION:
|
||||
TLSv1_method 170 EXIST::FUNCTION:
|
||||
TLSv1_server_method 171 EXIST::FUNCTION:
|
||||
TLSv1_client_method 172 EXIST::FUNCTION:
|
||||
BIO_new_buffer_ssl_connect 173 EXIST::FUNCTION:BIO
|
||||
BIO_new_ssl_connect 174 EXIST::FUNCTION:BIO
|
||||
SSL_get_ex_data_X509_STORE_CTX_idx 175 EXIST:!VMS:FUNCTION:
|
||||
SSL_get_ex_d_X509_STORE_CTX_idx 175 EXIST:VMS:FUNCTION:
|
||||
SSL_CTX_set_tmp_dh_callback 176 EXIST::FUNCTION:DH
|
||||
SSL_CTX_set_tmp_rsa_callback 177 EXIST::FUNCTION:RSA
|
||||
SSL_CTX_set_timeout 178 EXIST::FUNCTION:
|
||||
SSL_CTX_get_timeout 179 EXIST::FUNCTION:
|
||||
SSL_CTX_get_cert_store 180 EXIST::FUNCTION:
|
||||
SSL_CTX_set_cert_store 181 EXIST::FUNCTION:
|
||||
SSL_want 182 EXIST::FUNCTION:
|
||||
SSL_library_init 183 EXIST::FUNCTION:
|
||||
SSL_COMP_add_compression_method 184 EXIST::FUNCTION:
|
||||
SSL_add_file_cert_subjects_to_stack 185 EXIST:!VMS:FUNCTION:STDIO
|
||||
SSL_add_file_cert_subjs_to_stk 185 EXIST:VMS:FUNCTION:STDIO
|
||||
SSL_set_tmp_rsa_callback 186 EXIST::FUNCTION:RSA
|
||||
SSL_set_tmp_dh_callback 187 EXIST::FUNCTION:DH
|
||||
SSL_add_dir_cert_subjects_to_stack 188 EXIST:!VMS:FUNCTION:STDIO
|
||||
SSL_add_dir_cert_subjs_to_stk 188 EXIST:VMS:FUNCTION:STDIO
|
||||
SSL_set_session_id_context 189 EXIST::FUNCTION:
|
||||
SSL_CTX_use_certificate_chain_file 222 EXIST:!VMS:FUNCTION:STDIO
|
||||
SSL_CTX_use_cert_chain_file 222 EXIST:VMS:FUNCTION:STDIO
|
||||
SSL_CTX_set_verify_depth 225 EXIST::FUNCTION:
|
||||
SSL_set_verify_depth 226 EXIST::FUNCTION:
|
||||
SSL_CTX_get_verify_depth 228 EXIST::FUNCTION:
|
||||
SSL_get_verify_depth 229 EXIST::FUNCTION:
|
||||
SSL_CTX_set_session_id_context 231 EXIST::FUNCTION:
|
||||
SSL_CTX_set_cert_verify_callback 232 EXIST:!VMS:FUNCTION:
|
||||
SSL_CTX_set_cert_verify_cb 232 EXIST:VMS:FUNCTION:
|
||||
SSL_test_functions 233 EXIST::FUNCTION:UNIT_TEST
|
||||
SSL_CTX_set_default_passwd_cb_userdata 235 EXIST:!VMS:FUNCTION:
|
||||
SSL_CTX_set_def_passwd_cb_ud 235 EXIST:VMS:FUNCTION:
|
||||
SSL_set_purpose 236 EXIST::FUNCTION:
|
||||
SSL_CTX_set_trust 237 EXIST::FUNCTION:
|
||||
SSL_CTX_set_purpose 238 EXIST::FUNCTION:
|
||||
SSL_set_trust 239 EXIST::FUNCTION:
|
||||
SSL_get_finished 240 EXIST::FUNCTION:
|
||||
SSL_get_peer_finished 241 EXIST::FUNCTION:
|
||||
SSL_get1_session 242 EXIST::FUNCTION:
|
||||
SSL_CTX_callback_ctrl 243 EXIST::FUNCTION:
|
||||
SSL_callback_ctrl 244 EXIST::FUNCTION:
|
||||
SSL_CTX_sessions 245 EXIST::FUNCTION:
|
||||
SSL_get_rfd 246 EXIST::FUNCTION:
|
||||
SSL_get_wfd 247 EXIST::FUNCTION:
|
||||
kssl_cget_tkt 248 EXIST::FUNCTION:KRB5
|
||||
SSL_has_matching_session_id 249 EXIST::FUNCTION:
|
||||
kssl_err_set 250 EXIST::FUNCTION:KRB5
|
||||
kssl_ctx_show 251 EXIST::FUNCTION:KRB5
|
||||
kssl_validate_times 252 EXIST::FUNCTION:KRB5
|
||||
kssl_check_authent 253 EXIST::FUNCTION:KRB5
|
||||
kssl_ctx_new 254 EXIST::FUNCTION:KRB5
|
||||
kssl_build_principal_2 255 EXIST::FUNCTION:KRB5
|
||||
kssl_skip_confound 256 EXIST::FUNCTION:KRB5
|
||||
kssl_sget_tkt 257 EXIST::FUNCTION:KRB5
|
||||
SSL_set_generate_session_id 258 EXIST::FUNCTION:
|
||||
kssl_ctx_setkey 259 EXIST::FUNCTION:KRB5
|
||||
kssl_ctx_setprinc 260 EXIST::FUNCTION:KRB5
|
||||
kssl_ctx_free 261 EXIST::FUNCTION:KRB5
|
||||
kssl_krb5_free_data_contents 262 EXIST::FUNCTION:KRB5
|
||||
kssl_ctx_setstring 263 EXIST::FUNCTION:KRB5
|
||||
SSL_CTX_set_generate_session_id 264 EXIST::FUNCTION:
|
||||
SSL_renegotiate_pending 265 EXIST::FUNCTION:
|
||||
SSL_CTX_set_msg_callback 266 EXIST::FUNCTION:
|
||||
SSL_set_msg_callback 267 EXIST::FUNCTION:
|
||||
DTLSv1_client_method 268 EXIST::FUNCTION:
|
||||
SSL_CTX_set_tmp_ecdh_callback 269 EXIST::FUNCTION:ECDH
|
||||
SSL_set_tmp_ecdh_callback 270 EXIST::FUNCTION:ECDH
|
||||
SSL_COMP_get_name 271 EXIST::FUNCTION:
|
||||
SSL_get_current_compression 272 EXIST::FUNCTION:
|
||||
DTLSv1_method 273 EXIST::FUNCTION:
|
||||
SSL_get_current_expansion 274 EXIST::FUNCTION:
|
||||
DTLSv1_server_method 275 EXIST::FUNCTION:
|
||||
SSL_COMP_get_compression_methods 276 EXIST:!VMS:FUNCTION:
|
||||
SSL_COMP_get_compress_methods 276 EXIST:VMS:FUNCTION:
|
||||
SSL_SESSION_get_id 277 EXIST::FUNCTION:
|
||||
SSL_CTX_sess_set_new_cb 278 EXIST::FUNCTION:
|
||||
SSL_CTX_sess_get_get_cb 279 EXIST::FUNCTION:
|
||||
SSL_CTX_sess_set_get_cb 280 EXIST::FUNCTION:
|
||||
SSL_CTX_set_cookie_verify_cb 281 EXIST::FUNCTION:
|
||||
SSL_CTX_get_info_callback 282 EXIST::FUNCTION:
|
||||
SSL_CTX_set_cookie_generate_cb 283 EXIST::FUNCTION:
|
||||
SSL_CTX_set_client_cert_cb 284 EXIST::FUNCTION:
|
||||
SSL_CTX_sess_set_remove_cb 285 EXIST::FUNCTION:
|
||||
SSL_CTX_set_info_callback 286 EXIST::FUNCTION:
|
||||
SSL_CTX_sess_get_new_cb 287 EXIST::FUNCTION:
|
||||
SSL_CTX_get_client_cert_cb 288 EXIST::FUNCTION:
|
||||
SSL_CTX_sess_get_remove_cb 289 EXIST::FUNCTION:
|
||||
SSL_set_SSL_CTX 290 EXIST::FUNCTION:
|
||||
SSL_get_servername 291 EXIST::FUNCTION:TLSEXT
|
||||
SSL_get_servername_type 292 EXIST::FUNCTION:TLSEXT
|
||||
SSL_CTX_set_client_cert_engine 293 EXIST::FUNCTION:ENGINE
|
||||
SSL_CTX_use_psk_identity_hint 294 EXIST::FUNCTION:PSK
|
||||
SSL_CTX_set_psk_client_callback 295 EXIST::FUNCTION:PSK
|
||||
PEM_write_bio_SSL_SESSION 296 EXIST::FUNCTION:
|
||||
SSL_get_psk_identity_hint 297 EXIST::FUNCTION:PSK
|
||||
SSL_set_psk_server_callback 298 EXIST::FUNCTION:PSK
|
||||
SSL_use_psk_identity_hint 299 EXIST::FUNCTION:PSK
|
||||
SSL_set_psk_client_callback 300 EXIST::FUNCTION:PSK
|
||||
PEM_read_SSL_SESSION 301 EXIST:!WIN16:FUNCTION:
|
||||
PEM_read_bio_SSL_SESSION 302 EXIST::FUNCTION:
|
||||
SSL_CTX_set_psk_server_callback 303 EXIST::FUNCTION:PSK
|
||||
SSL_get_psk_identity 304 EXIST::FUNCTION:PSK
|
||||
PEM_write_SSL_SESSION 305 EXIST:!WIN16:FUNCTION:
|
||||
SSL_set_session_ticket_ext 306 EXIST::FUNCTION:
|
||||
SSL_set_session_secret_cb 307 EXIST::FUNCTION:
|
||||
SSL_set_session_ticket_ext_cb 308 EXIST::FUNCTION:
|
||||
SSL_set1_param 309 EXIST::FUNCTION:
|
||||
SSL_CTX_set1_param 310 EXIST::FUNCTION:
|
||||
SSL_tls1_key_exporter 311 NOEXIST::FUNCTION:
|
||||
SSL_renegotiate_abbreviated 312 EXIST::FUNCTION:
|
||||
TLSv1_1_method 313 EXIST::FUNCTION:
|
||||
TLSv1_1_client_method 314 EXIST::FUNCTION:
|
||||
TLSv1_1_server_method 315 EXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_client_pwd_callback 316 EXIST:!VMS:FUNCTION:SRP
|
||||
SSL_CTX_set_srp_client_pwd_cb 316 EXIST:VMS:FUNCTION:SRP
|
||||
SSL_get_srp_g 317 EXIST::FUNCTION:SRP
|
||||
SSL_CTX_set_srp_username_callback 318 EXIST:!VMS:FUNCTION:SRP
|
||||
SSL_CTX_set_srp_un_cb 318 EXIST:VMS:FUNCTION:SRP
|
||||
SSL_get_srp_userinfo 319 EXIST::FUNCTION:SRP
|
||||
SSL_set_srp_server_param 320 EXIST::FUNCTION:SRP
|
||||
SSL_set_srp_server_param_pw 321 EXIST::FUNCTION:SRP
|
||||
SSL_get_srp_N 322 EXIST::FUNCTION:SRP
|
||||
SSL_get_srp_username 323 EXIST::FUNCTION:SRP
|
||||
SSL_CTX_set_srp_password 324 EXIST::FUNCTION:SRP
|
||||
SSL_CTX_set_srp_strength 325 EXIST::FUNCTION:SRP
|
||||
SSL_CTX_set_srp_verify_param_callback 326 EXIST:!VMS:FUNCTION:SRP
|
||||
SSL_CTX_set_srp_vfy_param_cb 326 EXIST:VMS:FUNCTION:SRP
|
||||
SSL_CTX_set_srp_miss_srp_un_cb 327 NOEXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_missing_srp_username_callback 327 NOEXIST::FUNCTION:
|
||||
SSL_CTX_set_srp_cb_arg 328 EXIST::FUNCTION:SRP
|
||||
SSL_CTX_set_srp_username 329 EXIST::FUNCTION:SRP
|
||||
SSL_CTX_SRP_CTX_init 330 EXIST::FUNCTION:SRP
|
||||
SSL_SRP_CTX_init 331 EXIST::FUNCTION:SRP
|
||||
SRP_Calc_A_param 332 EXIST::FUNCTION:SRP
|
||||
SRP_generate_server_master_secret 333 EXIST:!VMS:FUNCTION:SRP
|
||||
SRP_gen_server_master_secret 333 EXIST:VMS:FUNCTION:SRP
|
||||
SSL_CTX_SRP_CTX_free 334 EXIST::FUNCTION:SRP
|
||||
SRP_generate_client_master_secret 335 EXIST:!VMS:FUNCTION:SRP
|
||||
SRP_gen_client_master_secret 335 EXIST:VMS:FUNCTION:SRP
|
||||
SSL_srp_server_param_with_username 336 EXIST:!VMS:FUNCTION:SRP
|
||||
SSL_srp_server_param_with_un 336 EXIST:VMS:FUNCTION:SRP
|
||||
SRP_have_to_put_srp_username 337 NOEXIST::FUNCTION:
|
||||
SSL_SRP_CTX_free 338 EXIST::FUNCTION:SRP
|
||||
SSL_set_debug 339 EXIST::FUNCTION:
|
||||
SSL_SESSION_get0_peer 340 EXIST::FUNCTION:
|
||||
TLSv1_2_client_method 341 EXIST::FUNCTION:
|
||||
SSL_SESSION_set1_id_context 342 EXIST::FUNCTION:
|
||||
TLSv1_2_server_method 343 EXIST::FUNCTION:
|
||||
SSL_cache_hit 344 EXIST::FUNCTION:
|
||||
SSL_get0_kssl_ctx 345 EXIST::FUNCTION:KRB5
|
||||
SSL_set0_kssl_ctx 346 EXIST::FUNCTION:KRB5
|
||||
SSL_SESSION_get0_id 347 NOEXIST::FUNCTION:
|
||||
SSL_set_state 348 EXIST::FUNCTION:
|
||||
SSL_CIPHER_get_id 349 EXIST::FUNCTION:
|
||||
TLSv1_2_method 350 EXIST::FUNCTION:
|
||||
SSL_SESSION_get_id_len 351 NOEXIST::FUNCTION:
|
||||
kssl_ctx_get0_client_princ 352 EXIST::FUNCTION:KRB5
|
||||
SSL_export_keying_material 353 EXIST::FUNCTION:TLSEXT
|
||||
SSL_set_tlsext_use_srtp 354 EXIST::FUNCTION:SRTP
|
||||
SSL_CTX_set_next_protos_advertised_cb 355 EXIST:!VMS:FUNCTION:NEXTPROTONEG
|
||||
SSL_CTX_set_next_protos_adv_cb 355 EXIST:VMS:FUNCTION:NEXTPROTONEG
|
||||
SSL_get0_next_proto_negotiated 356 EXIST::FUNCTION:NEXTPROTONEG
|
||||
SSL_get_selected_srtp_profile 357 EXIST::FUNCTION:SRTP
|
||||
SSL_CTX_set_tlsext_use_srtp 358 EXIST::FUNCTION:SRTP
|
||||
SSL_select_next_proto 359 EXIST::FUNCTION:TLSEXT
|
||||
SSL_get_srtp_profiles 360 EXIST::FUNCTION:SRTP
|
||||
SSL_CTX_set_next_proto_select_cb 361 EXIST:!VMS:FUNCTION:NEXTPROTONEG
|
||||
SSL_CTX_set_next_proto_sel_cb 361 EXIST:VMS:FUNCTION:NEXTPROTONEG
|
||||
SSL_SESSION_get_compress_id 362 EXIST::FUNCTION:
|
||||
SSL_get0_param 363 EXIST::FUNCTION:
|
||||
SSL_CTX_get0_privatekey 364 EXIST::FUNCTION:
|
||||
SSL_get_shared_sigalgs 365 EXIST::FUNCTION:TLSEXT
|
||||
SSL_CONF_CTX_finish 366 EXIST::FUNCTION:
|
||||
DTLS_method 367 EXIST::FUNCTION:
|
||||
DTLS_client_method 368 EXIST::FUNCTION:
|
||||
SSL_CIPHER_standard_name 369 EXIST::FUNCTION:SSL_TRACE
|
||||
SSL_set_alpn_protos 370 EXIST::FUNCTION:
|
||||
SSL_CTX_set_srv_supp_data 371 NOEXIST::FUNCTION:
|
||||
SSL_CONF_cmd_argv 372 EXIST::FUNCTION:
|
||||
DTLSv1_2_server_method 373 EXIST::FUNCTION:
|
||||
SSL_COMP_set0_compression_methods 374 EXIST:!VMS:FUNCTION:
|
||||
SSL_COMP_set0_compress_methods 374 EXIST:VMS:FUNCTION:
|
||||
SSL_CTX_set_cert_cb 375 EXIST::FUNCTION:
|
||||
SSL_CTX_add_client_custom_ext 376 EXIST::FUNCTION:TLSEXT
|
||||
SSL_is_server 377 EXIST::FUNCTION:
|
||||
SSL_CTX_get0_param 378 EXIST::FUNCTION:
|
||||
SSL_CONF_cmd 379 EXIST::FUNCTION:
|
||||
SSL_CTX_get_ssl_method 380 EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_set_ssl_ctx 381 EXIST::FUNCTION:
|
||||
SSL_CIPHER_find 382 EXIST::FUNCTION:
|
||||
SSL_CTX_use_serverinfo 383 EXIST::FUNCTION:TLSEXT
|
||||
DTLSv1_2_client_method 384 EXIST::FUNCTION:
|
||||
SSL_get0_alpn_selected 385 EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_clear_flags 386 EXIST::FUNCTION:
|
||||
SSL_CTX_set_alpn_protos 387 EXIST::FUNCTION:
|
||||
SSL_CTX_add_server_custom_ext 389 EXIST::FUNCTION:TLSEXT
|
||||
SSL_CTX_get0_certificate 390 EXIST::FUNCTION:
|
||||
SSL_CTX_set_alpn_select_cb 391 EXIST::FUNCTION:
|
||||
SSL_CONF_cmd_value_type 392 EXIST::FUNCTION:
|
||||
SSL_set_cert_cb 393 EXIST::FUNCTION:
|
||||
SSL_get_sigalgs 394 EXIST::FUNCTION:TLSEXT
|
||||
SSL_CONF_CTX_set1_prefix 395 EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_new 396 EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_set_flags 397 EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_set_ssl 398 EXIST::FUNCTION:
|
||||
SSL_check_chain 399 EXIST::FUNCTION:TLSEXT
|
||||
SSL_certs_clear 400 EXIST::FUNCTION:
|
||||
SSL_CONF_CTX_free 401 EXIST::FUNCTION:
|
||||
SSL_trace 402 EXIST::FUNCTION:SSL_TRACE
|
||||
SSL_CTX_set_cli_supp_data 403 NOEXIST::FUNCTION:
|
||||
DTLSv1_2_method 404 EXIST::FUNCTION:
|
||||
DTLS_server_method 405 EXIST::FUNCTION:
|
||||
SSL_CTX_use_serverinfo_file 406 EXIST::FUNCTION:STDIO,TLSEXT
|
||||
SSL_COMP_free_compression_methods 407 EXIST:!VMS:FUNCTION:
|
||||
SSL_COMP_free_compress_methods 407 EXIST:VMS:FUNCTION:
|
||||
SSL_extension_supported 409 EXIST::FUNCTION:TLSEXT
|
||||
@@ -1,7 +1,11 @@
|
||||
#!/usr/bin/env perl
|
||||
#
|
||||
# su-filter.pl
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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;
|
||||
|
||||
my $in_su = 0;
|
||||
@@ -47,7 +51,7 @@ while(<>) {
|
||||
do_output($out);
|
||||
$in_su = 0;
|
||||
}
|
||||
} elsif($incomm <= 0 && /( *)(static )?(const )?(union|struct) ([^\s]+ )?\{/) {
|
||||
} elsif($incomm <= 0 && /( *)(static )?(const )?(union|struct) ([a-zA-Z_\$][\$0-9a-zA-Z_]+ )?\{/) {
|
||||
$in_su = 1;
|
||||
$indent = $1;
|
||||
$out = $_;
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
|
||||
$num=1;
|
||||
$width=40;
|
||||
|
||||
while (<>)
|
||||
{
|
||||
chop;
|
||||
|
||||
$i=length($_);
|
||||
|
||||
$n=$width-$i;
|
||||
$i=int(($n+7)/8);
|
||||
print $_.("\t" x $i).$num."\n";
|
||||
$num++;
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Very simple script to detect and convert files that we want to re-encode to UTF8
|
||||
|
||||
git ls-tree -r --name-only HEAD | \
|
||||
while read F; do
|
||||
charset=`file -bi "$F" | sed -e 's|.*charset=||'`
|
||||
if [ "$charset" != "utf-8" -a "$charset" != "binary" -a "$charset" != "us-ascii" ]; then
|
||||
iconv -f ISO-8859-1 -t UTF8 < "$F" > "$F.utf8" && \
|
||||
( cmp -s "$F" "$F.utf8" || \
|
||||
( echo "$F"
|
||||
mv "$F" "$F.iso-8859-1"
|
||||
mv "$F.utf8" "$F"
|
||||
)
|
||||
)
|
||||
fi
|
||||
done
|
||||
26
util/unlocal_shlib.com.in
Normal file
26
util/unlocal_shlib.com.in
Normal file
@@ -0,0 +1,26 @@
|
||||
${-
|
||||
use File::Spec::Functions qw(rel2abs);
|
||||
|
||||
my $bldtop = rel2abs($config{builddir});
|
||||
our %names = ( map { $_ => $bldtop.$_.".EXE" }
|
||||
map { $unified_info{sharednames}->{$_} || () }
|
||||
@{$unified_info{libraries}} );
|
||||
"" -}
|
||||
$ ! Remove the local environment created by local_shlib.com
|
||||
$
|
||||
$ OPENSSL_NAMES := OPENSSL_NAMES_'F$GETJPI("","PID")'
|
||||
$ IF F$TRNLNM("OSSL_FLAG",OPENSSL_NAMES) .EQS. "" THEN EXIT 0
|
||||
$
|
||||
$ NAMES := {- join(",", keys %names); -}
|
||||
$ I = 0
|
||||
$ LOOP:
|
||||
$ E = F$ELEMENT(I,",",NAMES)
|
||||
$ I = I + 1
|
||||
$ IF E .EQS. "," THEN GOTO ENDLOOP
|
||||
$ OLDV = F$TRNLNM(E,OPENSSL_NAMES)
|
||||
$ DEASSIGN 'E'
|
||||
$ IF OLDV .NES. "" THEN DEFINE 'E' 'OLDV'
|
||||
$ GOTO LOOP
|
||||
$ ENDLOOP:
|
||||
$
|
||||
$ DEASSIGN 'OPENSSL_NAMES' /TABLE=LNM$PROCESS_DIRECTORY
|
||||
24
util/with_fallback.pm
Normal file
24
util/with_fallback.pm
Normal file
@@ -0,0 +1,24 @@
|
||||
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (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 {
|
||||
use File::Basename;
|
||||
use File::Spec::Functions;
|
||||
foreach (@_) {
|
||||
eval "require $_";
|
||||
if ($@) {
|
||||
unshift @INC, catdir(dirname(__FILE__), "..", "external", "perl");
|
||||
my $transfer = "transfer::$_";
|
||||
eval "require $transfer";
|
||||
shift @INC;
|
||||
warn $@ if $@;
|
||||
}
|
||||
}
|
||||
}
|
||||
1;
|
||||
@@ -1,42 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo Generating x86 assember
|
||||
echo Bignum
|
||||
(cd crypto/bn/asm; perl x86.pl cpp > bn86unix.cpp)
|
||||
(cd crypto/bn/asm; perl x86.pl win32 > bn-win32.asm)
|
||||
|
||||
echo DES
|
||||
(cd crypto/des/asm; perl des-586.pl cpp > dx86unix.cpp)
|
||||
(cd crypto/des/asm; perl des-586.pl win32 > d-win32.asm)
|
||||
|
||||
echo "crypt(3)"
|
||||
(cd crypto/des/asm; perl crypt586.pl cpp > yx86unix.cpp)
|
||||
(cd crypto/des/asm; perl crypt586.pl win32 > y-win32.asm)
|
||||
|
||||
echo Blowfish
|
||||
(cd crypto/bf/asm; perl bf-586.pl cpp > bx86unix.cpp)
|
||||
(cd crypto/bf/asm; perl bf-586.pl win32 > b-win32.asm)
|
||||
|
||||
echo CAST5
|
||||
(cd crypto/cast/asm; perl cast-586.pl cpp > cx86unix.cpp)
|
||||
(cd crypto/cast/asm; perl cast-586.pl win32 > c-win32.asm)
|
||||
|
||||
echo RC4
|
||||
(cd crypto/rc4/asm; perl rc4-586.pl cpp > rx86unix.cpp)
|
||||
(cd crypto/rc4/asm; perl rc4-586.pl win32 > r4-win32.asm)
|
||||
|
||||
echo MD5
|
||||
(cd crypto/md5/asm; perl md5-586.pl cpp > mx86unix.cpp)
|
||||
(cd crypto/md5/asm; perl md5-586.pl win32 > m5-win32.asm)
|
||||
|
||||
echo SHA1
|
||||
(cd crypto/sha/asm; perl sha1-586.pl cpp > sx86unix.cpp)
|
||||
(cd crypto/sha/asm; perl sha1-586.pl win32 > s1-win32.asm)
|
||||
|
||||
echo RIPEMD160
|
||||
(cd crypto/ripemd/asm; perl rmd-586.pl cpp > rm86unix.cpp)
|
||||
(cd crypto/ripemd/asm; perl rmd-586.pl win32 > rm-win32.asm)
|
||||
|
||||
echo RC5/32
|
||||
(cd crypto/rc5/asm; perl rc5-586.pl cpp > r586unix.cpp)
|
||||
(cd crypto/rc5/asm; perl rc5-586.pl win32 > r5-win32.asm)
|
||||
Reference in New Issue
Block a user