mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge weblab.(none):/home/marcsql/TREE/mysql-5.1-base
into weblab.(none):/home/marcsql/TREE/mysql-5.1-rt-merge
This commit is contained in:
17
.bzrignore
17
.bzrignore
@@ -1255,6 +1255,7 @@ mysql-test/mysql-test-run-shell
|
||||
mysql-test/mysql-test-run.log
|
||||
mysql-test/mysql_test_run_new
|
||||
mysql-test/ndb/ndbcluster
|
||||
mysql-test/partitions.log
|
||||
mysql-test/r/*.err
|
||||
mysql-test/r/*.log
|
||||
mysql-test/r/*.out
|
||||
@@ -1334,8 +1335,21 @@ mysql-test/r/symlink.log
|
||||
mysql-test/r/system_mysql_db.log
|
||||
mysql-test/r/tmp.result
|
||||
mysql-test/r/udf.log
|
||||
mysql-test/rpl.log
|
||||
mysql-test/share/mysql
|
||||
mysql-test/std_data/*.pem
|
||||
mysql-test/suite/funcs_1/r/innodb_trig_03e.warnings
|
||||
mysql-test/suite/funcs_1/r/innodb_views.warnings
|
||||
mysql-test/suite/funcs_1/r/memory_trig_03e.warnings
|
||||
mysql-test/suite/funcs_1/r/memory_views.warnings
|
||||
mysql-test/suite/funcs_1/r/myisam_trig_03e.warnings
|
||||
mysql-test/suite/funcs_1/r/myisam_views.warnings
|
||||
mysql-test/suite/funcs_1/r/ndb_trig_03e.warnings
|
||||
mysql-test/suite/funcs_1/r/ndb_views.warnings
|
||||
mysql-test/suite/partitions/r/diff
|
||||
mysql-test/suite/partitions/r/partition_bit_ndb.warnings
|
||||
mysql-test/suite/partitions/r/partition_special_innodb.warnings
|
||||
mysql-test/suite/partitions/r/partition_special_myisam.warnings
|
||||
mysql-test/t/index_merge.load
|
||||
mysql-test/t/tmp.test
|
||||
mysql-test/var
|
||||
@@ -1644,6 +1658,7 @@ ndb/src/kernel/error/liberror.dsp
|
||||
ndb/src/kernel/ndbd
|
||||
ndb/src/kernel/ndbd.dsp
|
||||
ndb/src/kernel/vm/libkernel.dsp
|
||||
ndb/src/libndb.ver
|
||||
ndb/src/libndbclient.dsp
|
||||
ndb/src/mgmapi/libmgmapi.dsp
|
||||
ndb/src/mgmclient/libndbmgmclient.dsp
|
||||
@@ -2080,6 +2095,7 @@ storage/archive/.deps/ha_archive_la-azio.Plo
|
||||
storage/archive/.deps/ha_archive_la-ha_archive.Plo
|
||||
storage/archive/.deps/libarchive_a-azio.Po
|
||||
storage/archive/.deps/libarchive_a-ha_archive.Po
|
||||
storage/archive/archive_reader
|
||||
storage/archive/archive_test
|
||||
storage/bdb/*.ds?
|
||||
storage/bdb/*.vcproj
|
||||
@@ -2638,6 +2654,7 @@ storage/ndb/src/kernel/error/liberror.dsp
|
||||
storage/ndb/src/kernel/ndbd
|
||||
storage/ndb/src/kernel/ndbd.dsp
|
||||
storage/ndb/src/kernel/vm/libkernel.dsp
|
||||
storage/ndb/src/libndb.ver
|
||||
storage/ndb/src/libndbclient.dsp
|
||||
storage/ndb/src/mgmapi/libmgmapi.dsp
|
||||
storage/ndb/src/mgmclient/libndbmgmclient.dsp
|
||||
|
@@ -93,6 +93,10 @@ if [ "x$warning_mode" != "xpedantic" ]; then
|
||||
warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W"
|
||||
warnings="$warnings -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare"
|
||||
warnings="$warnings -Wwrite-strings -Wunused-function -Wunused-label -Wunused-value -Wunused-variable"
|
||||
|
||||
# For more warnings, uncomment the following line
|
||||
# warnings="$global_warnings -Wshadow"
|
||||
|
||||
# C warnings
|
||||
c_warnings="$warnings -Wunused-parameter"
|
||||
# C++ warnings
|
||||
@@ -139,9 +143,17 @@ fi
|
||||
#
|
||||
base_configs="--prefix=$prefix --enable-assembler "
|
||||
base_configs="$base_configs --with-extra-charsets=complex "
|
||||
base_configs="$base_configs --enable-thread-safe-client --with-readline "
|
||||
base_configs="$base_configs --enable-thread-safe-client "
|
||||
base_configs="$base_configs --with-big-tables"
|
||||
|
||||
if test -d "$path/../cmd-line-utils/readline"
|
||||
then
|
||||
base_configs="$base_configs --with-readline"
|
||||
elif test -d "$path/../cmd-line-utils/libedit"
|
||||
then
|
||||
base_configs="$base_configs --with-libedit"
|
||||
fi
|
||||
|
||||
static_link="--with-mysqld-ldflags=-all-static "
|
||||
static_link="$static_link --with-client-ldflags=-all-static"
|
||||
# we need local-infile in all binaries for rpl000001
|
||||
@@ -183,6 +195,12 @@ fi
|
||||
# (http://samba.org/ccache) is installed, use it.
|
||||
# We use 'grep' and hope 'grep' will work as expected
|
||||
# (returns 0 if finds lines)
|
||||
if test "$USING_GCOV" != "1"
|
||||
then
|
||||
# Not using gcov; Safe to use ccache
|
||||
CCACHE_GCOV_VERSION_ENABLED=1
|
||||
fi
|
||||
|
||||
if ccache -V > /dev/null 2>&1 && test "$CCACHE_GCOV_VERSION_ENABLED" = "1"
|
||||
then
|
||||
echo "$CC" | grep "ccache" > /dev/null || CC="ccache $CC"
|
||||
|
19
BUILD/SETUP.sh.rej
Normal file
19
BUILD/SETUP.sh.rej
Normal file
@@ -0,0 +1,19 @@
|
||||
***************
|
||||
*** 39,46 ****
|
||||
c_warnings="$global_warnings -Wunused"
|
||||
cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor"
|
||||
|
||||
! alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet
|
||||
! pentium_cflags="-mcpu=pentiumpro"
|
||||
sparc_cflags=""
|
||||
|
||||
# be as fast as we can be without losing our ability to backtrace
|
||||
--- 39,46 ----
|
||||
c_warnings="$global_warnings -Wunused"
|
||||
cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor"
|
||||
|
||||
! #alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet
|
||||
! #pentium_cflags="-mcpu=pentiumpro"
|
||||
sparc_cflags=""
|
||||
|
||||
# be as fast as we can be without losing our ability to backtrace
|
@@ -2,6 +2,7 @@
|
||||
|
||||
# Need to disable ccache, or we loose the gcov-needed compiler output files.
|
||||
|
||||
USING_GCOV=1
|
||||
CCACHE_GCOV_VERSION_ENABLED=0
|
||||
if ccache -V > /dev/null 2>&1
|
||||
then
|
||||
@@ -26,8 +27,10 @@ export LDFLAGS="-fprofile-arcs -ftest-coverage"
|
||||
# The -fprofile-arcs and -ftest-coverage options cause GCC to instrument the
|
||||
# code with profiling information used by gcov.
|
||||
# the -DDISABLE_TAO_ASM is needed to avoid build failures in Yassl.
|
||||
extra_flags="$pentium_cflags -fprofile-arcs -ftest-coverage -DDISABLE_TAO_ASM -DHAVE_MUTEX_THREAD_ONLY $debug_extra_flags"
|
||||
extra_flags="$pentium_cflags -fprofile-arcs -ftest-coverage -DDISABLE_TAO_ASM -DHAVE_MUTEX_THREAD_ONLY $debug_extra_flags $debug_cflags $max_cflags -DMYSQL_SERVER_SUFFIX=-gcov"
|
||||
extra_configs="$pentium_configs $debug_configs --disable-shared $static_link"
|
||||
extra_configs="$extra_configs $max_configs"
|
||||
c_warnings="$c_warnings $debug_extra_warnings"
|
||||
cxx_warnings="$cxx_warnings $debug_extra_warnings"
|
||||
|
||||
. "$path/FINISH.sh"
|
||||
|
@@ -33,4 +33,14 @@
|
||||
4561bde4qWhz1I8tkItXKex5uniipA
|
||||
4562ba016dYH0JzszOqZ8p6psbKfnQ
|
||||
45771031yRCoM_ZfONdYchPvVEgLRg
|
||||
459a60d8rIxeTuhB3j_QsOwLGdcpng
|
||||
459a61c9OS8PzIsdviZJDkybJ1y1uA
|
||||
459a70691aYIfU2ohV0a3P5iTLpO2A
|
||||
459a7422KF_P7PuU3YQ5qG6ZLEVpiA
|
||||
459a74e4nRcXppMSBYeQQ5efDkTADg
|
||||
45ae6628gqKTsUFfnoNExadETVIkbA
|
||||
45ba4faf2oqu6eR8fqecR3LfSNcYUg
|
||||
45ba5238-NKl80QVXzdGo8hO9M75Xg
|
||||
45c0fdfb2mz6NdOIsLenJtf6_ZelTA
|
||||
45d1ffcd-r3v8A7uh92hQaMfQM9UPQ
|
||||
45d21437Vg_-i4uOWyvzYWHESXDP6A
|
||||
|
@@ -458,6 +458,12 @@ ccarkner@nslinuxw10.bedford.progress.com|mysql-test/t/isolation.test|20010327145
|
||||
fs
|
||||
holyfoot/hf@mysql.com/deer.(none)|mysql-test/r/bdb_notembedded.result|20061113160642|60022|276fa5181da9a588
|
||||
holyfoot/hf@mysql.com/deer.(none)|mysql-test/t/bdb_notembedded.test|20061113160642|06094|6ef2ea4713496614
|
||||
jani@a88-113-38-195.elisa-laajakaista.fi|BUILD/SETUP.sh.rej|20070122013357|30052|b0650da46e7c4e54
|
||||
jani@a88-113-38-195.elisa-laajakaista.fi|configure.in.rej|20070122013357|43533|4b7ec608b9c90e83
|
||||
jani@a88-113-38-195.elisa-laajakaista.fi|include/my_global.h.rej|20070122013357|29911|dc7f1642f6061af
|
||||
jani@a88-113-38-195.elisa-laajakaista.fi|include/my_pthread.h.rej|20070122013357|18348|a6b632d992e5df16
|
||||
jani@a88-113-38-195.elisa-laajakaista.fi|mysys/thr_alarm.c.rej|20070122013357|21935|c169568388079966
|
||||
jani@a88-113-38-195.elisa-laajakaista.fi|sql/mysqld.cc.rej|20070122013357|09337|84aad00c2111bc3
|
||||
jani@hynda.mysql.fi|client/mysqlcheck|20010419221207|26716|363e3278166d84ec
|
||||
jcole@tetra.bedford.progress.com|BitKeeper/etc/logging_ok|20001004201211|30554
|
||||
jimw@mysql.com|mysql-test/t/ndb_alter_table.disabled|20050311230559|27526|411e026940e7a0aa
|
||||
|
@@ -56,6 +56,8 @@ enum options_client
|
||||
OPT_MYSQL_PRESERVE_SCHEMA,
|
||||
OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE,
|
||||
OPT_TZ_UTC, OPT_AUTO_CLOSE, OPT_CREATE_SLAP_SCHEMA,
|
||||
OPT_SLAP_CSV, OPT_SLAP_CREATE_STRING,
|
||||
OPT_SLAP_AUTO_GENERATE_SQL_LOAD_TYPE, OPT_SLAP_AUTO_GENERATE_WRITE_NUM,
|
||||
OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT, OPT_SERVER_ID,
|
||||
OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT,
|
||||
OPT_DEBUG_INFO, OPT_COLUMN_TYPES
|
||||
|
@@ -131,7 +131,7 @@ typedef enum enum_info_type INFO_TYPE;
|
||||
static MYSQL mysql; /* The connection */
|
||||
static my_bool info_flag=0,ignore_errors=0,wait_flag=0,quick=0,
|
||||
connected=0,opt_raw_data=0,unbuffered=0,output_tables=0,
|
||||
rehash=1,skip_updates=0,safe_updates=0,one_database=0,
|
||||
opt_rehash=1,skip_updates=0,safe_updates=0,one_database=0,
|
||||
opt_compress=0, using_opt_local_infile=0,
|
||||
vertical=0, line_numbers=1, column_names=1,opt_html=0,
|
||||
opt_xml=0,opt_nopager=1, opt_outfile=0, named_cmds= 0,
|
||||
@@ -591,7 +591,8 @@ static struct my_option my_long_options[] =
|
||||
#endif
|
||||
{"auto-rehash", OPT_AUTO_REHASH,
|
||||
"Enable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time. Disable with --disable-auto-rehash.",
|
||||
(gptr*) &rehash, (gptr*) &rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
(gptr*) &opt_rehash, (gptr*) &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
|
||||
0, 0},
|
||||
{"no-auto-rehash", 'A',
|
||||
"No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect. WARNING: options deprecated; use --disable-auto-rehash instead.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@@ -898,7 +899,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
}
|
||||
break;
|
||||
case 'A':
|
||||
rehash= 0;
|
||||
opt_rehash= 0;
|
||||
break;
|
||||
case 'N':
|
||||
column_names= 0;
|
||||
@@ -1408,7 +1409,7 @@ static char **new_mysql_completion (const char *text, int start, int end);
|
||||
#if defined(USE_NEW_READLINE_INTERFACE) || defined(USE_LIBEDIT_INTERFACE)
|
||||
char *no_completion(const char*,int)
|
||||
#else
|
||||
int no_completion()
|
||||
char *no_completion()
|
||||
#endif
|
||||
{
|
||||
return 0; /* No filename completion */
|
||||
@@ -1496,10 +1497,10 @@ static void initialize_readline (char *name)
|
||||
setlocale(LC_ALL,""); /* so as libedit use isprint */
|
||||
#endif
|
||||
rl_attempted_completion_function= (CPPFunction*)&new_mysql_completion;
|
||||
rl_completion_entry_function= (Function*)&no_completion;
|
||||
rl_completion_entry_function= &no_completion;
|
||||
#else
|
||||
rl_attempted_completion_function= (CPPFunction*)&new_mysql_completion;
|
||||
rl_completion_entry_function= (Function*)&no_completion;
|
||||
rl_completion_entry_function= &no_completion;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1756,15 +1757,17 @@ char *rindex(const char *s,int c)
|
||||
|
||||
static int reconnect(void)
|
||||
{
|
||||
/* purecov: begin tested */
|
||||
if (opt_reconnect)
|
||||
{
|
||||
put_info("No connection. Trying to reconnect...",INFO_INFO);
|
||||
(void) com_connect((String *) 0, 0);
|
||||
if (rehash)
|
||||
if (opt_rehash)
|
||||
com_rehash(NULL, NULL);
|
||||
}
|
||||
if (!connected)
|
||||
return put_info("Can't connect to the server\n",INFO_ERROR);
|
||||
/* purecov: end */
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2933,7 +2936,7 @@ static int
|
||||
com_connect(String *buffer, char *line)
|
||||
{
|
||||
char *tmp, buff[256];
|
||||
bool save_rehash= rehash;
|
||||
bool save_rehash= opt_rehash;
|
||||
int error;
|
||||
|
||||
bzero(buff, sizeof(buff));
|
||||
@@ -2957,13 +2960,16 @@ com_connect(String *buffer, char *line)
|
||||
}
|
||||
}
|
||||
else
|
||||
rehash= 0; // Quick re-connect
|
||||
{
|
||||
/* Quick re-connect */
|
||||
opt_rehash= 0; /* purecov: tested */
|
||||
}
|
||||
buffer->length(0); // command used
|
||||
}
|
||||
else
|
||||
rehash= 0;
|
||||
opt_rehash= 0;
|
||||
error=sql_connect(current_host,current_db,current_user,opt_password,0);
|
||||
rehash= save_rehash;
|
||||
opt_rehash= save_rehash;
|
||||
|
||||
if (connected)
|
||||
{
|
||||
@@ -3125,7 +3131,7 @@ com_use(String *buffer __attribute__((unused)), char *line)
|
||||
current_db=my_strdup(tmp,MYF(MY_WME));
|
||||
#ifdef HAVE_READLINE
|
||||
if (select_db > 1)
|
||||
build_completion_hash(rehash, 1);
|
||||
build_completion_hash(opt_rehash, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -3279,7 +3285,7 @@ sql_real_connect(char *host,char *database,char *user,char *password,
|
||||
mysql.reconnect= 1;
|
||||
#endif
|
||||
#ifdef HAVE_READLINE
|
||||
build_completion_hash(rehash, 1);
|
||||
build_completion_hash(opt_rehash, 1);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@@ -3324,8 +3330,8 @@ static int
|
||||
com_status(String *buffer __attribute__((unused)),
|
||||
char *line __attribute__((unused)))
|
||||
{
|
||||
const char *status;
|
||||
char buff[22];
|
||||
const char *status_str;
|
||||
char buff[40];
|
||||
ulonglong id;
|
||||
MYSQL_RES *result;
|
||||
LINT_INIT(result);
|
||||
@@ -3351,9 +3357,9 @@ com_status(String *buffer __attribute__((unused)),
|
||||
mysql_free_result(result);
|
||||
}
|
||||
#ifdef HAVE_OPENSSL
|
||||
if ((status= mysql_get_ssl_cipher(&mysql)))
|
||||
if ((status_str= mysql_get_ssl_cipher(&mysql)))
|
||||
tee_fprintf(stdout, "SSL:\t\t\tCipher in use is %s\n",
|
||||
status);
|
||||
status_str);
|
||||
else
|
||||
#endif /* HAVE_OPENSSL */
|
||||
tee_puts("SSL:\t\t\tNot in use", stdout);
|
||||
@@ -3412,23 +3418,20 @@ com_status(String *buffer __attribute__((unused)),
|
||||
tee_fprintf(stdout, "Protocol:\t\tCompressed\n");
|
||||
#endif
|
||||
|
||||
if ((status=mysql_stat(&mysql)) && !mysql_error(&mysql)[0])
|
||||
if ((status_str= mysql_stat(&mysql)) && !mysql_error(&mysql)[0])
|
||||
{
|
||||
ulong sec;
|
||||
char buff[40];
|
||||
const char *pos= strchr(status,' ');
|
||||
const char *pos= strchr(status_str,' ');
|
||||
/* print label */
|
||||
tee_fprintf(stdout, "%.*s\t\t\t", (int) (pos-status), status);
|
||||
if ((status=str2int(pos,10,0,LONG_MAX,(long*) &sec)))
|
||||
tee_fprintf(stdout, "%.*s\t\t\t", (int) (pos-status_str), status_str);
|
||||
if ((status_str= str2int(pos,10,0,LONG_MAX,(long*) &sec)))
|
||||
{
|
||||
nice_time((double) sec,buff,0);
|
||||
tee_puts(buff, stdout); /* print nice time */
|
||||
while (*status == ' ') status++; /* to next info */
|
||||
}
|
||||
if (status)
|
||||
{
|
||||
while (*status_str == ' ')
|
||||
status_str++; /* to next info */
|
||||
tee_putc('\n', stdout);
|
||||
tee_puts(status, stdout);
|
||||
tee_puts(status_str, stdout);
|
||||
}
|
||||
}
|
||||
if (safe_updates)
|
||||
@@ -3448,7 +3451,7 @@ select_limit, max_join_size);
|
||||
}
|
||||
|
||||
static const char *
|
||||
server_version_string(MYSQL *mysql)
|
||||
server_version_string(MYSQL *con)
|
||||
{
|
||||
static char buf[MAX_SERVER_VERSION_LENGTH] = "";
|
||||
|
||||
@@ -3458,11 +3461,11 @@ server_version_string(MYSQL *mysql)
|
||||
char *bufp = buf;
|
||||
MYSQL_RES *result;
|
||||
|
||||
bufp = strnmov(buf, mysql_get_server_info(mysql), sizeof buf);
|
||||
bufp= strnmov(buf, mysql_get_server_info(con), sizeof buf);
|
||||
|
||||
/* "limit 1" is protection against SQL_SELECT_LIMIT=0 */
|
||||
if (!mysql_query(mysql, "select @@version_comment limit 1") &&
|
||||
(result = mysql_use_result(mysql)))
|
||||
if (!mysql_query(con, "select @@version_comment limit 1") &&
|
||||
(result = mysql_use_result(con)))
|
||||
{
|
||||
MYSQL_ROW cur = mysql_fetch_row(result);
|
||||
if (cur && cur[0])
|
||||
@@ -3552,10 +3555,10 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate)
|
||||
|
||||
|
||||
static int
|
||||
put_error(MYSQL *mysql)
|
||||
put_error(MYSQL *con)
|
||||
{
|
||||
return put_info(mysql_error(mysql), INFO_ERROR, mysql_errno(mysql),
|
||||
mysql_sqlstate(mysql));
|
||||
return put_info(mysql_error(con), INFO_ERROR, mysql_errno(con),
|
||||
mysql_sqlstate(con));
|
||||
}
|
||||
|
||||
|
||||
@@ -3802,8 +3805,6 @@ static const char* construct_prompt()
|
||||
break;
|
||||
case 'D':
|
||||
char* dateTime;
|
||||
time_t lclock;
|
||||
lclock = time(NULL);
|
||||
dateTime = ctime(&lclock);
|
||||
processed_prompt.append(strtok(dateTime,"\n"));
|
||||
break;
|
||||
|
@@ -449,9 +449,9 @@ int main(int argc, char **argv)
|
||||
|
||||
char *forced_defaults_file;
|
||||
char *forced_extra_defaults;
|
||||
char *defaults_group_suffix;
|
||||
char *local_defaults_group_suffix;
|
||||
const char *script_line;
|
||||
char *upgrade_defaults_path;
|
||||
char *upgrade_defaults_path= 0;
|
||||
char *defaults_to_use= NULL;
|
||||
int upgrade_defaults_created= 0;
|
||||
|
||||
@@ -466,7 +466,7 @@ int main(int argc, char **argv)
|
||||
/* Check if we are forced to use specific defaults */
|
||||
get_defaults_options(argc, argv,
|
||||
&forced_defaults_file, &forced_extra_defaults,
|
||||
&defaults_group_suffix);
|
||||
&local_defaults_group_suffix);
|
||||
|
||||
load_defaults("my", load_default_groups, &argc, &argv);
|
||||
|
||||
|
@@ -94,15 +94,14 @@ static my_bool file_not_closed_error= 0;
|
||||
This is because the event will be created (alloced) in read_log_event()
|
||||
(which returns a pointer) in check_header().
|
||||
*/
|
||||
Format_description_log_event* description_event;
|
||||
Format_description_log_event* glob_description_event;
|
||||
|
||||
static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
|
||||
const char* logname);
|
||||
static int dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
|
||||
const char* logname);
|
||||
static int dump_log_entries(const char* logname);
|
||||
static int dump_remote_file(NET* net, const char* fname);
|
||||
static void die(const char* fmt, ...);
|
||||
static void die(const char* fmt, ...) __attribute__ ((__noreturn__));
|
||||
static MYSQL* safe_connect();
|
||||
|
||||
|
||||
@@ -603,7 +602,7 @@ int process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
||||
ce->print(result_file, print_event_info, TRUE);
|
||||
|
||||
// If this binlog is not 3.23 ; why this test??
|
||||
if (description_event->binlog_version >= 3)
|
||||
if (glob_description_event->binlog_version >= 3)
|
||||
{
|
||||
if (load_processor.process(ce))
|
||||
break; // Error
|
||||
@@ -638,9 +637,10 @@ Create_file event for file_id: %u\n",exv->file_id);
|
||||
break;
|
||||
}
|
||||
case FORMAT_DESCRIPTION_EVENT:
|
||||
delete description_event;
|
||||
description_event= (Format_description_log_event*) ev;
|
||||
print_event_info->common_header_len= description_event->common_header_len;
|
||||
delete glob_description_event;
|
||||
glob_description_event= (Format_description_log_event*) ev;
|
||||
print_event_info->common_header_len=
|
||||
glob_description_event->common_header_len;
|
||||
ev->print(result_file, print_event_info);
|
||||
/*
|
||||
We don't want this event to be deleted now, so let's hide it (I
|
||||
@@ -650,7 +650,7 @@ Create_file event for file_id: %u\n",exv->file_id);
|
||||
*/
|
||||
ev= 0;
|
||||
if (!force_if_open_opt &&
|
||||
(description_event->flags & LOG_EVENT_BINLOG_IN_USE_F))
|
||||
(glob_description_event->flags & LOG_EVENT_BINLOG_IN_USE_F))
|
||||
{
|
||||
file_not_closed_error= 1;
|
||||
DBUG_RETURN(1);
|
||||
@@ -1037,7 +1037,7 @@ static int dump_log_entries(const char* logname)
|
||||
This is not as smart as check_header() (used for local log); it will not work
|
||||
for a binlog which mixes format. TODO: fix this.
|
||||
*/
|
||||
static int check_master_version(MYSQL* mysql,
|
||||
static int check_master_version(MYSQL *mysql_arg,
|
||||
Format_description_log_event
|
||||
**description_event)
|
||||
{
|
||||
@@ -1045,26 +1045,31 @@ static int check_master_version(MYSQL* mysql,
|
||||
MYSQL_ROW row;
|
||||
const char* version;
|
||||
|
||||
if (mysql_query(mysql, "SELECT VERSION()") ||
|
||||
!(res = mysql_store_result(mysql)))
|
||||
if (mysql_query(mysql_arg, "SELECT VERSION()") ||
|
||||
!(res = mysql_store_result(mysql_arg)))
|
||||
{
|
||||
/* purecov: begin inspected */
|
||||
char errmsg[256];
|
||||
strmake(errmsg, mysql_error(mysql), sizeof(errmsg)-1);
|
||||
mysql_close(mysql);
|
||||
strmake(errmsg, mysql_error(mysql_arg), sizeof(errmsg)-1);
|
||||
mysql_close(mysql_arg);
|
||||
die("Error checking master version: %s", errmsg);
|
||||
/* purecov: end */
|
||||
}
|
||||
if (!(row = mysql_fetch_row(res)))
|
||||
{
|
||||
/* purecov: begin inspected */
|
||||
mysql_free_result(res);
|
||||
mysql_close(mysql);
|
||||
die("Master returned no rows for SELECT VERSION()");
|
||||
return 1;
|
||||
/* purecov: end */
|
||||
}
|
||||
if (!(version = row[0]))
|
||||
{
|
||||
/* purecov: begin inspected */
|
||||
mysql_free_result(res);
|
||||
mysql_close(mysql);
|
||||
mysql_close(mysql_arg);
|
||||
die("Master reported NULL for the version");
|
||||
/* purecov: end */
|
||||
}
|
||||
|
||||
switch (*version) {
|
||||
@@ -1083,11 +1088,11 @@ static int check_master_version(MYSQL* mysql,
|
||||
*description_event= new Format_description_log_event(3);
|
||||
break;
|
||||
default:
|
||||
sql_print_error("Master reported unrecognized MySQL version '%s'",
|
||||
version);
|
||||
/* purecov: begin inspected */
|
||||
mysql_free_result(res);
|
||||
mysql_close(mysql);
|
||||
return 1;
|
||||
mysql_close(mysql_arg);
|
||||
die("Master reported unrecognized MySQL version '%s'", version);
|
||||
/* purecov: end */
|
||||
}
|
||||
mysql_free_result(res);
|
||||
return 0;
|
||||
@@ -1115,12 +1120,12 @@ static int dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
|
||||
mysql= safe_connect();
|
||||
net= &mysql->net;
|
||||
|
||||
if (check_master_version(mysql, &description_event))
|
||||
if (check_master_version(mysql, &glob_description_event))
|
||||
{
|
||||
fprintf(stderr, "Could not find server version");
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
if (!description_event || !description_event->is_valid())
|
||||
if (!glob_description_event || !glob_description_event->is_valid())
|
||||
{
|
||||
fprintf(stderr, "Invalid Format_description log event; \
|
||||
could be out of memory");
|
||||
@@ -1170,7 +1175,7 @@ could be out of memory");
|
||||
len, net->read_pos[5]));
|
||||
if (!(ev= Log_event::read_log_event((const char*) net->read_pos + 1 ,
|
||||
len - 1, &error_msg,
|
||||
description_event)))
|
||||
glob_description_event)))
|
||||
{
|
||||
fprintf(stderr, "Could not construct log event object\n");
|
||||
error= 1;
|
||||
@@ -1178,7 +1183,7 @@ could be out of memory");
|
||||
}
|
||||
|
||||
Log_event_type type= ev->get_type_code();
|
||||
if (description_event->binlog_version >= 3 ||
|
||||
if (glob_description_event->binlog_version >= 3 ||
|
||||
(type != LOAD_EVENT && type != CREATE_FILE_EVENT))
|
||||
{
|
||||
/*
|
||||
@@ -1384,7 +1389,7 @@ static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
|
||||
my_close(fd, MYF(MY_WME));
|
||||
return 1;
|
||||
}
|
||||
check_header(file, &description_event);
|
||||
check_header(file, &glob_description_event);
|
||||
}
|
||||
else // reading from stdin;
|
||||
{
|
||||
@@ -1406,7 +1411,7 @@ static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
|
||||
if (init_io_cache(file, fileno(stdin), 0, READ_CACHE, (my_off_t) 0,
|
||||
0, MYF(MY_WME | MY_NABP | MY_DONT_CHECK_FILESIZE)))
|
||||
return 1;
|
||||
check_header(file, &description_event);
|
||||
check_header(file, &glob_description_event);
|
||||
if (start_position)
|
||||
{
|
||||
/* skip 'start_position' characters from stdin */
|
||||
@@ -1424,7 +1429,7 @@ static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
|
||||
}
|
||||
}
|
||||
|
||||
if (!description_event || !description_event->is_valid())
|
||||
if (!glob_description_event || !glob_description_event->is_valid())
|
||||
die("Invalid Format_description log event; could be out of memory");
|
||||
|
||||
if (!start_position && my_b_read(file, tmp_buff, BIN_LOG_HEADER_SIZE))
|
||||
@@ -1437,14 +1442,14 @@ static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
|
||||
char llbuff[21];
|
||||
my_off_t old_off = my_b_tell(file);
|
||||
|
||||
Log_event* ev = Log_event::read_log_event(file, description_event);
|
||||
Log_event* ev = Log_event::read_log_event(file, glob_description_event);
|
||||
if (!ev)
|
||||
{
|
||||
/*
|
||||
if binlog wasn't closed properly ("in use" flag is set) don't complain
|
||||
about a corruption, but treat it as EOF and move to the next binlog.
|
||||
*/
|
||||
if (description_event->flags & LOG_EVENT_BINLOG_IN_USE_F)
|
||||
if (glob_description_event->flags & LOG_EVENT_BINLOG_IN_USE_F)
|
||||
file->error= 0;
|
||||
else if (file->error)
|
||||
{
|
||||
@@ -1469,7 +1474,7 @@ end:
|
||||
if (fd >= 0)
|
||||
my_close(fd, MYF(MY_WME));
|
||||
end_io_cache(file);
|
||||
delete description_event;
|
||||
delete glob_description_event;
|
||||
return error;
|
||||
}
|
||||
|
||||
|
@@ -115,7 +115,7 @@ static char compatible_mode_normal_str[255];
|
||||
static ulong opt_compatible_mode= 0;
|
||||
#define MYSQL_OPT_MASTER_DATA_EFFECTIVE_SQL 1
|
||||
#define MYSQL_OPT_MASTER_DATA_COMMENTED_SQL 2
|
||||
static uint opt_mysql_port= 0, err_len= 0, opt_master_data;
|
||||
static uint opt_mysql_port= 0, opt_master_data;
|
||||
static my_string opt_mysql_unix_port=0;
|
||||
static int first_error=0;
|
||||
static DYNAMIC_STRING extended_row;
|
||||
@@ -746,6 +746,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *end= compatible_mode_normal_str;
|
||||
int i;
|
||||
ulong mode;
|
||||
uint err_len;
|
||||
|
||||
opt_quoted= 1;
|
||||
opt_set_charset= 0;
|
||||
@@ -883,11 +884,11 @@ static int get_options(int *argc, char ***argv)
|
||||
/*
|
||||
** DB_error -- prints mysql error message and exits the program.
|
||||
*/
|
||||
static void DB_error(MYSQL *mysql, const char *when)
|
||||
static void DB_error(MYSQL *mysql_arg, const char *when)
|
||||
{
|
||||
DBUG_ENTER("DB_error");
|
||||
fprintf(stderr, "%s: Got error: %d: %s %s\n", my_progname,
|
||||
mysql_errno(mysql), mysql_error(mysql), when);
|
||||
mysql_errno(mysql_arg), mysql_error(mysql_arg), when);
|
||||
fflush(stderr);
|
||||
safe_exit(EX_MYSQLERR);
|
||||
DBUG_VOID_RETURN;
|
||||
@@ -1215,7 +1216,7 @@ static void print_quoted_xml(FILE *xml_file, const char *str, ulong len)
|
||||
..., attribute_name_n, attribute_value_n, NullS)
|
||||
xml_file - output file
|
||||
sbeg - line beginning
|
||||
send - line ending
|
||||
line_end - line ending
|
||||
tag_name - XML tag name.
|
||||
first_attribute_name - tag and first attribute
|
||||
first_attribute_value - (Implied) value of first attribute
|
||||
@@ -1235,7 +1236,8 @@ static void print_quoted_xml(FILE *xml_file, const char *str, ulong len)
|
||||
All attribute_value arguments will be quoted before output.
|
||||
*/
|
||||
|
||||
static void print_xml_tag(FILE * xml_file, const char* sbeg, const char* send,
|
||||
static void print_xml_tag(FILE * xml_file, const char* sbeg,
|
||||
const char* line_end,
|
||||
const char* tag_name,
|
||||
const char* first_attribute_name, ...)
|
||||
{
|
||||
@@ -1265,7 +1267,7 @@ static void print_xml_tag(FILE * xml_file, const char* sbeg, const char* send,
|
||||
va_end(arg_list);
|
||||
|
||||
fputc('>', xml_file);
|
||||
fputs(send, xml_file);
|
||||
fputs(line_end, xml_file);
|
||||
check_io(xml_file);
|
||||
}
|
||||
|
||||
@@ -1279,7 +1281,7 @@ static void print_xml_tag(FILE * xml_file, const char* sbeg, const char* send,
|
||||
sbeg - line beginning
|
||||
stag_atr - tag and attribute
|
||||
sval - value of attribute
|
||||
send - line ending
|
||||
line_end - line ending
|
||||
|
||||
DESCRIPTION
|
||||
Print tag with one attribute to the xml_file. Format is:
|
||||
@@ -1291,7 +1293,7 @@ static void print_xml_tag(FILE * xml_file, const char* sbeg, const char* send,
|
||||
|
||||
static void print_xml_null_tag(FILE * xml_file, const char* sbeg,
|
||||
const char* stag_atr, const char* sval,
|
||||
const char* send)
|
||||
const char* line_end)
|
||||
{
|
||||
fputs(sbeg, xml_file);
|
||||
fputs("<", xml_file);
|
||||
@@ -1299,7 +1301,7 @@ static void print_xml_null_tag(FILE * xml_file, const char* sbeg,
|
||||
fputs("\"", xml_file);
|
||||
print_quoted_xml(xml_file, sval, strlen(sval));
|
||||
fputs("\" xsi:nil=\"true\" />", xml_file);
|
||||
fputs(send, xml_file);
|
||||
fputs(line_end, xml_file);
|
||||
check_io(xml_file);
|
||||
}
|
||||
|
||||
@@ -2876,7 +2878,7 @@ static int dump_tablespaces_for_tables(char *db, char **table_names, int tables)
|
||||
dynstr_trunc(&where, 1);
|
||||
dynstr_append(&where,"))");
|
||||
|
||||
DBUG_PRINT("info",("Dump TS for Tables where: %s",where));
|
||||
DBUG_PRINT("info",("Dump TS for Tables where: %s",where.str));
|
||||
r= dump_tablespaces(where.str);
|
||||
dynstr_free(&where);
|
||||
return r;
|
||||
@@ -2906,7 +2908,7 @@ static int dump_tablespaces_for_databases(char** databases)
|
||||
dynstr_trunc(&where, 1);
|
||||
dynstr_append(&where,"))");
|
||||
|
||||
DBUG_PRINT("info",("Dump TS for DBs where: %s",where));
|
||||
DBUG_PRINT("info",("Dump TS for DBs where: %s",where.str));
|
||||
r= dump_tablespaces(where.str);
|
||||
dynstr_free(&where);
|
||||
return r;
|
||||
@@ -2918,7 +2920,7 @@ static int dump_tablespaces(char* ts_where)
|
||||
MYSQL_RES *tableres;
|
||||
char buf[FN_REFLEN];
|
||||
DYNAMIC_STRING sqlbuf;
|
||||
int first;
|
||||
int first= 0;
|
||||
/*
|
||||
The following are used for parsing the EXTRA field
|
||||
*/
|
||||
|
@@ -34,7 +34,7 @@
|
||||
|
||||
|
||||
/* Global Thread counter */
|
||||
int counter;
|
||||
uint counter;
|
||||
#ifdef HAVE_LIBPTHREAD
|
||||
pthread_mutex_t counter_mutex;
|
||||
pthread_cond_t count_threshhold;
|
||||
|
@@ -128,6 +128,7 @@ static my_bool opt_slave;
|
||||
static my_bool opt_compress= FALSE, tty_password= FALSE,
|
||||
opt_silent= FALSE,
|
||||
auto_generate_sql= FALSE;
|
||||
const char *auto_generate_sql_type= "mixed";
|
||||
|
||||
static unsigned long connect_flags= CLIENT_MULTI_RESULTS;
|
||||
|
||||
@@ -136,6 +137,7 @@ static int iterations;
|
||||
static char *default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME;
|
||||
static ulonglong actual_queries= 0;
|
||||
static ulonglong num_of_query;
|
||||
static ulonglong auto_generate_sql_number;
|
||||
const char *concurrency_str= NULL;
|
||||
static char *create_string;
|
||||
uint *concurrency;
|
||||
@@ -395,19 +397,27 @@ static struct my_option my_long_options[] =
|
||||
"Generate SQL where not supplied by file or command line.",
|
||||
(gptr*) &auto_generate_sql, (gptr*) &auto_generate_sql,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"auto-generate-sql-load-type", OPT_SLAP_AUTO_GENERATE_SQL_LOAD_TYPE,
|
||||
"Load types are mixed, write, or read. Default is mixed\n",
|
||||
(gptr*) &auto_generate_sql_type, (gptr*) &auto_generate_sql_type,
|
||||
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"auto-generate-sql-write-number", OPT_SLAP_AUTO_GENERATE_WRITE_NUM,
|
||||
"Number of rows to insert to used in read and write loads (default is 100).\n",
|
||||
(gptr*) &auto_generate_sql_number, (gptr*) &auto_generate_sql_number,
|
||||
0, GET_ULL, REQUIRED_ARG, 100, 0, 0, 0, 0, 0},
|
||||
{"compress", 'C', "Use compression in server/client protocol.",
|
||||
(gptr*) &opt_compress, (gptr*) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
{"concurrency", 'c', "Number of clients to simulate for query to run.",
|
||||
(gptr*) &concurrency_str, (gptr*) &concurrency_str, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"create", OPT_CREATE_SLAP_SCHEMA, "File or string to use create tables.",
|
||||
{"create", OPT_SLAP_CREATE_STRING, "File or string to use create tables.",
|
||||
(gptr*) &create_string, (gptr*) &create_string, 0, GET_STR, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"create-schema", OPT_CREATE_SLAP_SCHEMA, "Schema to run tests in.",
|
||||
(gptr*) &create_schema_string, (gptr*) &create_schema_string, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"csv", OPT_CREATE_SLAP_SCHEMA,
|
||||
{"csv", OPT_SLAP_CSV,
|
||||
"Generate CSV output to named file or to stdout if no file is named.",
|
||||
(gptr*) &opt_csv_str, (gptr*) &opt_csv_str, 0, GET_STR,
|
||||
OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@@ -429,13 +439,13 @@ static struct my_option my_long_options[] =
|
||||
(gptr*) &lock_directory, (gptr*) &lock_directory, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"number-char-cols", 'x',
|
||||
"Number of INT columns to create table with if specifying --auto-generate-sql.",
|
||||
"Number of VARCHAR columns to create table with if specifying --auto-generate-sql ",
|
||||
(gptr*) &num_char_cols, (gptr*) &num_char_cols, 0, GET_UINT, REQUIRED_ARG,
|
||||
1, 0, 0, 0, 0, 0},
|
||||
{"number-int-cols", 'y',
|
||||
"Number of VARCHAR columns to create table with if specifying "
|
||||
"--auto-generate-sql.", (gptr*) &num_int_cols, (gptr*) &num_int_cols, 0,
|
||||
GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
|
||||
"Number of INT columns to create table with if specifying --auto-generate-sql.",
|
||||
(gptr*) &num_int_cols, (gptr*) &num_int_cols, 0, GET_UINT, REQUIRED_ARG,
|
||||
1, 0, 0, 0, 0, 0},
|
||||
{"number-of-queries", OPT_MYSQL_NUMBER_OF_QUERY,
|
||||
"Limit each client to this number of queries (this is not exact).",
|
||||
(gptr*) &num_of_query, (gptr*) &num_of_query, 0,
|
||||
@@ -591,7 +601,6 @@ get_random_string(char *buf)
|
||||
DBUG_ENTER("get_random_string");
|
||||
for (x= RAND_STRING_SIZE; x > 0; x--)
|
||||
*buf_ptr++= ALPHANUMERICS[random() % ALPHANUMERICS_SIZE];
|
||||
DBUG_PRINT("info", ("random string: '%*s'", (int) (buf_ptr - buf), buf));
|
||||
DBUG_RETURN(buf_ptr - buf);
|
||||
}
|
||||
|
||||
@@ -638,7 +647,6 @@ build_table_string(void)
|
||||
ptr->string = (char *)my_malloc(table_string.length+1, MYF(MY_WME));
|
||||
ptr->length= table_string.length+1;
|
||||
strmov(ptr->string, table_string.str);
|
||||
DBUG_PRINT("info", ("create_string %s", ptr->string));
|
||||
dynstr_free(&table_string);
|
||||
DBUG_RETURN(ptr);
|
||||
}
|
||||
@@ -686,7 +694,6 @@ build_insert_string(void)
|
||||
ptr->string= (char *)my_malloc(insert_string.length+1, MYF(MY_WME));
|
||||
ptr->length= insert_string.length+1;
|
||||
strmov(ptr->string, insert_string.str);
|
||||
DBUG_PRINT("info", ("generated_insert_data %s", ptr->string));
|
||||
dynstr_free(&insert_string);
|
||||
DBUG_RETURN(ptr);
|
||||
}
|
||||
@@ -733,7 +740,6 @@ build_query_string(void)
|
||||
ptr->string= (char *)my_malloc(query_string.length+1, MYF(MY_WME));
|
||||
ptr->length= query_string.length+1;
|
||||
strmov(ptr->string, query_string.str);
|
||||
DBUG_PRINT("info", ("user_supplied_query %s", ptr->string));
|
||||
dynstr_free(&query_string);
|
||||
DBUG_RETURN(ptr);
|
||||
}
|
||||
@@ -799,19 +805,62 @@ get_options(int *argc,char ***argv)
|
||||
|
||||
if (auto_generate_sql)
|
||||
{
|
||||
create_statements= build_table_string();
|
||||
query_statements= build_insert_string();
|
||||
DBUG_PRINT("info", ("auto-generated insert is %s", query_statements->string));
|
||||
query_statements->next= build_query_string();
|
||||
DBUG_PRINT("info", ("auto-generated is %s", query_statements->next->string));
|
||||
if (verbose >= 1)
|
||||
unsigned long long x= 0;
|
||||
statement *ptr_statement;
|
||||
|
||||
create_statements= build_table_string();
|
||||
|
||||
if (auto_generate_sql_type[0] == 'r')
|
||||
{
|
||||
for (ptr_statement= create_statements, x= 0;
|
||||
x < auto_generate_sql_number;
|
||||
x++, ptr_statement= ptr_statement->next)
|
||||
{
|
||||
fprintf(stderr, "auto-generated insert is:\n");
|
||||
fprintf(stderr, "%s\n", query_statements->string);
|
||||
fprintf(stderr, "auto-generated is:\n");
|
||||
fprintf(stderr, "%s\n", query_statements->next->string);
|
||||
ptr_statement->next= build_insert_string();
|
||||
}
|
||||
|
||||
query_statements= build_query_string();
|
||||
}
|
||||
else if (auto_generate_sql_type[0] == 'w')
|
||||
{
|
||||
/*
|
||||
We generate a number of strings in case the engine is
|
||||
Archive (since strings which were identical one after another
|
||||
would be too easily optimized).
|
||||
*/
|
||||
query_statements= build_insert_string();
|
||||
for (ptr_statement= query_statements, x= 0;
|
||||
x < auto_generate_sql_number;
|
||||
x++, ptr_statement= ptr_statement->next)
|
||||
{
|
||||
ptr_statement->next= build_insert_string();
|
||||
}
|
||||
}
|
||||
else /* Mixed mode is default */
|
||||
{
|
||||
int coin= 0;
|
||||
|
||||
query_statements= build_insert_string();
|
||||
/*
|
||||
This logic should be extended to do a more mixed load,
|
||||
at the moment it results in "every other".
|
||||
*/
|
||||
for (ptr_statement= query_statements, x= 0;
|
||||
x < 4;
|
||||
x++, ptr_statement= ptr_statement->next)
|
||||
{
|
||||
if (coin)
|
||||
{
|
||||
ptr_statement->next= build_insert_string();
|
||||
coin= 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr_statement->next= build_query_string();
|
||||
coin= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -905,7 +954,6 @@ create_schema(MYSQL *mysql, const char *db, statement *stmt,
|
||||
DBUG_ENTER("create_schema");
|
||||
|
||||
len= snprintf(query, HUGE_STRING_LENGTH, "CREATE SCHEMA `%s`", db);
|
||||
DBUG_PRINT("info", ("query %s", query));
|
||||
|
||||
if (run_query(mysql, query, len))
|
||||
{
|
||||
@@ -1190,7 +1238,7 @@ limit_not_met:
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!con->stmt && con->limit && queries < con->limit)
|
||||
if (con->limit && queries < con->limit)
|
||||
goto limit_not_met;
|
||||
|
||||
end:
|
||||
@@ -1220,8 +1268,6 @@ parse_delimiter(const char *script, statement **stmt, char delm)
|
||||
uint length= strlen(script);
|
||||
uint count= 0; /* We know that there is always one */
|
||||
|
||||
DBUG_PRINT("info", ("Parsing %s\n", script));
|
||||
|
||||
for (tmp= *sptr= (statement *)my_malloc(sizeof(statement), MYF(MY_ZEROFILL));
|
||||
(retstr= strchr(ptr, delm));
|
||||
tmp->next= (statement *)my_malloc(sizeof(statement), MYF(MY_ZEROFILL)),
|
||||
@@ -1230,7 +1276,6 @@ parse_delimiter(const char *script, statement **stmt, char delm)
|
||||
count++;
|
||||
tmp->string= my_strndup(ptr, (size_t)(retstr - ptr), MYF(MY_FAE));
|
||||
tmp->length= (size_t)(retstr - ptr);
|
||||
DBUG_PRINT("info", (" Creating : %.*s\n", (uint)tmp->length, tmp->string));
|
||||
ptr+= retstr - ptr + 1;
|
||||
if (isspace(*ptr))
|
||||
ptr++;
|
||||
@@ -1242,7 +1287,6 @@ parse_delimiter(const char *script, statement **stmt, char delm)
|
||||
tmp->string= my_strndup(ptr, (size_t)((script + length) - ptr),
|
||||
MYF(MY_FAE));
|
||||
tmp->length= (size_t)((script + length) - ptr);
|
||||
DBUG_PRINT("info", (" Creating : %.*s\n", (uint)tmp->length, tmp->string));
|
||||
count++;
|
||||
}
|
||||
|
||||
|
@@ -84,11 +84,11 @@ enum {
|
||||
};
|
||||
|
||||
static int record= 0, opt_sleep= -1;
|
||||
static char *db= 0, *pass= 0;
|
||||
const char *user= 0, *host= 0, *unix_sock= 0, *opt_basedir= "./";
|
||||
static char *opt_db= 0, *opt_pass= 0;
|
||||
const char *opt_user= 0, *opt_host= 0, *unix_sock= 0, *opt_basedir= "./";
|
||||
const char *opt_logdir= "";
|
||||
const char *opt_include= 0, *opt_charsets_dir;
|
||||
static int port= 0;
|
||||
static int opt_port= 0;
|
||||
static int opt_max_connect_retries;
|
||||
static my_bool opt_compress= 0, silent= 0, verbose= 0;
|
||||
static my_bool tty_password= 0;
|
||||
@@ -610,15 +610,14 @@ void check_command_args(struct st_command *command,
|
||||
int i;
|
||||
const char *ptr= arguments;
|
||||
const char *start;
|
||||
|
||||
DBUG_ENTER("check_command_args");
|
||||
DBUG_PRINT("enter", ("num_args: %d", num_args));
|
||||
|
||||
for (i= 0; i < num_args; i++)
|
||||
{
|
||||
const struct command_arg *arg= &args[i];
|
||||
|
||||
switch (arg->type)
|
||||
{
|
||||
switch (arg->type) {
|
||||
/* A string */
|
||||
case ARG_STRING:
|
||||
/* Skip leading spaces */
|
||||
@@ -783,7 +782,7 @@ void free_used_memory()
|
||||
dynstr_free(&ds_progress);
|
||||
dynstr_free(&ds_warning_messages);
|
||||
free_all_replace();
|
||||
my_free(pass,MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free(opt_pass,MYF(MY_ALLOW_ZERO_PTR));
|
||||
free_defaults(default_argv);
|
||||
free_re();
|
||||
#ifdef __WIN__
|
||||
@@ -1313,7 +1312,7 @@ void var_set_errno(int sql_errno)
|
||||
|
||||
void var_query_set(VAR *var, const char *query, const char** query_end)
|
||||
{
|
||||
char* end = (char*)((query_end && *query_end) ?
|
||||
char *end = (char*)((query_end && *query_end) ?
|
||||
*query_end : query + strlen(query));
|
||||
MYSQL_RES *res;
|
||||
MYSQL_ROW row;
|
||||
@@ -1344,7 +1343,6 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
|
||||
DYNAMIC_STRING result;
|
||||
uint i;
|
||||
ulong *lengths;
|
||||
char *end;
|
||||
#ifdef NOT_YET
|
||||
MYSQL_FIELD *fields= mysql_fetch_fields(res);
|
||||
#endif
|
||||
@@ -1847,7 +1845,7 @@ void do_copy_file(struct st_command *command)
|
||||
|
||||
void do_chmod_file(struct st_command *command)
|
||||
{
|
||||
ulong mode= 0;
|
||||
long mode= 0;
|
||||
static DYNAMIC_STRING ds_mode;
|
||||
static DYNAMIC_STRING ds_file;
|
||||
const struct command_arg chmod_file_args[] = {
|
||||
@@ -2129,6 +2127,7 @@ void do_perl(struct st_command *command)
|
||||
int do_echo(struct st_command *command)
|
||||
{
|
||||
DYNAMIC_STRING ds_echo;
|
||||
DBUG_ENTER("do_echo");
|
||||
|
||||
init_dynamic_string(&ds_echo, "", command->query_len, 256);
|
||||
do_eval(&ds_echo, command->first_argument, command->end, FALSE);
|
||||
@@ -2136,7 +2135,7 @@ int do_echo(struct st_command *command)
|
||||
dynstr_append_mem(&ds_res, "\n", 1);
|
||||
dynstr_free(&ds_echo);
|
||||
command->last_argument= command->end;
|
||||
return(0);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -2432,7 +2431,6 @@ void do_let(struct st_command *command)
|
||||
char *p= command->first_argument;
|
||||
char *var_name, *var_name_end;
|
||||
DYNAMIC_STRING let_rhs_expr;
|
||||
|
||||
DBUG_ENTER("do_let");
|
||||
|
||||
init_dynamic_string(&let_rhs_expr, "", 512, 2048);
|
||||
@@ -3112,7 +3110,7 @@ int connect_n_handle_errors(struct st_command *command,
|
||||
|
||||
void do_connect(struct st_command *command)
|
||||
{
|
||||
int con_port= port;
|
||||
int con_port= opt_port;
|
||||
char *con_options;
|
||||
bool con_ssl= 0, con_compress= 0;
|
||||
char *ptr;
|
||||
@@ -3248,13 +3246,12 @@ void do_connect(struct st_command *command)
|
||||
|
||||
/* Use default db name */
|
||||
if (ds_database.length == 0)
|
||||
dynstr_set(&ds_database, db);
|
||||
dynstr_set(&ds_database, opt_db);
|
||||
|
||||
/* Special database to allow one to connect without a database name */
|
||||
if (ds_database.length && !strcmp(ds_database.str,"*NO-ONE*"))
|
||||
dynstr_set(&ds_database, "");
|
||||
|
||||
|
||||
if (connect_n_handle_errors(command, &next_con->mysql,
|
||||
ds_host.str,ds_user.str,
|
||||
ds_password.str, ds_database.str,
|
||||
@@ -3678,7 +3675,7 @@ int read_line(char *buf, int size)
|
||||
void convert_to_format_v1(char* query)
|
||||
{
|
||||
int last_c_was_quote= 0;
|
||||
char *p= query, *write= query;
|
||||
char *p= query, *to= query;
|
||||
char *end= strend(query);
|
||||
char last_c;
|
||||
|
||||
@@ -3686,7 +3683,7 @@ void convert_to_format_v1(char* query)
|
||||
{
|
||||
if (*p == '\n' && !last_c_was_quote)
|
||||
{
|
||||
*write++ = *p++; /* Save the newline */
|
||||
*to++ = *p++; /* Save the newline */
|
||||
|
||||
/* Skip any spaces on next line */
|
||||
while (*p && my_isspace(charset_info, *p))
|
||||
@@ -3697,19 +3694,19 @@ void convert_to_format_v1(char* query)
|
||||
else if (*p == '\'' || *p == '"' || *p == '`')
|
||||
{
|
||||
last_c= *p;
|
||||
*write++ = *p++;
|
||||
*to++ = *p++;
|
||||
|
||||
/* Copy anything until the next quote of same type */
|
||||
while (*p && *p != last_c)
|
||||
*write++ = *p++;
|
||||
*to++ = *p++;
|
||||
|
||||
*write++ = *p++;
|
||||
*to++ = *p++;
|
||||
|
||||
last_c_was_quote= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
*write++ = *p++;
|
||||
*to++ = *p++;
|
||||
last_c_was_quote= 0;
|
||||
}
|
||||
}
|
||||
@@ -3827,19 +3824,17 @@ void check_eol_junk(const char *eol)
|
||||
Create a command from a set of lines
|
||||
|
||||
SYNOPSIS
|
||||
read_command()
|
||||
command_ptr pointer where to return the new query
|
||||
read_command()
|
||||
command_ptr pointer where to return the new query
|
||||
|
||||
DESCRIPTION
|
||||
Converts lines returned by read_line into a command, this involves
|
||||
parsing the first word in the read line to find the command type.
|
||||
|
||||
Converts lines returned by read_line into a command, this involves
|
||||
parsing the first word in the read line to find the command type.
|
||||
|
||||
A -- comment may contain a valid query as the first word after the
|
||||
comment start. Thus it's always checked to see if that is the case.
|
||||
The advantage with this approach is to be able to execute commands
|
||||
terminated by new line '\n' regardless how many "delimiter" it contain.
|
||||
|
||||
*/
|
||||
|
||||
#define MAX_QUERY (256*1024) /* 256K -- a test in sp-big is >128K */
|
||||
@@ -3925,7 +3920,7 @@ static struct my_option my_long_options[] =
|
||||
{"cursor-protocol", OPT_CURSOR_PROTOCOL, "Use cursors for prepared statements.",
|
||||
(gptr*) &cursor_protocol, (gptr*) &cursor_protocol, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"database", 'D', "Database to use.", (gptr*) &db, (gptr*) &db, 0,
|
||||
{"database", 'D', "Database to use.", (gptr*) &opt_db, (gptr*) &opt_db, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef DBUG_OFF
|
||||
{"debug", '#', "This is a non-debug version. Catch this and exit",
|
||||
@@ -3936,7 +3931,7 @@ static struct my_option my_long_options[] =
|
||||
#endif
|
||||
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", (gptr*) &info_flag,
|
||||
(gptr*) &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"host", 'h', "Connect to host.", (gptr*) &host, (gptr*) &host, 0,
|
||||
{"host", 'h', "Connect to host.", (gptr*) &opt_host, (gptr*) &opt_host, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"include", 'i', "Include SQL before each test case.", (gptr*) &opt_include,
|
||||
(gptr*) &opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@@ -3952,8 +3947,8 @@ static struct my_option my_long_options[] =
|
||||
GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0},
|
||||
{"password", 'p', "Password to use when connecting to server.",
|
||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"port", 'P', "Port number to use for connection.", (gptr*) &port,
|
||||
(gptr*) &port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"port", 'P', "Port number to use for connection.", (gptr*) &opt_port,
|
||||
(gptr*) &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"ps-protocol", OPT_PS_PROTOCOL, "Use prepared statements protocol for communication",
|
||||
(gptr*) &ps_protocol, (gptr*) &ps_protocol, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@@ -3989,8 +3984,8 @@ static struct my_option my_long_options[] =
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"tmpdir", 't', "Temporary directory where sockets are put.",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"user", 'u', "User for login.", (gptr*) &user, (gptr*) &user, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"user", 'u', "User for login.", (gptr*) &opt_user, (gptr*) &opt_user, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"verbose", 'v', "Write more.", (gptr*) &verbose, (gptr*) &verbose, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"version", 'V', "Output version information and exit.",
|
||||
@@ -4117,8 +4112,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
case 'p':
|
||||
if (argument)
|
||||
{
|
||||
my_free(pass, MYF(MY_ALLOW_ZERO_PTR));
|
||||
pass= my_strdup(argument, MYF(MY_FAE));
|
||||
my_free(opt_pass, MYF(MY_ALLOW_ZERO_PTR));
|
||||
opt_pass= my_strdup(argument, MYF(MY_FAE));
|
||||
while (*argument) *argument++= 'x'; /* Destroy argument */
|
||||
tty_password= 0;
|
||||
}
|
||||
@@ -4155,7 +4150,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
exit(0);
|
||||
case '?':
|
||||
usage();
|
||||
exit(1);
|
||||
exit(0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -4175,9 +4170,9 @@ int parse_args(int argc, char **argv)
|
||||
exit(1);
|
||||
}
|
||||
if (argc == 1)
|
||||
db= *argv;
|
||||
opt_db= *argv;
|
||||
if (tty_password)
|
||||
pass=get_tty_password(NullS);
|
||||
opt_pass= get_tty_password(NullS); /* purify tested */
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -4462,13 +4457,13 @@ void append_result(DYNAMIC_STRING *ds, MYSQL_RES *res)
|
||||
void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt,
|
||||
MYSQL_FIELD *fields, uint num_fields)
|
||||
{
|
||||
MYSQL_BIND *bind;
|
||||
MYSQL_BIND *my_bind;
|
||||
my_bool *is_null;
|
||||
ulong *length;
|
||||
uint i;
|
||||
|
||||
/* Allocate array with bind structs, lengths and NULL flags */
|
||||
bind= (MYSQL_BIND*) my_malloc(num_fields * sizeof(MYSQL_BIND),
|
||||
my_bind= (MYSQL_BIND*) my_malloc(num_fields * sizeof(MYSQL_BIND),
|
||||
MYF(MY_WME | MY_FAE | MY_ZEROFILL));
|
||||
length= (ulong*) my_malloc(num_fields * sizeof(ulong),
|
||||
MYF(MY_WME | MY_FAE));
|
||||
@@ -4479,25 +4474,25 @@ void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt,
|
||||
for (i= 0; i < num_fields; i++)
|
||||
{
|
||||
uint max_length= fields[i].max_length + 1;
|
||||
bind[i].buffer_type= MYSQL_TYPE_STRING;
|
||||
bind[i].buffer= (char *)my_malloc(max_length, MYF(MY_WME | MY_FAE));
|
||||
bind[i].buffer_length= max_length;
|
||||
bind[i].is_null= &is_null[i];
|
||||
bind[i].length= &length[i];
|
||||
my_bind[i].buffer_type= MYSQL_TYPE_STRING;
|
||||
my_bind[i].buffer= (char *)my_malloc(max_length, MYF(MY_WME | MY_FAE));
|
||||
my_bind[i].buffer_length= max_length;
|
||||
my_bind[i].is_null= &is_null[i];
|
||||
my_bind[i].length= &length[i];
|
||||
|
||||
DBUG_PRINT("bind", ("col[%d]: buffer_type: %d, buffer_length: %lu",
|
||||
i, bind[i].buffer_type, bind[i].buffer_length));
|
||||
i, my_bind[i].buffer_type, my_bind[i].buffer_length));
|
||||
}
|
||||
|
||||
if (mysql_stmt_bind_result(stmt, bind))
|
||||
if (mysql_stmt_bind_result(stmt, my_bind))
|
||||
die("mysql_stmt_bind_result failed: %d: %s",
|
||||
mysql_stmt_errno(stmt), mysql_stmt_error(stmt));
|
||||
|
||||
while (mysql_stmt_fetch(stmt) == 0)
|
||||
{
|
||||
for (i= 0; i < num_fields; i++)
|
||||
append_field(ds, i, &fields[i], (const char *) bind[i].buffer,
|
||||
*bind[i].length, *bind[i].is_null);
|
||||
append_field(ds, i, &fields[i], (const char *) my_bind[i].buffer,
|
||||
*my_bind[i].length, *my_bind[i].is_null);
|
||||
if (!display_result_vertically)
|
||||
dynstr_append_mem(ds, "\n", 1);
|
||||
}
|
||||
@@ -4509,10 +4504,10 @@ void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt,
|
||||
for (i= 0; i < num_fields; i++)
|
||||
{
|
||||
/* Free data for output */
|
||||
my_free((gptr)bind[i].buffer, MYF(MY_WME | MY_FAE));
|
||||
my_free((gptr)my_bind[i].buffer, MYF(MY_WME | MY_FAE));
|
||||
}
|
||||
/* Free array with bind structs, lengths and NULL flags */
|
||||
my_free((gptr)bind , MYF(MY_WME | MY_FAE));
|
||||
my_free((gptr)my_bind , MYF(MY_WME | MY_FAE));
|
||||
my_free((gptr)length , MYF(MY_WME | MY_FAE));
|
||||
my_free((gptr)is_null , MYF(MY_WME | MY_FAE));
|
||||
}
|
||||
@@ -4649,17 +4644,14 @@ int append_warnings(DYNAMIC_STRING *ds, MYSQL* mysql)
|
||||
/*
|
||||
Run query using MySQL C API
|
||||
|
||||
SYNPOSIS
|
||||
run_query_normal
|
||||
mysql - mysql handle
|
||||
command - currrent command pointer
|
||||
flags -flags indicating wheter to SEND and/or REAP
|
||||
query - query string to execute
|
||||
query_len - length query string to execute
|
||||
ds - output buffer wherte to store result form query
|
||||
|
||||
RETURN VALUE
|
||||
error - function will not return
|
||||
SYNOPSIS
|
||||
run_query_normal()
|
||||
mysql mysql handle
|
||||
command current command pointer
|
||||
flags flags indicating if we should SEND and/or REAP
|
||||
query query string to execute
|
||||
query_len length query string to execute
|
||||
ds output buffer where to store result form query
|
||||
*/
|
||||
|
||||
void run_query_normal(struct st_connection *cn, struct st_command *command,
|
||||
@@ -5184,15 +5176,14 @@ int util_query(MYSQL* org_mysql, const char* query){
|
||||
/*
|
||||
Run query
|
||||
|
||||
SYNPOSIS
|
||||
run_query()
|
||||
mysql mysql handle
|
||||
command currrent command pointer
|
||||
|
||||
flags control the phased/stages of query execution to be performed
|
||||
if QUERY_SEND_FLAG bit is on, the query will be sent. If QUERY_REAP_FLAG
|
||||
is on the result will be read - for regular query, both bits must be on
|
||||
|
||||
SYNPOSIS
|
||||
run_query
|
||||
mysql - mysql handle
|
||||
command - currrent command pointer
|
||||
|
||||
*/
|
||||
|
||||
void run_query(struct st_connection *cn, struct st_command *command, int flags)
|
||||
@@ -5207,6 +5198,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
|
||||
my_bool view_created= 0, sp_created= 0;
|
||||
my_bool complete_query= ((flags & QUERY_SEND_FLAG) &&
|
||||
(flags & QUERY_REAP_FLAG));
|
||||
DBUG_ENTER("run_query");
|
||||
|
||||
init_dynamic_string(&ds_warnings, NULL, 0, 256);
|
||||
|
||||
@@ -5372,7 +5364,6 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
|
||||
|
||||
if (command->require_file[0])
|
||||
{
|
||||
|
||||
/* A result file was specified for _this_ query
|
||||
and the output should be checked against an already
|
||||
existing file which has been specified using --require or --result
|
||||
@@ -5385,6 +5376,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
|
||||
dynstr_free(&ds_result);
|
||||
if (command->type == Q_EVAL)
|
||||
dynstr_free(&eval_query);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
@@ -5712,8 +5704,8 @@ int main(int argc, char **argv)
|
||||
if (!(cur_con->name = my_strdup("default", MYF(MY_WME))))
|
||||
die("Out of memory");
|
||||
|
||||
safe_connect(&cur_con->mysql, cur_con->name, host, user, pass,
|
||||
db, port, unix_sock);
|
||||
safe_connect(&cur_con->mysql, cur_con->name, opt_host, opt_user, opt_pass,
|
||||
opt_db, opt_port, unix_sock);
|
||||
|
||||
/* Use all time until exit if no explicit 'start_timer' */
|
||||
timer_start= timer_now();
|
||||
@@ -6080,8 +6072,6 @@ int main(int argc, char **argv)
|
||||
if (result_file_name && ds_warning_messages.length)
|
||||
dump_warning_messages();
|
||||
|
||||
dynstr_free(&ds_res);
|
||||
|
||||
timer_output();
|
||||
free_used_memory();
|
||||
my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR);
|
||||
|
@@ -247,6 +247,10 @@ bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *cs)
|
||||
0 No conversion needed
|
||||
1 Either character set conversion or adding leading zeros
|
||||
(e.g. for UCS-2) must be done
|
||||
|
||||
NOTE
|
||||
to_cs may be NULL for "no conversion" if the system variable
|
||||
character_set_results is NULL.
|
||||
*/
|
||||
|
||||
bool String::needs_conversion(uint32 arg_length,
|
||||
@@ -255,7 +259,8 @@ bool String::needs_conversion(uint32 arg_length,
|
||||
uint32 *offset)
|
||||
{
|
||||
*offset= 0;
|
||||
if ((to_cs == &my_charset_bin) ||
|
||||
if (!to_cs ||
|
||||
(to_cs == &my_charset_bin) ||
|
||||
(to_cs == from_cs) ||
|
||||
my_charset_same(from_cs, to_cs) ||
|
||||
((from_cs == &my_charset_bin) &&
|
||||
@@ -612,27 +617,26 @@ skip:
|
||||
}
|
||||
|
||||
/*
|
||||
** replace substring with string
|
||||
** If wrong parameter or not enough memory, do nothing
|
||||
Replace substring with string
|
||||
If wrong parameter or not enough memory, do nothing
|
||||
*/
|
||||
|
||||
|
||||
bool String::replace(uint32 offset,uint32 arg_length,const String &to)
|
||||
{
|
||||
return replace(offset,arg_length,to.ptr(),to.length());
|
||||
}
|
||||
|
||||
bool String::replace(uint32 offset,uint32 arg_length,
|
||||
const char *to,uint32 length)
|
||||
const char *to, uint32 to_length)
|
||||
{
|
||||
long diff = (long) length-(long) arg_length;
|
||||
long diff = (long) to_length-(long) arg_length;
|
||||
if (offset+arg_length <= str_length)
|
||||
{
|
||||
if (diff < 0)
|
||||
{
|
||||
if (length)
|
||||
memcpy(Ptr+offset,to,length);
|
||||
bmove(Ptr+offset+length,Ptr+offset+arg_length,
|
||||
if (to_length)
|
||||
memcpy(Ptr+offset,to,to_length);
|
||||
bmove(Ptr+offset+to_length,Ptr+offset+arg_length,
|
||||
str_length-offset-arg_length);
|
||||
}
|
||||
else
|
||||
@@ -644,8 +648,8 @@ bool String::replace(uint32 offset,uint32 arg_length,
|
||||
bmove_upp(Ptr+str_length+diff,Ptr+str_length,
|
||||
str_length-offset-arg_length);
|
||||
}
|
||||
if (length)
|
||||
memcpy(Ptr+offset,to,length);
|
||||
if (to_length)
|
||||
memcpy(Ptr+offset,to,to_length);
|
||||
}
|
||||
str_length+=(uint32) diff;
|
||||
}
|
||||
@@ -818,8 +822,18 @@ copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
|
||||
from++;
|
||||
wc= '?';
|
||||
}
|
||||
else if (cnvres > MY_CS_TOOSMALL)
|
||||
{
|
||||
/*
|
||||
A correct multibyte sequence detected
|
||||
But it doesn't have Unicode mapping.
|
||||
*/
|
||||
error_count++;
|
||||
from+= (-cnvres);
|
||||
wc= '?';
|
||||
}
|
||||
else
|
||||
break; // Impossible char.
|
||||
break; // Not enough characters
|
||||
|
||||
outp:
|
||||
if ((cnvres= (*wc_mb)(to_cs, wc, (uchar*) to, to_end)) > 0)
|
||||
@@ -847,22 +861,22 @@ void String::print(String *str)
|
||||
switch (c)
|
||||
{
|
||||
case '\\':
|
||||
str->append("\\\\", 2);
|
||||
str->append(STRING_WITH_LEN("\\\\"));
|
||||
break;
|
||||
case '\0':
|
||||
str->append("\\0", 2);
|
||||
str->append(STRING_WITH_LEN("\\0"));
|
||||
break;
|
||||
case '\'':
|
||||
str->append("\\'", 2);
|
||||
str->append(STRING_WITH_LEN("\\'"));
|
||||
break;
|
||||
case '\n':
|
||||
str->append("\\n", 2);
|
||||
str->append(STRING_WITH_LEN("\\n"));
|
||||
break;
|
||||
case '\r':
|
||||
str->append("\\r", 2);
|
||||
str->append(STRING_WITH_LEN("\\r"));
|
||||
break;
|
||||
case 26: //Ctrl-Z
|
||||
str->append("\\z", 2);
|
||||
str->append(STRING_WITH_LEN("\\z"));
|
||||
break;
|
||||
default:
|
||||
str->append(c);
|
||||
|
@@ -23,6 +23,8 @@
|
||||
#define NOT_FIXED_DEC 31
|
||||
#endif
|
||||
|
||||
#define STRING_WITH_LEN(X) ((const char*) X), ((uint) (sizeof(X) - 1))
|
||||
|
||||
class String;
|
||||
int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
|
||||
String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
|
||||
@@ -76,13 +78,15 @@ public:
|
||||
{ /* never called */ }
|
||||
~String() { free(); }
|
||||
|
||||
inline void set_charset(CHARSET_INFO *charset) { str_charset= charset; }
|
||||
inline void set_charset(CHARSET_INFO *charset_arg)
|
||||
{ str_charset= charset_arg; }
|
||||
inline CHARSET_INFO *charset() const { return str_charset; }
|
||||
inline uint32 length() const { return str_length;}
|
||||
inline uint32 alloced_length() const { return Alloced_length;}
|
||||
inline char& operator [] (uint32 i) const { return Ptr[i]; }
|
||||
inline void length(uint32 len) { str_length=len ; }
|
||||
inline bool is_empty() { return (str_length == 0); }
|
||||
inline void mark_as_const() { Alloced_length= 0;}
|
||||
inline const char *ptr() const { return Ptr; }
|
||||
inline char *c_ptr()
|
||||
{
|
||||
|
@@ -112,7 +112,7 @@ int rl_attempted_completion_over = 0;
|
||||
char *rl_basic_word_break_characters = break_chars;
|
||||
char *rl_completer_word_break_characters = NULL;
|
||||
char *rl_completer_quote_characters = NULL;
|
||||
Function *rl_completion_entry_function = NULL;
|
||||
CPFunction *rl_completion_entry_function = NULL;
|
||||
CPPFunction *rl_attempted_completion_function = NULL;
|
||||
Function *rl_pre_input_hook = NULL;
|
||||
Function *rl_startup1_hook = NULL;
|
||||
@@ -1724,7 +1724,7 @@ rl_display_match_list (matches, len, max)
|
||||
static int
|
||||
_rl_complete_internal(int what_to_do)
|
||||
{
|
||||
Function *complet_func;
|
||||
CPFunction *complet_func;
|
||||
const LineInfo *li;
|
||||
char *temp, **matches;
|
||||
const char *ctemp;
|
||||
@@ -1737,7 +1737,7 @@ _rl_complete_internal(int what_to_do)
|
||||
|
||||
complet_func = rl_completion_entry_function;
|
||||
if (!complet_func)
|
||||
complet_func = (Function *)(void *)filename_completion_function;
|
||||
complet_func = filename_completion_function;
|
||||
|
||||
/* We now look backwards for the start of a filename/variable word */
|
||||
li = el_line(e);
|
||||
@@ -1764,7 +1764,7 @@ _rl_complete_internal(int what_to_do)
|
||||
} else
|
||||
matches = 0;
|
||||
if (!rl_attempted_completion_function || !matches)
|
||||
matches = completion_matches(temp, (CPFunction *)complet_func);
|
||||
matches = completion_matches(temp, complet_func);
|
||||
|
||||
if (matches) {
|
||||
int i, retval = CC_REFRESH;
|
||||
@@ -1789,8 +1789,7 @@ _rl_complete_internal(int what_to_do)
|
||||
* object is a directory.
|
||||
*/
|
||||
size_t alen = strlen(matches[0]);
|
||||
if ((complet_func !=
|
||||
(Function *)filename_completion_function
|
||||
if ((complet_func != filename_completion_function
|
||||
|| (alen > 0 && (matches[0])[alen - 1] != '/'))
|
||||
&& rl_completion_append_character) {
|
||||
char buf[2];
|
||||
|
@@ -102,7 +102,7 @@ extern int max_input_history;
|
||||
extern char *rl_basic_word_break_characters;
|
||||
extern char *rl_completer_word_break_characters;
|
||||
extern char *rl_completer_quote_characters;
|
||||
extern Function *rl_completion_entry_function;
|
||||
extern CPFunction *rl_completion_entry_function;
|
||||
extern CPPFunction *rl_attempted_completion_function;
|
||||
extern int rl_completion_type;
|
||||
extern int rl_completion_query_items;
|
||||
|
@@ -426,7 +426,7 @@ rl_redisplay ()
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
wchar_t wc;
|
||||
size_t wc_bytes;
|
||||
int wc_width;
|
||||
int wc_width= 0;
|
||||
mbstate_t ps;
|
||||
int _rl_wrapped_multicolumn = 0;
|
||||
#endif
|
||||
@@ -524,6 +524,17 @@ rl_redisplay ()
|
||||
wrap_offset = prompt_invis_chars_first_line = 0;
|
||||
}
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
#define CHECK_INV_LBREAKS() \
|
||||
do { \
|
||||
if (newlines >= (inv_lbsize - 2)) \
|
||||
{ \
|
||||
inv_lbsize *= 2; \
|
||||
inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
|
||||
_rl_wrapped_line = (int *)xrealloc (_rl_wrapped_line, inv_lbsize * sizeof (int)); \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
#define CHECK_INV_LBREAKS() \
|
||||
do { \
|
||||
if (newlines >= (inv_lbsize - 2)) \
|
||||
@@ -532,6 +543,7 @@ rl_redisplay ()
|
||||
inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
#define CHECK_LPOS() \
|
||||
|
@@ -560,12 +560,12 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line)
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
{
|
||||
int c, l;
|
||||
int chr, l;
|
||||
l = _rl_find_prev_mbchar (string, i, MB_FIND_ANY);
|
||||
c = string[l];
|
||||
chr = string[l];
|
||||
/* XXX - original patch had i - 1 ??? If i == 0 it would fail. */
|
||||
if (i && (c == '\'' || c == '"'))
|
||||
quoted_search_delimiter = c;
|
||||
if (i && (chr == '\'' || chr == '"'))
|
||||
quoted_search_delimiter = chr;
|
||||
}
|
||||
else
|
||||
#endif /* HANDLE_MULTIBYTE */
|
||||
|
@@ -529,17 +529,17 @@ _rl_read_mbchar (mbchar, size)
|
||||
may be FIRST. Used by the search functions, among others. Very similar
|
||||
to _rl_read_mbchar. */
|
||||
int
|
||||
_rl_read_mbstring (first, mb, mblen)
|
||||
_rl_read_mbstring (first, mb, mb_len)
|
||||
int first;
|
||||
char *mb;
|
||||
int mblen;
|
||||
int mb_len;
|
||||
{
|
||||
int i, c;
|
||||
mbstate_t ps;
|
||||
|
||||
c = first;
|
||||
memset (mb, 0, mblen);
|
||||
for (i = 0; i < mblen; i++)
|
||||
memset (mb, 0, mb_len);
|
||||
for (i = 0; i < mb_len; i++)
|
||||
{
|
||||
mb[i] = (char)c;
|
||||
memset (&ps, 0, sizeof (mbstate_t));
|
||||
|
@@ -1002,12 +1002,12 @@ _rl_rubout_char (count, key)
|
||||
}
|
||||
else
|
||||
{
|
||||
int orig_point;
|
||||
int orig_point2;
|
||||
|
||||
orig_point = rl_point;
|
||||
orig_point2 = rl_point;
|
||||
rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_NONZERO);
|
||||
c = rl_line_buffer[rl_point];
|
||||
rl_delete_text (rl_point, orig_point);
|
||||
rl_delete_text (rl_point, orig_point2);
|
||||
}
|
||||
#endif /* HANDLE_MULTIBYTE */
|
||||
|
||||
|
@@ -672,7 +672,7 @@ _rl_vi_change_mbchar_case (count)
|
||||
{
|
||||
wchar_t wc;
|
||||
char mb[MB_LEN_MAX+1];
|
||||
int mblen;
|
||||
int local_mblen;
|
||||
mbstate_t ps;
|
||||
|
||||
memset (&ps, 0, sizeof (mbstate_t));
|
||||
@@ -695,9 +695,9 @@ _rl_vi_change_mbchar_case (count)
|
||||
/* Vi is kind of strange here. */
|
||||
if (wc)
|
||||
{
|
||||
mblen = wcrtomb (mb, wc, &ps);
|
||||
if (mblen >= 0)
|
||||
mb[mblen] = '\0';
|
||||
local_mblen = wcrtomb (mb, wc, &ps);
|
||||
if (local_mblen >= 0)
|
||||
mb[local_mblen] = '\0';
|
||||
rl_begin_undo_group ();
|
||||
rl_delete (1, 0);
|
||||
rl_insert_text (mb);
|
||||
|
@@ -278,6 +278,17 @@ AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [
|
||||
ndb_bin_am_ldflags=""
|
||||
fi
|
||||
|
||||
# libndbclient versioning when linked with GNU ld.
|
||||
if $LD --version 2>/dev/null|grep -q GNU; then
|
||||
NDB_LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/storage/ndb/src/libndb.ver"
|
||||
AC_CONFIG_FILES(storage/ndb/src/libndb.ver)
|
||||
fi
|
||||
AC_SUBST(NDB_LD_VERSION_SCRIPT)
|
||||
|
||||
AC_SUBST(NDB_SHARED_LIB_MAJOR_VERSION)
|
||||
AC_SUBST(NDB_SHARED_LIB_VERSION)
|
||||
|
||||
|
||||
AC_SUBST(NDB_VERSION_MAJOR)
|
||||
AC_SUBST(NDB_VERSION_MINOR)
|
||||
AC_SUBST(NDB_VERSION_BUILD)
|
||||
|
25
configure.in
25
configure.in
@@ -15,6 +15,8 @@ DOT_FRM_VERSION=6
|
||||
# See the libtool docs for information on how to do shared lib versions.
|
||||
SHARED_LIB_MAJOR_VERSION=15
|
||||
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
|
||||
NDB_SHARED_LIB_MAJOR_VERSION=3
|
||||
NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0
|
||||
# Set all version vars based on $VERSION. How do we do this more elegant ?
|
||||
# Remember that regexps needs to quote [ and ] since this is run through m4
|
||||
MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|[[a-z]]*-.*$||"`
|
||||
@@ -354,6 +356,7 @@ if $LD --version 2>/dev/null|grep -q GNU; then
|
||||
fi
|
||||
AC_SUBST(LD_VERSION_SCRIPT)
|
||||
|
||||
|
||||
# Avoid bug in fcntl on some versions of linux
|
||||
AC_MSG_CHECKING([if we should use 'skip-external-locking' as default for $target_os])
|
||||
# Any variation of Linux
|
||||
@@ -970,7 +973,7 @@ case $SYSTEM_TYPE in
|
||||
*darwin6*)
|
||||
if test "$ac_cv_prog_gcc" = "yes"
|
||||
then
|
||||
FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH"
|
||||
FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH -DDONT_DECLARE_CXA_PURE_VIRTUAL "
|
||||
CFLAGS="$CFLAGS $FLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $FLAGS"
|
||||
MAX_C_OPTIMIZE="-O"
|
||||
@@ -2354,6 +2357,7 @@ readline_basedir=""
|
||||
readline_dir=""
|
||||
readline_h_ln_cmd=""
|
||||
readline_link=""
|
||||
want_to_use_readline="no"
|
||||
|
||||
if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null
|
||||
then
|
||||
@@ -2379,6 +2383,7 @@ then
|
||||
readline_link="\$(top_builddir)/cmd-line-utils/readline/libreadline.a"
|
||||
readline_h_ln_cmd="\$(LN) -s \$(top_srcdir)/cmd-line-utils/readline readline"
|
||||
compile_readline=yes
|
||||
want_to_use_readline="yes"
|
||||
AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE, 1)
|
||||
else
|
||||
# Use system readline library
|
||||
@@ -2388,10 +2393,12 @@ else
|
||||
MYSQL_CHECK_NEW_RL_INTERFACE
|
||||
MYSQL_CHECK_READLINE_DECLARES_HIST_ENTRY
|
||||
AC_LANG_RESTORE
|
||||
if [test "$mysql_cv_new_rl_interface" = "yes"]
|
||||
if [test "$mysql_cv_new_rl_interface" = "yes"] && [test -d "./cmd-line-utils/readline"]
|
||||
then
|
||||
# Use the new readline interface
|
||||
# Use the new readline interface, but only if the package includes a bundled libreadline
|
||||
# this way we avoid linking commercial source with GPL readline
|
||||
readline_link="-lreadline"
|
||||
want_to_use_readline="yes"
|
||||
elif [test "$mysql_cv_libedit_interface" = "yes"]
|
||||
then
|
||||
# Use libedit
|
||||
@@ -2402,6 +2409,15 @@ else
|
||||
versions of libedit or readline])
|
||||
fi
|
||||
fi
|
||||
|
||||
# if there is no readline, but we want to build with readline, we fail
|
||||
if [test "$want_to_use_readline" = "yes"] && [test ! -d "./cmd-line-utils/readline"]
|
||||
then
|
||||
AC_MSG_ERROR([This commercially licensed MySQL source package can't
|
||||
be built with libreadline. Please use --with-libedit to use
|
||||
the bundled version of libedit instead.])
|
||||
fi
|
||||
|
||||
#
|
||||
# if either readline or libedit is enabled - generate Makefile's for both
|
||||
# (to make sure both are included in 'make dist')
|
||||
@@ -2531,7 +2547,8 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
|
||||
sql/sql_builtin.cc sql-common/Makefile dnl
|
||||
dbug/Makefile scripts/Makefile include/Makefile dnl
|
||||
tests/Makefile Docs/Makefile support-files/Makefile dnl
|
||||
support-files/MacOSX/Makefile mysql-test/Makefile dnl
|
||||
support-files/MacOSX/Makefile support-files/RHEL4-SElinux/Makefile dnl
|
||||
mysql-test/Makefile dnl
|
||||
mysql-test/ndb/Makefile netware/Makefile sql-bench/Makefile dnl
|
||||
include/mysql_version.h plugin/Makefile win/Makefile)
|
||||
|
||||
|
299
configure.in.rej
Normal file
299
configure.in.rej
Normal file
@@ -0,0 +1,299 @@
|
||||
***************
|
||||
*** 388,402 ****
|
||||
if expr "$target_os" : "[[Ll]]inux.*" > /dev/null
|
||||
then
|
||||
MYSQLD_DEFAULT_SWITCHES="--skip-locking"
|
||||
! IS_LINUX="true"
|
||||
AC_MSG_RESULT("yes");
|
||||
else
|
||||
MYSQLD_DEFAULT_SWITCHES=""
|
||||
! IS_LINUX="false"
|
||||
AC_MSG_RESULT("no");
|
||||
fi
|
||||
AC_SUBST(MYSQLD_DEFAULT_SWITCHES)
|
||||
! AC_SUBST(IS_LINUX)
|
||||
|
||||
dnl Find paths to some shell programs
|
||||
AC_PATH_PROG(LN, ln, ln)
|
||||
--- 388,403 ----
|
||||
if expr "$target_os" : "[[Ll]]inux.*" > /dev/null
|
||||
then
|
||||
MYSQLD_DEFAULT_SWITCHES="--skip-locking"
|
||||
! TARGET_LINUX="true"
|
||||
AC_MSG_RESULT("yes");
|
||||
+ AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
|
||||
else
|
||||
MYSQLD_DEFAULT_SWITCHES=""
|
||||
! TARGET_LINUX="false"
|
||||
AC_MSG_RESULT("no");
|
||||
fi
|
||||
AC_SUBST(MYSQLD_DEFAULT_SWITCHES)
|
||||
! AC_SUBST(TARGET_LINUX)
|
||||
|
||||
dnl Find paths to some shell programs
|
||||
AC_PATH_PROG(LN, ln, ln)
|
||||
***************
|
||||
*** 576,582 ****
|
||||
# (this is true on the MySQL build machines to avoid NSS problems)
|
||||
#
|
||||
|
||||
! if test "$IS_LINUX" = "true" -a "$static_nss" = ""
|
||||
then
|
||||
tmp=`nm /usr/lib/libc.a | grep _nss_files_getaliasent_r`
|
||||
if test -n "$tmp"
|
||||
--- 577,583 ----
|
||||
# (this is true on the MySQL build machines to avoid NSS problems)
|
||||
#
|
||||
|
||||
! if test "$TARGET_LINUX" = "true" -a "$static_nss" = ""
|
||||
then
|
||||
tmp=`nm /usr/lib/libc.a | grep _nss_files_getaliasent_r`
|
||||
if test -n "$tmp"
|
||||
***************
|
||||
*** 827,833 ****
|
||||
])
|
||||
AC_SUBST(WRAPLIBS)
|
||||
|
||||
! if test "$IS_LINUX" = "true"; then
|
||||
AC_MSG_CHECKING([for atomic operations])
|
||||
|
||||
AC_LANG_SAVE
|
||||
--- 828,834 ----
|
||||
])
|
||||
AC_SUBST(WRAPLIBS)
|
||||
|
||||
! if test "$TARGET_LINUX" = "true"; then
|
||||
AC_MSG_CHECKING([for atomic operations])
|
||||
|
||||
AC_LANG_SAVE
|
||||
***************
|
||||
*** 870,876 ****
|
||||
[ USE_PSTACK=no ])
|
||||
pstack_libs=
|
||||
pstack_dirs=
|
||||
! if test "$USE_PSTACK" = yes -a "$IS_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386" -a "$with_mit_threads" = "no"
|
||||
then
|
||||
have_libiberty= have_libbfd=
|
||||
my_save_LIBS="$LIBS"
|
||||
--- 871,877 ----
|
||||
[ USE_PSTACK=no ])
|
||||
pstack_libs=
|
||||
pstack_dirs=
|
||||
! if test "$USE_PSTACK" = yes -a "$TARGET_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386" -a "$with_mit_threads" = "no"
|
||||
then
|
||||
have_libiberty= have_libbfd=
|
||||
my_save_LIBS="$LIBS"
|
||||
***************
|
||||
*** 1239,1301 ****
|
||||
# Hack for DEC-UNIX (OSF1)
|
||||
if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no"
|
||||
then
|
||||
! # Look for LinuxThreads.
|
||||
! AC_MSG_CHECKING("LinuxThreads")
|
||||
! grepres=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
|
||||
! getconfres=`which getconf >/dev/null && getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |grep LINUXTHREADS | wc -l || echo 0`
|
||||
! if test "$grepres" -gt 0 -o "$getconfres" -gt 0
|
||||
then
|
||||
! AC_MSG_RESULT("Found")
|
||||
! AC_DEFINE(HAVE_LINUXTHREADS)
|
||||
! # Linux 2.0 sanity check
|
||||
! AC_TRY_COMPILE([#include <sched.h>], [int a = sched_get_priority_min(1);], ,
|
||||
! AC_MSG_ERROR([Syntax error in sched.h. Change _P to __P in the /usr/include/sched.h file. See the Installation chapter in the Reference Manual]))
|
||||
! # RedHat 5.0 does not work with dynamic linking of this. -static also
|
||||
! # gives a speed increase in linux so it does not hurt on other systems.
|
||||
! with_named_thread="-lpthread"
|
||||
! else
|
||||
! AC_MSG_RESULT("Not found")
|
||||
! # If this is a linux machine we should barf
|
||||
! AC_MSG_CHECKING("NPTL")
|
||||
! if test "$IS_LINUX" = "true"
|
||||
! then
|
||||
! getconfres=`which getconf >/dev/null && getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |grep NPTL | wc -l || echo 0`
|
||||
! if test "$getconfres" -gt 0
|
||||
then
|
||||
! AC_DEFINE(HAVE_LINUXTHREADS) dnl All this code predates NPTL, so "have linuxthreads" is a poor name.
|
||||
! with_named_thread="-lpthread"
|
||||
else
|
||||
! AC_MSG_ERROR([This is a Linux system and neither Linuxthreads nor NPTL were
|
||||
! found. Please install Linuxthreads or a new glibc and try
|
||||
! again. See the Installation chapter in the Reference Manual for
|
||||
! more information.])
|
||||
fi
|
||||
! else
|
||||
! AC_MSG_CHECKING("DEC threads")
|
||||
! if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a
|
||||
! then
|
||||
! with_named_thread="-lpthread -lmach -lexc"
|
||||
! CFLAGS="$CFLAGS -D_REENTRANT"
|
||||
! CXXFLAGS="$CXXFLAGS -D_REENTRANT"
|
||||
! AC_DEFINE(HAVE_DEC_THREADS)
|
||||
! AC_MSG_RESULT("yes")
|
||||
! else
|
||||
! AC_MSG_RESULT("no")
|
||||
! AC_MSG_CHECKING("DEC 3.2 threads")
|
||||
! if test -f /usr/shlib/libpthreads.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a
|
||||
! then
|
||||
! with_named_thread="-lpthreads -lmach -lc_r"
|
||||
! AC_DEFINE(HAVE_DEC_THREADS)
|
||||
! AC_DEFINE(HAVE_DEC_3_2_THREADS)
|
||||
! with_osf32_threads="yes"
|
||||
! MYSQLD_DEFAULT_SWITCHES="--skip-thread-priority"
|
||||
! AC_MSG_RESULT("yes")
|
||||
! else
|
||||
! AC_MSG_RESULT("no")
|
||||
! fi
|
||||
! fi
|
||||
! fi
|
||||
! fi
|
||||
fi
|
||||
|
||||
|
||||
--- 1240,1337 ----
|
||||
# Hack for DEC-UNIX (OSF1)
|
||||
if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no"
|
||||
then
|
||||
! AC_MSG_CHECKING("Linux threads")
|
||||
! if test "$TARGET_LINUX" = "true"
|
||||
then
|
||||
! AC_MSG_RESULT("starting")
|
||||
! # use getconf to check glibc contents
|
||||
! AC_MSG_CHECKING("getconf GNU_LIBPTHREAD_VERSION")
|
||||
! case `getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` in
|
||||
! NPTL* )
|
||||
! AC_MSG_RESULT("NPTL")
|
||||
! AC_DEFINE([HAVE_NPTL], [1], [NPTL threads implementation])
|
||||
! with_named_thread="-lpthread"
|
||||
! ;;
|
||||
! LINUXTHREADS* )
|
||||
! AC_MSG_RESULT("Linuxthreads")
|
||||
! AC_DEFINE([HAVE_LINUXTHREADS], [1],
|
||||
! [Whether we are using Xavier Leroy's LinuxThreads])
|
||||
! with_named_thread="-lpthread"
|
||||
! ;;
|
||||
! * )
|
||||
! AC_MSG_RESULT("unknown")
|
||||
! ;;
|
||||
! esac
|
||||
! if test "$with_named_thread" = "no"
|
||||
then
|
||||
! # old method, check headers
|
||||
! # Look for LinuxThreads.
|
||||
! AC_MSG_CHECKING("LinuxThreads in header file comment")
|
||||
! res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
|
||||
! if test "$res" -gt 0
|
||||
! then
|
||||
! AC_MSG_RESULT("Found")
|
||||
! AC_DEFINE([HAVE_LINUXTHREADS], [1],
|
||||
! [Whether we are using Xavier Leroy's LinuxThreads])
|
||||
! # Linux 2.0 sanity check
|
||||
! AC_TRY_COMPILE([#include <sched.h>], [int a = sched_get_priority_min(1);], ,
|
||||
! AC_MSG_ERROR([Syntax error in sched.h. Change _P to __P in the /usr/include/sched.h file. See the Installation chapter in the Reference Manual]))
|
||||
! # RedHat 5.0 does not work with dynamic linking of this. -static also
|
||||
! # gives a speed increase in linux so it does not hurt on other systems.
|
||||
! with_named_thread="-lpthread"
|
||||
! else
|
||||
! AC_MSG_RESULT("Not found")
|
||||
! # If this is a linux machine we should barf
|
||||
! AC_MSG_ERROR([This is a Linux system without a working getconf,
|
||||
! and Linuxthreads was not found. Please install it (or a new glibc) and try again.
|
||||
! See the Installation chapter in the Reference Manual for more information.])
|
||||
! fi
|
||||
else
|
||||
! AC_MSG_RESULT("no need to check headers")
|
||||
fi
|
||||
! AC_MSG_CHECKING("for pthread_create in -lpthread");
|
||||
! ac_save_LIBS="$LIBS"
|
||||
! LIBS="$LIBS -lpthread"
|
||||
! AC_TRY_LINK( [#include <pthread.h>],
|
||||
! [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
|
||||
! AC_MSG_RESULT("yes"),
|
||||
! [ AC_MSG_RESULT("no")
|
||||
! AC_MSG_ERROR([
|
||||
! This is a Linux system claiming to support threads, either Linuxthreads or NPTL, but linking a test program failed.
|
||||
! Please install one of these (or a new glibc) and try again.
|
||||
! See the Installation chapter in the Reference Manual for more information.]) ]
|
||||
! )
|
||||
! LIBS="$ac_save_LIBS"
|
||||
! else
|
||||
! AC_MSG_RESULT("no")
|
||||
! fi # "$TARGET_LINUX"
|
||||
! fi # "$with_named_thread" = "no" -a "$with_mit_threads" = "no"
|
||||
!
|
||||
! if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no"
|
||||
! then
|
||||
! AC_MSG_CHECKING("DEC threads")
|
||||
! if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a
|
||||
! then
|
||||
! with_named_thread="-lpthread -lmach -lexc"
|
||||
! CFLAGS="$CFLAGS -D_REENTRANT"
|
||||
! CXXFLAGS="$CXXFLAGS -D_REENTRANT"
|
||||
! AC_DEFINE(HAVE_DEC_THREADS)
|
||||
! AC_MSG_RESULT("yes")
|
||||
! else
|
||||
! AC_MSG_RESULT("no")
|
||||
! AC_MSG_CHECKING("DEC 3.2 threads")
|
||||
! if test -f /usr/shlib/libpthreads.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a
|
||||
! then
|
||||
! with_named_thread="-lpthreads -lmach -lc_r"
|
||||
! AC_DEFINE(HAVE_DEC_THREADS)
|
||||
! AC_DEFINE(HAVE_DEC_3_2_THREADS)
|
||||
! with_osf32_threads="yes"
|
||||
! MYSQLD_DEFAULT_SWITCHES="--skip-thread-priority"
|
||||
! AC_MSG_RESULT("yes")
|
||||
! else
|
||||
! AC_MSG_RESULT("no")
|
||||
! fi
|
||||
! fi
|
||||
fi
|
||||
|
||||
|
||||
***************
|
||||
*** 1720,1726 ****
|
||||
AC_SUBST(COMPILATION_COMMENT)
|
||||
|
||||
AC_MSG_CHECKING("need of special linking flags")
|
||||
! if test "$IS_LINUX" = "true" -a "$ac_cv_prog_gcc" = "yes" -a "$all_is_static" != "yes"
|
||||
then
|
||||
LDFLAGS="$LDFLAGS -rdynamic"
|
||||
AC_MSG_RESULT("-rdynamic")
|
||||
--- 1756,1762 ----
|
||||
AC_SUBST(COMPILATION_COMMENT)
|
||||
|
||||
AC_MSG_CHECKING("need of special linking flags")
|
||||
! if test "$TARGET_LINUX" = "true" -a "$ac_cv_prog_gcc" = "yes" -a "$all_is_static" != "yes"
|
||||
then
|
||||
LDFLAGS="$LDFLAGS -rdynamic"
|
||||
AC_MSG_RESULT("-rdynamic")
|
||||
***************
|
||||
*** 1873,1878 ****
|
||||
tell atod memcpy memmove \
|
||||
setupterm strcasecmp sighold vidattr lrand48 localtime_r \
|
||||
sigset sigthreadmask pthread_sigmask pthread_setprio pthread_setprio_np \
|
||||
pthread_setschedparam pthread_attr_setprio pthread_attr_setschedparam \
|
||||
pthread_attr_create pthread_getsequence_np pthread_attr_setstacksize \
|
||||
pthread_attr_getstacksize pthread_key_delete \
|
||||
--- 1909,1915 ----
|
||||
tell atod memcpy memmove \
|
||||
setupterm strcasecmp sighold vidattr lrand48 localtime_r \
|
||||
sigset sigthreadmask pthread_sigmask pthread_setprio pthread_setprio_np \
|
||||
+ sigaction sigemptyset sigaddset \
|
||||
pthread_setschedparam pthread_attr_setprio pthread_attr_setschedparam \
|
||||
pthread_attr_create pthread_getsequence_np pthread_attr_setstacksize \
|
||||
pthread_attr_getstacksize pthread_key_delete \
|
||||
***************
|
||||
*** 1884,1890 ****
|
||||
# Sanity check: We chould not have any fseeko symbol unless
|
||||
# large_file_support=yes
|
||||
AC_CHECK_FUNCS(fseeko,
|
||||
! [if test "$large_file_support" = no -a "$IS_LINUX" = "true";
|
||||
then
|
||||
AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!");
|
||||
fi]
|
||||
--- 1921,1927 ----
|
||||
# Sanity check: We chould not have any fseeko symbol unless
|
||||
# large_file_support=yes
|
||||
AC_CHECK_FUNCS(fseeko,
|
||||
! [if test "$large_file_support" = no -a "$TARGET_LINUX" = "true";
|
||||
then
|
||||
AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!");
|
||||
fi]
|
14
dbug/dbug.c
14
dbug/dbug.c
@@ -2375,4 +2375,18 @@ va_list ap;
|
||||
|
||||
#endif /* NO_VARARGS */
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* Dummy function, workaround for MySQL bug#14420 related
|
||||
* build failure on a platform where linking with an empty
|
||||
* archive fails.
|
||||
*
|
||||
* This block can be removed as soon as a fix for bug#14420
|
||||
* is implemented.
|
||||
*/
|
||||
int i_am_a_dummy_function() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -309,7 +309,7 @@ FILE *inf;
|
||||
unsigned long fn_ssz;
|
||||
unsigned long lastuse;
|
||||
unsigned int pos;
|
||||
unsigned long time;
|
||||
unsigned long local_time;
|
||||
unsigned int oldpos;
|
||||
unsigned long oldtime;
|
||||
unsigned long oldchild;
|
||||
@@ -335,15 +335,15 @@ FILE *inf;
|
||||
*/
|
||||
while (pop (&oldpos, &oldtime, &oldchild)) {
|
||||
DBUG_PRINT ("popped", ("%lu %lu", oldtime, oldchild));
|
||||
time = fn_time - oldtime;
|
||||
local_time = fn_time - oldtime;
|
||||
t = top ();
|
||||
t -> children += time;
|
||||
t -> children += local_time;
|
||||
DBUG_PRINT ("update", ("%s", modules[t -> pos].name));
|
||||
DBUG_PRINT ("update", ("%lu", t -> children));
|
||||
time -= oldchild;
|
||||
modules[oldpos].m_time += time;
|
||||
local_time -= oldchild;
|
||||
modules[oldpos].m_time += local_time;
|
||||
modules[oldpos].m_calls++;
|
||||
tot_time += time;
|
||||
tot_time += local_time;
|
||||
tot_calls++;
|
||||
if (pos == oldpos) {
|
||||
goto next_line; /* Should be a break2 */
|
||||
@@ -355,11 +355,11 @@ FILE *inf;
|
||||
* it so that it works the next time too.
|
||||
*/
|
||||
t = top ();
|
||||
time = fn_time - t -> time - t -> children;
|
||||
local_time = fn_time - t -> time - t -> children;
|
||||
t -> time = fn_time; t -> children = 0;
|
||||
modules[pos].m_time += time;
|
||||
modules[pos].m_time += local_time;
|
||||
modules[pos].m_calls++;
|
||||
tot_time += time;
|
||||
tot_time += local_time;
|
||||
tot_calls++;
|
||||
break;
|
||||
case 'S':
|
||||
@@ -405,13 +405,13 @@ FILE *inf;
|
||||
* time of fn_time.
|
||||
*/
|
||||
while (pop (&oldpos,&oldtime,&oldchild)) {
|
||||
time = fn_time - oldtime;
|
||||
local_time = fn_time - oldtime;
|
||||
t = top ();
|
||||
t -> children += time;
|
||||
time -= oldchild;
|
||||
modules[oldpos].m_time += time;
|
||||
t -> children += local_time;
|
||||
local_time -= oldchild;
|
||||
modules[oldpos].m_time += local_time;
|
||||
modules[oldpos].m_calls++;
|
||||
tot_time += time;
|
||||
tot_time += local_time;
|
||||
tot_calls++;
|
||||
}
|
||||
DBUG_VOID_RETURN;
|
||||
@@ -472,17 +472,17 @@ unsigned long int *called, *timed;
|
||||
{
|
||||
char *name = m -> name;
|
||||
register unsigned int calls = m -> m_calls;
|
||||
register unsigned long time = m -> m_time;
|
||||
register unsigned long local_time = m -> m_time;
|
||||
register unsigned long stkuse = m -> m_stkuse;
|
||||
unsigned int import;
|
||||
double per_time = 0.0;
|
||||
double per_calls = 0.0;
|
||||
double ms_per_call, ftime;
|
||||
double ms_per_call, local_ftime;
|
||||
|
||||
DBUG_ENTER ("out_item");
|
||||
|
||||
if (tot_time > 0) {
|
||||
per_time = (double) (time * 100) / (double) tot_time;
|
||||
per_time = (double) (local_time * 100) / (double) tot_time;
|
||||
}
|
||||
if (tot_calls > 0) {
|
||||
per_calls = (double) (calls * 100) / (double) tot_calls;
|
||||
@@ -491,18 +491,18 @@ unsigned long int *called, *timed;
|
||||
|
||||
if (verbose) {
|
||||
fprintf (outf, "%6d\t%10.2f\t%11ld\t%10.2f %10d\t%-15s\n",
|
||||
calls, per_calls, time, per_time, import, name);
|
||||
calls, per_calls, local_time, per_time, import, name);
|
||||
} else {
|
||||
ms_per_call = time;
|
||||
ms_per_call = local_time;
|
||||
ms_per_call /= calls;
|
||||
ftime = time;
|
||||
ftime /= 1000;
|
||||
local_ftime = local_time;
|
||||
local_ftime /= 1000;
|
||||
fprintf(outf, "%8.2f%8.3f%8u%8.3f%8.2f%8u%8lu %-s\n",
|
||||
per_time, ftime, calls, ms_per_call, per_calls, import,
|
||||
per_time, local_ftime, calls, ms_per_call, per_calls, import,
|
||||
stkuse, name);
|
||||
}
|
||||
*called = calls;
|
||||
*timed = time;
|
||||
*timed = local_time;
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
@@ -517,7 +517,7 @@ FILE *outf;
|
||||
register unsigned int root;
|
||||
register unsigned long int *s_calls, *s_time;
|
||||
{
|
||||
unsigned long int calls, time;
|
||||
unsigned long int calls, local_time;
|
||||
|
||||
DBUG_ENTER ("out_body");
|
||||
DBUG_PRINT ("out_body", ("%lu,%lu",*s_calls,*s_time));
|
||||
@@ -526,10 +526,10 @@ register unsigned long int *s_calls, *s_time;
|
||||
} else {
|
||||
while (root != MAXPROCS) {
|
||||
out_body (outf, s_table[root].lchild,s_calls,s_time);
|
||||
out_item (outf, &modules[s_table[root].pos],&calls,&time);
|
||||
DBUG_PRINT ("out_body", ("-- %lu -- %lu --", calls, time));
|
||||
out_item (outf, &modules[s_table[root].pos],&calls,&local_time);
|
||||
DBUG_PRINT ("out_body", ("-- %lu -- %lu --", calls, local_time));
|
||||
*s_calls += calls;
|
||||
*s_time += time;
|
||||
*s_time += local_time;
|
||||
root = s_table[root].rchild;
|
||||
}
|
||||
DBUG_PRINT ("out_body", ("%lu,%lu", *s_calls, *s_time));
|
||||
|
@@ -1,6 +1,13 @@
|
||||
#ifdef DBUG_OFF /* We are testing dbug */
|
||||
#undef DBUG_OFF
|
||||
#endif
|
||||
|
||||
int factorial(register int value) {
|
||||
if(value > 1) {
|
||||
value *= factorial(value-1);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <my_global.h>
|
||||
|
||||
@@ -15,3 +22,6 @@ register int value)
|
||||
DBUG_PRINT ("result", ("result is %d", value));
|
||||
DBUG_RETURN (value);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -48,15 +48,16 @@ static struct my_option my_long_options[] =
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"defaults-extra-file", 'e',
|
||||
"Read this file after the global /etc config file and before the config file in the users home directory.",
|
||||
(gptr*) &defaults_extra_file, (gptr*) &defaults_extra_file, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
(gptr*) &my_defaults_extra_file, (gptr*) &my_defaults_extra_file, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"defaults-group-suffix", 'g',
|
||||
"In addition to the given groups, read also groups with this suffix",
|
||||
(gptr*) &defaults_group_suffix, (gptr*) &defaults_group_suffix,
|
||||
(gptr*) &my_defaults_group_suffix, (gptr*) &my_defaults_group_suffix,
|
||||
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"extra-file", 'e',
|
||||
"Synonym for --defaults-extra-file.",
|
||||
(gptr*) &defaults_extra_file, (gptr*) &defaults_extra_file, 0, GET_STR,
|
||||
(gptr*) &my_defaults_extra_file,
|
||||
(gptr*) &my_defaults_extra_file, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"no-defaults", 'n', "Return an empty string (useful for scripts).",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
|
@@ -1,4 +1,20 @@
|
||||
yaSSL Release notes, version 1.5.0 (11/09/06)
|
||||
*****************yaSSL Release notes, version 1.5.8 (1/10/07)
|
||||
|
||||
This release of yaSSL contains bug fixes, portability enhancements, and
|
||||
support for GCC 4.1.1 and vs2005 sp1.
|
||||
|
||||
|
||||
|
||||
Since yaSSL now supports zlib, as does libcur, the libcurl build test can
|
||||
fail if yaSSL is built with zlib support since the zlib library isn't
|
||||
passed. You can do two things to fix this:
|
||||
|
||||
1) build yaSSL w/o zlib --without-zlib
|
||||
2) or add flags to curl configure LDFLAGS="-lm -lz"
|
||||
|
||||
|
||||
|
||||
*****************yaSSL Release notes, version 1.5.0 (11/09/06)
|
||||
|
||||
This release of yaSSL contains bug fixes, portability enhancements,
|
||||
and full TLS 1.1 support. Use the functions:
|
||||
@@ -7,7 +23,7 @@ yaSSL Release notes, version 1.5.0 (11/09/06)
|
||||
SSL_METHOD *TLSv1_1_client_method(void);
|
||||
|
||||
or the SSLv23 versions (even though yaSSL doesn't support SSL 2.0 the v23
|
||||
means to pick the highest of SSL 3.0, TLS 1.0, or TLS 1.1.
|
||||
means to pick the highest of SSL 3.0, TLS 1.0, or TLS 1.1).
|
||||
|
||||
|
||||
See normal build instructions below under 1.0.6.
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* yaSSL buffer header defines input and output buffers to simulate streaming
|
||||
@@ -56,11 +49,13 @@ 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 {
|
||||
Check() {}
|
||||
void check(uint i, uint limit);
|
||||
};
|
||||
|
||||
|
||||
struct NoCheck {
|
||||
NoCheck() {}
|
||||
void check(uint, uint);
|
||||
};
|
||||
|
||||
@@ -198,6 +193,7 @@ inline void checked_delete(T* p)
|
||||
// sets pointer to zero so safe for std conatiners
|
||||
struct del_ptr_zero
|
||||
{
|
||||
del_ptr_zero() {}
|
||||
template <typename T>
|
||||
void operator()(T*& p) const
|
||||
{
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* The certificate wrapper header defines certificate management functions
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* crypto_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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* The crypto wrapper header is used to define policies for the cipher
|
||||
@@ -49,6 +42,7 @@ namespace yaSSL {
|
||||
// Digest policy should implement a get_digest, update, and get sizes for pad
|
||||
// and digest
|
||||
struct Digest : public virtual_base {
|
||||
Digest() {}
|
||||
virtual void get_digest(byte*) = 0;
|
||||
virtual void get_digest(byte*, const byte*, unsigned int) = 0;
|
||||
virtual void update(const byte*, unsigned int) = 0;
|
||||
@@ -60,6 +54,7 @@ struct Digest : public virtual_base {
|
||||
|
||||
// For use with NULL Digests
|
||||
struct NO_MAC : public Digest {
|
||||
NO_MAC() {}
|
||||
void get_digest(byte*);
|
||||
void get_digest(byte*, const byte*, unsigned int);
|
||||
void update(const byte*, unsigned int);
|
||||
@@ -184,6 +179,7 @@ private:
|
||||
// BulkCipher policy should implement encrypt, decrypt, get block size,
|
||||
// and set keys for encrypt and decrypt
|
||||
struct BulkCipher : public virtual_base {
|
||||
BulkCipher() {}
|
||||
virtual void encrypt(byte*, const byte*, unsigned int) = 0;
|
||||
virtual void decrypt(byte*, const byte*, unsigned int) = 0;
|
||||
virtual void set_encryptKey(const byte*, const byte* = 0) = 0;
|
||||
@@ -197,6 +193,7 @@ struct BulkCipher : public virtual_base {
|
||||
|
||||
// For use with NULL Ciphers
|
||||
struct NO_Cipher : public BulkCipher {
|
||||
NO_Cipher() {}
|
||||
void encrypt(byte*, const byte*, unsigned int) {}
|
||||
void decrypt(byte*, const byte*, unsigned int) {}
|
||||
void set_encryptKey(const byte*, const byte*) {}
|
||||
@@ -318,12 +315,14 @@ struct Auth : public virtual_base {
|
||||
virtual bool verify(const byte*, unsigned int, const byte*,
|
||||
unsigned int) = 0;
|
||||
virtual uint get_signatureLength() const = 0;
|
||||
Auth() {}
|
||||
virtual ~Auth() {}
|
||||
};
|
||||
|
||||
|
||||
// For use with NULL Authentication schemes
|
||||
struct NO_Auth : public Auth {
|
||||
NO_Auth() {}
|
||||
void sign(byte*, const byte*, unsigned int, const RandomPool&) {}
|
||||
bool verify(const byte*, unsigned int, const byte*, unsigned int)
|
||||
{ return true; }
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* The factory header defines an Object Factory, used by SSL message and
|
||||
* handshake types.
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* The handshake header declares function prototypes for creating and reading
|
||||
* the various handshake messages.
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* lock.hpp provides an os specific Lock, locks mutex on entry and unlocks
|
||||
* automatically upon exit, no-ops provided for Single Threaded
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* yaSSL log interface
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* ssl.h
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* ssl.h defines openssl compatibility layer
|
||||
*
|
||||
@@ -41,7 +34,7 @@
|
||||
#include "rsa.h"
|
||||
|
||||
|
||||
#define YASSL_VERSION "1.5.0"
|
||||
#define YASSL_VERSION "1.5.8"
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* The socket wrapper header defines a Socket class that hides the differences
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* timer.hpp provides a high res and low res timers
|
||||
*
|
||||
|
@@ -1,23 +1,20 @@
|
||||
/* yassl.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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* yaSSL externel header defines yaSSL API
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* yaSSL error header defines error codes and an exception class
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* yassl_imp.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* yaSSL implementation header defines all strucutres from the SSL.v3
|
||||
* specification "draft-freier-ssl-version3-02.txt"
|
||||
@@ -71,6 +64,7 @@ struct RecordLayerHeader {
|
||||
|
||||
// base for all messages
|
||||
struct Message : public virtual_base {
|
||||
Message() {}
|
||||
virtual input_buffer& set(input_buffer&) =0;
|
||||
virtual output_buffer& get(output_buffer&) const =0;
|
||||
|
||||
@@ -184,6 +178,7 @@ private:
|
||||
class HandShakeBase : public virtual_base {
|
||||
int length_;
|
||||
public:
|
||||
HandShakeBase() {}
|
||||
int get_length() const;
|
||||
void set_length(int);
|
||||
|
||||
@@ -201,6 +196,7 @@ public:
|
||||
|
||||
|
||||
struct HelloRequest : public HandShakeBase {
|
||||
HelloRequest() {}
|
||||
input_buffer& set(input_buffer& in);
|
||||
output_buffer& get(output_buffer& out) const;
|
||||
|
||||
@@ -334,6 +330,7 @@ private:
|
||||
|
||||
|
||||
struct ServerKeyBase : public virtual_base {
|
||||
ServerKeyBase() {}
|
||||
virtual ~ServerKeyBase() {}
|
||||
virtual void build(SSL&) {}
|
||||
virtual void read(SSL&, input_buffer&) {}
|
||||
@@ -344,15 +341,21 @@ struct ServerKeyBase : public virtual_base {
|
||||
|
||||
// Server random number for FORTEZZA KEA
|
||||
struct Fortezza_Server : public ServerKeyBase {
|
||||
Fortezza_Server() {}
|
||||
opaque r_s_[FORTEZZA_MAX];
|
||||
};
|
||||
|
||||
|
||||
struct SignatureBase : public virtual_base {
|
||||
SignatureBase() {}
|
||||
virtual ~SignatureBase() {}
|
||||
};
|
||||
|
||||
struct anonymous_sa : public SignatureBase {};
|
||||
struct anonymous_sa : public SignatureBase
|
||||
{
|
||||
public:
|
||||
anonymous_sa() {}
|
||||
};
|
||||
|
||||
|
||||
struct Hashes {
|
||||
@@ -362,11 +365,13 @@ struct Hashes {
|
||||
|
||||
|
||||
struct rsa_sa : public SignatureBase {
|
||||
rsa_sa() {}
|
||||
Hashes hashes_;
|
||||
};
|
||||
|
||||
|
||||
struct dsa_sa : public SignatureBase {
|
||||
dsa_sa() {}
|
||||
uint8 sha_[SHA_LEN];
|
||||
};
|
||||
|
||||
@@ -394,6 +399,7 @@ private:
|
||||
|
||||
// Server's RSA exchange
|
||||
struct RSA_Server : public ServerKeyBase {
|
||||
RSA_Server() {}
|
||||
ServerRSAParams params_;
|
||||
opaque* signature_; // signed rsa_sa hashes
|
||||
};
|
||||
@@ -468,6 +474,7 @@ struct PreMasterSecret {
|
||||
|
||||
|
||||
struct ClientKeyBase : public virtual_base {
|
||||
ClientKeyBase() {}
|
||||
virtual ~ClientKeyBase() {}
|
||||
virtual void build(SSL&) {}
|
||||
virtual void read(SSL&, input_buffer&) {}
|
||||
@@ -498,6 +505,7 @@ private:
|
||||
// Fortezza Key Parameters from page 29
|
||||
// hard code lengths cause only used here
|
||||
struct FortezzaKeys : public ClientKeyBase {
|
||||
FortezzaKeys() {}
|
||||
opaque y_c_ [128]; // client's Yc, public value
|
||||
opaque r_c_ [128]; // client's Rc
|
||||
opaque y_signature_ [40]; // DSS signed public key
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* yassl_int.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* yaSSL internal header defines SSL supporting types not specified in the
|
||||
@@ -235,6 +228,7 @@ struct BIGNUM {
|
||||
TaoCrypt::Integer), we need to explicitly state the namespace
|
||||
here to let gcc 2.96 deduce the correct type.
|
||||
*/
|
||||
BIGNUM() {}
|
||||
yaSSL::Integer int_;
|
||||
void assign(const byte* b, uint s) { int_.assign(b,s); }
|
||||
};
|
||||
@@ -591,6 +585,9 @@ class SSL {
|
||||
Socket socket_; // socket wrapper
|
||||
Buffers buffers_; // buffered handshakes and data
|
||||
Log log_; // logger
|
||||
|
||||
// optimization variables
|
||||
bool has_data_; // buffered data ready?
|
||||
public:
|
||||
SSL(SSL_CTX* ctx);
|
||||
|
||||
@@ -613,6 +610,8 @@ public:
|
||||
Log& useLog();
|
||||
Buffers& useBuffers();
|
||||
|
||||
bool HasData() const;
|
||||
|
||||
// sets
|
||||
void set_pending(Cipher suite);
|
||||
void set_random(const opaque*, ConnectionEnd);
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* yassl_types.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* yaSSL types header defines all constants, enums, and typedefs
|
||||
* from the SSL.v3 specification "draft-freier-ssl-version3-02.txt"
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* buffer.cpp
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* yaSSL buffer header implements input/output buffers to simulate streaming
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* cert_wrapper.cpp
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* The certificate wrapper source implements certificate management functions
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* crypto_wrapper.cpp
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* The crypto wrapper source implements the policies for the cipher
|
||||
* components used by SSL.
|
||||
@@ -557,6 +550,7 @@ void RandomPool::Fill(opaque* dst, uint sz) const
|
||||
|
||||
// Implementation of DSS Authentication
|
||||
struct DSS::DSSImpl {
|
||||
DSSImpl() {}
|
||||
void SetPublic (const byte*, unsigned int);
|
||||
void SetPrivate(const byte*, unsigned int);
|
||||
TaoCrypt::DSA_PublicKey publicKey_;
|
||||
@@ -629,6 +623,7 @@ bool DSS::verify(const byte* sha_digest, unsigned int /* shaSz */,
|
||||
|
||||
// Implementation of RSA key interface
|
||||
struct RSA::RSAImpl {
|
||||
RSAImpl() {}
|
||||
void SetPublic (const byte*, unsigned int);
|
||||
void SetPrivate(const byte*, unsigned int);
|
||||
TaoCrypt::RSA_PublicKey publicKey_;
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* handshake.cpp
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* The handshake source implements functions for creating and reading
|
||||
@@ -979,7 +972,7 @@ int receiveData(SSL& ssl, Data& data, bool peek)
|
||||
ssl.verfiyHandShakeComplete();
|
||||
if (ssl.GetError()) return -1;
|
||||
|
||||
if (!ssl.bufferedData())
|
||||
if (!ssl.HasData())
|
||||
processReply(ssl);
|
||||
|
||||
if (peek)
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* lock.cpp
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* Locking functions
|
||||
*/
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* log.cpp
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* Debug logging functions
|
||||
*/
|
||||
|
@@ -1,22 +1,4 @@
|
||||
REM quick and dirty build file for testing different MSDEVs
|
||||
|
||||
@echo off
|
||||
REM Copyright (C) 2006 MySQL AB
|
||||
REM
|
||||
REM This program is free software; you can redistribute it and/or modify
|
||||
REM it under the terms of the GNU General Public License as published by
|
||||
REM the Free Software Foundation; version 2 of the License.
|
||||
REM
|
||||
REM This program is distributed in the hope that it will be useful,
|
||||
REM but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
REM GNU General Public License for more details.
|
||||
REM
|
||||
REM You should have received a copy of the GNU General Public License
|
||||
REM along with this program; if not, write to the Free Software
|
||||
REM Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
@echo on
|
||||
|
||||
setlocal
|
||||
|
||||
set myFLAGS= /I../include /I../taocrypt/mySTL /I../taocrypt/include /W3 /c /ZI
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* socket_wrapper.cpp
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* The socket wrapper source implements a Socket class that hides the
|
||||
@@ -81,7 +74,7 @@ socket_t Socket::get_fd() const
|
||||
|
||||
Socket::~Socket()
|
||||
{
|
||||
closeSocket();
|
||||
// don't close automatically now
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* ssl.cpp
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* SSL source implements all openssl compatibility API functions
|
||||
*
|
||||
@@ -407,7 +400,6 @@ int SSL_do_handshake(SSL* ssl)
|
||||
|
||||
int SSL_clear(SSL* ssl)
|
||||
{
|
||||
ssl->useSocket().closeSocket();
|
||||
GetErrors().Remove();
|
||||
|
||||
return SSL_SUCCESS;
|
||||
@@ -958,7 +950,7 @@ void ERR_print_errors_fp(FILE* /*fp*/)
|
||||
|
||||
char* ERR_error_string(unsigned long errNumber, char* buffer)
|
||||
{
|
||||
static char* msg = (char*) "Please supply a buffer for error string";
|
||||
static char* msg = "Please supply a buffer for error string";
|
||||
|
||||
if (buffer) {
|
||||
SetErrorString(YasslError(errNumber), buffer);
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* template_instnt.cpp
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* Explicit template instantiation requests
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* timer.cpp
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* timer.cpp implements a high res and low res timer
|
||||
*
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* yassl.cpp
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* yaSSL implements external API
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* yassl_error.cpp
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* yaSSL error implements and an exception class
|
||||
@@ -150,6 +143,10 @@ void SetErrorString(YasslError error, char* buffer)
|
||||
strncpy(buffer, "the read operation would block", max);
|
||||
break;
|
||||
|
||||
case CERTFICATE_ERROR :
|
||||
strncpy(buffer, "Unable to verify certificate", max);
|
||||
break;
|
||||
|
||||
// TaoCrypt errors
|
||||
case NO_ERROR_E :
|
||||
strncpy(buffer, "not in error state", max);
|
||||
@@ -255,8 +252,12 @@ void SetErrorString(YasslError error, char* buffer)
|
||||
strncpy(buffer, "ASN: bad other signature confirmation", max);
|
||||
break;
|
||||
|
||||
case CERTFICATE_ERROR :
|
||||
strncpy(buffer, "Unable to verify certificate", max);
|
||||
case CONTENT_E :
|
||||
strncpy(buffer, "bad content processing", max);
|
||||
break;
|
||||
|
||||
case PEM_E :
|
||||
strncpy(buffer, "bad PEM format processing", max);
|
||||
break;
|
||||
|
||||
default :
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* yassl_imp.cpp
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* yaSSL source implements all SSL.v3 secification structures.
|
||||
*/
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* yassl_int.cpp
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* yaSSL internal source implements SSL supporting types not specified in the
|
||||
@@ -298,7 +291,7 @@ const ClientKeyFactory& sslFactory::getClientKey() const
|
||||
SSL::SSL(SSL_CTX* ctx)
|
||||
: secure_(ctx->getMethod()->getVersion(), crypto_.use_random(),
|
||||
ctx->getMethod()->getSide(), ctx->GetCiphers(), ctx,
|
||||
ctx->GetDH_Parms().set_)
|
||||
ctx->GetDH_Parms().set_), has_data_(false)
|
||||
{
|
||||
if (int err = crypto_.get_random().GetError()) {
|
||||
SetError(YasslError(err));
|
||||
@@ -1054,6 +1047,8 @@ void SSL::fillData(Data& data)
|
||||
if (data.get_length() == dataSz)
|
||||
break;
|
||||
}
|
||||
|
||||
if (buffers_.getData().size() == 0) has_data_ = false; // none left
|
||||
}
|
||||
|
||||
|
||||
@@ -1389,9 +1384,17 @@ bool SSL::isTLSv1_1() const
|
||||
}
|
||||
|
||||
|
||||
// is there buffered data available, optimization to remove iteration on buffer
|
||||
bool SSL::HasData() const
|
||||
{
|
||||
return has_data_;
|
||||
}
|
||||
|
||||
|
||||
void SSL::addData(input_buffer* data)
|
||||
{
|
||||
buffers_.useData().push_back(data);
|
||||
if (!has_data_) has_data_ = true;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -65,7 +65,7 @@ int main(int argc, char** argv)
|
||||
|
||||
const int megs = 5; // how much to test
|
||||
|
||||
const byte key[] =
|
||||
const byte global_key[] =
|
||||
{
|
||||
0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef,
|
||||
0xfe,0xde,0xba,0x98,0x76,0x54,0x32,0x10,
|
||||
@@ -81,19 +81,19 @@ const byte iv[] =
|
||||
};
|
||||
|
||||
|
||||
byte plain [1024*1024];
|
||||
byte cipher[1024*1024];
|
||||
byte global_plain [1024*1024];
|
||||
byte global_cipher[1024*1024];
|
||||
|
||||
|
||||
void bench_des()
|
||||
{
|
||||
DES_EDE3_CBC_Encryption enc;
|
||||
enc.SetKey(key, 16, iv);
|
||||
enc.SetKey(global_key, 16, iv);
|
||||
|
||||
double start = current_time();
|
||||
|
||||
for(int i = 0; i < megs; i++)
|
||||
enc.Process(plain, cipher, sizeof(plain));
|
||||
enc.Process(global_plain, global_cipher, sizeof(global_plain));
|
||||
|
||||
double total = current_time() - start;
|
||||
|
||||
@@ -107,12 +107,12 @@ void bench_des()
|
||||
void bench_aes(bool show)
|
||||
{
|
||||
AES_CBC_Encryption enc;
|
||||
enc.SetKey(key, 16, iv);
|
||||
enc.SetKey(global_key, 16, iv);
|
||||
|
||||
double start = current_time();
|
||||
|
||||
for(int i = 0; i < megs; i++)
|
||||
enc.Process(plain, cipher, sizeof(plain));
|
||||
enc.Process(global_plain, global_cipher, sizeof(global_plain));
|
||||
|
||||
double total = current_time() - start;
|
||||
|
||||
@@ -127,12 +127,12 @@ void bench_aes(bool show)
|
||||
void bench_twofish()
|
||||
{
|
||||
Twofish_CBC_Encryption enc;
|
||||
enc.SetKey(key, 16, iv);
|
||||
enc.SetKey(global_key, 16, iv);
|
||||
|
||||
double start = current_time();
|
||||
|
||||
for(int i = 0; i < megs; i++)
|
||||
enc.Process(plain, cipher, sizeof(plain));
|
||||
enc.Process(global_plain, global_cipher, sizeof(global_plain));
|
||||
|
||||
double total = current_time() - start;
|
||||
|
||||
@@ -147,12 +147,12 @@ void bench_twofish()
|
||||
void bench_blowfish()
|
||||
{
|
||||
Blowfish_CBC_Encryption enc;
|
||||
enc.SetKey(key, 16, iv);
|
||||
enc.SetKey(global_key, 16, iv);
|
||||
|
||||
double start = current_time();
|
||||
|
||||
for(int i = 0; i < megs; i++)
|
||||
enc.Process(plain, cipher, sizeof(plain));
|
||||
enc.Process(global_plain, global_cipher, sizeof(global_plain));
|
||||
|
||||
double total = current_time() - start;
|
||||
|
||||
@@ -166,12 +166,12 @@ void bench_blowfish()
|
||||
void bench_arc4()
|
||||
{
|
||||
ARC4 enc;
|
||||
enc.SetKey(key, 16);
|
||||
enc.SetKey(global_key, 16);
|
||||
|
||||
double start = current_time();
|
||||
|
||||
for(int i = 0; i < megs; i++)
|
||||
enc.Process(cipher, plain, sizeof(plain));
|
||||
enc.Process(global_cipher, global_plain, sizeof(global_plain));
|
||||
|
||||
double total = current_time() - start;
|
||||
|
||||
@@ -191,7 +191,7 @@ void bench_md5()
|
||||
|
||||
|
||||
for(int i = 0; i < megs; i++)
|
||||
hash.Update(plain, sizeof(plain));
|
||||
hash.Update(global_plain, sizeof(global_plain));
|
||||
|
||||
hash.Final(digest);
|
||||
|
||||
@@ -213,7 +213,7 @@ void bench_sha()
|
||||
|
||||
|
||||
for(int i = 0; i < megs; i++)
|
||||
hash.Update(plain, sizeof(plain));
|
||||
hash.Update(global_plain, sizeof(global_plain));
|
||||
|
||||
hash.Final(digest);
|
||||
|
||||
@@ -241,7 +241,7 @@ void bench_ripemd()
|
||||
|
||||
|
||||
for(int i = 0; i < megs; i++)
|
||||
hash.Update(plain, sizeof(plain));
|
||||
hash.Update(global_plain, sizeof(global_plain));
|
||||
|
||||
hash.Final(digest);
|
||||
|
||||
|
@@ -1,22 +1,4 @@
|
||||
REM quick and dirty build file for testing different MSDEVs
|
||||
|
||||
@echo off
|
||||
REM Copyright (C) 2006 MySQL AB
|
||||
REM
|
||||
REM This program is free software; you can redistribute it and/or modify
|
||||
REM it under the terms of the GNU General Public License as published by
|
||||
REM the Free Software Foundation; version 2 of the License.
|
||||
REM
|
||||
REM This program is distributed in the hope that it will be useful,
|
||||
REM but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
REM GNU General Public License for more details.
|
||||
REM
|
||||
REM You should have received a copy of the GNU General Public License
|
||||
REM along with this program; if not, write to the Free Software
|
||||
REM Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
@echo on
|
||||
|
||||
setlocal
|
||||
|
||||
set myFLAGS= /I../include /I../mySTL /c /W3 /G6 /O2
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* aes.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* aes.hpp defines AES
|
||||
*/
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* algebra.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* based on Wei Dai's algebra.h from CryptoPP */
|
||||
|
||||
@@ -47,6 +40,7 @@ class TAOCRYPT_NO_VTABLE AbstractGroup : public virtual_base
|
||||
public:
|
||||
typedef Integer Element;
|
||||
|
||||
AbstractGroup() {}
|
||||
virtual ~AbstractGroup() {}
|
||||
|
||||
virtual bool Equal(const Element &a, const Element &b) const =0;
|
||||
@@ -101,6 +95,7 @@ private:
|
||||
class MultiplicativeGroupT : public AbstractGroup
|
||||
{
|
||||
public:
|
||||
MultiplicativeGroupT() {}
|
||||
const AbstractRing& GetRing() const
|
||||
{return *m_pRing;}
|
||||
|
||||
@@ -152,6 +147,7 @@ class TAOCRYPT_NO_VTABLE AbstractEuclideanDomain
|
||||
: public AbstractRing
|
||||
{
|
||||
public:
|
||||
AbstractEuclideanDomain() {}
|
||||
typedef Integer Element;
|
||||
|
||||
virtual void DivisionAlgorithm(Element &r, Element &q, const Element &a,
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* arc4.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* arc4.hpp defines ARC4
|
||||
*/
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* asn.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* asn.hpp provides ASN1 BER, PublicKey, and x509v3 decoding
|
||||
*/
|
||||
@@ -99,6 +92,17 @@ enum DNTags
|
||||
};
|
||||
|
||||
|
||||
enum PCKS12_Tags
|
||||
{
|
||||
/* DATA = 1, */ // from ASN1
|
||||
SIGNED_DATA = 2,
|
||||
ENVELOPED_DATA = 3,
|
||||
SIGNED_AND_ENVELOPED_DATA = 4,
|
||||
DIGESTED_DATA = 5,
|
||||
ENCRYPTED_DATA = 6
|
||||
};
|
||||
|
||||
|
||||
enum Constants
|
||||
{
|
||||
MIN_DATE_SZ = 13,
|
||||
@@ -195,6 +199,16 @@ private:
|
||||
};
|
||||
|
||||
|
||||
// PKCS12 BER Decoder
|
||||
class PKCS12_Decoder : public BER_Decoder {
|
||||
public:
|
||||
explicit PKCS12_Decoder(Source& s) : BER_Decoder(s) {}
|
||||
void Decode();
|
||||
private:
|
||||
void ReadHeader();
|
||||
};
|
||||
|
||||
|
||||
// General PublicKey
|
||||
class PublicKey {
|
||||
byte* key_;
|
||||
@@ -241,6 +255,7 @@ private:
|
||||
typedef STL::list<Signer*> SignerList;
|
||||
|
||||
|
||||
enum ContentType { HUH = 651 };
|
||||
enum SigType { SHAwDSA = 517, MD2wRSA = 646, MD5wRSA = 648, SHAwRSA =649};
|
||||
enum HashType { MD2h = 646, MD5h = 649, SHAh = 88 };
|
||||
enum KeyType { DSAk = 515, RSAk = 645 }; // sums of algo OID
|
||||
@@ -345,6 +360,12 @@ private:
|
||||
};
|
||||
|
||||
|
||||
// Get Cert in PEM format from BEGIN to END
|
||||
int GetCert(Source&);
|
||||
|
||||
// Get Cert in PEM format from pkcs12 file
|
||||
int GetPKCS_Cert(const char* password, Source&);
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* block.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* block.hpp provides word and byte blocks with configurable allocators
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* blowfish.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* blowfish.hpp defines Blowfish
|
||||
*/
|
||||
@@ -89,7 +82,7 @@ typedef BlockCipher<DECRYPTION, Blowfish, CBC> Blowfish_CBC_Decryption;
|
||||
|
||||
|
||||
|
||||
} // naemspace
|
||||
} // namespace
|
||||
|
||||
#endif // TAO_CRYPT_BLOWFISH_HPP
|
||||
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* coding.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* coding.hpp defines hex and base64 encoding/decoing
|
||||
*/
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* des.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* des.hpp defines DES, DES_EDE2, and DES_EDE3
|
||||
see FIPS 46-2 and FIPS 81
|
||||
@@ -48,6 +41,7 @@ enum { DES_BLOCK_SIZE = 8, DES_KEY_SIZE = 32 };
|
||||
|
||||
class BasicDES {
|
||||
public:
|
||||
BasicDES() {}
|
||||
void SetKey(const byte*, word32, CipherDir dir);
|
||||
void RawProcessBlock(word32&, word32&) const;
|
||||
protected:
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* dh.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* dh.hpp provides Diffie-Hellman support
|
||||
*/
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* dsa.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* dsa.hpp provides Digitial Signautre Algorithm see FIPS 186-2
|
||||
*/
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* error.hpp provides a taocrypt error numbers
|
||||
*
|
||||
@@ -70,8 +63,12 @@ DSA_SZ_E = 1035, // "bad DSA r or s size"
|
||||
BEFORE_DATE_E = 1036, // "before date in the future"
|
||||
AFTER_DATE_E = 1037, // "after date in the past"
|
||||
SIG_CONFIRM_E = 1038, // "bad self signature confirmation"
|
||||
SIG_OTHER_E = 1039 // "bad other signature confirmation"
|
||||
SIG_OTHER_E = 1039, // "bad other signature confirmation"
|
||||
|
||||
CONTENT_E = 1040, // "bad content processing"
|
||||
PEM_E = 1041 // "bad pem format error"
|
||||
|
||||
// add error string to yassl/src/yassl_error.cpp !!!
|
||||
};
|
||||
|
||||
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* file.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* file.hpp provies File Sources and Sinks
|
||||
*/
|
||||
@@ -71,8 +64,10 @@ public:
|
||||
void SetError(ErrorNumber w) { error_.SetError(w); }
|
||||
|
||||
friend class FileSource; // for get()
|
||||
private:
|
||||
Source(const Source& that) : buffer_(that.buffer_), current_(that.current_) {}
|
||||
|
||||
Source(const Source& that)
|
||||
: buffer_(that.buffer_), current_(that.current_) {}
|
||||
|
||||
Source& operator=(const Source& that)
|
||||
{
|
||||
Source tmp(that);
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* hash.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* hash.hpp provides a base for digest types
|
||||
*/
|
||||
@@ -38,6 +31,7 @@ namespace TaoCrypt {
|
||||
// HASH
|
||||
class HASH : public virtual_base {
|
||||
public:
|
||||
HASH() {}
|
||||
virtual ~HASH() {}
|
||||
|
||||
virtual void Update(const byte*, word32) = 0;
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* hmac.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* hamc.hpp implements HMAC, see RFC 2104
|
||||
*/
|
||||
@@ -116,11 +109,11 @@ void HMAC<T>::KeyInnerHash()
|
||||
|
||||
// Update
|
||||
template <class T>
|
||||
void HMAC<T>::Update(const byte* msg, word32 length)
|
||||
void HMAC<T>::Update(const byte* msg_arg, word32 length)
|
||||
{
|
||||
if (!innerHashKeyed_)
|
||||
KeyInnerHash();
|
||||
mac_.Update(msg, length);
|
||||
mac_.Update(msg_arg, length);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* integer.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* based on Wei Dai's integer.h from CryptoPP */
|
||||
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* kernelc.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* kernelc.hpp provides support for C std lib when compiled in kernel mode
|
||||
*/
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* md5.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* md2.hpp provides MD2 digest support, see RFC 1319
|
||||
*/
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* md4.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* md4.hpp provides MD4 digest support
|
||||
* WANRING: MD4 is considered insecure, only use if you have to, e.g., yaSSL
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* md5.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* md5.hpp provides MD5 digest support, see RFC 1321
|
||||
*/
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* misc.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* based on Wei Dai's misc.h from CryptoPP */
|
||||
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* modarith.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* based on Wei Dai's modarith.h from CryptoPP */
|
||||
@@ -44,8 +37,8 @@ public:
|
||||
typedef int RandomizationParameter;
|
||||
typedef Integer Element;
|
||||
|
||||
ModularArithmetic(const Integer &modulus = Integer::One())
|
||||
: modulus(modulus), result((word)0, modulus.reg_.size()) {}
|
||||
ModularArithmetic(const Integer &modulus_arg = Integer::One())
|
||||
: modulus(modulus_arg), result((word)0, modulus_arg.reg_.size()) {}
|
||||
|
||||
ModularArithmetic(const ModularArithmetic &ma)
|
||||
: AbstractRing(),
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* modes.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* modes.hpp provides ECB and CBC modes for block cipher encryption/decryption
|
||||
*/
|
||||
@@ -49,8 +42,8 @@ public:
|
||||
{ cipher_.Process(c, p, sz); }
|
||||
void SetKey(const byte* k, word32 sz)
|
||||
{ cipher_.SetKey(k, sz, DIR); }
|
||||
void SetKey(const byte* k, word32 sz, const byte* iv)
|
||||
{ cipher_.SetKey(k, sz, DIR); cipher_.SetIV(iv); }
|
||||
void SetKey(const byte* k, word32 sz, const byte* iv_arg)
|
||||
{ cipher_.SetKey(k, sz, DIR); cipher_.SetIV(iv_arg); }
|
||||
private:
|
||||
T cipher_;
|
||||
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* pwdbased.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* pwdbased.hpp defines PBKDF2 from PKCS #5
|
||||
*/
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* random.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* random.hpp provides a crypto secure Random Number Generator using an OS
|
||||
specific seed
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* ripemd.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* ripemd.hpp provides RIPEMD digest support
|
||||
*/
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* rsa.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* rsa.hpp provides RSA ES encrypt/decrypt, SSL (block type 1) sign and verify
|
||||
*/
|
||||
@@ -138,6 +131,7 @@ private:
|
||||
// block type 2 padding
|
||||
class RSA_BlockType2 {
|
||||
public:
|
||||
RSA_BlockType2() {}
|
||||
void Pad(const byte*, word32, byte*, word32,
|
||||
RandomNumberGenerator&) const;
|
||||
word32 UnPad(const byte*, word32, byte*) const;
|
||||
@@ -147,6 +141,7 @@ public:
|
||||
// block type 1 padding
|
||||
class RSA_BlockType1 {
|
||||
public:
|
||||
RSA_BlockType1() {}
|
||||
void Pad(const byte*, word32, byte*, word32,
|
||||
RandomNumberGenerator&) const;
|
||||
word32 UnPad(const byte*, word32, byte*) const;
|
||||
@@ -181,25 +176,27 @@ public:
|
||||
|
||||
// Public Encrypt
|
||||
template<class Pad>
|
||||
void RSA_Encryptor<Pad>::Encrypt(const byte* plain, word32 sz, byte* cipher,
|
||||
RandomNumberGenerator& rng)
|
||||
void RSA_Encryptor<Pad>::Encrypt(const byte* plain_arg, word32 sz,
|
||||
byte* cipher_arg,
|
||||
RandomNumberGenerator& rng_arg)
|
||||
{
|
||||
PK_Lengths lengths(key_.GetModulus());
|
||||
assert(sz <= lengths.FixedMaxPlaintextLength());
|
||||
|
||||
ByteBlock paddedBlock(lengths.PaddedBlockByteLength());
|
||||
padding_.Pad(plain, sz, paddedBlock.get_buffer(),
|
||||
lengths.PaddedBlockBitLength(), rng);
|
||||
padding_.Pad(plain_arg, sz, paddedBlock.get_buffer(),
|
||||
lengths.PaddedBlockBitLength(), rng_arg);
|
||||
|
||||
key_.ApplyFunction(Integer(paddedBlock.get_buffer(), paddedBlock.size())).
|
||||
Encode(cipher, lengths.FixedCiphertextLength());
|
||||
Encode(cipher_arg, lengths.FixedCiphertextLength());
|
||||
}
|
||||
|
||||
|
||||
// Private Decrypt
|
||||
template<class Pad>
|
||||
word32 RSA_Decryptor<Pad>::Decrypt(const byte* cipher, word32 sz, byte* plain,
|
||||
RandomNumberGenerator& rng)
|
||||
word32 RSA_Decryptor<Pad>::Decrypt(const byte* cipher_arg, word32 sz,
|
||||
byte* plain_arg,
|
||||
RandomNumberGenerator& rng_arg)
|
||||
{
|
||||
PK_Lengths lengths(key_.GetModulus());
|
||||
assert(sz == lengths.FixedCiphertextLength());
|
||||
@@ -208,29 +205,29 @@ word32 RSA_Decryptor<Pad>::Decrypt(const byte* cipher, word32 sz, byte* plain,
|
||||
return 0;
|
||||
|
||||
ByteBlock paddedBlock(lengths.PaddedBlockByteLength());
|
||||
Integer x = key_.CalculateInverse(rng, Integer(cipher,
|
||||
Integer x = key_.CalculateInverse(rng_arg, Integer(cipher_arg,
|
||||
lengths.FixedCiphertextLength()).Ref());
|
||||
if (x.ByteCount() > paddedBlock.size())
|
||||
x = Integer::Zero(); // don't return false, prevents timing attack
|
||||
x.Encode(paddedBlock.get_buffer(), paddedBlock.size());
|
||||
return padding_.UnPad(paddedBlock.get_buffer(),
|
||||
lengths.PaddedBlockBitLength(), plain);
|
||||
lengths.PaddedBlockBitLength(), plain_arg);
|
||||
}
|
||||
|
||||
|
||||
// Private SSL type (block 1) Encrypt
|
||||
template<class Pad>
|
||||
void RSA_Decryptor<Pad>::SSL_Sign(const byte* message, word32 sz, byte* sig,
|
||||
RandomNumberGenerator& rng)
|
||||
RandomNumberGenerator& rng_arg)
|
||||
{
|
||||
RSA_PublicKey inverse;
|
||||
inverse.Initialize(key_.GetModulus(), key_.GetPrivateExponent());
|
||||
RSA_Encryptor<RSA_BlockType1> enc(inverse); // SSL Type
|
||||
enc.Encrypt(message, sz, sig, rng);
|
||||
enc.Encrypt(message, sz, sig, rng_arg);
|
||||
}
|
||||
|
||||
|
||||
word32 SSL_Decrypt(const RSA_PublicKey& key, const byte* sig, byte* plain);
|
||||
word32 SSL_Decrypt(const RSA_PublicKey& key, const byte* sig, byte* plain_arg);
|
||||
|
||||
|
||||
// Public SSL type (block 1) Decrypt
|
||||
@@ -238,11 +235,11 @@ template<class Pad>
|
||||
bool RSA_Encryptor<Pad>::SSL_Verify(const byte* message, word32 sz,
|
||||
const byte* sig)
|
||||
{
|
||||
ByteBlock plain(PK_Lengths(key_.GetModulus()).FixedMaxPlaintextLength());
|
||||
if (SSL_Decrypt(key_, sig, plain.get_buffer()) != sz)
|
||||
ByteBlock local_plain(PK_Lengths(key_.GetModulus()).FixedMaxPlaintextLength());
|
||||
if (SSL_Decrypt(key_, sig, local_plain.get_buffer()) != sz)
|
||||
return false; // not right justified or bad padding
|
||||
|
||||
if ( (memcmp(plain.get_buffer(), message, sz)) == 0)
|
||||
if ( (memcmp(local_plain.get_buffer(), message, sz)) == 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* runtime.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* runtime.hpp provides C++ runtime support functions when building a pure C
|
||||
* version of yaSSL, user must define YASSL_PURE_C
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* sha.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* sha.hpp provides SHA-1 digests, see RFC 3174
|
||||
*/
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* twofish.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* twofish.hpp defines Twofish
|
||||
*/
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* type_traits.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* type_traits defines fundamental types
|
||||
* see discussion in C++ Templates, $19.1
|
||||
@@ -69,7 +62,11 @@ MK_FUNDAMENTAL_TYPE(unsigned long)
|
||||
|
||||
MK_FUNDAMENTAL_TYPE(float)
|
||||
MK_FUNDAMENTAL_TYPE( double)
|
||||
MK_FUNDAMENTAL_TYPE(long double)
|
||||
|
||||
#ifdef LONG_DOUBLE_IS_DISTINCT_TYPE
|
||||
// Don't define by default as this gives warnings on power mac
|
||||
MK_FUNDAMENTAL_TYPE(long double)
|
||||
#endif
|
||||
|
||||
#if defined(WORD64_AVAILABLE) && defined(WORD64_IS_DISTINCT_TYPE)
|
||||
MK_FUNDAMENTAL_TYPE(word64)
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* types.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* based on Wei Dai's misc.h from CryptoPP, basic crypt types */
|
||||
|
||||
@@ -72,7 +65,8 @@ typedef unsigned int word32;
|
||||
|
||||
|
||||
#if defined(HAVE_64_MULTIPLY) && (defined(__alpha__) || defined(__ia64__) \
|
||||
|| defined(_ARCH_PPC64) || defined(__mips64) || defined(__x86_64__))
|
||||
|| defined(_ARCH_PPC64) || defined(__mips64) || defined(__x86_64__) \
|
||||
|| defined(_M_X64) || defined(_M_IA64))
|
||||
// These platforms have 64-bit CPU registers. Unfortunately most C++ compilers
|
||||
// don't allow any way to access the 64-bit by 64-bit multiply instruction
|
||||
// without using assembly, so in order to use word64 as word, the assembly
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* mySTL algorithm.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* mySTL algorithm implements max, min, for_each, swap, find_if, copy,
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* 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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* mySTL helpers implements misc constructs for vector and list
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* mySTL list.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* mySTL list implements a simple list
|
||||
@@ -238,7 +231,7 @@ void list<T>::push_front(T t)
|
||||
template<typename T>
|
||||
void list<T>::pop_front()
|
||||
{
|
||||
node* front = head_;
|
||||
node* local_front = head_;
|
||||
|
||||
if (head_ == 0)
|
||||
return;
|
||||
@@ -248,8 +241,8 @@ void list<T>::pop_front()
|
||||
head_ = head_->next_;
|
||||
head_->prev_ = 0;
|
||||
}
|
||||
destroy(front);
|
||||
FreeMemory(front);
|
||||
destroy(local_front);
|
||||
FreeMemory(local_front);
|
||||
--sz_;
|
||||
}
|
||||
|
||||
@@ -310,13 +303,13 @@ T list<T>::back() const
|
||||
template<typename T>
|
||||
typename list<T>::node* list<T>::look_up(T t)
|
||||
{
|
||||
node* list = head_;
|
||||
node* local_list = head_;
|
||||
|
||||
if (list == 0) return 0;
|
||||
if (local_list == 0) return 0;
|
||||
|
||||
for (; list; list = list->next_)
|
||||
if (list->value_ == t)
|
||||
return list;
|
||||
for (; local_list; local_list = local_list->next_)
|
||||
if (local_list->value_ == t)
|
||||
return local_list;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* mySTL memory.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* mySTL memory implements auto_ptr
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* mySTL memory_array.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* mySTL memory_arry implements auto_array
|
||||
|
@@ -1,27 +1,20 @@
|
||||
/* mySTL pair.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.
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as it
|
||||
* is applied to yaSSL. View the full text of the exception in the file
|
||||
* FLOSS-EXCEPTIONS in the directory of this software distribution.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
|
||||
This program 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; version 2 of the License.
|
||||
|
||||
This program 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; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
|
||||
/* mySTL pair implements pair
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user