Commit 3efe3e26 authored by unknown's avatar unknown

merged


BitKeeper/etc/logging_ok:
  auto-union
client/mysql.cc:
  automerged
parents a34cb793 89001262
...@@ -2,12 +2,6 @@ cflags="$c_warnings $extra_flags" ...@@ -2,12 +2,6 @@ cflags="$c_warnings $extra_flags"
cxxflags="$cxx_warnings $base_cxxflags $extra_flags" cxxflags="$cxx_warnings $base_cxxflags $extra_flags"
extra_configs="$extra_configs $local_infile_configs" extra_configs="$extra_configs $local_infile_configs"
configure="./configure $base_configs $extra_configs" configure="./configure $base_configs $extra_configs"
for arg
do
# Escape special characters so they don't confuse eval
configure="$configure "`echo "$arg" | \
sed -e 's,\([^a-zA-Z0-9_.=-]\),\\\\\1,g'`
done
commands="\ commands="\
$make -k distclean || true $make -k distclean || true
......
...@@ -29,6 +29,7 @@ EXTRA_DIST = FINISH.sh \ ...@@ -29,6 +29,7 @@ EXTRA_DIST = FINISH.sh \
compile-pentium-debug-max \ compile-pentium-debug-max \
compile-pentium-debug-no-bdb \ compile-pentium-debug-no-bdb \
compile-pentium-debug-openssl \ compile-pentium-debug-openssl \
compile-pentium-debug-yassl \
compile-pentium-gcov \ compile-pentium-gcov \
compile-pentium-gprof \ compile-pentium-gprof \
compile-pentium-max \ compile-pentium-max \
......
...@@ -19,8 +19,23 @@ if test -r /proc/cpuinfo ; then ...@@ -19,8 +19,23 @@ if test -r /proc/cpuinfo ; then
if test -z "$model_name" ; then if test -z "$model_name" ; then
model_name=`uname -m` model_name=`uname -m`
fi fi
else
# Fallback when there is no /proc/cpuinfo
case "`uname -s`" in
FreeBSD)
cpu_family=`uname -m`;
model_name=`sysctl -b hw.model`
;;
*)
cpu_family=`uname -m`;
model_name="unknown";
;;
esac
fi fi
cpu_flag=""
cpu_flag_old=""
case "$cpu_family--$model_name" in case "$cpu_family--$model_name" in
Alpha*EV6*) Alpha*EV6*)
cpu_flag="ev6"; cpu_flag="ev6";
...@@ -28,11 +43,24 @@ case "$cpu_family--$model_name" in ...@@ -28,11 +43,24 @@ case "$cpu_family--$model_name" in
*Xeon*) *Xeon*)
cpu_flag="nocona"; cpu_flag="nocona";
;; ;;
*Pentium*4*Mobile*CPU*)
cpu_flag="pentium4m";
;;
*Pentium*4*CPU*) *Pentium*4*CPU*)
cpu_flag="pentium4"; cpu_flag="pentium4";
;; ;;
*Pentium*III*Mobile*CPU*)
cpu_flag="pentium3m";
;;
*Pentium*III*CPU*)
cpu_flag="pentium3";
;;
*Pentium*M*pro*)
cpu_flag="pentium-m";
;;
*Athlon*64*) *Athlon*64*)
cpu_flag="athlon64"; cpu_flag="athlon64";
cpu_flag_old="athlon";
;; ;;
*Athlon*) *Athlon*)
cpu_flag="athlon"; cpu_flag="athlon";
...@@ -72,6 +100,10 @@ case "$cc_ver--$cc_verno" in ...@@ -72,6 +100,10 @@ case "$cc_ver--$cc_verno" in
check_cpu_cflags="-mtune=$cpu_flag -march=$cpu_flag" check_cpu_cflags="-mtune=$cpu_flag -march=$cpu_flag"
;; ;;
*GCC*) *GCC*)
# Fix for older compiler versions
if test -n "$cpu_flag_old"; then
cpu_flag="$cpu_flag_old"
fi
check_cpu_cflags="-mcpu=$cpu_flag -march=$cpu_flag" check_cpu_cflags="-mcpu=$cpu_flag -march=$cpu_flag"
;; ;;
*) *)
......
#! /bin/sh
path=`dirname $0`
. "$path/SETUP.sh"
c_warnings=""
cxx_warnings=""
fast_cflags="-O3"
base_cxxflags="-fno-handle-exceptions"
# FIXME do we need to link static, not to depend on CodeWarrior libs?
if [ x$MODE = x ] ; then
echo "You need to give an argument, 'standard', 'max', 'debug' or 'debug-max'"
echo "Like: MODE=standard BUILD/compile-darwin-codewarrior"
exit 1
else
case $MODE in
standard|pro-gpl)
# FIXME pro/pro-gpl different libedit/readline
extra_flags="$ppc_cflags $fast_cflags"
;;
pro)
# FIXME pro/pro-gpl different libedit/readline
extra_flags="$ppc_cflags $fast_cflags"
extra_configs="--with-libedit"
;;
max)
extra_flags="$ppc_cflags $fast_cflags"
extra_configs="$max_configs"
;;
debug)
extra_flags="$ppc_cflags $debug_cflags"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$debug_configs"
;;
debug-max)
extra_flags="$ppc_cflags $debug_cflags $max_cflags"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$debug_configs $max_configs"
;;
*)
echo "You need to give an argument, 'standard', 'max', 'debug' or 'debug-max'"
echo "Like: MODE=standard BUILD/compile-darwin-codewarrior"
exit 1
;;
esac
fi
extra_configs="$extra_configs --with-darwin-mwcc"
. "$path/FINISH.sh"
...@@ -18,12 +18,17 @@ autoconf ...@@ -18,12 +18,17 @@ autoconf
# Default to gcc for CC and CXX # Default to gcc for CC and CXX
if test -z "$CXX" ; then if test -z "$CXX" ; then
export CXX=gcc export CXX=gcc
# Set some required compile options
if test -z "$CXXFLAGS" ; then
export CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti"
fi
fi fi
if test -z "$CC" ; then if test -z "$CC" ; then
export CC=gcc export CC=gcc
fi fi
# Use ccache, if available # Use ccache, if available
if ccache -V > /dev/null 2>&1 if ccache -V > /dev/null 2>&1
then then
......
#! /bin/sh
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"
extra_configs="$extra_configs --with-debug=full --with-yassl"
. "$path/FINISH.sh"
...@@ -69,6 +69,7 @@ pager: ...@@ -69,6 +69,7 @@ pager:
hours: hours:
[serg:]checkout:get [serg:]checkout:get
[arjen:]checkout:get [arjen:]checkout:get
[kostja:]checkout:get
[nick:]checkout:get [nick:]checkout:get
checkout:edit checkout:edit
eoln:unix eoln:unix
...@@ -15,6 +15,7 @@ ahlentz@co3064164-a.rochd1.qld.optusnet.com.au ...@@ -15,6 +15,7 @@ ahlentz@co3064164-a.rochd1.qld.optusnet.com.au
akishkin@work.mysql.com akishkin@work.mysql.com
anjuta@arthur.local anjuta@arthur.local
antony@ltantony.dsl-verizon.net antony@ltantony.dsl-verizon.net
antony@ltantony.mysql.com
antony@ltantony.rdg.cyberkinetica.com antony@ltantony.rdg.cyberkinetica.com
antony@ltantony.rdg.cyberkinetica.homeunix.net antony@ltantony.rdg.cyberkinetica.homeunix.net
arjen@bitbike.com arjen@bitbike.com
...@@ -32,6 +33,7 @@ bar@mysql.com ...@@ -32,6 +33,7 @@ bar@mysql.com
bar@noter.intranet.mysql.r18.ru bar@noter.intranet.mysql.r18.ru
bell@51.0.168.192.in-addr.arpa bell@51.0.168.192.in-addr.arpa
bell@52.0.168.192.in-addr.arpa bell@52.0.168.192.in-addr.arpa
bell@book.sanja.is.com.ua
bell@laptop.sanja.is.com.ua bell@laptop.sanja.is.com.ua
bell@sanja.is.com.ua bell@sanja.is.com.ua
bk@admin.bk bk@admin.bk
...@@ -50,6 +52,8 @@ dlenev@build.mysql.com ...@@ -50,6 +52,8 @@ dlenev@build.mysql.com
dlenev@jabberwock.localdomain dlenev@jabberwock.localdomain
dlenev@mysql.com dlenev@mysql.com
ejonore@mc03.ndb.mysql.com ejonore@mc03.ndb.mysql.com
evgen@moonbone.(none)
evgen@moonbone.local
gbichot@production.mysql.com gbichot@production.mysql.com
gbichot@quadita2.mysql.com gbichot@quadita2.mysql.com
gbichot@quadxeon.mysql.com gbichot@quadxeon.mysql.com
...@@ -80,6 +84,7 @@ hf@bisonxp.(none) ...@@ -80,6 +84,7 @@ hf@bisonxp.(none)
hf@deer.(none) hf@deer.(none)
hf@deer.mysql.r18.ru hf@deer.mysql.r18.ru
hf@genie.(none) hf@genie.(none)
holyfoot@mysql.com
igor@hundin.mysql.fi igor@hundin.mysql.fi
igor@linux.local igor@linux.local
igor@rurik.mysql.com igor@rurik.mysql.com
...@@ -94,6 +99,7 @@ jani@dsl-jkl1657.dial.inet.fi ...@@ -94,6 +99,7 @@ jani@dsl-jkl1657.dial.inet.fi
jani@dsl-kpogw4gb5.dial.inet.fi jani@dsl-kpogw4gb5.dial.inet.fi
jani@hynda.(none) jani@hynda.(none)
jani@hynda.mysql.fi jani@hynda.mysql.fi
jani@ibmlab.site
jani@janikt.pp.saunalahti.fi jani@janikt.pp.saunalahti.fi
jani@linux.local jani@linux.local
jani@rhols221.adsl.netsonic.fi jani@rhols221.adsl.netsonic.fi
...@@ -110,6 +116,7 @@ jcole@sarvik.tfr.cafe.ee ...@@ -110,6 +116,7 @@ jcole@sarvik.tfr.cafe.ee
jcole@tetra.spaceapes.com jcole@tetra.spaceapes.com
jimw@mysql.com jimw@mysql.com
joerg@mysql.com joerg@mysql.com
joerg@trift-lap.fambruehe
jon@gigan. jon@gigan.
jonas@mysql.com jonas@mysql.com
joreland@bk-internal.mysql.com joreland@bk-internal.mysql.com
...@@ -120,6 +127,7 @@ kaa@polly.local ...@@ -120,6 +127,7 @@ kaa@polly.local
kaj@work.mysql.com kaj@work.mysql.com
kent@mysql.com kent@mysql.com
konstantin@mysql.com konstantin@mysql.com
kosipov@production.mysql.com
kostja@oak.local kostja@oak.local
lars@mysql.com lars@mysql.com
lenz@kallisto.mysql.com lenz@kallisto.mysql.com
...@@ -175,6 +183,7 @@ mwagner@cash.mwagner.org ...@@ -175,6 +183,7 @@ mwagner@cash.mwagner.org
mwagner@evoq.mwagner.org mwagner@evoq.mwagner.org
mwagner@here.mwagner.org mwagner@here.mwagner.org
mwagner@mysql.com mwagner@mysql.com
mwagner@ultrafly.mysql.com
mwagner@work.mysql.com mwagner@work.mysql.com
mydev@mysql.com mydev@mysql.com
mysql@home.(none) mysql@home.(none)
...@@ -184,6 +193,7 @@ mysqldev@build.mysql2.com ...@@ -184,6 +193,7 @@ mysqldev@build.mysql2.com
mysqldev@melody.local mysqldev@melody.local
mysqldev@mysql.com mysqldev@mysql.com
mysqldev@o2k.irixworld.net mysqldev@o2k.irixworld.net
ndbdev@dl145b.mysql.com
ndbdev@eel.hemma.oreland.se ndbdev@eel.hemma.oreland.se
ndbdev@ndbmaster.mysql.com ndbdev@ndbmaster.mysql.com
ndbdev@shark. ndbdev@shark.
...@@ -216,9 +226,11 @@ ram@deer.(none) ...@@ -216,9 +226,11 @@ ram@deer.(none)
ram@gw.mysql.r18.ru ram@gw.mysql.r18.ru
ram@gw.udmsearch.izhnet.ru ram@gw.udmsearch.izhnet.ru
ram@mysql.r18.ru ram@mysql.r18.ru
ram@ram-book.(none)
ram@ram.(none) ram@ram.(none)
ramil@mysql.com ramil@mysql.com
ranger@regul.home.lan ranger@regul.home.lan
rburnett@bk-internal.mysql.com
rburnett@build.mysql.com rburnett@build.mysql.com
reggie@bob.(none) reggie@bob.(none)
reggie@mdk10.(none) reggie@mdk10.(none)
...@@ -239,6 +251,7 @@ serg@serg.mysql.com ...@@ -239,6 +251,7 @@ serg@serg.mysql.com
serg@sergbook.mylan serg@sergbook.mylan
serg@sergbook.mysql.com serg@sergbook.mysql.com
sergefp@mysql.com sergefp@mysql.com
shuichi@mysql.com
sinisa@rhols221.adsl.netsonic.fi sinisa@rhols221.adsl.netsonic.fi
stewart@mysql.com stewart@mysql.com
svoj@mysql.com svoj@mysql.com
...@@ -266,6 +279,7 @@ tonu@x153.internalnet ...@@ -266,6 +279,7 @@ tonu@x153.internalnet
tonu@x3.internalnet tonu@x3.internalnet
tsmith@build.mysql.com tsmith@build.mysql.com
tulin@build.mysql.com tulin@build.mysql.com
tulin@dl145b.mysql.com
tulin@mysql.com tulin@mysql.com
ulli@morbus.(none) ulli@morbus.(none)
venu@hundin.mysql.fi venu@hundin.mysql.fi
......
...@@ -20,7 +20,7 @@ AUTOMAKE_OPTIONS = foreign ...@@ -20,7 +20,7 @@ AUTOMAKE_OPTIONS = foreign
# These are built from source in the Docs directory # These are built from source in the Docs directory
EXTRA_DIST = INSTALL-SOURCE README COPYING EXCEPTIONS-CLIENT EXTRA_DIST = INSTALL-SOURCE README COPYING EXCEPTIONS-CLIENT
SUBDIRS = . include @docs_dirs@ @zlib_dir@ \ SUBDIRS = . include @docs_dirs@ @zlib_dir@ @yassl_dir@ \
@readline_topdir@ sql-common \ @readline_topdir@ sql-common \
@thread_dirs@ pstack \ @thread_dirs@ pstack \
@sql_union_dirs@ scripts man tests \ @sql_union_dirs@ scripts man tests \
...@@ -102,5 +102,10 @@ tags: ...@@ -102,5 +102,10 @@ tags:
test: test:
cd mysql-test; ./mysql-test-run && ./mysql-test-run --ps-protocol cd mysql-test; ./mysql-test-run && ./mysql-test-run --ps-protocol
test-force:
cd mysql-test; \
mysql-test-run --force ;\
mysql-test-run --ps-protocol --force
# Don't update the files from bitkeeper # Don't update the files from bitkeeper
%::SCCS/s.% %::SCCS/s.%
...@@ -30,10 +30,10 @@ noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \ ...@@ -30,10 +30,10 @@ noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \
mysql_SOURCES = mysql.cc readline.cc sql_string.cc completion_hash.cc mysql_SOURCES = mysql.cc readline.cc sql_string.cc completion_hash.cc
mysqladmin_SOURCES = mysqladmin.cc mysqladmin_SOURCES = mysqladmin.cc
mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) $(CXXLDFLAGS) mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) $(CXXLDFLAGS)
mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS)
mysqltest_SOURCES= mysqltest.c $(top_srcdir)/mysys/my_getsystime.c mysqltest_SOURCES= mysqltest.c $(top_srcdir)/mysys/my_getsystime.c
mysqltest_LDADD = $(top_builddir)/regex/libregex.a $(LDADD) mysqltest_LDADD = $(top_builddir)/regex/libregex.a $(LDADD)
mysqlbinlog_SOURCES = mysqlbinlog.cc $(top_srcdir)/mysys/mf_tempdir.c mysqlbinlog_SOURCES = mysqlbinlog.cc $(top_srcdir)/mysys/mf_tempdir.c $(top_srcdir)/mysys/my_new.cc
mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS)
mysqltestmanagerc_SOURCES = mysqlmanagerc.c mysqltestmanagerc_SOURCES = mysqlmanagerc.c
mysqltestmanager_pwgen_SOURCES = mysqlmanager-pwgen.c mysqltestmanager_pwgen_SOURCES = mysqlmanager-pwgen.c
sql_src=log_event.h mysql_priv.h log_event.cc my_decimal.h my_decimal.cc sql_src=log_event.h mysql_priv.h log_event.cc my_decimal.h my_decimal.cc
......
...@@ -45,10 +45,9 @@ enum options_client ...@@ -45,10 +45,9 @@ enum options_client
OPT_COMPATIBLE, OPT_RECONNECT, OPT_DELIMITER, OPT_SECURE_AUTH, OPT_COMPATIBLE, OPT_RECONNECT, OPT_DELIMITER, OPT_SECURE_AUTH,
OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_CREATE_OPTIONS, OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_CREATE_OPTIONS,
OPT_START_POSITION, OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME, OPT_START_POSITION, OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME,
OPT_SIGINT_IGNORE, OPT_HEXBLOB, OPT_ORDER_BY_PRIMARY OPT_SIGINT_IGNORE, OPT_HEXBLOB, OPT_ORDER_BY_PRIMARY, OPT_COUNT,
#ifdef HAVE_NDBCLUSTER_DB #ifdef HAVE_NDBCLUSTER_DB
,OPT_NDBCLUSTER,OPT_NDB_CONNECTSTRING OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING,
#endif #endif
,OPT_IGNORE_TABLE OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS
,OPT_SHOW_WARNINGS
}; };
...@@ -720,9 +720,15 @@ static void usage(int version) ...@@ -720,9 +720,15 @@ static void usage(int version)
const char* readline= "readline"; const char* readline= "readline";
#endif #endif
#ifdef HAVE_READLINE
printf("%s Ver %s Distrib %s, for %s (%s) using %s %s\n", printf("%s Ver %s Distrib %s, for %s (%s) using %s %s\n",
my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE, my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE,
readline, rl_library_version); readline, rl_library_version);
#else
printf("%s Ver %s Distrib %s, for %s (%s)", my_progname, VER,
MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
#endif
if (version) if (version)
return; return;
printf("\ printf("\
...@@ -966,7 +972,8 @@ static int read_lines(bool execute_commands) ...@@ -966,7 +972,8 @@ static int read_lines(bool execute_commands)
} }
else else
{ {
char *prompt= (char*) (glob_buffer.is_empty() ? construct_prompt() : char *prompt= (char*) (ml_comment ? " /*> " :
glob_buffer.is_empty() ? construct_prompt() :
!in_string ? " -> " : !in_string ? " -> " :
in_string == '\'' ? in_string == '\'' ?
" '> " : (in_string == '`' ? " '> " : (in_string == '`' ?
...@@ -1103,6 +1110,7 @@ static bool add_line(String &buffer,char *line,char *in_string, ...@@ -1103,6 +1110,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
uchar inchar; uchar inchar;
char buff[80], *pos, *out; char buff[80], *pos, *out;
COMMANDS *com; COMMANDS *com;
bool need_space= 0;
if (!line[0] && buffer.is_empty()) if (!line[0] && buffer.is_empty())
return 0; return 0;
...@@ -1211,6 +1219,7 @@ static bool add_line(String &buffer,char *line,char *in_string, ...@@ -1211,6 +1219,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
{ {
pos++; pos++;
*ml_comment= 0; *ml_comment= 0;
need_space= 1;
} }
else else
{ // Add found char to buffer { // Add found char to buffer
...@@ -1220,9 +1229,16 @@ static bool add_line(String &buffer,char *line,char *in_string, ...@@ -1220,9 +1229,16 @@ static bool add_line(String &buffer,char *line,char *in_string,
(inchar == '\'' || inchar == '"' || inchar == '`')) (inchar == '\'' || inchar == '"' || inchar == '`'))
*in_string= (char) inchar; *in_string= (char) inchar;
if (!*ml_comment) if (!*ml_comment)
{
if (need_space && !my_isspace(charset_info, (char)inchar))
{
*out++= ' ';
need_space= 0;
}
*out++= (char) inchar; *out++= (char) inchar;
} }
} }
}
if (out != line || !buffer.is_empty()) if (out != line || !buffer.is_empty())
{ {
*out++='\n'; *out++='\n';
......
...@@ -727,7 +727,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -727,7 +727,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
void (*func) (MYSQL_RES*, MYSQL_ROW, uint); void (*func) (MYSQL_RES*, MYSQL_ROW, uint);
new_line = 1; new_line = 1;
if (mysql_query(mysql, "show status") || if (mysql_query(mysql, "show /*!50002 GLOBAL */ status") ||
!(res = mysql_store_result(mysql))) !(res = mysql_store_result(mysql)))
{ {
my_printf_error(0, "unable to show status; error: '%s'", MYF(ME_BELL), my_printf_error(0, "unable to show status; error: '%s'", MYF(ME_BELL),
...@@ -1346,6 +1346,3 @@ static my_bool wait_pidfile(char *pidfile, time_t last_modified, ...@@ -1346,6 +1346,3 @@ static my_bool wait_pidfile(char *pidfile, time_t last_modified,
} }
DBUG_RETURN(error); DBUG_RETURN(error);
} }
#ifdef __GNUC__
FIX_GCC_LINKING_PROBLEM
#endif
...@@ -1458,4 +1458,3 @@ int main(int argc, char** argv) ...@@ -1458,4 +1458,3 @@ int main(int argc, char** argv)
#include "log_event.cc" #include "log_event.cc"
#endif #endif
FIX_GCC_LINKING_PROBLEM
...@@ -83,7 +83,7 @@ static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick= 1, extended_insert= 1, ...@@ -83,7 +83,7 @@ static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick= 1, extended_insert= 1,
opt_autocommit=0,opt_disable_keys=1,opt_xml=0, opt_autocommit=0,opt_disable_keys=1,opt_xml=0,
opt_delete_master_logs=0, tty_password=0, opt_delete_master_logs=0, tty_password=0,
opt_single_transaction=0, opt_comments= 0, opt_compact= 0, opt_single_transaction=0, opt_comments= 0, opt_compact= 0,
opt_hex_blob=0, opt_order_by_primary=0; opt_hex_blob=0, opt_order_by_primary=0, opt_ignore=0;
static ulong opt_max_allowed_packet, opt_net_buffer_length; static ulong opt_max_allowed_packet, opt_net_buffer_length;
static MYSQL mysql_connection,*sock=0; static MYSQL mysql_connection,*sock=0;
static char insert_pat[12 * 1024],*opt_password=0,*current_user=0, static char insert_pat[12 * 1024],*opt_password=0,*current_user=0,
...@@ -257,6 +257,9 @@ static struct my_option my_long_options[] = ...@@ -257,6 +257,9 @@ static struct my_option my_long_options[] =
"use the directive multiple times, once for each table. Each table must " "use the directive multiple times, once for each table. Each table must "
"be specified with both database and table names, e.g. --ignore-table=database.table", "be specified with both database and table names, e.g. --ignore-table=database.table",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"insert-ignore", OPT_INSERT_IGNORE, "Insert rows with INSERT IGNORE.",
(gptr*) &opt_ignore, (gptr*) &opt_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"lines-terminated-by", OPT_LTB, "Lines in the i.file are terminated by ...", {"lines-terminated-by", OPT_LTB, "Lines in the i.file are terminated by ...",
(gptr*) &lines_terminated, (gptr*) &lines_terminated, 0, GET_STR, (gptr*) &lines_terminated, (gptr*) &lines_terminated, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
...@@ -1100,13 +1103,15 @@ static uint get_table_structure(char *table, char *db) ...@@ -1100,13 +1103,15 @@ static uint get_table_structure(char *table, char *db)
my_bool init=0; my_bool init=0;
uint numFields; uint numFields;
char *strpos, *result_table, *opt_quoted_table; char *strpos, *result_table, *opt_quoted_table;
const char *delayed; const char *insert_option;
char name_buff[NAME_LEN+3],table_buff[NAME_LEN*2+3]; char name_buff[NAME_LEN+3],table_buff[NAME_LEN*2+3];
char table_buff2[NAME_LEN*2+3]; char table_buff2[NAME_LEN*2+3];
FILE *sql_file = md_result_file; FILE *sql_file = md_result_file;
DBUG_ENTER("get_table_structure"); DBUG_ENTER("get_table_structure");
delayed= opt_delayed ? " DELAYED " : ""; insert_option= (opt_delayed && opt_ignore) ? " DELAYED IGNORE " :
opt_delayed ? " DELAYED " :
opt_ignore ? " IGNORE " : "";
if (verbose) if (verbose)
fprintf(stderr, "-- Retrieving table structure for table %s...\n", table); fprintf(stderr, "-- Retrieving table structure for table %s...\n", table);
...@@ -1190,11 +1195,11 @@ static uint get_table_structure(char *table, char *db) ...@@ -1190,11 +1195,11 @@ static uint get_table_structure(char *table, char *db)
if (cFlag) if (cFlag)
my_snprintf(insert_pat, sizeof(insert_pat), "INSERT %sINTO %s (", my_snprintf(insert_pat, sizeof(insert_pat), "INSERT %sINTO %s (",
delayed, opt_quoted_table); insert_option, opt_quoted_table);
else else
{ {
my_snprintf(insert_pat, sizeof(insert_pat), "INSERT %sINTO %s VALUES ", my_snprintf(insert_pat, sizeof(insert_pat), "INSERT %sINTO %s VALUES ",
delayed, opt_quoted_table); insert_option, opt_quoted_table);
if (!extended_insert) if (!extended_insert)
strcat(insert_pat,"("); strcat(insert_pat,"(");
} }
...@@ -1258,11 +1263,11 @@ static uint get_table_structure(char *table, char *db) ...@@ -1258,11 +1263,11 @@ static uint get_table_structure(char *table, char *db)
} }
if (cFlag) if (cFlag)
my_snprintf(insert_pat, sizeof(insert_pat), "INSERT %sINTO %s (", my_snprintf(insert_pat, sizeof(insert_pat), "INSERT %sINTO %s (",
delayed, result_table); insert_option, result_table);
else else
{ {
my_snprintf(insert_pat, sizeof(insert_pat), "INSERT %sINTO %s VALUES ", my_snprintf(insert_pat, sizeof(insert_pat), "INSERT %sINTO %s VALUES ",
delayed, result_table); insert_option, result_table);
if (!extended_insert) if (!extended_insert)
strcat(insert_pat,"("); strcat(insert_pat,"(");
} }
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <sslopt-vars.h> #include <sslopt-vars.h>
static my_string host=0,opt_password=0,user=0; static my_string host=0,opt_password=0,user=0;
static my_bool opt_show_keys= 0, opt_compress= 0, opt_status= 0, static my_bool opt_show_keys= 0, opt_compress= 0, opt_count=0, opt_status= 0,
tty_password= 0, opt_table_type= 0; tty_password= 0, opt_table_type= 0;
static uint opt_verbose=0; static uint opt_verbose=0;
static char *default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME; static char *default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME;
...@@ -71,8 +71,7 @@ int main(int argc, char **argv) ...@@ -71,8 +71,7 @@ int main(int argc, char **argv)
char *pos= argv[argc-1], *to; char *pos= argv[argc-1], *to;
for (to= pos ; *pos ; pos++, to++) for (to= pos ; *pos ; pos++, to++)
{ {
switch (*pos) switch (*pos) {
{
case '*': case '*':
*pos= '%'; *pos= '%';
first_argument_uses_wildcards= 1; first_argument_uses_wildcards= 1;
...@@ -163,6 +162,10 @@ static struct my_option my_long_options[] = ...@@ -163,6 +162,10 @@ static struct my_option my_long_options[] =
{"default-character-set", OPT_DEFAULT_CHARSET, {"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", (gptr*) &default_charset, "Set the default character set.", (gptr*) &default_charset,
(gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, (gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"count", OPT_COUNT,
"Show number of rows per table (may be slow for not MyISAM tables)",
(gptr*) &opt_count, (gptr*) &opt_count, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"compress", 'C', "Use compression in server/client protocol.", {"compress", 'C', "Use compression in server/client protocol.",
(gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0, (gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
...@@ -308,6 +311,14 @@ get_options(int *argc,char ***argv) ...@@ -308,6 +311,14 @@ get_options(int *argc,char ***argv)
if (tty_password) if (tty_password)
opt_password=get_tty_password(NullS); opt_password=get_tty_password(NullS);
if (opt_count)
{
/*
We need to set verbose to 2 as we need to change the output to include
the number-of-rows column
*/
opt_verbose= 2;
}
return; return;
} }
...@@ -322,7 +333,7 @@ list_dbs(MYSQL *mysql,const char *wild) ...@@ -322,7 +333,7 @@ list_dbs(MYSQL *mysql,const char *wild)
char query[255]; char query[255];
MYSQL_FIELD *field; MYSQL_FIELD *field;
MYSQL_RES *result; MYSQL_RES *result;
MYSQL_ROW row, trow, rrow; MYSQL_ROW row, rrow;
if (!(result=mysql_list_dbs(mysql,wild))) if (!(result=mysql_list_dbs(mysql,wild)))
{ {
...@@ -352,11 +363,6 @@ list_dbs(MYSQL *mysql,const char *wild) ...@@ -352,11 +363,6 @@ list_dbs(MYSQL *mysql,const char *wild)
if (opt_verbose) if (opt_verbose)
{ {
/*
* Original code by MG16373; Slightly modified by Monty.
* Print now the count of tables and rows for each database.
*/
if (!(mysql_select_db(mysql,row[0]))) if (!(mysql_select_db(mysql,row[0])))
{ {
MYSQL_RES *tresult = mysql_list_tables(mysql,(char*)NULL); MYSQL_RES *tresult = mysql_list_tables(mysql,(char*)NULL);
...@@ -366,6 +372,8 @@ list_dbs(MYSQL *mysql,const char *wild) ...@@ -366,6 +372,8 @@ list_dbs(MYSQL *mysql,const char *wild)
rowcount = 0; rowcount = 0;
if (opt_verbose > 1) if (opt_verbose > 1)
{ {
/* Print the count of tables and rows for each database */
MYSQL_ROW trow;
while ((trow = mysql_fetch_row(tresult))) while ((trow = mysql_fetch_row(tresult)))
{ {
sprintf(query,"SELECT COUNT(*) FROM `%s`",trow[0]); sprintf(query,"SELECT COUNT(*) FROM `%s`",trow[0]);
...@@ -487,10 +495,6 @@ list_tables(MYSQL *mysql,const char *db,const char *table) ...@@ -487,10 +495,6 @@ list_tables(MYSQL *mysql,const char *db,const char *table)
while ((row = mysql_fetch_row(result))) while ((row = mysql_fetch_row(result)))
{ {
/*
* Modified by MG16373
* Print now the count of rows for each table.
*/
counter++; counter++;
if (opt_verbose > 0) if (opt_verbose > 0)
{ {
...@@ -510,6 +514,7 @@ list_tables(MYSQL *mysql,const char *db,const char *table) ...@@ -510,6 +514,7 @@ list_tables(MYSQL *mysql,const char *db,const char *table)
if (opt_verbose > 1) if (opt_verbose > 1)
{ {
/* Print the count of rows for each table */
sprintf(query,"SELECT COUNT(*) FROM `%s`",row[0]); sprintf(query,"SELECT COUNT(*) FROM `%s`",row[0]);
if (!(mysql_query(mysql,query))) if (!(mysql_query(mysql,query)))
{ {
...@@ -574,7 +579,7 @@ list_table_status(MYSQL *mysql,const char *db,const char *wild) ...@@ -574,7 +579,7 @@ list_table_status(MYSQL *mysql,const char *db,const char *wild)
MYSQL_RES *result; MYSQL_RES *result;
MYSQL_ROW row; MYSQL_ROW row;
end=strxmov(query,"show table status from ",db,NullS); end=strxmov(query,"show table status from `",db,"`",NullS);
if (wild && wild[0]) if (wild && wild[0])
strxmov(end," like '",wild,"'",NullS); strxmov(end," like '",wild,"'",NullS);
if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql))) if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql)))
...@@ -600,8 +605,8 @@ list_table_status(MYSQL *mysql,const char *db,const char *wild) ...@@ -600,8 +605,8 @@ list_table_status(MYSQL *mysql,const char *db,const char *wild)
} }
/* /*
** list fields uses field interface as an example of how to parse list fields uses field interface as an example of how to parse
** a MYSQL FIELD a MYSQL FIELD
*/ */
static int static int
...@@ -612,6 +617,7 @@ list_fields(MYSQL *mysql,const char *db,const char *table, ...@@ -612,6 +617,7 @@ list_fields(MYSQL *mysql,const char *db,const char *table,
MYSQL_RES *result; MYSQL_RES *result;
MYSQL_ROW row; MYSQL_ROW row;
ulong rows; ulong rows;
LINT_INIT(rows);
if (mysql_select_db(mysql,db)) if (mysql_select_db(mysql,db))
{ {
...@@ -619,6 +625,9 @@ list_fields(MYSQL *mysql,const char *db,const char *table, ...@@ -619,6 +625,9 @@ list_fields(MYSQL *mysql,const char *db,const char *table,
mysql_error(mysql)); mysql_error(mysql));
return 1; return 1;
} }
if (opt_count)
{
sprintf(query,"select count(*) from `%s`", table); sprintf(query,"select count(*) from `%s`", table);
if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql))) if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql)))
{ {
...@@ -626,9 +635,10 @@ list_fields(MYSQL *mysql,const char *db,const char *table, ...@@ -626,9 +635,10 @@ list_fields(MYSQL *mysql,const char *db,const char *table,
my_progname,db,table,mysql_error(mysql)); my_progname,db,table,mysql_error(mysql));
return 1; return 1;
} }
row = mysql_fetch_row(result); row= mysql_fetch_row(result);
rows = (ulong) strtoull(row[0], (char**) 0, 10); rows= (ulong) strtoull(row[0], (char**) 0, 10);
mysql_free_result(result); mysql_free_result(result);
}
end=strmov(strmov(strmov(query,"show /*!32332 FULL */ columns from `"),table),"`"); end=strmov(strmov(strmov(query,"show /*!32332 FULL */ columns from `"),table),"`");
if (wild && wild[0]) if (wild && wild[0])
...@@ -640,8 +650,9 @@ list_fields(MYSQL *mysql,const char *db,const char *table, ...@@ -640,8 +650,9 @@ list_fields(MYSQL *mysql,const char *db,const char *table,
return 1; return 1;
} }
printf("Database: %s Table: %s Rows: %lu", db, table, rows); printf("Database: %s Table: %s", db, table);
if (opt_count)
printf(" Rows: %lu", rows);
if (wild && wild[0]) if (wild && wild[0])
printf(" Wildcard: %s",wild); printf(" Wildcard: %s",wild);
putchar('\n'); putchar('\n');
...@@ -675,7 +686,7 @@ list_fields(MYSQL *mysql,const char *db,const char *table, ...@@ -675,7 +686,7 @@ list_fields(MYSQL *mysql,const char *db,const char *table,
/***************************************************************************** /*****************************************************************************
** General functions to print a nice ascii-table from data General functions to print a nice ascii-table from data
*****************************************************************************/ *****************************************************************************/
static void static void
......
...@@ -22,9 +22,9 @@ libedit_a_DEPENDENCIES = @LIBEDIT_LOBJECTS@ ...@@ -22,9 +22,9 @@ libedit_a_DEPENDENCIES = @LIBEDIT_LOBJECTS@
pkginclude_HEADERS = readline/readline.h pkginclude_HEADERS = readline/readline.h
noinst_HEADERS = chared.h el.h histedit.h key.h parse.h refresh.h sig.h \ noinst_HEADERS = chared.h el.h el_term.h histedit.h key.h parse.h refresh.h sig.h \
sys.h tokenizer.h config.h hist.h map.h prompt.h read.h \ sys.h tokenizer.h config.h hist.h map.h prompt.h read.h \
search.h tty.h libedit_term.h search.h tty.h libedit_term.h vis.h
EXTRA_DIST = makelist.sh np/unvis.c np/strlcpy.c np/vis.c np/vis.h np/strlcat.c np/fgetln.c EXTRA_DIST = makelist.sh np/unvis.c np/strlcpy.c np/vis.c np/vis.h np/strlcat.c np/fgetln.c
......
...@@ -2,8 +2,10 @@ ...@@ -2,8 +2,10 @@
#include "my_config.h" #include "my_config.h"
#include "sys.h" #include "sys.h"
#if defined(LIBC_SCCS) && !defined(lint)
#define __RCSID(x) #define __RCSID(x)
#define __COPYRIGHT(x) #define __COPYRIGHT(x)
#endif
#define __RENAME(x) #define __RENAME(x)
#define _DIAGASSERT(x) #define _DIAGASSERT(x)
......
...@@ -346,7 +346,7 @@ get_term_capabilities (bp) ...@@ -346,7 +346,7 @@ get_term_capabilities (bp)
register unsigned int i; register unsigned int i;
for (i = 0; i < NUM_TC_STRINGS; i++) for (i = 0; i < NUM_TC_STRINGS; i++)
# ifdef __LCC__ # if defined(__LCC__) || defined(__MWERKS__)
*(tc_strings[i].tc_value) = tgetstr ((char *)tc_strings[i].tc_var, bp); *(tc_strings[i].tc_value) = tgetstr ((char *)tc_strings[i].tc_var, bp);
# else # else
*(tc_strings[i].tc_value) = tgetstr (tc_strings[i].tc_var, bp); *(tc_strings[i].tc_value) = tgetstr (tc_strings[i].tc_var, bp);
......
...@@ -646,8 +646,8 @@ m4_define([_AC_PROG_CXX_EXIT_DECLARATION], ...@@ -646,8 +646,8 @@ m4_define([_AC_PROG_CXX_EXIT_DECLARATION],
'void exit (int);' \ 'void exit (int);' \
'#include <stdlib.h>' '#include <stdlib.h>'
do do
_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([@%:@include <stdlib.h> _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration
$ac_declaration], @%:@include <stdlib.h>],
[exit (42);])], [exit (42);])],
[], [],
[continue]) [continue])
...@@ -693,3 +693,20 @@ dnl --------------------------------------------------------------------------- ...@@ -693,3 +693,20 @@ dnl ---------------------------------------------------------------------------
dnl END OF MYSQL_CHECK_BIG_TABLES SECTION dnl END OF MYSQL_CHECK_BIG_TABLES SECTION
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl MYSQL_NEEDS_MYSYS_NEW
AC_DEFUN([MYSQL_NEEDS_MYSYS_NEW],
[AC_CACHE_CHECK([needs mysys_new helpers], mysql_use_mysys_new,
[
AC_LANG_PUSH(C++)
AC_TRY_LINK([], [
class A { public: int b; }; A *a=new A; a->b=10; delete a;
], mysql_use_mysys_new=no, mysql_use_mysys_new=yes)
AC_LANG_POP(C++)
])
if test "$mysql_use_mysys_new" = "yes"
then
AC_DEFINE([USE_MYSYS_NEW], [1], [Needs to use mysys_new helpers])
fi
])
AC_CONFIG_FILES(extra/yassl/Makefile dnl
extra/yassl/taocrypt/Makefile dnl
extra/yassl/taocrypt/src/Makefile dnl
extra/yassl/src/Makefile)
AC_DEFUN([MYSQL_CHECK_YASSL], [
AC_MSG_CHECKING(for yaSSL)
AC_ARG_WITH([yassl],
[ --with-yassl Include the yaSSL support],
[yassl=yes],
[yassl=no])
if test "$yassl" = "yes"
then
if test "$openssl" != "no"
then
AC_MSG_ERROR([Cannot configure MySQL to use yaSSL and OpenSSL simultaneously.])
fi
AC_MSG_RESULT([using bundled yaSSL])
yassl_dir="extra/yassl"
openssl_libs="\
\$(top_builddir)/extra/yassl/src/libyassl.a\
\$(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.a"
openssl_includes="-I\$(top_srcdir)/extra/yassl/include"
AC_DEFINE([HAVE_OPENSSL], [1], [Defined by configure. Using yaSSL for OpenSSL emulation.])
else
yassl_dir=""
AC_MSG_RESULT(no)
fi
AC_SUBST(openssl_libs)
AC_SUBST(openssl_includes)
AC_SUBST(yassl_dir)
])
This diff is collapsed.
...@@ -24,6 +24,7 @@ BUILT_SOURCES= $(top_builddir)/include/mysqld_error.h \ ...@@ -24,6 +24,7 @@ BUILT_SOURCES= $(top_builddir)/include/mysqld_error.h \
$(top_builddir)/include/mysqld_ername.h $(top_builddir)/include/mysqld_ername.h
pkginclude_HEADERS= $(BUILT_SOURCES) pkginclude_HEADERS= $(BUILT_SOURCES)
CLEANFILES = $(BUILT_SOURCES) CLEANFILES = $(BUILT_SOURCES)
DIST_SUBDIRS= yassl
# This will build mysqld_error.h and sql_state.h # This will build mysqld_error.h and sql_state.h
$(top_builddir)/include/mysqld_error.h: comp_err $(top_builddir)/include/mysqld_error.h: comp_err
......
...@@ -27,12 +27,20 @@ ...@@ -27,12 +27,20 @@
const char *config_file="my"; /* Default config file */ const char *config_file="my"; /* Default config file */
uint verbose= 0, opt_defaults_file_used= 0; uint verbose= 0, opt_defaults_file_used= 0;
const char *default_dbug_option="d:t:o,/tmp/my_print_defaults.trace";
static struct my_option my_long_options[] = static struct my_option my_long_options[] =
{ {
{"config-file", 'c', "The config file to be used.", {"config-file", 'c', "The config file to be used.",
(gptr*) &config_file, (gptr*) &config_file, 0, GET_STR, REQUIRED_ARG, (gptr*) &config_file, (gptr*) &config_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
#ifdef DBUG_OFF
{"debug", '#', "This is a non-debug version. Catch this and exit",
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else
{"debug", '#', "Output debug log", (gptr*) &default_dbug_option,
(gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"defaults-file", 'c', "Synonym for --config-file.", {"defaults-file", 'c', "Synonym for --config-file.",
(gptr*) &config_file, (gptr*) &config_file, 0, GET_STR, REQUIRED_ARG, (gptr*) &config_file, (gptr*) &config_file, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
...@@ -68,6 +76,7 @@ static void usage(my_bool version) ...@@ -68,6 +76,7 @@ static void usage(my_bool version)
puts("Prints all arguments that is give to some program using the default files"); puts("Prints all arguments that is give to some program using the default files");
printf("Usage: %s [OPTIONS] groups\n", my_progname); printf("Usage: %s [OPTIONS] groups\n", my_progname);
my_print_help(my_long_options); my_print_help(my_long_options);
my_print_default_files(config_file);
my_print_variables(my_long_options); my_print_variables(my_long_options);
printf("\nExample usage:\n%s --config-file=my client mysql\n", my_progname); printf("\nExample usage:\n%s --config-file=my client mysql\n", my_progname);
} }
...@@ -95,6 +104,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -95,6 +104,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case 'V': case 'V':
usage(1); usage(1);
exit(0); exit(0);
case '#':
DBUG_PUSH(argument ? argument : default_dbug_option);
break;
} }
return 0; return 0;
} }
...@@ -118,7 +130,7 @@ static int get_options(int *argc,char ***argv) ...@@ -118,7 +130,7 @@ static int get_options(int *argc,char ***argv)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int count, error; int count, error;
char **load_default_groups, *tmp_arguments[2], char **load_default_groups, *tmp_arguments[3],
**argument, **arguments; **argument, **arguments;
char *defaults, *extra_defaults; char *defaults, *extra_defaults;
MY_INIT(argv[0]); MY_INIT(argv[0]);
......
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need
`configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a
time in the source code directory. After you have installed the
package for one architecture, use `make distclean' before reconfiguring
for another architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
will cause the specified gcc to be used as the C compiler (unless it is
overridden in the site shell script).
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
SUBDIRS = taocrypt src
EXTRA_DIST = yassl.dsp yassl.dsw mySTL/*.hpp
yaSSL Release notes, version 0.9.6
This release of yaSSL contains minor bug fixes, removal of STL support, and
removal of exceptions and rtti so that the library can be linked without the
std c++ library.
--To build on Linux, Solaris, FreeBSD, Mac OS X, or Cygwin
./configure
make
run testsuite from yaSSL-Home/testsuite to test the build
--To build on Win32
Choose (Re)Build All from the project workspace
run Debug\testsuite.exe from yaSSL-Home\testsuite to test the build
******************yaSSL Release notes, version 0.9.2
This release of yaSSL contains minor bug fixes, expanded certificate
verification and chaining, and improved documentation.
Please see build instructions in release notes 0.3.0.
******************yaSSL Release notes, version 0.9.0
This release of yaSSL contains minor bug fixes, client verification handling,
hex and base64 encoing/decoding, and an improved test suite.
Please see build instructions in release notes 0.3.0.
******************yaSSL Release notes, version 0.8.0
This release of yaSSL contains minor bug fixes, and initial porting effort to
64bit, BigEndian, and more UNIX systems.
Please see build instructions in release notes 0.3.0.
******************yaSSL Release notes, version 0.6.0
This release of yaSSL contains minor bug fixes, source cleanup, and binary beta
(1) of the yaSSL libraries.
Please see build instructions in release notes 0.3.0.
******************yaSSL Release notes, version 0.5.0
This release of yaSSL contains minor bug fixes, full session resumption
support, and initial testing suite support.
Please see build instructions in release notes 0.3.0.
******************yaSSL Release notes, version 0.4.0
This release of yaSSL contains minor bug fixes, an optional memory tracker,
an echo client and server with input/output redirection for load testing,
and initial session caching support.
Please see build instructions in release notes 0.3.0.
******************yaSSL Release notes, version 0.3.5
This release of yaSSL contains minor bug fixes and extensions to the crypto
library including a full test suite.
*******************yaSSL Release notes, version 0.3.0
This release of yaSSL contains minor bug fixes and extensions to the crypto
library including AES and an improved random number generator. GNU autoconf
and automake are now used to simplify the build process on Linux.
*** Linux Build process
./configure
make
*** Windows Build process
open the yassl workspace and build the project
*******************yaSSL Release notes, version 0.2.9
This release of yaSSL contains minor bug fixes and extensions to the crypto
library.
See the notes at the bottom of this page for build instructions.
*******************yaSSL Release notes, version 0.2.5
This release of yaSSL contains minor bug fixes and a beta binary of the yaSSL
libraries for win32 and linux.
See the notes at the bottom of this page for build instructions.
*******************yaSSL Release notes, version 0.2.0
This release of yaSSL contains minor bug fixes and initial alternate crypto
functionality.
*** Complete Build ***
See the notes in Readme.txt for build instructions.
*** Update Build ***
If you have already done a complete build of yaSSL as described in the release
0.0.1 - 0.1.0 notes and downloaded the update to 0.2.0, place the update file
yassl-update-0.2.0.tar.gz in the yaSSL home directory and issue the command:
gzip -cd yassl-update-0.2.0.tar.gz | tar xvf -
to update the previous release.
Then issue the make command on linux or rebuild the yaSSL project on Windows.
*******************yaSSL Release notes, version 0.1.0
This release of yaSSL contains minor bug fixes, full client and server TLSv1
support including full ephemeral Diffie-Hellman support, SSL type RSA and DSS
signing and verification, and initial stunnel 4.05 build support.
*********************yaSSL Release notes, version 0.0.3
The third release of yaSSL contains minor bug fixes, client certificate
enhancements, and initial ephemeral Diffie-Hellman integration:
*********************
yaSSL Release notes, version 0.0.2
The second release of yaSSL contains minor bug fixes, client certificate
enhancements, session resumption, and improved TLS support including:
- HMAC for MD5 and SHA-1
- PRF (pseudo random function)
- Master Secret and Key derivation routines
- Record Authentication codes
- Finish verify data check
Once ephemeral RSA and DH are added yaSSL will be fully complaint with TLS.
**********************
yassl Release notes, version 0.0.1
The first release of yassl supports normal RSA mode SSLv3 connections with
support for SHA-1 and MD5 digests. Ciphers include DES, 3DES, and RC4.
yassl uses the CryptoPP library for cryptography, the source is available at
www.cryptopp.com .
yassl uses CML (the Certificate Management Library) for x509 support. More
features will be in future versions. The CML source is available for download
from www.digitalnet.com/knowledge/cml_home.htm .
The next release of yassl will support the 3 lesser-used SSL connection modes;
HandShake resumption, Ephemeral RSA (or DH), and Client Authentication as well
as full support for TLS. Backwards support for SSLv2 is not planned at this
time.
**********************
Building yassl on linux:
use the ./buildall script to build everything.
buildall will configure and build CML, CryptoPP, and yassl. Testing was
preformed with gcc version 3.3.2 on kernel 2.4.22.
**********************
Building yassl on Windows:
Testing was preformed on Windows 2000 with Visual C++ 6 sp5.
1) decompress esnacc_r16.tgz in place, see buildall for syntax if unsure
2) decompress smp_r23.tgz in place
3) unzip cryptopp51/crypto51.zip in place
4) Build SNACC (part of CML) using snacc_builds.dsw in the SNACC directory
5) Build SMP (part of CMP) using smp.dsw in the smp directory
6) Build yassl using yassl.dsw
**********************
examples, server and client:
Please see the server and client examples in both versions to see how to link
to yassl and the support libraries. On linux do 'make server' and 'make
client' to build them. On Windows you will find the example projects in the
main workspace, yassl.dsw.
The example server and client are compatible with openssl.
**********************
Building yassl into mysql on linux:
Testing was done using mysql version 4.0.17.
alter openssl_libs in the configure file, line 21056. Change '-lssl -lcrypto'
to '-lyassl -lcryptopp -lcmapi -lcmlasn -lctil -lc++asn1'.
see build/config_command for the configure command used to configure mysql
please change /home/touska/ to the relevant directory of course.
add yassl/lib to the LD_LIBRARY_PATH because libmysql/conf_to_src does not
use the ssl lib directory though it does use the ssl libraries.
make
make install
*********************
License: yassl is currently under the GPL, please see license information
in the source and include files.
*********************
Contact: please send comments or questions to Todd A Ouska at todd@yassl.com
and/or Larry Stefonic at larry@yassl.com or 425-741-6858.
/* buffer.hpp
*
* Copyright (C) 2003 Sawtooth Consulting Ltd.
*
* This file is part of yaSSL.
*
* yaSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* yaSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/* yaSSL buffer header defines input and output buffers to simulate streaming
* with SSL types and sockets
*/
#ifndef yaSSL_BUFFER_HPP
#define yaSSL_BUFFER_HPP
#include <cassert> // assert
#include "yassl_error.hpp" // Error
#include "memory.hpp" // mySTL::auto_ptr
#include "algorithm.hpp" // mySTL::swap
#ifdef _MSC_VER
// disable truncated debug symbols
#pragma warning(disable:4786)
#endif
namespace yaSSL {
typedef unsigned char byte;
typedef unsigned int uint;
const uint AUTO = 0xFEEDBEEF;
// Checking Policy should implement a check function that tests whether the
// index is within the size limit of the array
struct Check {
void check(uint i, uint limit);
};
struct NoCheck {
void check(uint, uint);
};
/* input_buffer operates like a smart c style array with a checking option,
* meant to be read from through [] with AUTO index or read().
* Should only write to at/near construction with assign() or raw (e.g., recv)
* followed by add_size with the number of elements added by raw write.
*
* Not using vector because need checked []access, offset, and the ability to
* write to the buffer bulk wise and have the correct size
*/
class input_buffer : public Check {
uint size_; // number of elements in buffer
uint current_; // current offset position in buffer
byte* buffer_; // storage for buffer
byte* end_; // end of storage marker
public:
input_buffer();
explicit input_buffer(uint s);
// with assign
input_buffer(uint s, const byte* t, uint len);
~input_buffer();
// users can pass defualt zero length buffer and then allocate
void allocate(uint s);
// for passing to raw writing functions at beginning, then use add_size
byte* get_buffer() const;
// after a raw write user can set new size
// if you know the size before the write use assign()
void add_size(uint i);
uint get_capacity() const;
uint get_current() const;
uint get_size() const;
uint get_remaining() const;
void set_current(uint i);
// read only access through [], advance current
// user passes in AUTO index for ease of use
const byte& operator[](uint i);
// end of input test
bool eof();
// peek ahead
byte peek() const;
// write function, should use at/near construction
void assign(const byte* t, uint s);
// use read to query input, adjusts current
void read(byte* dst, uint length);
private:
input_buffer(const input_buffer&); // hide copy
input_buffer& operator=(const input_buffer&); // and assign
};
/* output_buffer operates like a smart c style array with a checking option.
* Meant to be written to through [] with AUTO index or write().
* Size (current) counter increases when written to. Can be constructed with
* zero length buffer but be sure to allocate before first use.
* Don't use add write for a couple bytes, use [] instead, way less overhead.
*
* Not using vector because need checked []access and the ability to
* write to the buffer bulk wise and retain correct size
*/
class output_buffer : public Check {
uint current_; // current offset and elements in buffer
byte* buffer_; // storage for buffer
byte* end_; // end of storage marker
public:
// default
output_buffer();
// with allocate
explicit output_buffer(uint s);
// with assign
output_buffer(uint s, const byte* t, uint len);
~output_buffer();
uint get_size() const;
uint get_capacity() const;
void set_current(uint c);
// users can pass defualt zero length buffer and then allocate
void allocate(uint s);
// for passing to reading functions when finished
const byte* get_buffer() const;
// allow write access through [], update current
// user passes in AUTO as index for ease of use
byte& operator[](uint i);
// end of output test
bool eof();
void write(const byte* t, uint s);
private:
output_buffer(const output_buffer&); // hide copy
output_buffer& operator=(const output_buffer&); // and assign
};
// turn delete an incomplete type into comipler error instead of warning
template <typename T>
inline void checked_delete(T* p)
{
typedef char complete_type[sizeof(T) ? 1 : -1];
(void)sizeof(complete_type);
delete p;
}
// checked delete functor increases effeciency, no indirection on function call
// sets pointer to zero so safe for std conatiners
struct del_ptr_zero
{
template <typename T>
void operator()(T*& p) const
{
T* tmp = 0;
mySTL::swap(tmp, p);
checked_delete(tmp);
}
};
} // naemspace
#endif // yaSSL_BUUFER_HPP
/* cert_wrapper.hpp
*
* Copyright (C) 2003 Sawtooth Consulting Ltd.
*
* This file is part of yaSSL.
*
* yaSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* yaSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/* The certificate wrapper header defines certificate management functions
*
*/
#ifndef yaSSL_CERT_WRAPPER_HPP
#define yaSSL_CERT_WRAPPER_HPP
#ifdef _MSC_VER
// disable truncated debug symbols
#pragma warning(disable:4786)
#endif
#include "yassl_types.hpp" // SignatureAlgorithm
#include "buffer.hpp" // input_buffer
#include "asn.hpp" // SignerList
#include "list.hpp" // mySTL::list
#include "algorithm.hpp" // mySTL::for_each
namespace yaSSL {
typedef unsigned char opaque;
class X509; // forward openSSL type
using TaoCrypt::SignerList;
// an x509 version 3 certificate
class x509 {
uint length_;
opaque* buffer_;
public:
explicit x509(uint sz);
~x509();
uint get_length() const;
const opaque* get_buffer() const;
opaque* use_buffer();
x509(const x509&);
x509& operator=(const x509&);
private:
void Swap(x509&);
};
// Certificate Manager keeps a list of the cert chain and public key
class CertManager {
typedef mySTL::list<x509*> CertList;
CertList list_; // self
input_buffer privateKey_;
CertList peerList_; // peer
input_buffer peerPublicKey_;
X509* peerX509_; // peer's openSSL X509
SignatureAlgorithm keyType_; // self key type
SignatureAlgorithm peerKeyType_; // peer's key type
SignerList signers_; // decoded CA keys and names
// plus verified chained certs
bool verifyPeer_;
bool failNoCert_;
bool sendVerify_;
public:
CertManager();
~CertManager();
void AddPeerCert(x509* x); // take ownership
void CopySelfCert(const x509* x);
int CopyCaCert(const x509* x);
int Validate();
int SetPrivateKey(const x509&);
const x509* get_cert() const;
const opaque* get_peerKey() const;
const opaque* get_privateKey() const;
X509* get_peerX509() const;
SignatureAlgorithm get_keyType() const;
SignatureAlgorithm get_peerKeyType() const;
uint get_peerKeyLength() const;
uint get_privateKeyLength() const;
bool verifyPeer() const;
bool failNoCert() const;
bool sendVerify() const;
void setVerifyPeer();
void setFailNoCert();
void setSendVerify();
private:
CertManager(const CertManager&); // hide copy
CertManager& operator=(const CertManager&); // and assign
};
} // naemspace
#endif // yaSSL_CERT_WRAPPER_HPP
This diff is collapsed.
/* factory.hpp
*
* Copyright (C) 2003 Sawtooth Consulting Ltd.
*
* This file is part of yaSSL.
*
* yaSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* yaSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/* The factory header defines an Object Factory, used by SSL message and
* handshake types.
*
* See Desgin Pattern in GoF and Alexandrescu's chapter in Modern C++ Design,
* page 208
*/
#ifndef yaSSL_FACTORY_HPP
#define yaSSL_FACTORY_HPP
#include "vector.hpp"
#include "pair.hpp"
#include "yassl_error.hpp"
// VC60 workaround: it doesn't allow typename in some places
#if defined(_MSC_VER) && (_MSC_VER < 1300)
#define CPP_TYPENAME
#else
#define CPP_TYPENAME typename
#endif
namespace yaSSL {
// Factory uses its callback map to create objects by id,
// returning an abstract base pointer
template<class AbstractProduct,
typename IdentifierType = int,
typename ProductCreator = AbstractProduct* (*)()
>
class Factory {
typedef mySTL::pair<IdentifierType, ProductCreator> CallBack;
typedef mySTL::vector<CallBack> CallBackVector;
CallBackVector callbacks_;
public:
// pass function pointer to register all callbacks upon creation
explicit Factory(void (*init)(Factory<AbstractProduct, IdentifierType,
ProductCreator>&))
{
init(*this);
}
// reservce place in vector before registering, used by init funcion
void Reserve(size_t sz)
{
callbacks_.reserve(sz);
}
// register callback
void Register(const IdentifierType& id, ProductCreator pc)
{
callbacks_.push_back(mySTL::make_pair(id, pc));
}
// THE Creator, returns a new object of the proper type or 0
AbstractProduct* CreateObject(const IdentifierType& id) const
{
const CallBack* first = callbacks_.begin();
const CallBack* last = callbacks_.end();
while (first != last) {
if (first->first == id)
break;
++first;
}
if (first == callbacks_.end())
return 0;
return (first->second)();
}
private:
Factory(const Factory&); // hide copy
Factory& operator=(const Factory&); // and assign
};
} // naemspace
#endif // yaSSL_FACTORY_HPP
/* handshake.hpp
*
* Copyright (C) 2003 Sawtooth Consulting Ltd.
*
* This file is part of yaSSL.
*
* yaSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* yaSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/* The handshake header declares function prototypes for creating and reading
* the various handshake messages.
*/
#ifndef yaSSL_HANDSHAKE_HPP
#define yaSSL_HANDSHAKE_HPP
#include "yassl_types.hpp"
namespace yaSSL {
// forward decls
class SSL;
class Finished;
class Data;
class Alert;
struct Hashes;
enum BufferOutput { buffered, unbuffered };
void sendClientHello(SSL&);
void sendServerHello(SSL&, BufferOutput = buffered);
void sendServerHelloDone(SSL&, BufferOutput = buffered);
void sendClientKeyExchange(SSL&, BufferOutput = buffered);
void sendServerKeyExchange(SSL&, BufferOutput = buffered);
void sendChangeCipher(SSL&, BufferOutput = buffered);
void sendFinished(SSL&, ConnectionEnd, BufferOutput = buffered);
void sendCertificate(SSL&, BufferOutput = buffered);
void sendCertificateRequest(SSL&, BufferOutput = buffered);
void sendCertificateVerify(SSL&, BufferOutput = buffered);
int sendData(SSL&, const void*, int);
int sendAlert(SSL& ssl, const Alert& alert);
int receiveData(SSL&, Data&);
void processReply(SSL&);
void buildFinished(SSL&, Finished&, const opaque*);
void build_certHashes(SSL&, Hashes&);
void hmac(SSL&, byte*, const byte*, uint, ContentType, bool verify = false);
void TLS_hmac(SSL&, byte*, const byte*, uint, ContentType,
bool verify = false);
void PRF(byte* digest, uint digLen, const byte* secret, uint secLen,
const byte* label, uint labLen, const byte* seed, uint seedLen);
} // naemspace
#endif // yaSSL_HANDSHAKE_HPP
/* lock.hpp
*
* Copyright (C) 2003 Sawtooth Consulting Ltd.
*
* This file is part of yaSSL.
*
* yaSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* yaSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/* lock.hpp provides an os specific Lock, locks mutex on entry and unlocks
* automatically upon exit, no-ops provided for Single Threaded
*/
#ifndef yaSSL_LOCK_HPP
#define yaSSL_LOCK_HPP
namespace yaSSL {
#ifdef MULTI_THREADED
#ifdef WIN32
#include <windows.h>
class Mutex {
CRITICAL_SECTION cs_;
public:
Mutex();
~Mutex();
class Lock;
friend class Lock;
class Lock {
Mutex& mutex_;
public:
explicit Lock(Mutex& lm);
~Lock();
};
};
#else // WIN32
#include <pthread.h>
class Mutex {
pthread_mutex_t mutex_;
public:
Mutex();
~Mutex();
class Lock;
friend class Lock;
class Lock {
Mutex& mutex_;
public:
explicit Lock(Mutex& lm);
~Lock();
};
};
#endif // WIN32
#else // MULTI_THREADED (WE'RE SINGLE)
class Mutex {
public:
class Lock {
public:
explicit Lock(Mutex&) {}
};
};
#endif // MULTI_THREADED
} // namespace
#endif // yaSSL_LOCK_HPP
/* log.hpp
*
* Copyright (C) 2003 Sawtooth Consulting Ltd.
*
* This file is part of yaSSL.
*
* yaSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* yaSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/* yaSSL log interface
*
*/
#ifndef yaSSL_LOG_HPP
#define yaSSL_LOG_HPP
#include "socket_wrapper.hpp"
#ifdef YASSL_LOG
#include <cstdio>
#endif
namespace yaSSL {
typedef unsigned int uint;
// Debug logger
class Log {
#ifdef YASSL_LOG
FILE* log_;
#endif
public:
explicit Log(const char* str = "yaSSL.log");
~Log();
void Trace(const char*);
void ShowTCP(socket_t, bool ended = false);
void ShowData(uint, bool sent = false);
};
} // naemspace
#endif // yaSSL_LOG_HPP
/* crypto.h for openSSL */
#ifndef ysSSL_crypto_h__
#define yaSSL_crypto_h__
const char* SSLeay_version(int type);
#define SSLEAY_VERSION 0x0900L
#define SSLEAY_VERSION_NUMBER SSLEAY_VERSION
#endif /* yaSSL_crypto_h__ */
/* err.h for openssl */
#ifndef ysSSL_err_h__
#define yaSSL_err_h__
#endif /* yaSSL_err_h__ */
/* lhash.h for openSSL */
/* opensslv.h compatibility */
#ifndef yaSSL_opensslv_h__
#define yaSSL_opensslv_h__
/* api version compatibility */
#define OPENSSL_VERSION_NUMBER 0x0090700f
#endif /* yaSSLopensslv_h__ */
/* rand.h for openSSL */
/* rsa.h for openSSL */
#ifndef ysSSL_rsa_h__
#define yaSSL_rsa_h__
enum { RSA_F4 = 1 };
#endif /* yaSSL_rsa_h__ */
This diff is collapsed.
/* socket_wrapper.hpp
*
* Copyright (C) 2003 Sawtooth Consulting Ltd.
*
* This file is part of yaSSL.
*
* yaSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* yaSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/* The socket wrapper header defines a Socket class that hides the differences
* between Berkely style sockets and Windows sockets, allowing transparent TCP
* access.
*/
#ifndef yaSSL_SOCKET_WRAPPER_HPP
#define yaSSL_SOCKET_WRAPPER_HPP
#include <cassert>
#ifdef WIN32
#include <winsock2.h>
#else
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#endif
namespace yaSSL {
typedef unsigned int uint;
#ifdef WIN32
typedef SOCKET socket_t;
#else
typedef int socket_t;
const socket_t INVALID_SOCKET = -1;
const int SD_RECEIVE = 0;
const int SD_SEND = 1;
const int SD_BOTH = 2;
const int SOCKET_ERROR = -1;
#endif
typedef unsigned char byte;
// Wraps Windows Sockets and BSD Sockets
class Socket {
socket_t socket_; // underlying socket descriptor
public:
explicit Socket(socket_t s = INVALID_SOCKET);
virtual ~Socket();
void set_fd(socket_t s);
uint get_ready() const;
socket_t get_fd() const;
uint send(const byte* buf, unsigned int len, int flags = 0) const;
uint receive(byte* buf, unsigned int len, int flags = 0) const;
void wait() const;
void closeSocket();
void shutDown(int how = SD_SEND);
static int get_lastError();
static void set_lastError(int error);
private:
Socket(const Socket&); // hide copy
Socket& operator= (const Socket&); // and assign
};
} // naemspace
#endif // yaSSL_SOCKET_WRAPPER_HPP
/* timer.hpp
*
* Copyright (C) 2003 Sawtooth Consulting Ltd.
*
* This file is part of yaSSL.
*
* yaSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* yaSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/* timer.hpp provides a high res and low res timers
*
*/
#ifndef yaSSL_TIMER_HPP
#define yaSSL_TIMER_HPP
namespace yaSSL {
typedef double timer_d;
typedef unsigned int uint;
timer_d timer();
uint lowResTimer();
} // namespace
#endif // yaSSL_TIMER_HPP
/* yassl_error.hpp
*
* Copyright (C) 2003 Sawtooth Consulting Ltd.
*
* This file is part of yaSSL.
*
* yaSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* yaSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/* yaSSL error header defines error codes and an exception class
*/
#ifndef yaSSL_ERROR_HPP
#define yaSSL_ERROR_HPP
#include "stdexcept.hpp"
namespace yaSSL {
enum YasslError {
no_error = 0,
// 10 - 47 from AlertDescription, 0 also close_notify
range_error = 101,
realloc_error = 102,
factory_error = 103,
unknown_cipher = 104,
prefix_error = 105,
record_layer = 106,
handshake_layer = 107,
out_of_order = 108,
bad_input = 109,
match_error = 110,
no_key_file = 111,
verify_error = 112,
send_error = 113,
receive_error = 114,
certificate_error = 115,
// 1000+ from TaoCrypt error.hpp
};
enum Library { yaSSL_Lib = 0, CryptoLib, SocketLib };
// Base class for all yaSSL exceptions
class Error : public mySTL::runtime_error {
YasslError error_;
Library lib_;
public:
explicit Error(const char* s = "", YasslError e = no_error,
Library l = yaSSL_Lib);
YasslError get_number() const;
Library get_lib() const;
};
} // naemspace
#endif // yaSSL_ERROR_HPP
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* mySTL helpers.hpp
*
* Copyright (C) 2003 Sawtooth Consulting Ltd.
*
* This file is part of yaSSL.
*
* yaSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* yaSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/* mySTL helpers implements misc constructs for vector and list
*
*/
#ifndef mySTL_HELPERS_HPP
#define mySTL_HELPERS_HPP
#include <cstdlib>
namespace mySTL {
template <typename T, typename T2>
inline void construct(T* p, const T2& value)
{
new (static_cast<void*>(p)) T(value);
}
template <typename T>
inline void construct(T* p)
{
new (static_cast<void*>(p)) T();
}
template <typename T>
inline void destroy(T* p)
{
p->~T();
}
template <typename Iter>
void destroy(Iter first, Iter last)
{
while (first != last) {
destroy(&*first);
++first;
}
}
template <typename Iter, typename PlaceIter>
PlaceIter uninit_copy(Iter first, Iter last, PlaceIter place)
{
while (first != last) {
construct(&*place, *first);
++first;
++place;
}
return place;
}
template <typename PlaceIter, typename Size, typename T>
PlaceIter uninit_fill_n(PlaceIter place, Size n, const T& value)
{
while (n) {
construct(&*place, value);
--n;
++place;
}
return place;
}
} // namespace mySTL
#endif // mySTL_HELPERS_HPP
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment