mirror of
https://github.com/adulau/ssldump.git
synced 2024-11-22 01:17:04 +00:00
commit
4a0bbffc92
36 changed files with 259 additions and 11154 deletions
6
.github/workflows/ccpp.yml
vendored
6
.github/workflows/ccpp.yml
vendored
|
@ -15,8 +15,10 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt install libpcap-dev libssl-dev
|
||||
sudo apt install autoconf libpcap-dev libssl-dev
|
||||
- name: autogen
|
||||
run: ./autogen.sh
|
||||
- name: configure
|
||||
run: ./configure --with-pcap-lib=/usr/lib/x86_64-linux-gnu/
|
||||
run: ./configure
|
||||
- name: make
|
||||
run: make
|
||||
|
|
23
.gitignore
vendored
23
.gitignore
vendored
|
@ -7,3 +7,26 @@ config.log
|
|||
config.status
|
||||
dist
|
||||
autom4te.cache
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
base/.deps/
|
||||
base/.dirstamp
|
||||
base/Makefile.in
|
||||
common/Makefile.in
|
||||
common/lib/.deps/
|
||||
common/lib/.dirstamp
|
||||
common/lib/Makefile.in
|
||||
compile
|
||||
config.h
|
||||
config.h.in
|
||||
configure
|
||||
depcomp
|
||||
install-sh
|
||||
missing
|
||||
null/.deps/
|
||||
null/.dirstamp
|
||||
null/Makefile.in
|
||||
ssl/.deps/
|
||||
ssl/.dirstamp
|
||||
ssl/Makefile.in
|
||||
stamp-h1
|
||||
|
|
1
AUTHORS
Symbolic link
1
AUTHORS
Symbolic link
|
@ -0,0 +1 @@
|
|||
CREDITS
|
1
COPYING
Symbolic link
1
COPYING
Symbolic link
|
@ -0,0 +1 @@
|
|||
COPYRIGHT
|
29
Makefile.am
Normal file
29
Makefile.am
Normal file
|
@ -0,0 +1,29 @@
|
|||
bin_PROGRAMS = ssldump
|
||||
man_MANS = ssldump.1
|
||||
|
||||
ssldump_SOURCES = \
|
||||
base/pcap-snoop.c\
|
||||
base/network.c\
|
||||
base/proto_mod.c\
|
||||
base/common.c\
|
||||
ssl/ssl_analyze.c\
|
||||
null/null_analyze.c\
|
||||
common/lib/r_errors.c\
|
||||
base/tcppack.c\
|
||||
base/tcpconn.c\
|
||||
ssl/ssldecode.c\
|
||||
ssl/sslprint.c\
|
||||
ssl/ssl.enums.c\
|
||||
ssl/sslxprint.c\
|
||||
ssl/ciphersuites.c
|
||||
|
||||
ssldump_CPPFLAGS = \
|
||||
-I$(top_srcdir)\
|
||||
-I$(top_srcdir)/common/include\
|
||||
-I$(top_srcdir)/null\
|
||||
-I$(top_srcdir)/ssl\
|
||||
-I$(top_srcdir)/base\
|
||||
-D_BSD_SOURCE=1\
|
||||
-D_DEFAULT_SOURCE=1\
|
||||
-DLINUX
|
||||
|
127
Makefile.in
127
Makefile.in
|
@ -1,127 +0,0 @@
|
|||
# Copyright (C) 1999-2000 RTFM, Inc.
|
||||
# All Rights Reserved
|
||||
|
||||
# This package is a SSLv3/TLS protocol analyzer written by Eric
|
||||
# Rescorla <ekr@rtfm.com> and licensed by RTFM, Inc.
|
||||
|
||||
# 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 acknowledgement:
|
||||
#
|
||||
# This product includes software developed by Eric Rescorla for
|
||||
# RTFM, Inc.
|
||||
|
||||
# 4. Neither the name of RTFM, Inc. nor the name of Eric Rescorla may
|
||||
# be used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
|
||||
# THIS SOFTWARE IS PROVIDED BY ERIC RESCORLA AND RTFM, INC. ``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 REGENTS 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
|
||||
# SUCH DAMAGE.
|
||||
CC=@CC@
|
||||
|
||||
all: ssldump
|
||||
|
||||
PACKAGE_TARNAME=@PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION=@PACKAGE_VERSION@
|
||||
|
||||
OBJSUFFIX=o
|
||||
LIBSUFFIX=a
|
||||
INSTALL=@INSTALL@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
sbindir=@sbindir@
|
||||
mandir=@mandir@
|
||||
datarootdir=@datarootdir@
|
||||
docdir=@docdir@
|
||||
RM=rm -f
|
||||
|
||||
ROOT=./
|
||||
ANALYZE_SRCDIR=$(ROOT)base/
|
||||
COMMONDIR=common/
|
||||
COMMON_LIB_SRCDIR=$(COMMONDIR)lib/
|
||||
ANALYZE_NULL_SRCDIR=$(ROOT)null/
|
||||
ANALYZE_SSL_SRCDIR=$(ROOT)ssl/
|
||||
ANALYZE_RECORD_SRCDIR=$(ROOT)@RECORD_MOD@/
|
||||
include rules.mk
|
||||
|
||||
include $(COMMON_LIB_SRCDIR)/targets.mk
|
||||
include $(ANALYZE_SRCDIR)targets.mk
|
||||
include $(ANALYZE_NULL_SRCDIR)targets.mk
|
||||
include $(ANALYZE_SSL_SRCDIR)targets.mk
|
||||
include $(ANALYZE_RECORD_SRCDIR)targets.mk
|
||||
|
||||
INCLUDES += -I$(COMMONDIR)include/ -I$(ANALYZE_NULL_SRCDIR) -I$(ANALYZE_SSL_SRCDIR)
|
||||
|
||||
|
||||
DEFINES += @DEFINES@
|
||||
INCLUDES += @INCLUDES@
|
||||
LIBS += @LDFLAGS@ @LIBS@
|
||||
|
||||
CFLAGS += @CFLAGS@ @DEFS@
|
||||
|
||||
|
||||
.PHONY: clean install dist
|
||||
|
||||
ssldump: $(OBJECTS)
|
||||
$(CC) $(OBJECTS) -o $@ $(LIBS)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJECTS) ssldump
|
||||
|
||||
install:
|
||||
$(INSTALL) -m 755 -d $(sbindir)
|
||||
$(INSTALL) -m 755 -d $(mandir)/man1
|
||||
$(INSTALL) -m 755 -d $(docdir)
|
||||
$(INSTALL) -m 755 ssldump $(sbindir)/ssldump
|
||||
$(INSTALL) -m 644 ssldump.1 $(mandir)/man1/ssldump.1
|
||||
$(INSTALL) -m 644 README $(docdir)
|
||||
$(INSTALL) -m 644 README.md $(docdir)
|
||||
$(INSTALL) -m 644 ChangeLog $(docdir)
|
||||
$(INSTALL) -m 644 COPYRIGHT $(docdir)
|
||||
$(INSTALL) -m 644 CREDITS $(docdir)
|
||||
|
||||
dist:
|
||||
rm -rf dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
|
||||
mkdir -p dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
|
||||
ls -1| grep -vx -e dist -e autom4te.cache \
|
||||
| xargs cp -pR -t dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
|
||||
make -C dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) clean
|
||||
rm dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)/Makefile
|
||||
find dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) -name '*~' -exec rm {} \; -print
|
||||
find dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) -name '*.o' -exec rm {} \; -print
|
||||
find dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) -name '#*#' -exec rm {} \; -print
|
||||
find dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) -name '.#*' -exec rm {} \; -print
|
||||
find dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) -name 'CVS' -exec rm -rf {} \; -print
|
||||
find dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) -name '*bak' -exec rm -rf {} \; -print
|
||||
find dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) -name '*.core' -exec rm -rf {} \; -print
|
||||
find dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) -name '*.tr' -exec rm -rf {} \; -print
|
||||
find dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) -name '*.pl' -exec rm -rf {} \; -print
|
||||
find dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) -name '*.pem' -exec rm -rf {} \; -print
|
||||
find dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) -name '*orig' -exec rm -rf {} \; -print
|
||||
find dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) -name '*.rej' -exec rm -rf {} \; -print
|
||||
rm -f dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)/config.status
|
||||
rm -f dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)/config.log
|
||||
rm -f dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)/config.cache
|
||||
rm -f dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)/config.h
|
||||
rm -f dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)/ssl/a.out
|
||||
rm -f dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)/all
|
||||
tar cf - -C dist $(PACKAGE_TARNAME)-$(PACKAGE_VERSION) \
|
||||
| gzip >dist/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz
|
1
NEWS
Symbolic link
1
NEWS
Symbolic link
|
@ -0,0 +1 @@
|
|||
ChangeLog
|
20
README.md
20
README.md
|
@ -30,6 +30,26 @@ Additional back-end code available is in the [crl-monitor ](https://github.com/a
|
|||
|
||||
- Current version of ssldump is v1.1 (released: 2019-12-28) - [ChangeLog](https://raw.githubusercontent.com/adulau/ssldump/master/ChangeLog)
|
||||
|
||||
# Build instructions
|
||||
|
||||
On Debian & Ubuntu:
|
||||
```
|
||||
apt install build-essential autoconf libssl-dev libpcap-dev
|
||||
./autogen.sh
|
||||
./configure --prefix=/usr/local
|
||||
make
|
||||
(optional) make install
|
||||
```
|
||||
|
||||
On Fedora, Centos & RHEL:
|
||||
```
|
||||
dnf install autoconf automake gcc make openssl-devel libpcap-devel
|
||||
./autogen.sh
|
||||
./configure --prefix=/usr/local
|
||||
make
|
||||
(optional) make install
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
The contributing policy is simple. If you have a patch to propose, make a pull-request
|
||||
|
|
5
autogen.sh
Executable file
5
autogen.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
autoreconf -v -i
|
||||
|
||||
|
|
@ -47,6 +47,10 @@
|
|||
#ifndef _network_h
|
||||
#define _network_h
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
|
@ -86,8 +86,8 @@ static int pcap_if_type=DLT_NULL;
|
|||
int err_exit PROTO_LIST((char *str,int num));
|
||||
int usage PROTO_LIST((void));
|
||||
int print_version PROTO_LIST((void));
|
||||
RETSIGTYPE sig_handler PROTO_LIST((void));
|
||||
void pcap_cb PROTO_LIST((u_char *ptr,struct pcap_pkthdr *hdr,u_char *data));
|
||||
void sig_handler PROTO_LIST((int sig));
|
||||
void pcap_cb PROTO_LIST((u_char *ptr,const struct pcap_pkthdr *hdr,const u_char *data));
|
||||
int main PROTO_LIST((int argc,char **argv));
|
||||
|
||||
int packet_cnt = 0; // Packet counter used for connection pool cleaning
|
||||
|
@ -124,7 +124,7 @@ int print_version()
|
|||
exit(0);
|
||||
}
|
||||
|
||||
RETSIGTYPE sig_handler()
|
||||
void sig_handler(int sig)
|
||||
{
|
||||
fflush(stdout);
|
||||
exit(0);
|
||||
|
@ -132,8 +132,8 @@ RETSIGTYPE sig_handler()
|
|||
|
||||
void pcap_cb(ptr,hdr,data)
|
||||
u_char *ptr;
|
||||
struct pcap_pkthdr *hdr;
|
||||
u_char *data;
|
||||
const struct pcap_pkthdr *hdr;
|
||||
const u_char *data;
|
||||
{
|
||||
n_handler *n;
|
||||
int len;
|
||||
|
@ -240,7 +240,7 @@ void pcap_cb(ptr,hdr,data)
|
|||
break;
|
||||
#endif
|
||||
}
|
||||
network_process_packet(n,&hdr->ts,data,len);
|
||||
network_process_packet(n,(struct timeval *) &hdr->ts,(u_char *)data,len);
|
||||
|
||||
if(packet_cnt == conn_freq) {
|
||||
packet_cnt = 0;
|
||||
|
@ -283,6 +283,7 @@ int main(argc,argv)
|
|||
extern char *optarg;
|
||||
extern int optind;
|
||||
#endif
|
||||
pcap_if_t *interfaces;
|
||||
char *interface_name=0;
|
||||
char *file=0;
|
||||
char *filter=0;
|
||||
|
@ -382,7 +383,11 @@ int main(argc,argv)
|
|||
|
||||
if(!file){
|
||||
if(!interface_name){
|
||||
interface_name=pcap_lookupdev(errbuf);
|
||||
if(pcap_findalldevs(&interfaces,errbuf)==-1) {
|
||||
fprintf(stderr,"PCAP: %s\n",errbuf);
|
||||
err_exit("Aborting",-1);
|
||||
}
|
||||
interface_name=interfaces->name;
|
||||
if(!interface_name){
|
||||
fprintf(stderr,"PCAP: %s\n",errbuf);
|
||||
err_exit("Aborting",-1);
|
||||
|
|
275
base/targets.mk
275
base/targets.mk
|
@ -1,275 +0,0 @@
|
|||
#
|
||||
# targets.mk
|
||||
#
|
||||
# $Source: /usr/local/CVS/ssldump/base/targets.mk,v $
|
||||
# $Revision: 1.3 $
|
||||
# $Date: 2002/08/17 01:33:16 $
|
||||
# $Name: $
|
||||
# $Disclaimer$
|
||||
#
|
||||
# Copyright (C) 2001, Terisa Systems, Inc.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# ekr@terisa.com
|
||||
#
|
||||
|
||||
|
||||
|
||||
#
|
||||
# CONFIGURE USER-DEFINED MAKE ENVIRONMENT
|
||||
#
|
||||
# These fields are specified by the user. The remainder of
|
||||
# this file is generated from this user-specified information.
|
||||
#
|
||||
# ANALYZE_DEFINES:
|
||||
# cpp defines, with the -D flag preceeding each
|
||||
#
|
||||
# ANALYZE_INCLUDES:
|
||||
# cpp include directories, with the -I flag preceeding each
|
||||
#
|
||||
# ANALYZE_INTERNAL:
|
||||
# headers files which are local to a specific module directory,
|
||||
# and should not be used by other parts of the toolkit or by
|
||||
# the user
|
||||
#
|
||||
# ANALYZE_LIBNAME:
|
||||
# the library associated with this module directory, used in
|
||||
# most cases for debugging purposes
|
||||
#
|
||||
# ANALYZE_LIBPATHS:
|
||||
# link-time directories to search for libraries, with the -L flag
|
||||
# preceeding each
|
||||
#
|
||||
# ANALYZE_LIBRARIES:
|
||||
# link-time libraries, with the -l flag preceeding each
|
||||
#
|
||||
# ANALYZE_LOCALFLAGS:
|
||||
# compile-time flags specific to compiling only the files in
|
||||
# this module directory--this variable should only be set in
|
||||
# extremely exceptional cases
|
||||
#
|
||||
# ANALYZE_MAKEFILES:
|
||||
# the makefiles
|
||||
#
|
||||
# ANALYZE_PREFIX:
|
||||
# defines the module name, which also serves as the
|
||||
# prefix for all the variable names defined in this file
|
||||
#
|
||||
# ANALYZE_PRIVATE:
|
||||
# the private, for-toolkit-use-only API header files
|
||||
#
|
||||
# ANALYZE_PROGRAMS:
|
||||
# programs to build
|
||||
#
|
||||
# ANALYZE_PUBLIC:
|
||||
# the header files that define the public API for the toolkit
|
||||
# and any other 'public' files that should be copied to
|
||||
# the build directory
|
||||
#
|
||||
# ANALYZE_SOURCES:
|
||||
# the source files to compile to object
|
||||
#
|
||||
ANALYZE_DEFINES =
|
||||
ANALYZE_INCLUDES = -I$(ANALYZE_SRCDIR)
|
||||
ANALYZE_INTERNAL =
|
||||
ANALYZE_LIBNAME =
|
||||
ANALYZE_LIBPATHS =
|
||||
ANALYZE_LIBRARIES =
|
||||
ANALYZE_LOCALFLAGS =
|
||||
ANALYZE_MAKEFILES = targets.mk
|
||||
ANALYZE_PREFIX = ANALYZE
|
||||
ANALYZE_PRIVATE = network.h proto_mod.h tcpconn.h tcppack.h
|
||||
ANALYZE_PROGRAMS =
|
||||
ANALYZE_PUBLIC =
|
||||
ANALYZE_SOURCES = network.c pcap-snoop.c proto_mod.c tcpconn.c \
|
||||
tcppack.c
|
||||
|
||||
|
||||
|
||||
#
|
||||
# CONFIGURE AUTOMATICALLY-GENERATED MAKE ENVIRONMENT
|
||||
#
|
||||
# ANALYZE_OBJECTS:
|
||||
# object files to build
|
||||
#
|
||||
# ANALYZE_UNUSED:
|
||||
# obsolete files in the module directory that are not
|
||||
# used during the build process
|
||||
#
|
||||
# ANALYZE_USED:
|
||||
# all files in the module directory that are used
|
||||
# during the build process
|
||||
#
|
||||
ANALYZE_OBJECTS = network.$(OBJSUFFIX) pcap-snoop.$(OBJSUFFIX) \
|
||||
proto_mod.$(OBJSUFFIX) tcpconn.$(OBJSUFFIX) \
|
||||
tcppack.$(OBJSUFFIX)
|
||||
ANALYZE_UNUSED = common.c debug.c debug.h print_utils.c \
|
||||
print_utils.h
|
||||
ANALYZE_USED = $(ANALYZE_INTERNAL:%=$(ANALYZE_SRCDIR)%) \
|
||||
$(ANALYZE_MAKEFILES:%=$(ANALYZE_SRCDIR)%) \
|
||||
$(ANALYZE_PRIVATE:%=$(ANALYZE_SRCDIR)%) \
|
||||
$(ANALYZE_PUBLIC:%=$(ANALYZE_SRCDIR)%) \
|
||||
$(ANALYZE_SOURCES:%=$(ANALYZE_SRCDIR)%)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# NOTES
|
||||
#
|
||||
# The following variables may be used during the build process,
|
||||
# but are not defined in this file. If they are to be set
|
||||
# to something other than the default blank, then they must
|
||||
# be set by the calling make system.
|
||||
#
|
||||
# ANALYZE_SRCDIR:
|
||||
# if the build target directory is different from the
|
||||
# module directory (the source directory), then this
|
||||
# variable contains the relative or full path of
|
||||
# the module directory
|
||||
#
|
||||
# LIBARS:
|
||||
# the library archive files (with fully-specified paths) that
|
||||
# executables built from this module directory depend upon
|
||||
#
|
||||
# LIBPATHS:
|
||||
# the paths to search for library archives (specified with
|
||||
# the -L)
|
||||
#
|
||||
# LIBRARIES:
|
||||
# the libraries to use while building executables from
|
||||
# this module directory (specified with the -l)
|
||||
#
|
||||
|
||||
|
||||
|
||||
#
|
||||
# GLOBAL ENVIRONMENT
|
||||
#
|
||||
DEFINES += $(ANALYZE_DEFINES)
|
||||
INCLUDES += $(ANALYZE_INCLUDES)
|
||||
LIBPATHS += $(ANALYZE_LIBPATHS)
|
||||
LIBRARIES += $(ANALYZE_LIBRARIES)
|
||||
OBJECTS += $(ANALYZE_OBJECTS)
|
||||
PUBLIC += $(ANALYZE_PUBLIC)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# GENERIC DEPENDENCIES
|
||||
#
|
||||
# default:
|
||||
# default dependency, must be the first dependency in this makefile
|
||||
#
|
||||
# all:
|
||||
# build everything in this module directory
|
||||
#
|
||||
# build:
|
||||
# make only the toolkit build files of this module directory
|
||||
#
|
||||
# ci:
|
||||
# perform an RCS check-in of this module directory
|
||||
#
|
||||
# clean:
|
||||
# remove the compiled files
|
||||
#
|
||||
# clean_public:
|
||||
# remove the public header files that have been copied
|
||||
# to a public build directory
|
||||
#
|
||||
# objects:
|
||||
# build the object files (this dependency is used for
|
||||
# building the toolkit library)
|
||||
#
|
||||
# private:
|
||||
# build only the private API header files
|
||||
#
|
||||
# public:
|
||||
# build only the public API header files
|
||||
#
|
||||
default: $(ANALYZE_LIBNAME)
|
||||
default: $(ANALYZE_PROGRAMS)
|
||||
|
||||
all: $(ANALYZE_PUBLIC)
|
||||
all: $(ANALYZE_OBJECTS)
|
||||
all: $(ANALYZE_LIBNAME)
|
||||
all: $(ANALYZE_PROGRAMS)
|
||||
build: $(ANALYZE_PUBLIC)
|
||||
build: $(ANALYZE_OBJECTS)
|
||||
ci: analyze_ci
|
||||
clean: analyze_clean
|
||||
clean_public: analyze_clean_public
|
||||
objects: $(ANALYZE_OBJECTS)
|
||||
private: $(ANALYZE_PRIVATE)
|
||||
public: $(ANALYZE_PUBLIC)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# LOCAL UTILITY DEPENDENCIES
|
||||
#
|
||||
# utility dependencies are necessary because of some
|
||||
# make-isms having to do with dependencies
|
||||
#
|
||||
|
||||
analyze_ci:
|
||||
$(CI) $(CIFLAGS) $(ANALYZE_USED)
|
||||
|
||||
analyze_clean:
|
||||
$(RM) $(RMFLAGS) $(ANALYZE_OBJECTS) $(ANALYZE_LIBNAME) $(ANALYZE_PROGRAMS)
|
||||
|
||||
analyze_clean_public:
|
||||
$(RM) $(RMFLAGS) $(ANALYZE_PUBLIC)
|
||||
|
||||
analyze_objects: $(ANALYZE_OBJECTS)
|
||||
|
||||
analyze_programs: $(ANALYZE_PROGRAMS)
|
||||
|
||||
analyze_public: $(ANALYZE_PUBLIC)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# BUILD DEPENDENCIES
|
||||
#
|
||||
# build dependencies invoke the rule used to build each
|
||||
# class of file
|
||||
#
|
||||
|
||||
$(ANALYZE_LIBNAME):
|
||||
$(AR) $(ARFLAGS) $@ $?
|
||||
$(RANLIB) $@
|
||||
|
||||
$(ANALYZE_OBJECTS):
|
||||
$(COMPILE.c) $(ANALYZE_SRCDIR)$(@:%.$(OBJSUFFIX)=%.c) $(DEFINES) $(INCLUDES) $(ANALYZE_LOCALFLAGS)
|
||||
|
||||
$(ANALYZE_PUBLIC):
|
||||
$(CP) $(CPFLAGS) $(ANALYZE_SRCDIR)$@ $@
|
||||
|
||||
$(ANALYZE_PROGRAMS):
|
||||
$(LINK.c) -o $@ $@.$(OBJSUFFIX) $(LDLIBS) $(LIBS) $(LIBRARIES) $(LIBPATHS)
|
||||
#LIBS above is obsolete (use LIBARARIES instead)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# FILE DEPENDENCIES
|
||||
#
|
||||
# file dependencies state, for each file that is built,
|
||||
# which file(s) it depends upon
|
||||
#
|
||||
|
||||
network.$(OBJSUFFIX): $(ANALYZE_SRCDIR)network.h
|
||||
network.$(OBJSUFFIX): $(ANALYZE_SRCDIR)network.c
|
||||
|
||||
pcap-snoop.$(OBJSUFFIX): $(ANALYZE_SRCDIR)pcap-snoop.c
|
||||
|
||||
proto_mod.$(OBJSUFFIX): $(ANALYZE_SRCDIR)proto_mod.h
|
||||
proto_mod.$(OBJSUFFIX): $(ANALYZE_SRCDIR)proto_mod.c
|
||||
|
||||
tcpconn.$(OBJSUFFIX): $(ANALYZE_SRCDIR)tcpconn.h
|
||||
tcpconn.$(OBJSUFFIX): $(ANALYZE_SRCDIR)tcpconn.c
|
||||
|
||||
tcppack.$(OBJSUFFIX): $(ANALYZE_SRCDIR)tcppack.h
|
||||
tcppack.$(OBJSUFFIX): $(ANALYZE_SRCDIR)tcppack.c
|
||||
|
||||
$(ANALYZE_LIBNAME): $(ANALYZE_OBJECTS)
|
|
@ -101,5 +101,8 @@ int tcp_destroy_conn PROTO_LIST((tcp_conn *conn));
|
|||
int free_tcp_segment_queue PROTO_LIST((segment *seg));
|
||||
int copy_tcp_segment_queue PROTO_LIST((segment **out,segment *in));
|
||||
|
||||
int clean_old_conn(void);
|
||||
int destroy_all_conn(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
1
common/Makefile.am
Normal file
1
common/Makefile.am
Normal file
|
@ -0,0 +1 @@
|
|||
SUBDIRS = lib
|
|
@ -47,6 +47,10 @@
|
|||
#ifndef _r_common_h
|
||||
#define _r_common_h
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "r_defaults.h"
|
||||
#include "r_includes.h"
|
||||
#include "r_types.h"
|
||||
|
|
|
@ -47,6 +47,10 @@
|
|||
#ifndef _r_time_h
|
||||
#define _r_time_h
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <winsock2.h>
|
||||
#else
|
||||
|
|
|
@ -47,6 +47,10 @@
|
|||
#ifndef _r_types_h
|
||||
#define _r_types_h
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifndef R_DEFINED_UINT4
|
||||
#ifndef SIZEOF_UNSIGNED_INT
|
||||
typedef unsigned int UINT4;
|
||||
|
|
|
@ -1,279 +0,0 @@
|
|||
#
|
||||
# local.mk
|
||||
#
|
||||
# $Source: /usr/local/CVS/ssldump/common/lib/local.mk,v $
|
||||
# $Revision: 1.2 $
|
||||
# $Date: 2001/10/04 17:19:47 $
|
||||
# $Name: $
|
||||
# $Disclaimer$
|
||||
#
|
||||
# Copyright (C) 2001, Terisa Systems, Inc.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# ekr@terisa.com
|
||||
#
|
||||
|
||||
|
||||
|
||||
#
|
||||
# CONFIGURE USER-DEFINED MAKE ENVIRONMENT
|
||||
#
|
||||
# These fields are specified by the user. The remainder of
|
||||
# this file is generated from this user-specified information.
|
||||
#
|
||||
# COMMON_LIB_DEFINES:
|
||||
# cpp defines, with the -D flag preceeding each
|
||||
#
|
||||
# COMMON_LIB_INCLUDES:
|
||||
# cpp include directories, with the -I flag preceeding each
|
||||
#
|
||||
# COMMON_LIB_INTERNAL:
|
||||
# headers files which are local to a specific module directory,
|
||||
# and should not be used by other parts of the toolkit or by
|
||||
# the user
|
||||
#
|
||||
# COMMON_LIB_LIBNAME:
|
||||
# the library associated with this module directory, used in
|
||||
# most cases for debugging purposes
|
||||
#
|
||||
# COMMON_LIB_LIBPATHS:
|
||||
# link-time directories to search for libraries, with the -L flag
|
||||
# preceeding each
|
||||
#
|
||||
# COMMON_LIB_LIBRARIES:
|
||||
# link-time libraries, with the -l flag preceeding each
|
||||
#
|
||||
# COMMON_LIB_LOCALFLAGS:
|
||||
# compile-time flags specific to compiling only the files in
|
||||
# this module directory--this variable should only be set in
|
||||
# extremely exceptional cases
|
||||
#
|
||||
# COMMON_LIB_MAKEFILES:
|
||||
# the makefiles
|
||||
#
|
||||
# COMMON_LIB_PREFIX:
|
||||
# defines the module name, which also serves as the
|
||||
# prefix for all the variable names defined in this file
|
||||
#
|
||||
# COMMON_LIB_PRIVATE:
|
||||
# the private, for-toolkit-use-only API header files
|
||||
#
|
||||
# COMMON_LIB_PROGRAMS:
|
||||
# programs to build
|
||||
#
|
||||
# COMMON_LIB_PUBLIC:
|
||||
# the header files that define the public API for the toolkit
|
||||
# and any other 'public' files that should be copied to
|
||||
# the build directory
|
||||
#
|
||||
# COMMON_LIB_SOURCES:
|
||||
# the source files to compile to object
|
||||
#
|
||||
COMMON_LIB_DEFINES =
|
||||
COMMON_LIB_INCLUDES =
|
||||
COMMON_LIB_INTERNAL =
|
||||
COMMON_LIB_LIBNAME =
|
||||
COMMON_LIB_LIBPATHS =
|
||||
COMMON_LIB_LIBRARIES =
|
||||
COMMON_LIB_LOCALFLAGS =
|
||||
COMMON_LIB_MAKEFILES = targets.mk
|
||||
COMMON_LIB_PREFIX = COMMON_LIB
|
||||
COMMON_LIB_PRIVATE =
|
||||
COMMON_LIB_PROGRAMS =
|
||||
COMMON_LIB_PUBLIC =
|
||||
COMMON_LIB_SOURCES = debug.c r_assoc.c r_bitfield.c r_data.c \
|
||||
r_errors.c r_list.c r_replace.c r_time.c
|
||||
|
||||
|
||||
|
||||
#
|
||||
# CONFIGURE AUTOMATICALLY-GENERATED MAKE ENVIRONMENT
|
||||
#
|
||||
# COMMON_LIB_OBJECTS:
|
||||
# object files to build
|
||||
#
|
||||
# COMMON_LIB_UNUSED:
|
||||
# obsolete files in the module directory that are not
|
||||
# used during the build process
|
||||
#
|
||||
# COMMON_LIB_USED:
|
||||
# all files in the module directory that are used
|
||||
# during the build process
|
||||
#
|
||||
COMMON_LIB_OBJECTS = debug.$(OBJSUFFIX) r_assoc.$(OBJSUFFIX) \
|
||||
r_bitfield.$(OBJSUFFIX) r_data.$(OBJSUFFIX) \
|
||||
r_errors.$(OBJSUFFIX) r_list.$(OBJSUFFIX) \
|
||||
r_replace.$(OBJSUFFIX) r_time.$(OBJSUFFIX)
|
||||
COMMON_LIB_UNUSED = assoc.h debug.h local.mk r_assoc_test.c r_data.h
|
||||
COMMON_LIB_USED = $(COMMON_LIB_INTERNAL:%=$(COMMON_LIB_SRCDIR)%) \
|
||||
$(COMMON_LIB_MAKEFILES:%=$(COMMON_LIB_SRCDIR)%) \
|
||||
$(COMMON_LIB_PRIVATE:%=$(COMMON_LIB_SRCDIR)%) \
|
||||
$(COMMON_LIB_PUBLIC:%=$(COMMON_LIB_SRCDIR)%) \
|
||||
$(COMMON_LIB_SOURCES:%=$(COMMON_LIB_SRCDIR)%)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# NOTES
|
||||
#
|
||||
# The following variables may be used during the build process,
|
||||
# but are not defined in this file. If they are to be set
|
||||
# to something other than the default blank, then they must
|
||||
# be set by the calling make system.
|
||||
#
|
||||
# COMMON_LIB_SRCDIR:
|
||||
# if the build target directory is different from the
|
||||
# module directory (the source directory), then this
|
||||
# variable contains the relative or full path of
|
||||
# the module directory
|
||||
#
|
||||
# LIBARS:
|
||||
# the library archive files (with fully-specified paths) that
|
||||
# executables built from this module directory depend upon
|
||||
#
|
||||
# LIBPATHS:
|
||||
# the paths to search for library archives (specified with
|
||||
# the -L)
|
||||
#
|
||||
# LIBRARIES:
|
||||
# the libraries to use while building executables from
|
||||
# this module directory (specified with the -l)
|
||||
#
|
||||
|
||||
|
||||
|
||||
#
|
||||
# GLOBAL ENVIRONMENT
|
||||
#
|
||||
DEFINES += $(COMMON_LIB_DEFINES)
|
||||
INCLUDES += $(COMMON_LIB_INCLUDES)
|
||||
LIBPATHS += $(COMMON_LIB_LIBPATHS)
|
||||
LIBRARIES += $(COMMON_LIB_LIBRARIES)
|
||||
OBJECTS += $(COMMON_LIB_OBJECTS)
|
||||
PUBLIC += $(COMMON_LIB_PUBLIC)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# GENERIC DEPENDENCIES
|
||||
#
|
||||
# default:
|
||||
# default dependency, must be the first dependency in this makefile
|
||||
#
|
||||
# all:
|
||||
# build everything in this module directory
|
||||
#
|
||||
# build:
|
||||
# make only the toolkit build files of this module directory
|
||||
#
|
||||
# ci:
|
||||
# perform an RCS check-in of this module directory
|
||||
#
|
||||
# clean:
|
||||
# remove the compiled files
|
||||
#
|
||||
# clean_public:
|
||||
# remove the public header files that have been copied
|
||||
# to a public build directory
|
||||
#
|
||||
# objects:
|
||||
# build the object files (this dependency is used for
|
||||
# building the toolkit library)
|
||||
#
|
||||
# private:
|
||||
# build only the private API header files
|
||||
#
|
||||
# public:
|
||||
# build only the public API header files
|
||||
#
|
||||
default: $(COMMON_LIB_LIBNAME)
|
||||
default: $(COMMON_LIB_PROGRAMS)
|
||||
|
||||
all: $(COMMON_LIB_PUBLIC)
|
||||
all: $(COMMON_LIB_OBJECTS)
|
||||
all: $(COMMON_LIB_LIBNAME)
|
||||
all: $(COMMON_LIB_PROGRAMS)
|
||||
build: $(COMMON_LIB_PUBLIC)
|
||||
build: $(COMMON_LIB_OBJECTS)
|
||||
ci: common_lib_ci
|
||||
clean: common_lib_clean
|
||||
clean_public: common_lib_clean_public
|
||||
objects: $(COMMON_LIB_OBJECTS)
|
||||
private: $(COMMON_LIB_PRIVATE)
|
||||
public: $(COMMON_LIB_PUBLIC)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# LOCAL UTILITY DEPENDENCIES
|
||||
#
|
||||
# utility dependencies are necessary because of some
|
||||
# make-isms having to do with dependencies
|
||||
#
|
||||
|
||||
common_lib_ci:
|
||||
$(CI) $(CIFLAGS) $(COMMON_LIB_USED)
|
||||
|
||||
common_lib_clean:
|
||||
$(RM) $(RMFLAGS) $(COMMON_LIB_OBJECTS) $(COMMON_LIB_LIBNAME) $(COMMON_LIB_PROGRAMS)
|
||||
|
||||
common_lib_clean_public:
|
||||
$(RM) $(RMFLAGS) $(COMMON_LIB_PUBLIC)
|
||||
|
||||
common_lib_objects: $(COMMON_LIB_OBJECTS)
|
||||
|
||||
common_lib_programs: $(COMMON_LIB_PROGRAMS)
|
||||
|
||||
common_lib_public: $(COMMON_LIB_PUBLIC)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# BUILD DEPENDENCIES
|
||||
#
|
||||
# build dependencies invoke the rule used to build each
|
||||
# class of file
|
||||
#
|
||||
|
||||
$(COMMON_LIB_LIBNAME):
|
||||
$(AR) $(ARFLAGS) $@ $?
|
||||
$(RANLIB) $@
|
||||
|
||||
$(COMMON_LIB_OBJECTS):
|
||||
$(COMPILE.c) $(COMMON_LIB_SRCDIR)$(@:%.$(OBJSUFFIX)=%.c) $(DEFINES) $(INCLUDES) $(COMMON_LIB_LOCALFLAGS)
|
||||
|
||||
$(COMMON_LIB_PUBLIC):
|
||||
$(CP) $(CPFLAGS) $(COMMON_LIB_SRCDIR)$@ $@
|
||||
|
||||
$(COMMON_LIB_PROGRAMS):
|
||||
$(LINK.c) $@.$(OBJSUFFIX) $(LDLIBS) $(LIBS) $(LIBRARIES) $(LIBPATHS)
|
||||
#LIBS above is obsolete (use LIBARARIES instead)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# FILE DEPENDENCIES
|
||||
#
|
||||
# file dependencies state, for each file that is built,
|
||||
# which file(s) it depends upon
|
||||
#
|
||||
|
||||
debug.$(OBJSUFFIX): $(COMMON_LIB_SRCDIR)debug.h
|
||||
debug.$(OBJSUFFIX): $(COMMON_LIB_SRCDIR)debug.c
|
||||
|
||||
r_assoc.$(OBJSUFFIX): $(COMMON_LIB_SRCDIR)r_assoc.c
|
||||
|
||||
r_bitfield.$(OBJSUFFIX): $(COMMON_LIB_SRCDIR)r_bitfield.c
|
||||
|
||||
r_data.$(OBJSUFFIX): $(COMMON_LIB_SRCDIR)r_data.h
|
||||
r_data.$(OBJSUFFIX): $(COMMON_LIB_SRCDIR)r_data.c
|
||||
|
||||
r_errors.$(OBJSUFFIX): $(COMMON_LIB_SRCDIR)r_errors.c
|
||||
|
||||
r_list.$(OBJSUFFIX): $(COMMON_LIB_SRCDIR)r_list.c
|
||||
|
||||
r_replace.$(OBJSUFFIX): $(COMMON_LIB_SRCDIR)r_replace.c
|
||||
|
||||
r_time.$(OBJSUFFIX): $(COMMON_LIB_SRCDIR)r_time.c
|
||||
|
||||
$(COMMON_LIB_LIBNAME): $(COMMON_LIB_OBJECTS)
|
|
@ -1,2 +0,0 @@
|
|||
include $(COMMON_LIB_SRCDIR)local.mk
|
||||
|
|
@ -1,259 +0,0 @@
|
|||
#
|
||||
# targets.mk
|
||||
#
|
||||
# $Source: /usr/local/CVS/ssldump/common/lib/threads/pthreads/targets.mk,v $
|
||||
# $Revision: 1.1.1.1 $
|
||||
# $Date: 2000/10/09 00:45:39 $
|
||||
# $Name: $
|
||||
# $Disclaimer$
|
||||
#
|
||||
# Copyright (C) 1999, Terisa Systems, Inc.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# ekr@terisa.com
|
||||
#
|
||||
|
||||
|
||||
|
||||
#
|
||||
# CONFIGURE USER-DEFINED MAKE ENVIRONMENT
|
||||
#
|
||||
# These fields are specified by the user. The remainder of
|
||||
# this file is generated from this user-specified information.
|
||||
#
|
||||
# THREADS_PTHREADS_DEFINES:
|
||||
# cpp defines, with the -D flag preceeding each
|
||||
#
|
||||
# THREADS_PTHREADS_INCLUDES:
|
||||
# cpp include directories, with the -I flag preceeding each
|
||||
#
|
||||
# THREADS_PTHREADS_INTERNAL:
|
||||
# headers files which are local to a specific module directory,
|
||||
# and should not be used by other parts of the toolkit or by
|
||||
# the user
|
||||
#
|
||||
# THREADS_PTHREADS_LIBNAME:
|
||||
# the library associated with this module directory, used in
|
||||
# most cases for debugging purposes
|
||||
#
|
||||
# THREADS_PTHREADS_LIBPATHS:
|
||||
# link-time directories to search for libraries, with the -L flag
|
||||
# preceeding each
|
||||
#
|
||||
# THREADS_PTHREADS_LIBRARIES:
|
||||
# link-time libraries, with the -l flag preceeding each
|
||||
#
|
||||
# THREADS_PTHREADS_LOCALFLAGS:
|
||||
# compile-time flags specific to compiling only the files in
|
||||
# this module directory--this variable should only be set in
|
||||
# extremely exceptional cases
|
||||
#
|
||||
# THREADS_PTHREADS_MAKEFILES:
|
||||
# the makefiles
|
||||
#
|
||||
# THREADS_PTHREADS_PREFIX:
|
||||
# defines the module name, which also serves as the
|
||||
# prefix for all the variable names defined in this file
|
||||
#
|
||||
# THREADS_PTHREADS_PRIVATE:
|
||||
# the private, for-toolkit-use-only API header files
|
||||
#
|
||||
# THREADS_PTHREADS_PROGRAMS:
|
||||
# programs to build
|
||||
#
|
||||
# THREADS_PTHREADS_PUBLIC:
|
||||
# the header files that define the public API for the toolkit
|
||||
# and any other 'public' files that should be copied to
|
||||
# the build directory
|
||||
#
|
||||
# THREADS_PTHREADS_SOURCES:
|
||||
# the source files to compile to object
|
||||
#
|
||||
THREADS_PTHREADS_DEFINES =
|
||||
THREADS_PTHREADS_INCLUDES =
|
||||
THREADS_PTHREADS_INTERNAL =
|
||||
THREADS_PTHREADS_LIBNAME =
|
||||
THREADS_PTHREADS_LIBPATHS =
|
||||
THREADS_PTHREADS_LIBRARIES =
|
||||
THREADS_PTHREADS_LOCALFLAGS =
|
||||
THREADS_PTHREADS_MAKEFILES =
|
||||
THREADS_PTHREADS_PREFIX = THREADS_PTHREADS
|
||||
THREADS_PTHREADS_PRIVATE =
|
||||
THREADS_PTHREADS_PROGRAMS =
|
||||
THREADS_PTHREADS_PUBLIC =
|
||||
THREADS_PTHREADS_SOURCES = pthread.c
|
||||
|
||||
|
||||
|
||||
#
|
||||
# CONFIGURE AUTOMATICALLY-GENERATED MAKE ENVIRONMENT
|
||||
#
|
||||
# THREADS_PTHREADS_OBJECTS:
|
||||
# object files to build
|
||||
#
|
||||
# THREADS_PTHREADS_UNUSED:
|
||||
# obsolete files in the module directory that are not
|
||||
# used during the build process
|
||||
#
|
||||
# THREADS_PTHREADS_USED:
|
||||
# all files in the module directory that are used
|
||||
# during the build process
|
||||
#
|
||||
THREADS_PTHREADS_OBJECTS = pthread.$(OBJSUFFIX)
|
||||
THREADS_PTHREADS_UNUSED = targets.mk
|
||||
THREADS_PTHREADS_USED = $(THREADS_PTHREADS_INTERNAL:%=$(THREADS_PTHREADS_SRCDIR)%) \
|
||||
$(THREADS_PTHREADS_MAKEFILES:%=$(THREADS_PTHREADS_SRCDIR)%) \
|
||||
$(THREADS_PTHREADS_PRIVATE:%=$(THREADS_PTHREADS_SRCDIR)%) \
|
||||
$(THREADS_PTHREADS_PUBLIC:%=$(THREADS_PTHREADS_SRCDIR)%) \
|
||||
$(THREADS_PTHREADS_SOURCES:%=$(THREADS_PTHREADS_SRCDIR)%)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# NOTES
|
||||
#
|
||||
# The following variables may be used during the build process,
|
||||
# but are not defined in this file. If they are to be set
|
||||
# to something other than the default blank, then they must
|
||||
# be set by the calling make system.
|
||||
#
|
||||
# THREADS_PTHREADS_SRCDIR:
|
||||
# if the build target directory is different from the
|
||||
# module directory (the source directory), then this
|
||||
# variable contains the relative or full path of
|
||||
# the module directory
|
||||
#
|
||||
# LIBARS:
|
||||
# the library archive files (with fully-specified paths) that
|
||||
# executables built from this module directory depend upon
|
||||
#
|
||||
# LIBPATHS:
|
||||
# the paths to search for library archives (specified with
|
||||
# the -L)
|
||||
#
|
||||
# LIBRARIES:
|
||||
# the libraries to use while building executables from
|
||||
# this module directory (specified with the -l)
|
||||
#
|
||||
|
||||
|
||||
|
||||
#
|
||||
# GLOBAL ENVIRONMENT
|
||||
#
|
||||
DEFINES += $(THREADS_PTHREADS_DEFINES)
|
||||
INCLUDES += $(THREADS_PTHREADS_INCLUDES)
|
||||
LIBPATHS += $(THREADS_PTHREADS_LIBPATHS)
|
||||
LIBRARIES += $(THREADS_PTHREADS_LIBRARIES)
|
||||
OBJECTS += $(THREADS_PTHREADS_OBJECTS)
|
||||
PUBLIC += $(THREADS_PTHREADS_PUBLIC)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# GENERIC DEPENDENCIES
|
||||
#
|
||||
# default:
|
||||
# default dependency, must be the first dependency in this makefile
|
||||
#
|
||||
# all:
|
||||
# build everything in this module directory
|
||||
#
|
||||
# build:
|
||||
# make only the toolkit build files of this module directory
|
||||
#
|
||||
# ci:
|
||||
# perform an RCS check-in of this module directory
|
||||
#
|
||||
# clean:
|
||||
# remove the compiled files
|
||||
#
|
||||
# clean_public:
|
||||
# remove the public header files that have been copied
|
||||
# to a public build directory
|
||||
#
|
||||
# objects:
|
||||
# build the object files (this dependency is used for
|
||||
# building the toolkit library)
|
||||
#
|
||||
# private:
|
||||
# build only the private API header files
|
||||
#
|
||||
# public:
|
||||
# build only the public API header files
|
||||
#
|
||||
default: $(THREADS_PTHREADS_LIBNAME)
|
||||
default: $(THREADS_PTHREADS_PROGRAMS)
|
||||
|
||||
all: $(THREADS_PTHREADS_PUBLIC)
|
||||
all: $(THREADS_PTHREADS_OBJECTS)
|
||||
all: $(THREADS_PTHREADS_LIBNAME)
|
||||
all: $(THREADS_PTHREADS_PROGRAMS)
|
||||
build: $(THREADS_PTHREADS_PUBLIC)
|
||||
build: $(THREADS_PTHREADS_OBJECTS)
|
||||
ci: threads_pthreads_ci
|
||||
clean: threads_pthreads_clean
|
||||
clean_public: threads_pthreads_clean_public
|
||||
objects: $(THREADS_PTHREADS_OBJECTS)
|
||||
private: $(THREADS_PTHREADS_PRIVATE)
|
||||
public: $(THREADS_PTHREADS_PUBLIC)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# LOCAL UTILITY DEPENDENCIES
|
||||
#
|
||||
# utility dependencies are necessary because of some
|
||||
# make-isms having to do with dependencies
|
||||
#
|
||||
|
||||
threads_pthreads_ci:
|
||||
$(CI) $(CIFLAGS) $(THREADS_PTHREADS_USED)
|
||||
|
||||
threads_pthreads_clean:
|
||||
$(RM) $(RMFLAGS) $(THREADS_PTHREADS_OBJECTS) $(THREADS_PTHREADS_LIBNAME) $(THREADS_PTHREADS_PROGRAMS)
|
||||
|
||||
threads_pthreads_clean_public:
|
||||
$(RM) $(RMFLAGS) $(THREADS_PTHREADS_PUBLIC)
|
||||
|
||||
threads_pthreads_objects: $(THREADS_PTHREADS_OBJECTS)
|
||||
|
||||
threads_pthreads_programs: $(THREADS_PTHREADS_PROGRAMS)
|
||||
|
||||
threads_pthreads_public: $(THREADS_PTHREADS_PUBLIC)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# BUILD DEPENDENCIES
|
||||
#
|
||||
# build dependencies invoke the rule used to build each
|
||||
# class of file
|
||||
#
|
||||
|
||||
$(THREADS_PTHREADS_LIBNAME):
|
||||
$(AR) $(ARFLAGS) $@ $?
|
||||
$(RANLIB) $@
|
||||
|
||||
$(THREADS_PTHREADS_OBJECTS):
|
||||
$(COMPILE.c) $(THREADS_PTHREADS_SRCDIR)$(@:%.$(OBJSUFFIX)=%.c) $(DEFINES) $(INCLUDES) $(THREADS_PTHREADS_LOCALFLAGS)
|
||||
|
||||
$(THREADS_PTHREADS_PUBLIC):
|
||||
$(CP) $(CPFLAGS) $(THREADS_PTHREADS_SRCDIR)$@ $@
|
||||
|
||||
$(THREADS_PTHREADS_PROGRAMS):
|
||||
$(LINK.c) $@.$(OBJSUFFIX) $(LDLIBS) $(LIBS) $(LIBRARIES) $(LIBPATHS)
|
||||
#LIBS above is obsolete (use LIBARARIES instead)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# FILE DEPENDENCIES
|
||||
#
|
||||
# file dependencies state, for each file that is built,
|
||||
# which file(s) it depends upon
|
||||
#
|
||||
|
||||
pthread.$(OBJSUFFIX): $(THREADS_PTHREADS_SRCDIR)pthread.c
|
||||
|
||||
$(THREADS_PTHREADS_LIBNAME): $(THREADS_PTHREADS_OBJECTS)
|
|
@ -1,4 +0,0 @@
|
|||
THREADS_SRCDIR=$(COMMON_LIB_SRCDIR)threads/
|
||||
THREADS_PTHREADS_SRCDIR=$(THREADS_SRCDIR)pthreads/
|
||||
|
||||
include $(THREADS_SRCDIR)$(THREADS_TYPE)/targets.mk
|
1502
config.guess
vendored
1502
config.guess
vendored
File diff suppressed because it is too large
Load diff
1714
config.sub
vendored
1714
config.sub
vendored
File diff suppressed because it is too large
Load diff
87
configure.ac
Normal file
87
configure.ac
Normal file
|
@ -0,0 +1,87 @@
|
|||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ([2.69])
|
||||
AC_INIT([ssldump], [1.1])
|
||||
AM_INIT_AUTOMAKE([subdir-objects])
|
||||
AC_CONFIG_SRCDIR([base/pcap-snoop.c])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_INSTALL
|
||||
|
||||
|
||||
# Checks for header files.
|
||||
AC_FUNC_ALLOCA
|
||||
AC_FUNC_MALLOC
|
||||
AC_CHECK_HEADERS([arpa/inet.h memory.h netdb.h netinet/in.h stdlib.h string.h sys/param.h sys/socket.h sys/time.h unistd.h],,[AC_MSG_ERROR([Missing header.])])
|
||||
AC_HEADER_STDC
|
||||
AC_HEADER_TIME
|
||||
|
||||
have_pcap=no
|
||||
AC_SEARCH_LIBS([pcap_create], [pcap], [have_pcap=yes])
|
||||
|
||||
if test "x${have_pcap}" = xyes; then
|
||||
AC_CHECK_HEADERS([pcap.h pcap-bpf.h], [], [have_pcap=no])
|
||||
fi
|
||||
|
||||
if test "x${have_pcap}" = xno; then
|
||||
AC_MSG_ERROR([
|
||||
---------------------------------------
|
||||
Unable to find libpcap on this system
|
||||
Check 'config.log' for more information
|
||||
|
||||
On Debian and Ubuntu systems you can
|
||||
install the required library and header
|
||||
files with
|
||||
apt install libpcap-dev
|
||||
---------------------------------------
|
||||
])
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB([pcap],[pcap_create])
|
||||
|
||||
have_ssl=no
|
||||
AC_SEARCH_LIBS([OPENSSL_init_ssl], [ssl], [have_ssl=yes])
|
||||
|
||||
if test "x${have_ssl}" = xyes; then
|
||||
AC_CHECK_HEADERS([openssl/ssl.h], [], [have_ssl=no])
|
||||
fi
|
||||
|
||||
if test "x${have_ssl}" = xno; then
|
||||
AC_MSG_ERROR([
|
||||
---------------------------------------
|
||||
Unable to find libssl on this system
|
||||
Check 'config.log' for more information
|
||||
|
||||
On Debian and Ubuntu systems you can
|
||||
install the required library and header
|
||||
files with
|
||||
apt install libssl-dev
|
||||
---------------------------------------
|
||||
])
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB([ssl], [OPENSSL_init_ssl])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_CHECK_SIZEOF([unsigned short])
|
||||
AC_CHECK_SIZEOF([unsigned int])
|
||||
AC_CHECK_SIZEOF([unsigned long])
|
||||
AC_CHECK_SIZEOF([unsigned long long])
|
||||
|
||||
# Checks for library functions.
|
||||
AC_FUNC_MALLOC
|
||||
AC_FUNC_REALLOC
|
||||
AC_CHECK_FUNCS([gethostbyaddr gettimeofday inet_ntoa isascii memmove memset strchr strdup strstr strtol])
|
||||
|
||||
AC_CONFIG_FILES([Makefile
|
||||
common/Makefile
|
||||
common/lib/Makefile
|
||||
null/Makefile
|
||||
ssl/Makefile
|
||||
base/Makefile])
|
||||
AC_OUTPUT
|
253
configure.in
253
configure.in
|
@ -1,253 +0,0 @@
|
|||
dnl Copyright (C) 1999-2000 RTFM, Inc.
|
||||
dnl All Rights Reserved
|
||||
|
||||
dnl This package is a SSLv3/TLS protocol analyzer written by Eric
|
||||
dnl Rescorla <ekr@rtfm.com> and licensed by RTFM, Inc.
|
||||
|
||||
dnl Redistribution and use in source and binary forms, with or without
|
||||
dnl modification, are permitted provided that the following conditions
|
||||
dnl are met:
|
||||
dnl 1. Redistributions of source code must retain the above copyright
|
||||
dnl notice, this list of conditions and the following disclaimer.
|
||||
dnl 2. Redistributions in binary form must reproduce the above
|
||||
dnl copyright notice, this list of conditions and the following
|
||||
dnl disclaimer in the documentation and/or other materials provided
|
||||
dnl with the distribution.
|
||||
dnl 3. All advertising materials mentioning features or use of this
|
||||
dnl software must display the following acknowledgement:
|
||||
dnl
|
||||
dnl This product includes software developed by Eric Rescorla for
|
||||
dnl RTFM, Inc.
|
||||
dnl
|
||||
dnl 4. Neither the name of RTFM, Inc. nor the name of Eric Rescorla
|
||||
dnl may be used to endorse or promote products derived from this
|
||||
dnl software without specific prior written permission.
|
||||
dnl
|
||||
dnl THIS SOFTWARE IS PROVIDED BY ERIC RESCORLA AND RTFM, INC. ``AS
|
||||
dnl IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
dnl FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
dnl REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
dnl INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
dnl (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
dnl SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
dnl HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
dnl CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
dnl OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
dnl EVEN IF ADVISED OF THE POSSIBILITY SUCH DAMAGE.
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(ssldump, 1.0)
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_INSTALL
|
||||
|
||||
AC_MSG_RESULT(configuring for $target_os)
|
||||
|
||||
dnl Replace `main' with a function in -lm:
|
||||
AC_CHECK_LIB(m, pow)
|
||||
|
||||
dnl System-specific stuff
|
||||
case "$target_os" in
|
||||
linux*)
|
||||
DEFINES="$DEFINES -D_BSD_SOURCE=1 -DLINUX"
|
||||
;;
|
||||
solaris*)
|
||||
LIBS="$LIBS -lsocket -lnsl"
|
||||
;;
|
||||
esac
|
||||
|
||||
RECORD_MOD="dummy"
|
||||
|
||||
dnl Look for PCAP
|
||||
dnl We absolutely need pcap
|
||||
ac_pcap_inc_dir="/usr/include /usr/include/pcap /usr/local/include"
|
||||
ac_pcap_lib_dir="/usr/local/lib64 /usr/local/lib /usr/lib64 /usr/lib"
|
||||
|
||||
AC_ARG_WITH(pcap,[--with-pcap root location for pcap library],
|
||||
if test "$withval" = "no"; then
|
||||
AC_MSG_ERROR(PCAP required for ssldump)
|
||||
else
|
||||
ac_pcap_inc_dir=$withval/include
|
||||
ac_pcap_lib_dir=$withval/lib
|
||||
fi
|
||||
)
|
||||
|
||||
AC_ARG_WITH(pcap-inc,[--with-pcap-inc PCAP include files],
|
||||
ac_pcap_inc_dir=$withval
|
||||
)
|
||||
AC_ARG_WITH(pcap-lib,[--with-pcap-lib PCAP library files],
|
||||
ac_pcap_lib_dir=$withval
|
||||
)
|
||||
|
||||
dnl Now look for it
|
||||
AC_MSG_CHECKING(for PCAP include files)
|
||||
ac_found_pcap_inc_dir="no"
|
||||
for dir in $ac_pcap_inc_dir; do
|
||||
if test -f $dir/pcap.h; then
|
||||
if test "$dir" != "/usr/include"; then
|
||||
INCLUDES="-I$dir $INCLUDES"
|
||||
fi
|
||||
ac_found_pcap_inc_dir=$dir
|
||||
echo "found in $dir"
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
||||
if test "$ac_found_pcap_inc_dir" = "no"; then
|
||||
echo
|
||||
AC_MSG_ERROR(Couldn't find PCAP includes: needed for ssldump)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for PCAP library)
|
||||
ac_found_pcap_lib_dir="no"
|
||||
for dir in $ac_pcap_lib_dir; do
|
||||
if test -f $dir/libpcap.a -o -f $dir/libpcap.so; then
|
||||
dnl Ok, we think we've found them, but check that they
|
||||
dnl actually contain the right functions.
|
||||
save_LIBS=$LIBS
|
||||
save_LDFLAGS=$LDFLAGS
|
||||
LIBS="-lpcap $LIBS"
|
||||
if test "$dir" != "/usr/lib" -a "$dir" != "/usr/lib64"; then
|
||||
LDFLAGS="-L$dir $LDFLAGS"
|
||||
fi
|
||||
AC_TRY_LINK_FUNC(pcap_open_live,ac_linked_libpcap="true",
|
||||
ac_linked_libpcap="false");
|
||||
if test "$ac_linked_libpcap" != "false"; then
|
||||
ac_found_pcap_lib_dir=$dir
|
||||
break
|
||||
fi
|
||||
LIBS=$save_LIBS
|
||||
LDFLAGS=$save_LDFLAGS
|
||||
fi
|
||||
done
|
||||
|
||||
if test "$ac_found_pcap_lib_dir" = "no"; then
|
||||
echo
|
||||
AC_MSG_ERROR(Couldn't find PCAP library: needed for ssldump)
|
||||
else
|
||||
echo "found in $ac_found_pcap_lib_dir"
|
||||
fi
|
||||
|
||||
dnl See if we can find OpenSSL
|
||||
dnl We can compile without OpenSSL if we have to
|
||||
ac_use_openssl="true"
|
||||
ac_openssl_lib_dir="/usr/lib /usr/local /usr/local/ssl /usr/local/ssl/lib /usr/pkg"
|
||||
ac_openssl_inc_dir="/usr/include /usr/local /usr/local/ssl /usr/pkg /usr/local/ssl/include"
|
||||
|
||||
AC_ARG_WITH(openssl,[--with-openssl root location for OpenSSL],
|
||||
if test "$withval" = "no"; then
|
||||
ac_use_openssl="false"
|
||||
else
|
||||
ac_openssl_lib_dir="$withval/lib $withval"
|
||||
ac_openssl_inc_dir=$withval/include
|
||||
fi
|
||||
)
|
||||
|
||||
AC_ARG_WITH(openssl-inc,[--with-openssl-inc OpenSSL include files],
|
||||
ac_openssl_inc_dir=$withval
|
||||
)
|
||||
AC_ARG_WITH(openssl-lib,[--with-openssl-lib OpenSSL library files],
|
||||
ac_openssl_lib_dir=$withval
|
||||
)
|
||||
|
||||
dnl Now look for OpenSSL
|
||||
if test "$ac_use_openssl" != "false"; then
|
||||
ac_found_openssl_inc_dir="no"
|
||||
AC_MSG_CHECKING(for OpenSSL include files)
|
||||
for dir in $ac_openssl_inc_dir; do
|
||||
if test -f $dir/openssl/ssl.h; then
|
||||
ac_found_openssl_inc_dir=$dir
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test "$ac_found_openssl_inc_dir" != "no"; then
|
||||
echo "found in $ac_found_openssl_inc_dir"
|
||||
else
|
||||
echo "not found."
|
||||
ac_use_openssl="false"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$ac_use_openssl" != "false"; then
|
||||
ac_found_openssl_lib_dir="no"
|
||||
AC_MSG_CHECKING(for OpenSSL libraries)
|
||||
for dir in $ac_openssl_lib_dir; do
|
||||
found_ssl="false"
|
||||
if test -f $dir/libssl.a -a -f $dir/libcrypto.a; then
|
||||
found_ssl="true"
|
||||
fi
|
||||
if test -f $dir/libssl.so -a -f $dir/libcrypto.so; then
|
||||
found_ssl="true"
|
||||
fi
|
||||
if $found_ssl != "false"; then
|
||||
dnl Ok, we think we've found them, but check that they
|
||||
dnl actually contain the right functions.
|
||||
save_LIBS=$LIBS
|
||||
save_LDFLAGS=$LDFLAGS
|
||||
LIBS="-lssl -lcrypto $LIBS"
|
||||
LDFLAGS="-L$dir $LDFLAGS"
|
||||
AC_TRY_LINK_FUNC(SSL_load_error_strings,ac_linked_libssl="true",
|
||||
ac_linked_libssl="false");
|
||||
AC_TRY_LINK_FUNC(RC4_set_key,ac_linked_libcrypto="true",
|
||||
ac_linked_libcrypto="false");
|
||||
if test "$ac_linked_libssl" != "false" -a \
|
||||
"$ac_linked_libcrypto" != "false"; then
|
||||
ac_found_openssl_lib_dir=$dir
|
||||
break
|
||||
fi
|
||||
LIBS=$save_LIBS
|
||||
LDFLAGS=$save_LDFLAGS
|
||||
fi
|
||||
done
|
||||
if test "$ac_found_openssl_lib_dir" != "no"; then
|
||||
echo "found in $ac_found_openssl_lib_dir"
|
||||
INCLUDES="-I$ac_found_openssl_inc_dir $INCLUDES"
|
||||
DEFINES="-DOPENSSL $DEFINES"
|
||||
else
|
||||
echo "not found."
|
||||
ac_use_openssl="false"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$ac_use_openssl" = "false"; then
|
||||
AC_MSG_WARN(compiling without OpenSSL)
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(record,[--with-record Compile with record module (EKR Use Only)],
|
||||
DEFINES="-DENABLE_RECORD $DEFINES"
|
||||
RECORD_MOD="record"
|
||||
)
|
||||
|
||||
dnl Replace `main' with a function in -lpcap:
|
||||
AC_CHECK_LIB(pcap, pcap_open)
|
||||
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_CHECK_HEADERS(sys/time.h)
|
||||
AC_HEADER_STDC
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_HEADER_TIME
|
||||
|
||||
dnl Find a 4-byte integer size
|
||||
AC_CHECK_SIZEOF(unsigned short)
|
||||
AC_CHECK_SIZEOF(unsigned int)
|
||||
AC_CHECK_SIZEOF(unsigned long)
|
||||
AC_CHECK_SIZEOF(unsigned long long)
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_FUNC_MEMCMP
|
||||
AC_TYPE_SIGNAL
|
||||
AC_FUNC_VPRINTF
|
||||
AC_CHECK_FUNCS(strdup)
|
||||
|
||||
|
||||
AC_SUBST(RECORD_MOD)
|
||||
AC_SUBST(INCLUDES)
|
||||
AC_SUBST(DEFINES)
|
||||
AC_OUTPUT(Makefile)
|
251
install-sh
251
install-sh
|
@ -1,251 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
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}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
transformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
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;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
chmodcmd=""
|
||||
else
|
||||
instcmd=mkdir
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
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`
|
||||
else
|
||||
true
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
0
null/Makefile.am
Normal file
0
null/Makefile.am
Normal file
260
null/targets.mk
260
null/targets.mk
|
@ -1,260 +0,0 @@
|
|||
#
|
||||
# targets.mk
|
||||
#
|
||||
# $Source: /usr/local/CVS/ssldump/null/targets.mk,v $
|
||||
# $Revision: 1.1.1.1 $
|
||||
# $Date: 2000/10/09 00:45:39 $
|
||||
# $Name: $
|
||||
# $Disclaimer$
|
||||
#
|
||||
# Copyright (C) 1999, Terisa Systems, Inc.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# ekr@terisa.com
|
||||
#
|
||||
|
||||
|
||||
|
||||
#
|
||||
# CONFIGURE USER-DEFINED MAKE ENVIRONMENT
|
||||
#
|
||||
# These fields are specified by the user. The remainder of
|
||||
# this file is generated from this user-specified information.
|
||||
#
|
||||
# ANALYZE_NULL_DEFINES:
|
||||
# cpp defines, with the -D flag preceeding each
|
||||
#
|
||||
# ANALYZE_NULL_INCLUDES:
|
||||
# cpp include directories, with the -I flag preceeding each
|
||||
#
|
||||
# ANALYZE_NULL_INTERNAL:
|
||||
# headers files which are local to a specific module directory,
|
||||
# and should not be used by other parts of the toolkit or by
|
||||
# the user
|
||||
#
|
||||
# ANALYZE_NULL_LIBNAME:
|
||||
# the library associated with this module directory, used in
|
||||
# most cases for debugging purposes
|
||||
#
|
||||
# ANALYZE_NULL_LIBPATHS:
|
||||
# link-time directories to search for libraries, with the -L flag
|
||||
# preceeding each
|
||||
#
|
||||
# ANALYZE_NULL_LIBRARIES:
|
||||
# link-time libraries, with the -l flag preceeding each
|
||||
#
|
||||
# ANALYZE_NULL_LOCALFLAGS:
|
||||
# compile-time flags specific to compiling only the files in
|
||||
# this module directory--this variable should only be set in
|
||||
# extremely exceptional cases
|
||||
#
|
||||
# ANALYZE_NULL_MAKEFILES:
|
||||
# the makefiles
|
||||
#
|
||||
# ANALYZE_NULL_PREFIX:
|
||||
# defines the module name, which also serves as the
|
||||
# prefix for all the variable names defined in this file
|
||||
#
|
||||
# ANALYZE_NULL_PRIVATE:
|
||||
# the private, for-toolkit-use-only API header files
|
||||
#
|
||||
# ANALYZE_NULL_PROGRAMS:
|
||||
# programs to build
|
||||
#
|
||||
# ANALYZE_NULL_PUBLIC:
|
||||
# the header files that define the public API for the toolkit
|
||||
# and any other 'public' files that should be copied to
|
||||
# the build directory
|
||||
#
|
||||
# ANALYZE_NULL_SOURCES:
|
||||
# the source files to compile to object
|
||||
#
|
||||
ANALYZE_NULL_DEFINES =
|
||||
ANALYZE_NULL_INCLUDES = -I$(ANALYZE_NULL_SRCDIR)
|
||||
ANALYZE_NULL_INTERNAL =
|
||||
ANALYZE_NULL_LIBNAME =
|
||||
ANALYZE_NULL_LIBPATHS =
|
||||
ANALYZE_NULL_LIBRARIES =
|
||||
ANALYZE_NULL_LOCALFLAGS =
|
||||
ANALYZE_NULL_MAKEFILES = targets.mk
|
||||
ANALYZE_NULL_PREFIX = ANALYZE_NULL
|
||||
ANALYZE_NULL_PRIVATE = null_analyze.h
|
||||
ANALYZE_NULL_PROGRAMS =
|
||||
ANALYZE_NULL_PUBLIC =
|
||||
ANALYZE_NULL_SOURCES = null_analyze.c
|
||||
|
||||
|
||||
|
||||
#
|
||||
# CONFIGURE AUTOMATICALLY-GENERATED MAKE ENVIRONMENT
|
||||
#
|
||||
# ANALYZE_NULL_OBJECTS:
|
||||
# object files to build
|
||||
#
|
||||
# ANALYZE_NULL_UNUSED:
|
||||
# obsolete files in the module directory that are not
|
||||
# used during the build process
|
||||
#
|
||||
# ANALYZE_NULL_USED:
|
||||
# all files in the module directory that are used
|
||||
# during the build process
|
||||
#
|
||||
ANALYZE_NULL_OBJECTS = null_analyze.$(OBJSUFFIX)
|
||||
ANALYZE_NULL_UNUSED =
|
||||
ANALYZE_NULL_USED = $(ANALYZE_NULL_INTERNAL:%=$(ANALYZE_NULL_SRCDIR)%) \
|
||||
$(ANALYZE_NULL_MAKEFILES:%=$(ANALYZE_NULL_SRCDIR)%) \
|
||||
$(ANALYZE_NULL_PRIVATE:%=$(ANALYZE_NULL_SRCDIR)%) \
|
||||
$(ANALYZE_NULL_PUBLIC:%=$(ANALYZE_NULL_SRCDIR)%) \
|
||||
$(ANALYZE_NULL_SOURCES:%=$(ANALYZE_NULL_SRCDIR)%)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# NOTES
|
||||
#
|
||||
# The following variables may be used during the build process,
|
||||
# but are not defined in this file. If they are to be set
|
||||
# to something other than the default blank, then they must
|
||||
# be set by the calling make system.
|
||||
#
|
||||
# ANALYZE_NULL_SRCDIR:
|
||||
# if the build target directory is different from the
|
||||
# module directory (the source directory), then this
|
||||
# variable contains the relative or full path of
|
||||
# the module directory
|
||||
#
|
||||
# LIBARS:
|
||||
# the library archive files (with fully-specified paths) that
|
||||
# executables built from this module directory depend upon
|
||||
#
|
||||
# LIBPATHS:
|
||||
# the paths to search for library archives (specified with
|
||||
# the -L)
|
||||
#
|
||||
# LIBRARIES:
|
||||
# the libraries to use while building executables from
|
||||
# this module directory (specified with the -l)
|
||||
#
|
||||
|
||||
|
||||
|
||||
#
|
||||
# GLOBAL ENVIRONMENT
|
||||
#
|
||||
DEFINES += $(ANALYZE_NULL_DEFINES)
|
||||
INCLUDES += $(ANALYZE_NULL_INCLUDES)
|
||||
LIBPATHS += $(ANALYZE_NULL_LIBPATHS)
|
||||
LIBRARIES += $(ANALYZE_NULL_LIBRARIES)
|
||||
OBJECTS += $(ANALYZE_NULL_OBJECTS)
|
||||
PUBLIC += $(ANALYZE_NULL_PUBLIC)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# GENERIC DEPENDENCIES
|
||||
#
|
||||
# default:
|
||||
# default dependency, must be the first dependency in this makefile
|
||||
#
|
||||
# all:
|
||||
# build everything in this module directory
|
||||
#
|
||||
# build:
|
||||
# make only the toolkit build files of this module directory
|
||||
#
|
||||
# ci:
|
||||
# perform an RCS check-in of this module directory
|
||||
#
|
||||
# clean:
|
||||
# remove the compiled files
|
||||
#
|
||||
# clean_public:
|
||||
# remove the public header files that have been copied
|
||||
# to a public build directory
|
||||
#
|
||||
# objects:
|
||||
# build the object files (this dependency is used for
|
||||
# building the toolkit library)
|
||||
#
|
||||
# private:
|
||||
# build only the private API header files
|
||||
#
|
||||
# public:
|
||||
# build only the public API header files
|
||||
#
|
||||
default: $(ANALYZE_NULL_LIBNAME)
|
||||
default: $(ANALYZE_NULL_PROGRAMS)
|
||||
|
||||
all: $(ANALYZE_NULL_PUBLIC)
|
||||
all: $(ANALYZE_NULL_OBJECTS)
|
||||
all: $(ANALYZE_NULL_LIBNAME)
|
||||
all: $(ANALYZE_NULL_PROGRAMS)
|
||||
build: $(ANALYZE_NULL_PUBLIC)
|
||||
build: $(ANALYZE_NULL_OBJECTS)
|
||||
ci: analyze_null_ci
|
||||
clean: analyze_null_clean
|
||||
clean_public: analyze_null_clean_public
|
||||
objects: $(ANALYZE_NULL_OBJECTS)
|
||||
private: $(ANALYZE_NULL_PRIVATE)
|
||||
public: $(ANALYZE_NULL_PUBLIC)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# LOCAL UTILITY DEPENDENCIES
|
||||
#
|
||||
# utility dependencies are necessary because of some
|
||||
# make-isms having to do with dependencies
|
||||
#
|
||||
|
||||
analyze_null_ci:
|
||||
$(CI) $(CIFLAGS) $(ANALYZE_NULL_USED)
|
||||
|
||||
analyze_null_clean:
|
||||
$(RM) $(RMFLAGS) $(ANALYZE_NULL_OBJECTS) $(ANALYZE_NULL_LIBNAME) $(ANALYZE_NULL_PROGRAMS)
|
||||
|
||||
analyze_null_clean_public:
|
||||
$(RM) $(RMFLAGS) $(ANALYZE_NULL_PUBLIC)
|
||||
|
||||
analyze_null_objects: $(ANALYZE_NULL_OBJECTS)
|
||||
|
||||
analyze_null_programs: $(ANALYZE_NULL_PROGRAMS)
|
||||
|
||||
analyze_null_public: $(ANALYZE_NULL_PUBLIC)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# BUILD DEPENDENCIES
|
||||
#
|
||||
# build dependencies invoke the rule used to build each
|
||||
# class of file
|
||||
#
|
||||
|
||||
$(ANALYZE_NULL_LIBNAME):
|
||||
$(AR) $(ARFLAGS) $@ $?
|
||||
$(RANLIB) $@
|
||||
|
||||
$(ANALYZE_NULL_OBJECTS):
|
||||
$(COMPILE.c) $(ANALYZE_NULL_SRCDIR)$(@:%.o=%.c) $(DEFINES) $(INCLUDES) $(ANALYZE_NULL_LOCALFLAGS)
|
||||
|
||||
$(ANALYZE_NULL_PUBLIC):
|
||||
$(CP) $(CPFLAGS) $(ANALYZE_NULL_SRCDIR)$@ $@
|
||||
|
||||
$(ANALYZE_NULL_PROGRAMS):
|
||||
$(LINK.c) $@.$(OBJSUFFIX) $(LDLIBS) $(LIBS) $(LIBRARIES) $(LIBPATHS)
|
||||
#LIBS above is obsolete (use LIBARARIES instead)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# FILE DEPENDENCIES
|
||||
#
|
||||
# file dependencies state, for each file that is built,
|
||||
# which file(s) it depends upon
|
||||
#
|
||||
|
||||
null_analyze.$(OBJSUFFIX): $(ANALYZE_NULL_SRCDIR)null_analyze.h
|
||||
null_analyze.$(OBJSUFFIX): $(ANALYZE_NULL_SRCDIR)null_analyze.c
|
||||
|
||||
$(ANALYZE_NULL_LIBNAME): $(ANALYZE_NULL_OBJECTS)
|
10
rules.mk
10
rules.mk
|
@ -1,10 +0,0 @@
|
|||
OBJSUFFIX=o
|
||||
LIBSUFFIX=a
|
||||
RANLIB=ranlib
|
||||
|
||||
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@
|
||||
LINK.c = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
.c.$(OBJSUFFIX):
|
||||
$(COMPILE.c) $(OUTPUT_OPTION) $<
|
||||
|
0
ssl/Makefile.am
Normal file
0
ssl/Makefile.am
Normal file
|
@ -149,7 +149,7 @@ int ssl_create_rec_decoder(dp,cs,mk,sk,iv)
|
|||
else
|
||||
memcpy(dec->mac_key->data,mk,cs->dig_len);
|
||||
|
||||
if(!(dec->evp=(EVP_CIPHER_CTX *)malloc(sizeof(EVP_CIPHER_CTX))))
|
||||
if(!(dec->evp=EVP_CIPHER_CTX_new()))
|
||||
ABORT(R_NO_MEMORY);
|
||||
EVP_CIPHER_CTX_init(dec->evp);
|
||||
EVP_CipherInit(dec->evp,ciph,sk,iv,0);
|
||||
|
@ -178,8 +178,7 @@ int ssl_destroy_rec_decoder(dp)
|
|||
r_data_destroy(&d->write_key);
|
||||
#ifdef OPENSSL
|
||||
if(d->evp){
|
||||
EVP_CIPHER_CTX_cleanup(d->evp);
|
||||
free(d->evp);
|
||||
EVP_CIPHER_CTX_free(d->evp);
|
||||
}
|
||||
free(*dp);
|
||||
#endif
|
||||
|
@ -357,41 +356,43 @@ static int tls_check_mac(d,ct,ver,data,datalen,iv,ivlen,mac)
|
|||
UINT4 ivlen;
|
||||
UCHAR *mac;
|
||||
{
|
||||
HMAC_CTX hm;
|
||||
HMAC_CTX *hm = HMAC_CTX_new();
|
||||
if(!hm)
|
||||
ERETURN(R_NO_MEMORY);
|
||||
const EVP_MD *md;
|
||||
UINT4 l;
|
||||
UCHAR buf[128];
|
||||
|
||||
md=EVP_get_digestbyname(digests[d->cs->dig-0x40]);
|
||||
HMAC_Init(&hm,d->mac_key->data,d->mac_key->len,md);
|
||||
HMAC_Init(hm,d->mac_key->data,d->mac_key->len,md);
|
||||
|
||||
fmt_seq(d->seq,buf);
|
||||
d->seq++;
|
||||
HMAC_Update(&hm,buf,8);
|
||||
HMAC_Update(hm,buf,8);
|
||||
buf[0]=ct;
|
||||
HMAC_Update(&hm,buf,1);
|
||||
HMAC_Update(hm,buf,1);
|
||||
|
||||
buf[0]=MSB(ver);
|
||||
buf[1]=LSB(ver);
|
||||
HMAC_Update(&hm,buf,2);
|
||||
HMAC_Update(hm,buf,2);
|
||||
|
||||
buf[0]=MSB(datalen);
|
||||
buf[1]=LSB(datalen);
|
||||
HMAC_Update(&hm,buf,2);
|
||||
HMAC_Update(hm,buf,2);
|
||||
|
||||
/* for encrypt-then-mac with an explicit IV */
|
||||
if(ivlen && iv){
|
||||
HMAC_Update(&hm,iv,ivlen);
|
||||
HMAC_Update(&hm,data,datalen-ivlen);
|
||||
HMAC_Update(hm,iv,ivlen);
|
||||
HMAC_Update(hm,data,datalen-ivlen);
|
||||
}
|
||||
else
|
||||
HMAC_Update(&hm,data,datalen);
|
||||
HMAC_Update(hm,data,datalen);
|
||||
|
||||
HMAC_Final(&hm,buf,&l);
|
||||
HMAC_Final(hm,buf,&l);
|
||||
if(memcmp(mac,buf,l))
|
||||
ERETURN(SSL_BAD_MAC);
|
||||
|
||||
HMAC_cleanup(&hm);
|
||||
HMAC_CTX_free(hm);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
@ -403,7 +404,7 @@ int ssl3_check_mac(d,ct,ver,data,datalen,mac)
|
|||
UINT4 datalen;
|
||||
UCHAR *mac;
|
||||
{
|
||||
EVP_MD_CTX mc;
|
||||
EVP_MD_CTX *mc = EVP_MD_CTX_new();
|
||||
const EVP_MD *md;
|
||||
UINT4 l;
|
||||
UCHAR buf[64],dgst[20];
|
||||
|
@ -412,42 +413,44 @@ int ssl3_check_mac(d,ct,ver,data,datalen,mac)
|
|||
pad_ct=(d->cs->dig==DIG_SHA)?40:48;
|
||||
|
||||
md=EVP_get_digestbyname(digests[d->cs->dig-0x40]);
|
||||
EVP_DigestInit(&mc,md);
|
||||
EVP_DigestInit(mc,md);
|
||||
|
||||
EVP_DigestUpdate(&mc,d->mac_key->data,d->mac_key->len);
|
||||
EVP_DigestUpdate(mc,d->mac_key->data,d->mac_key->len);
|
||||
|
||||
memset(buf,0x36,pad_ct);
|
||||
EVP_DigestUpdate(&mc,buf,pad_ct);
|
||||
EVP_DigestUpdate(mc,buf,pad_ct);
|
||||
|
||||
fmt_seq(d->seq,buf);
|
||||
d->seq++;
|
||||
EVP_DigestUpdate(&mc,buf,8);
|
||||
EVP_DigestUpdate(mc,buf,8);
|
||||
|
||||
buf[0]=ct;
|
||||
EVP_DigestUpdate(&mc,buf,1);
|
||||
EVP_DigestUpdate(mc,buf,1);
|
||||
|
||||
buf[0]=MSB(datalen);
|
||||
buf[1]=LSB(datalen);
|
||||
EVP_DigestUpdate(&mc,buf,2);
|
||||
EVP_DigestUpdate(mc,buf,2);
|
||||
|
||||
EVP_DigestUpdate(&mc,data,datalen);
|
||||
EVP_DigestUpdate(mc,data,datalen);
|
||||
|
||||
EVP_DigestFinal(&mc,dgst,&l);
|
||||
EVP_DigestFinal(mc,dgst,&l);
|
||||
|
||||
EVP_DigestInit(&mc,md);
|
||||
EVP_DigestInit(mc,md);
|
||||
|
||||
EVP_DigestUpdate(&mc,d->mac_key->data,d->mac_key->len);
|
||||
EVP_DigestUpdate(mc,d->mac_key->data,d->mac_key->len);
|
||||
|
||||
memset(buf,0x5c,pad_ct);
|
||||
EVP_DigestUpdate(&mc,buf,pad_ct);
|
||||
EVP_DigestUpdate(mc,buf,pad_ct);
|
||||
|
||||
EVP_DigestUpdate(&mc,dgst,l);
|
||||
EVP_DigestUpdate(mc,dgst,l);
|
||||
|
||||
EVP_DigestFinal(&mc,dgst,&l);
|
||||
EVP_DigestFinal(mc,dgst,&l);
|
||||
|
||||
if(memcmp(mac,dgst,l))
|
||||
ERETURN(SSL_BAD_MAC);
|
||||
|
||||
EVP_MD_CTX_free(mc);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -591,6 +591,7 @@ int ssl_process_client_key_exchange(ssl,d,msg,len)
|
|||
int r,_status;
|
||||
int i;
|
||||
EVP_PKEY *pk;
|
||||
const BIGNUM *n;
|
||||
|
||||
/* Remove the master secret if it was there
|
||||
to force keying material regeneration in
|
||||
|
@ -610,14 +611,15 @@ int ssl_process_client_key_exchange(ssl,d,msg,len)
|
|||
if(!pk)
|
||||
return(-1);
|
||||
|
||||
if(pk->type!=EVP_PKEY_RSA)
|
||||
if(EVP_PKEY_id(pk)!=EVP_PKEY_RSA)
|
||||
return(-1);
|
||||
|
||||
if(r=r_data_alloc(&d->PMS,BN_num_bytes(pk->pkey.rsa->n)))
|
||||
RSA_get0_key(EVP_PKEY_get0_RSA(pk), &n, NULL, NULL);
|
||||
if(r=r_data_alloc(&d->PMS,BN_num_bytes(n)))
|
||||
ABORT(r);
|
||||
|
||||
i=RSA_private_decrypt(len,msg,d->PMS->data,
|
||||
pk->pkey.rsa,RSA_PKCS1_PADDING);
|
||||
EVP_PKEY_get0_RSA(pk),RSA_PKCS1_PADDING);
|
||||
|
||||
if(i!=48)
|
||||
ABORT(SSL_BAD_PMS);
|
||||
|
@ -668,7 +670,7 @@ static int tls_P_hash(ssl,secret,seed,md,out)
|
|||
UCHAR *A;
|
||||
UCHAR _A[128],tmp[128];
|
||||
unsigned int A_l,tmp_l;
|
||||
HMAC_CTX hm;
|
||||
HMAC_CTX *hm = HMAC_CTX_new();
|
||||
|
||||
CRDUMPD("P_hash secret",secret);
|
||||
CRDUMPD("P_hash seed",seed);
|
||||
|
@ -677,17 +679,15 @@ static int tls_P_hash(ssl,secret,seed,md,out)
|
|||
A_l=seed->len;
|
||||
|
||||
while(left){
|
||||
HMAC_Init(&hm,secret->data,secret->len,md);
|
||||
HMAC_Update(&hm,A,A_l);
|
||||
HMAC_Final(&hm,_A,&A_l);
|
||||
HMAC_cleanup(&hm);
|
||||
HMAC_Init(hm,secret->data,secret->len,md);
|
||||
HMAC_Update(hm,A,A_l);
|
||||
HMAC_Final(hm,_A,&A_l);
|
||||
A=_A;
|
||||
|
||||
HMAC_Init(&hm,secret->data,secret->len,md);
|
||||
HMAC_Update(&hm,A,A_l);
|
||||
HMAC_Update(&hm,seed->data,seed->len);
|
||||
HMAC_Final(&hm,tmp,&tmp_l);
|
||||
HMAC_cleanup(&hm);
|
||||
HMAC_Init(hm,secret->data,secret->len,md);
|
||||
HMAC_Update(hm,A,A_l);
|
||||
HMAC_Update(hm,seed->data,seed->len);
|
||||
HMAC_Final(hm,tmp,&tmp_l);
|
||||
|
||||
tocpy=MIN(left,tmp_l);
|
||||
memcpy(ptr,tmp,tocpy);
|
||||
|
@ -695,6 +695,7 @@ static int tls_P_hash(ssl,secret,seed,md,out)
|
|||
left-=tocpy;
|
||||
}
|
||||
|
||||
HMAC_CTX_free(hm);
|
||||
CRDUMPD("P_hash out",out);
|
||||
|
||||
return (0);
|
||||
|
@ -1070,7 +1071,7 @@ static int ssl_generate_session_hash(ssl,d)
|
|||
int r,_status,dgi;
|
||||
unsigned int len;
|
||||
const EVP_MD *md;
|
||||
EVP_MD_CTX dgictx;
|
||||
HMAC_CTX *dgictx = HMAC_CTX_new();
|
||||
|
||||
if(r=r_data_alloc(&d->session_hash,EVP_MAX_MD_SIZE))
|
||||
ABORT(r);
|
||||
|
@ -1084,21 +1085,21 @@ static int ssl_generate_session_hash(ssl,d)
|
|||
ERETURN(SSL_BAD_MAC);
|
||||
}
|
||||
|
||||
EVP_DigestInit(&dgictx,md);
|
||||
EVP_DigestUpdate(&dgictx,d->handshake_messages->data,d->handshake_messages->len);
|
||||
EVP_DigestFinal(&dgictx,d->session_hash->data,&d->session_hash->len);
|
||||
EVP_DigestInit(dgictx,md);
|
||||
EVP_DigestUpdate(dgictx,d->handshake_messages->data,d->handshake_messages->len);
|
||||
EVP_DigestFinal(dgictx,d->session_hash->data,&d->session_hash->len);
|
||||
|
||||
break;
|
||||
case SSLV3_VERSION:
|
||||
case TLSV1_VERSION:
|
||||
case TLSV11_VERSION:
|
||||
EVP_DigestInit(&dgictx,EVP_get_digestbyname("MD5"));
|
||||
EVP_DigestUpdate(&dgictx,d->handshake_messages->data,d->handshake_messages->len);
|
||||
EVP_DigestFinal_ex(&dgictx,d->session_hash->data,&d->session_hash->len);
|
||||
EVP_DigestInit(dgictx,EVP_get_digestbyname("MD5"));
|
||||
EVP_DigestUpdate(dgictx,d->handshake_messages->data,d->handshake_messages->len);
|
||||
EVP_DigestFinal_ex(dgictx,d->session_hash->data,&d->session_hash->len);
|
||||
|
||||
EVP_DigestInit(&dgictx,EVP_get_digestbyname("SHA1"));
|
||||
EVP_DigestUpdate(&dgictx,d->handshake_messages->data,d->handshake_messages->len);
|
||||
EVP_DigestFinal(&dgictx,d->session_hash->data+d->session_hash->len,&len);
|
||||
EVP_DigestInit(dgictx,EVP_get_digestbyname("SHA1"));
|
||||
EVP_DigestUpdate(dgictx,d->handshake_messages->data,d->handshake_messages->len);
|
||||
EVP_DigestFinal(dgictx,d->session_hash->data+d->session_hash->len,&len);
|
||||
|
||||
d->session_hash->len+=len;
|
||||
break;
|
||||
|
|
282
ssl/targets.mk
282
ssl/targets.mk
|
@ -1,282 +0,0 @@
|
|||
#
|
||||
# targets.mk
|
||||
#
|
||||
# $Source: /usr/local/CVS/ssldump/ssl/targets.mk,v $
|
||||
# $Revision: 1.2 $
|
||||
# $Date: 2001/12/08 14:57:51 $
|
||||
# $Name: $
|
||||
# $Disclaimer$
|
||||
#
|
||||
# Copyright (C) 1999, Terisa Systems, Inc.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# ekr@terisa.com
|
||||
#
|
||||
|
||||
|
||||
|
||||
#
|
||||
# CONFIGURE USER-DEFINED MAKE ENVIRONMENT
|
||||
#
|
||||
# These fields are specified by the user. The remainder of
|
||||
# this file is generated from this user-specified information.
|
||||
#
|
||||
# ANALYZE_SSL_DEFINES:
|
||||
# cpp defines, with the -D flag preceeding each
|
||||
#
|
||||
# ANALYZE_SSL_INCLUDES:
|
||||
# cpp include directories, with the -I flag preceeding each
|
||||
#
|
||||
# ANALYZE_SSL_INTERNAL:
|
||||
# headers files which are local to a specific module directory,
|
||||
# and should not be used by other parts of the toolkit or by
|
||||
# the user
|
||||
#
|
||||
# ANALYZE_SSL_LIBNAME:
|
||||
# the library associated with this module directory, used in
|
||||
# most cases for debugging purposes
|
||||
#
|
||||
# ANALYZE_SSL_LIBPATHS:
|
||||
# link-time directories to search for libraries, with the -L flag
|
||||
# preceeding each
|
||||
#
|
||||
# ANALYZE_SSL_LIBRARIES:
|
||||
# link-time libraries, with the -l flag preceeding each
|
||||
#
|
||||
# ANALYZE_SSL_LOCALFLAGS:
|
||||
# compile-time flags specific to compiling only the files in
|
||||
# this module directory--this variable should only be set in
|
||||
# extremely exceptional cases
|
||||
#
|
||||
# ANALYZE_SSL_MAKEFILES:
|
||||
# the makefiles
|
||||
#
|
||||
# ANALYZE_SSL_PREFIX:
|
||||
# defines the module name, which also serves as the
|
||||
# prefix for all the variable names defined in this file
|
||||
#
|
||||
# ANALYZE_SSL_PRIVATE:
|
||||
# the private, for-toolkit-use-only API header files
|
||||
#
|
||||
# ANALYZE_SSL_PROGRAMS:
|
||||
# programs to build
|
||||
#
|
||||
# ANALYZE_SSL_PUBLIC:
|
||||
# the header files that define the public API for the toolkit
|
||||
# and any other 'public' files that should be copied to
|
||||
# the build directory
|
||||
#
|
||||
# ANALYZE_SSL_SOURCES:
|
||||
# the source files to compile to object
|
||||
#
|
||||
ANALYZE_SSL_DEFINES =
|
||||
ANALYZE_SSL_INCLUDES = -I$(ANALYZE_SSL_SRCDIR)
|
||||
ANALYZE_SSL_INTERNAL =
|
||||
ANALYZE_SSL_LIBNAME =
|
||||
ANALYZE_SSL_LIBPATHS =
|
||||
ANALYZE_SSL_LIBRARIES =
|
||||
ANALYZE_SSL_LOCALFLAGS =
|
||||
ANALYZE_SSL_MAKEFILES =
|
||||
ANALYZE_SSL_PREFIX = ANALYZE_SSL
|
||||
ANALYZE_SSL_PRIVATE = ssl_analyze.h
|
||||
ANALYZE_SSL_PROGRAMS =
|
||||
ANALYZE_SSL_PUBLIC =
|
||||
ANALYZE_SSL_SOURCES = ciphersuites.c ssl.enums.c ssl_analyze.c \
|
||||
ssl_rec.c ssldecode.c sslprint.c sslxprint.c
|
||||
|
||||
|
||||
|
||||
#
|
||||
# CONFIGURE AUTOMATICALLY-GENERATED MAKE ENVIRONMENT
|
||||
#
|
||||
# ANALYZE_SSL_OBJECTS:
|
||||
# object files to build
|
||||
#
|
||||
# ANALYZE_SSL_UNUSED:
|
||||
# obsolete files in the module directory that are not
|
||||
# used during the build process
|
||||
#
|
||||
# ANALYZE_SSL_USED:
|
||||
# all files in the module directory that are used
|
||||
# during the build process
|
||||
#
|
||||
ANALYZE_SSL_OBJECTS = ciphersuites.$(OBJSUFFIX) ssl.enums.$(OBJSUFFIX) \
|
||||
ssl_analyze.$(OBJSUFFIX) ssl_rec.$(OBJSUFFIX) \
|
||||
ssldecode.$(OBJSUFFIX) sslprint.$(OBJSUFFIX) \
|
||||
sslxprint.$(OBJSUFFIX)
|
||||
ANALYZE_SSL_UNUSED = Makefile lex.yy.c main.c ssl.enums.h ssl_enum.c \
|
||||
ssl_h.h sslciphers.h ssldecode.h sslprint.h \
|
||||
sslxprint.h targets.mk y.tab.c y.tab.h
|
||||
ANALYZE_SSL_USED = $(ANALYZE_SSL_INTERNAL:%=$(ANALYZE_SSL_SRCDIR)%) \
|
||||
$(ANALYZE_SSL_MAKEFILES:%=$(ANALYZE_SSL_SRCDIR)%) \
|
||||
$(ANALYZE_SSL_PRIVATE:%=$(ANALYZE_SSL_SRCDIR)%) \
|
||||
$(ANALYZE_SSL_PUBLIC:%=$(ANALYZE_SSL_SRCDIR)%) \
|
||||
$(ANALYZE_SSL_SOURCES:%=$(ANALYZE_SSL_SRCDIR)%)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# NOTES
|
||||
#
|
||||
# The following variables may be used during the build process,
|
||||
# but are not defined in this file. If they are to be set
|
||||
# to something other than the default blank, then they must
|
||||
# be set by the calling make system.
|
||||
#
|
||||
# ANALYZE_SSL_SRCDIR:
|
||||
# if the build target directory is different from the
|
||||
# module directory (the source directory), then this
|
||||
# variable contains the relative or full path of
|
||||
# the module directory
|
||||
#
|
||||
# LIBARS:
|
||||
# the library archive files (with fully-specified paths) that
|
||||
# executables built from this module directory depend upon
|
||||
#
|
||||
# LIBPATHS:
|
||||
# the paths to search for library archives (specified with
|
||||
# the -L)
|
||||
#
|
||||
# LIBRARIES:
|
||||
# the libraries to use while building executables from
|
||||
# this module directory (specified with the -l)
|
||||
#
|
||||
|
||||
|
||||
|
||||
#
|
||||
# GLOBAL ENVIRONMENT
|
||||
#
|
||||
DEFINES += $(ANALYZE_SSL_DEFINES)
|
||||
INCLUDES += $(ANALYZE_SSL_INCLUDES)
|
||||
LIBPATHS += $(ANALYZE_SSL_LIBPATHS)
|
||||
LIBRARIES += $(ANALYZE_SSL_LIBRARIES)
|
||||
OBJECTS += $(ANALYZE_SSL_OBJECTS)
|
||||
PUBLIC += $(ANALYZE_SSL_PUBLIC)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# GENERIC DEPENDENCIES
|
||||
#
|
||||
# default:
|
||||
# default dependency, must be the first dependency in this makefile
|
||||
#
|
||||
# all:
|
||||
# build everything in this module directory
|
||||
#
|
||||
# build:
|
||||
# make only the toolkit build files of this module directory
|
||||
#
|
||||
# ci:
|
||||
# perform an RCS check-in of this module directory
|
||||
#
|
||||
# clean:
|
||||
# remove the compiled files
|
||||
#
|
||||
# clean_public:
|
||||
# remove the public header files that have been copied
|
||||
# to a public build directory
|
||||
#
|
||||
# objects:
|
||||
# build the object files (this dependency is used for
|
||||
# building the toolkit library)
|
||||
#
|
||||
# private:
|
||||
# build only the private API header files
|
||||
#
|
||||
# public:
|
||||
# build only the public API header files
|
||||
#
|
||||
default: $(ANALYZE_SSL_LIBNAME)
|
||||
default: $(ANALYZE_SSL_PROGRAMS)
|
||||
|
||||
all: $(ANALYZE_SSL_PUBLIC)
|
||||
all: $(ANALYZE_SSL_OBJECTS)
|
||||
all: $(ANALYZE_SSL_LIBNAME)
|
||||
all: $(ANALYZE_SSL_PROGRAMS)
|
||||
build: $(ANALYZE_SSL_PUBLIC)
|
||||
build: $(ANALYZE_SSL_OBJECTS)
|
||||
ci: analyze_ssl_ci
|
||||
clean: analyze_ssl_clean
|
||||
clean_public: analyze_ssl_clean_public
|
||||
objects: $(ANALYZE_SSL_OBJECTS)
|
||||
private: $(ANALYZE_SSL_PRIVATE)
|
||||
public: $(ANALYZE_SSL_PUBLIC)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# LOCAL UTILITY DEPENDENCIES
|
||||
#
|
||||
# utility dependencies are necessary because of some
|
||||
# make-isms having to do with dependencies
|
||||
#
|
||||
|
||||
analyze_ssl_ci:
|
||||
$(CI) $(CIFLAGS) $(ANALYZE_SSL_USED)
|
||||
|
||||
analyze_ssl_clean:
|
||||
$(RM) $(RMFLAGS) $(ANALYZE_SSL_OBJECTS) $(ANALYZE_SSL_LIBNAME) $(ANALYZE_SSL_PROGRAMS)
|
||||
|
||||
analyze_ssl_clean_public:
|
||||
$(RM) $(RMFLAGS) $(ANALYZE_SSL_PUBLIC)
|
||||
|
||||
analyze_ssl_objects: $(ANALYZE_SSL_OBJECTS)
|
||||
|
||||
analyze_ssl_programs: $(ANALYZE_SSL_PROGRAMS)
|
||||
|
||||
analyze_ssl_public: $(ANALYZE_SSL_PUBLIC)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# BUILD DEPENDENCIES
|
||||
#
|
||||
# build dependencies invoke the rule used to build each
|
||||
# class of file
|
||||
#
|
||||
|
||||
$(ANALYZE_SSL_LIBNAME):
|
||||
$(AR) $(ARFLAGS) $@ $?
|
||||
$(RANLIB) $@
|
||||
|
||||
$(ANALYZE_SSL_OBJECTS):
|
||||
$(COMPILE.c) $(ANALYZE_SSL_SRCDIR)$(@:%.o=%.c) $(DEFINES) $(INCLUDES) $(ANALYZE_SSL_LOCALFLAGS)
|
||||
|
||||
$(ANALYZE_SSL_PUBLIC):
|
||||
$(CP) $(CPFLAGS) $(ANALYZE_SSL_SRCDIR)$@ $@
|
||||
|
||||
$(ANALYZE_SSL_PROGRAMS):
|
||||
$(LINK.c) $@.$(OBJSUFFIX) $(LDLIBS) $(LIBS) $(LIBRARIES) $(LIBPATHS)
|
||||
#LIBS above is obsolete (use LIBARARIES instead)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# FILE DEPENDENCIES
|
||||
#
|
||||
# file dependencies state, for each file that is built,
|
||||
# which file(s) it depends upon
|
||||
#
|
||||
|
||||
ciphersuites.$(OBJSUFFIX): $(ANALYZE_SSL_SRCDIR)ciphersuites.c
|
||||
|
||||
ssl.enums.$(OBJSUFFIX): $(ANALYZE_SSL_SRCDIR)ssl.enums.h
|
||||
ssl.enums.$(OBJSUFFIX): $(ANALYZE_SSL_SRCDIR)ssl.enums.c
|
||||
|
||||
ssl_analyze.$(OBJSUFFIX): $(ANALYZE_SSL_SRCDIR)ssl_analyze.h
|
||||
ssl_analyze.$(OBJSUFFIX): $(ANALYZE_SSL_SRCDIR)ssl_analyze.c
|
||||
|
||||
ssl_rec.$(OBJSUFFIX): $(ANALYZE_SSL_SRCDIR)ssl_rec.c
|
||||
|
||||
ssldecode.$(OBJSUFFIX): $(ANALYZE_SSL_SRCDIR)ssldecode.h
|
||||
ssldecode.$(OBJSUFFIX): $(ANALYZE_SSL_SRCDIR)ssldecode.c
|
||||
|
||||
sslprint.$(OBJSUFFIX): $(ANALYZE_SSL_SRCDIR)sslprint.h
|
||||
sslprint.$(OBJSUFFIX): $(ANALYZE_SSL_SRCDIR)sslprint.c
|
||||
|
||||
sslxprint.$(OBJSUFFIX): $(ANALYZE_SSL_SRCDIR)sslxprint.h
|
||||
sslxprint.$(OBJSUFFIX): $(ANALYZE_SSL_SRCDIR)sslxprint.c
|
||||
|
||||
$(ANALYZE_SSL_LIBNAME): $(ANALYZE_SSL_OBJECTS)
|
Loading…
Reference in a new issue