diff options
Diffstat (limited to 'extra')
32 files changed, 179 insertions, 118 deletions
diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt index a569641a198..f8f71b00743 100644 --- a/extra/CMakeLists.txt +++ b/extra/CMakeLists.txt @@ -31,24 +31,28 @@ IF(NOT CMAKE_CROSSCOMPILING) TARGET_LINK_LIBRARIES(comp_err mysys) ENDIF() -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/include/mysqld_error.h - ${PROJECT_BINARY_DIR}/sql/share/english/errmsg.sys - COMMAND comp_err - --charset=${PROJECT_SOURCE_DIR}/sql/share/charsets - --out-dir=${PROJECT_BINARY_DIR}/sql/share/ - --header_file=${PROJECT_BINARY_DIR}/include/mysqld_error.h - --name_file=${PROJECT_BINARY_DIR}/include/mysqld_ername.h - --state_file=${PROJECT_BINARY_DIR}/include/sql_state.h - --in_file=${PROJECT_SOURCE_DIR}/sql/share/errmsg-utf8.txt - DEPENDS ${PROJECT_SOURCE_DIR}/sql/share/errmsg-utf8.txt - ${CMAKE_CURRENT_SOURCE_DIR}/comp_err.c) +# Generate mysqld_error.h +# Try not to change its timestamp if not necessary(as touching +# mysqld_error.h results in rebuild of the almost whole server) +# To preserve timestamp, first generate a temp header file, then copy it +# to mysqld_error.h using cmake -E copy_if_different +ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/include/mysqld_error.h.tmp + COMMAND comp_err + --charset=${PROJECT_SOURCE_DIR}/sql/share/charsets + --out-dir=${CMAKE_BINARY_DIR}/sql/share/ + --header_file=${CMAKE_BINARY_DIR}/include/mysqld_error.h.tmp + --name_file=${CMAKE_BINARY_DIR}/include/mysqld_ername.h.tmp + --state_file=${CMAKE_BINARY_DIR}/include/sql_state.h.tmp + --in_file=${PROJECT_SOURCE_DIR}/sql/share/errmsg-utf8.txt + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/include/mysqld_error.h.tmp ${CMAKE_BINARY_DIR}/include/mysqld_error.h + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/include/mysqld_ername.h.tmp ${CMAKE_BINARY_DIR}/include/mysqld_ername.h + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/include/sql_state.h.tmp ${CMAKE_BINARY_DIR}/include/sql_state.h + DEPENDS comp_err ${PROJECT_SOURCE_DIR}/sql/share/errmsg-utf8.txt) ADD_CUSTOM_TARGET(GenError ALL DEPENDS - ${PROJECT_BINARY_DIR}/include/mysqld_error.h - ${PROJECT_BINARY_DIR}/sql/share/english/errmsg.sys - ${PROJECT_SOURCE_DIR}/sql/share/errmsg-utf8.txt) + ${CMAKE_BINARY_DIR}/include/mysqld_error.h.tmp) MYSQL_ADD_EXECUTABLE(my_print_defaults my_print_defaults.c) TARGET_LINK_LIBRARIES(my_print_defaults mysys) @@ -57,6 +61,7 @@ MYSQL_ADD_EXECUTABLE(perror perror.c) ADD_DEPENDENCIES(perror GenError) TARGET_LINK_LIBRARIES(perror mysys) +IF(UNIX) MYSQL_ADD_EXECUTABLE(resolveip resolveip.c) TARGET_LINK_LIBRARIES(resolveip mysys) IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS") @@ -65,9 +70,9 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS") MY_SEARCH_LIBS(inet_aton "nsl;socket;resolv" SOLARIS_NSL) TARGET_LINK_LIBRARIES(resolveip ${SOLARIS_NSL}) ENDIF() +ENDIF() - -MYSQL_ADD_EXECUTABLE(replace replace.c) +MYSQL_ADD_EXECUTABLE(replace replace.c COMPONENT Server) TARGET_LINK_LIBRARIES(replace mysys) IF(UNIX) MYSQL_ADD_EXECUTABLE(innochecksum innochecksum.c) @@ -75,7 +80,6 @@ IF(UNIX) MYSQL_ADD_EXECUTABLE(resolve_stack_dump resolve_stack_dump.c) TARGET_LINK_LIBRARIES(resolve_stack_dump mysys) - MYSQL_ADD_EXECUTABLE(mysql_waitpid mysql_waitpid.c) + MYSQL_ADD_EXECUTABLE(mysql_waitpid mysql_waitpid.c COMPONENT Client) TARGET_LINK_LIBRARIES(mysql_waitpid mysys) ENDIF() - diff --git a/extra/comp_err.c b/extra/comp_err.c index bf100fdef85..1fababf3ae5 100644 --- a/extra/comp_err.c +++ b/extra/comp_err.c @@ -1,5 +1,6 @@ /* - Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2011, Oracle and/or its affiliates & Anjuta Widenius + Copyright (c) 2008-2011 Monty Program 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 @@ -36,6 +37,7 @@ #define HEADER_LENGTH 32 /* Length of header in errmsg.sys */ #define DEFAULT_CHARSET_DIR "../sql/share/charsets" #define ER_PREFIX "ER_" +#define ER_PREFIX2 "MARIA_ER_" #define WARN_PREFIX "WARN_" static char *OUTFILE= (char*) "errmsg.sys"; static char *HEADERFILE= (char*) "mysqld_error.h"; @@ -59,7 +61,7 @@ const char *empty_string= ""; /* For empty states */ */ const char *default_language= "eng"; -int er_offset= 1000; +uint er_offset= 1000; my_bool info_flag= 0; /* Storage of one error message row (for one language) */ @@ -87,7 +89,7 @@ struct languages struct errors { const char *er_name; /* Name of the error (ER_HASHCK) */ - int d_code; /* Error code number */ + uint d_code; /* Error code number */ const char *sql_code1; /* sql state */ const char *sql_code2; /* ODBC state */ struct errors *next_error; /* Pointer to next error */ @@ -110,7 +112,8 @@ static struct my_option my_long_options[]= NO_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Prints version", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"charset", 'C', "Charset dir", &charsets_dir, &charsets_dir, + {"charset", 'C', "Charset dir", + (char**) &charsets_dir, (char**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"in_file", 'F', "Input file", &TXTFILE, &TXTFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -128,6 +131,7 @@ static struct my_option my_long_options[]= }; +static struct errors *generate_empty_message(uint dcode); static struct languages *parse_charset_string(char *str); static struct errors *parse_error_string(char *ptr, int er_count); static struct message *parse_message_string(struct message *new_message, @@ -226,7 +230,7 @@ static int create_header_files(struct errors *error_head) struct errors *tmp_error; struct message *er_msg; const char *er_text; - + uint current_d_code; DBUG_ENTER("create_header_files"); if (!(er_definef= my_fopen(HEADERFILE, O_WRONLY, MYF(MY_WME)))) @@ -251,13 +255,22 @@ static int create_header_files(struct errors *error_head) fprintf(er_definef, "#define ER_ERROR_FIRST %d\n", error_head->d_code); + current_d_code= error_head->d_code -1; for (tmp_error= error_head; tmp_error; tmp_error= tmp_error->next_error) { /* generating mysqld_error.h fprintf() will automatically add \r on windows */ - fprintf(er_definef, "#define %s %d\n", tmp_error->er_name, + + if (!tmp_error->er_name) + continue; /* Placeholder for gap */ + + if (tmp_error->d_code > current_d_code + 1) + fprintf(er_definef, "\n/* New section */\n\n"); + current_d_code= tmp_error->d_code; + + fprintf(er_definef, "#define %s %u\n", tmp_error->er_name, tmp_error->d_code); er_last= tmp_error->d_code; @@ -429,7 +442,8 @@ static int parse_input_file(const char *file_name, struct errors **top_error, char *str, buff[1000]; struct errors *current_error= 0, **tail_error= top_error; struct message current_message; - int rcount= 0; + uint rcount= 0; + my_bool er_offset_found= 0; DBUG_ENTER("parse_input_file"); *top_error= 0; @@ -450,11 +464,32 @@ static int parse_input_file(const char *file_name, struct errors **top_error, } if (is_prefix(str, "start-error-number")) { - if (!(er_offset= parse_error_offset(str))) + uint tmp_er_offset; + if (!(tmp_er_offset= parse_error_offset(str))) { fprintf(stderr, "Failed to parse the error offset string!\n"); DBUG_RETURN(0); } + if (!er_offset_found) + { + er_offset_found= 1; + er_offset= tmp_er_offset; + } + else + { + /* Create empty error messages between er_offset and tmp_err_offset */ + if (tmp_er_offset < er_offset + rcount) + { + fprintf(stderr, "new start-error-number %u is smaller than current error message: %u\n", tmp_er_offset, er_offset + rcount); + DBUG_RETURN(0); + } + for ( ; er_offset + rcount < tmp_er_offset ; rcount++) + { + current_error= generate_empty_message(er_offset + rcount); + *tail_error= current_error; + tail_error= ¤t_error->next_error; + } + } continue; } if (is_prefix(str, "default-language")) @@ -501,7 +536,8 @@ static int parse_input_file(const char *file_name, struct errors **top_error, DBUG_RETURN(0); continue; } - if (is_prefix(str, ER_PREFIX) || is_prefix(str, WARN_PREFIX)) + if (is_prefix(str, ER_PREFIX) || is_prefix(str, WARN_PREFIX) || + is_prefix(str, ER_PREFIX2)) { if (!(current_error= parse_error_string(str, rcount))) { @@ -516,12 +552,12 @@ static int parse_input_file(const char *file_name, struct errors **top_error, continue; } if (*str == '#' || *str == '\n') - continue; /* skip comment or empty lines */ + continue; /* skip comment or empty lines */ fprintf(stderr, "Wrong input file format. Stop!\nLine: %s\n", str); DBUG_RETURN(0); } - *tail_error= 0; /* Mark end of list */ + *tail_error= 0; /* Mark end of list */ my_fclose(file, MYF(0)); DBUG_RETURN(rcount); @@ -630,7 +666,6 @@ static struct message *find_message(struct errors *err, const char *lang, DBUG_RETURN(tmp); if (!strcmp(tmp->lang_short_name, default_language)) { - DBUG_ASSERT(tmp->text[0] != 0); return_val= tmp; } } @@ -850,6 +885,33 @@ static struct message *parse_message_string(struct message *new_message, } +static struct errors *generate_empty_message(uint d_code) +{ + struct errors *new_error; + struct message message; + + /* create a new element */ + if (!(new_error= (struct errors *) my_malloc(sizeof(*new_error), + MYF(MY_WME)))) + return(0); + if (my_init_dynamic_array(&new_error->msg, sizeof(struct message), 0, 1)) + return(0); /* OOM: Fatal error */ + + new_error->er_name= NULL; + new_error->d_code= d_code; + new_error->sql_code1= empty_string; + new_error->sql_code2= empty_string; + + if (!(message.lang_short_name= my_strdup(default_language, MYF(MY_WME))) || + !(message.text= my_strdup("", MYF(MY_WME)))) + return(0); + + /* Can't fail as msg is preallocated */ + (void) insert_dynamic(&new_error->msg, (uchar*) &message); + return(new_error); +} + + /* Parsing the string with error name and codes; returns the pointer to the errors struct @@ -862,7 +924,9 @@ static struct errors *parse_error_string(char *str, int er_count) DBUG_PRINT("enter", ("str: %s", str)); /* create a new element */ - new_error= (struct errors *) my_malloc(sizeof(*new_error), MYF(MY_WME)); + if (!(new_error= (struct errors *) my_malloc(sizeof(*new_error), + MYF(MY_WME)))) + DBUG_RETURN(0); if (my_init_dynamic_array(&new_error->msg, sizeof(struct message), 0, 0)) DBUG_RETURN(0); /* OOM: Fatal error */ @@ -992,7 +1056,7 @@ static struct languages *parse_charset_string(char *str) static void print_version(void) { DBUG_ENTER("print_version"); - printf("%s (Compile errormessage) Ver %s\n", my_progname, "2.0"); + printf("%s (Compile errormessage) Ver %s\n", my_progname, "3.0"); DBUG_VOID_RETURN; } diff --git a/extra/innochecksum.c b/extra/innochecksum.c index b55b510b888..ed4dfc48789 100644 --- a/extra/innochecksum.c +++ b/extra/innochecksum.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2011, Oracle and/or its affiliates 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 diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c index 55d3d1f8597..8a16e677cb9 100644 --- a/extra/my_print_defaults.c +++ b/extra/my_print_defaults.c @@ -1,6 +1,5 @@ - /* - Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2011, Oracle and/or its affiliates 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 @@ -51,33 +50,33 @@ static struct my_option my_long_options[] = {"config-file", 'c', "Deprecated, please use --defaults-file instead. " "Name of config file to read; if no extension is given, default " "extension (e.g., .ini or .cnf) will be added", - &config_file, &config_file, 0, GET_STR, REQUIRED_ARG, + (char**) &config_file, (char**) &config_file, 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", 0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, #else - {"debug", '#', "Output debug log", &default_dbug_option, - &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"debug", '#', "Output debug log", (char**) &default_dbug_option, + (char**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif {"defaults-file", 'c', "Like --config-file, except: if first option, " "then read this file only, do not read global or per-user config " "files; should be the first option", - &config_file, &config_file, 0, GET_STR, REQUIRED_ARG, + (char**) &config_file, (char*) &config_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"defaults-extra-file", 'e', "Read this file after the global config file and before the config " "file in the users home directory; should be the first option", - &my_defaults_extra_file, &my_defaults_extra_file, 0, + (void *)&my_defaults_extra_file, (void *)&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", - &my_defaults_group_suffix, &my_defaults_group_suffix, + (char**) &my_defaults_group_suffix, (char**) &my_defaults_group_suffix, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"extra-file", 'e', "Deprecated. Synonym for --defaults-extra-file.", - &my_defaults_extra_file, - &my_defaults_extra_file, 0, GET_STR, + (void *)&my_defaults_extra_file, + (void *)&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}, @@ -103,7 +102,7 @@ static void usage(my_bool version) my_print_help(my_long_options); my_print_default_files(config_file); my_print_variables(my_long_options); - printf("\nExample usage:\n%s --defaults-file=example.cnf client mysql\n", my_progname); + printf("\nExample usage:\n%s --defaults-file=example.cnf client client-server mysql\n", my_progname); } diff --git a/extra/mysql_waitpid.c b/extra/mysql_waitpid.c index 23177eb51cb..7777da25aa1 100644 --- a/extra/mysql_waitpid.c +++ b/extra/mysql_waitpid.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. +/* + Copyright (c) 2003, 2010, Oracle and/or its affiliates 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 diff --git a/extra/perror.c b/extra/perror.c index af5d95d3c5b..c8ea85c5504 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2011, Oracle and/or its affiliates 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 @@ -419,6 +419,8 @@ int main(int argc,char *argv[]) if (unknown_error) free(unknown_error); + my_handler_error_unregister(); + my_end(0); exit(error); return error; } diff --git a/extra/replace.c b/extra/replace.c index 53bc1fd925a..8aef9f9a0a0 100644 --- a/extra/replace.c +++ b/extra/replace.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2011, Oracle and/or its affiliates This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -138,6 +138,7 @@ int main(int argc, char *argv[]) } } free_buffer(); + my_free(replace); my_end(verbose ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR); exit(error ? 2 : 0); return 0; /* No compiler warning */ @@ -1086,7 +1087,7 @@ static int convert_file(REPLACE *rep, char * name) my_fclose(in,MYF(0)); my_fclose(out,MYF(0)); if (updated && ! error) - my_redel(org_name,tempname,MYF(MY_WME | MY_LINK_WARNING)); + my_redel(org_name, tempname, 0, MYF(MY_WME | MY_LINK_WARNING)); else my_delete(tempname,MYF(MY_WME)); if (!silent && ! error) diff --git a/extra/resolve_stack_dump.c b/extra/resolve_stack_dump.c index 3422b7ef4de..dd77e1785d0 100644 --- a/extra/resolve_stack_dump.c +++ b/extra/resolve_stack_dump.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. +/* + Copyright (c) 2001, 2010, Oracle and/or its affiliates 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 diff --git a/extra/resolveip.c b/extra/resolveip.c index f69aa7fec5f..b6840d9d463 100644 --- a/extra/resolveip.c +++ b/extra/resolveip.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* + Copyright (c) 2000, 2010, Oracle and/or its affiliates 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 @@ -24,9 +25,7 @@ #ifndef WIN32 # include <sys/types.h> # include <sys/socket.h> -# ifndef HAVE_BROKEN_NETINET_INCLUDES -# include <netinet/in.h> -# endif +# include <netinet/in.h> # include <arpa/inet.h> # include <netdb.h> #endif diff --git a/extra/yassl/include/yassl_int.hpp b/extra/yassl/include/yassl_int.hpp index 686e958d7e1..e5ee00bc21c 100644 --- a/extra/yassl/include/yassl_int.hpp +++ b/extra/yassl/include/yassl_int.hpp @@ -440,7 +440,7 @@ public: const Ciphers& GetCiphers() const; const DH_Parms& GetDH_Parms() const; const Stats& GetStats() const; - const VerifyCallback getVerifyCallback() const; + VerifyCallback getVerifyCallback() const; pem_password_cb GetPasswordCb() const; void* GetUserData() const; bool GetSessionCacheOff() const; diff --git a/extra/yassl/src/buffer.cpp b/extra/yassl/src/buffer.cpp index f8174098249..d885c953207 100644 --- a/extra/yassl/src/buffer.cpp +++ b/extra/yassl/src/buffer.cpp @@ -22,6 +22,9 @@ * with SSL types and sockets */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include <string.h> // memcpy #include "runtime.hpp" diff --git a/extra/yassl/src/crypto_wrapper.cpp b/extra/yassl/src/crypto_wrapper.cpp index ccd43c442c9..afb492c83c5 100644 --- a/extra/yassl/src/crypto_wrapper.cpp +++ b/extra/yassl/src/crypto_wrapper.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2010, Oracle and/or its affiliates 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 @@ -954,7 +954,10 @@ x509* PemToDer(FILE* file, CertType type, EncryptedInfo* info) } } // get blank line - if (fgets(line, sizeof(line), file)) + if (fgets(line,sizeof(line), file) == 0) + { + /* Impossible case */ + } begin = ftell(file); } diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp index 00a3b885f88..8401798534b 100644 --- a/extra/yassl/src/ssl.cpp +++ b/extra/yassl/src/ssl.cpp @@ -1628,10 +1628,10 @@ unsigned long ERR_get_error() } - int SSL_CTX_use_certificate_chain_file(SSL_CTX*, const char*) + int SSL_CTX_use_certificate_chain_file(SSL_CTX* ctx, const char* file) { - // TDOD: - return SSL_SUCCESS; + // For the moment, treat like use_certificate_file + return read_file(ctx, file, SSL_FILETYPE_PEM, Cert); } diff --git a/extra/yassl/src/timer.cpp b/extra/yassl/src/timer.cpp index c1286b0724c..945cc8c8b0b 100644 --- a/extra/yassl/src/timer.cpp +++ b/extra/yassl/src/timer.cpp @@ -24,7 +24,7 @@ #include "timer.hpp" #ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 #include <windows.h> #else #include <sys/time.h> diff --git a/extra/yassl/src/yassl_error.cpp b/extra/yassl/src/yassl_error.cpp index 74735347841..e55c10c68c0 100644 --- a/extra/yassl/src/yassl_error.cpp +++ b/extra/yassl/src/yassl_error.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2011, Oracle and/or its affiliates 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 diff --git a/extra/yassl/src/yassl_imp.cpp b/extra/yassl/src/yassl_imp.cpp index 66a173bece8..c0ef23a4e94 100644 --- a/extra/yassl/src/yassl_imp.cpp +++ b/extra/yassl/src/yassl_imp.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2012, Oracle and/or its affiliates 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 diff --git a/extra/yassl/src/yassl_int.cpp b/extra/yassl/src/yassl_int.cpp index 73f8f2330c5..65e17b01544 100644 --- a/extra/yassl/src/yassl_int.cpp +++ b/extra/yassl/src/yassl_int.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2012, Oracle and/or its affiliates 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 @@ -1852,7 +1852,7 @@ SSL_CTX::GetCA_List() const } -const VerifyCallback SSL_CTX::getVerifyCallback() const +VerifyCallback SSL_CTX::getVerifyCallback() const { return verifyCallback_; } diff --git a/extra/yassl/taocrypt/benchmark/benchmark.cpp b/extra/yassl/taocrypt/benchmark/benchmark.cpp index 225a1a0fa46..6ed7351a56b 100644 --- a/extra/yassl/taocrypt/benchmark/benchmark.cpp +++ b/extra/yassl/taocrypt/benchmark/benchmark.cpp @@ -1,24 +1,10 @@ -/* - Copyright (C) 2006, 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. -*/ - // benchmark.cpp // TaoCrypt benchmark +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <string.h> #include <stdio.h> diff --git a/extra/yassl/taocrypt/include/block.hpp b/extra/yassl/taocrypt/include/block.hpp index ae3df8a3009..77017e9d5e4 100644 --- a/extra/yassl/taocrypt/include/block.hpp +++ b/extra/yassl/taocrypt/include/block.hpp @@ -164,7 +164,8 @@ public: void CleanNew(word32 newSize) { New(newSize); - memset(buffer_, 0, sz_ * sizeof(T)); + if (sz_ > 0) + memset(buffer_, 0, sz_ * sizeof(T)); } void New(word32 newSize) diff --git a/extra/yassl/taocrypt/include/blowfish.hpp b/extra/yassl/taocrypt/include/blowfish.hpp index 3ad2aedc587..e868872d3cf 100644 --- a/extra/yassl/taocrypt/include/blowfish.hpp +++ b/extra/yassl/taocrypt/include/blowfish.hpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2006, 2010, Oracle and/or its affiliates 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 diff --git a/extra/yassl/taocrypt/include/file.hpp b/extra/yassl/taocrypt/include/file.hpp index 820fd8ff431..c340c4fa3ea 100644 --- a/extra/yassl/taocrypt/include/file.hpp +++ b/extra/yassl/taocrypt/include/file.hpp @@ -117,7 +117,7 @@ public: word32 size(bool use_current = false); private: - void put(Source&); + size_t put(Source&); FileSink(const FileSink&); // hide FileSink& operator=(const FileSink&); // hide diff --git a/extra/yassl/taocrypt/include/runtime.hpp b/extra/yassl/taocrypt/include/runtime.hpp index 568c0b3afd8..328c8e9e978 100644 --- a/extra/yassl/taocrypt/include/runtime.hpp +++ b/extra/yassl/taocrypt/include/runtime.hpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2010, Oracle and/or its affiliates 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 diff --git a/extra/yassl/taocrypt/src/aes.cpp b/extra/yassl/taocrypt/src/aes.cpp index 811b483b0c9..3b09c5280bf 100644 --- a/extra/yassl/taocrypt/src/aes.cpp +++ b/extra/yassl/taocrypt/src/aes.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2010, Oracle and/or its affiliates 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 @@ -51,7 +51,8 @@ void AES::Process(byte* out, const byte* in, word32 sz) out += BLOCK_SIZE; in += BLOCK_SIZE; } - else if (mode_ == CBC) { + else if (mode_ == CBC) + { if (dir_ == ENCRYPTION) while (blocks--) { r_[0] ^= *(word32*)in; diff --git a/extra/yassl/taocrypt/src/algebra.cpp b/extra/yassl/taocrypt/src/algebra.cpp index 73423d47546..29754b27b5e 100644 --- a/extra/yassl/taocrypt/src/algebra.cpp +++ b/extra/yassl/taocrypt/src/algebra.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2010, Oracle and/or its affiliates 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 @@ -18,7 +18,6 @@ /* based on Wei Dai's algebra.cpp from CryptoPP */ #undef NDEBUG -#define DEBUG // GCC 4.0 bug if NDEBUG and Optimize > 1 #include "runtime.hpp" #include "algebra.hpp" diff --git a/extra/yassl/taocrypt/src/blowfish.cpp b/extra/yassl/taocrypt/src/blowfish.cpp index 64e8f0a84aa..e1c7c852d19 100644 --- a/extra/yassl/taocrypt/src/blowfish.cpp +++ b/extra/yassl/taocrypt/src/blowfish.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2006, 2010, Oracle and/or its affiliates 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 @@ -53,7 +53,8 @@ void Blowfish::Process(byte* out, const byte* in, word32 sz) out += BLOCK_SIZE; in += BLOCK_SIZE; } - else if (mode_ == CBC) { + else if (mode_ == CBC) + { if (dir_ == ENCRYPTION) while (blocks--) { r_[0] ^= *(word32*)in; diff --git a/extra/yassl/taocrypt/src/coding.cpp b/extra/yassl/taocrypt/src/coding.cpp index 8647ea13f20..97c62ea12a7 100644 --- a/extra/yassl/taocrypt/src/coding.cpp +++ b/extra/yassl/taocrypt/src/coding.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2010, Oracle and/or its affiliates 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 diff --git a/extra/yassl/taocrypt/src/file.cpp b/extra/yassl/taocrypt/src/file.cpp index 0498038a04b..88ead8e550e 100644 --- a/extra/yassl/taocrypt/src/file.cpp +++ b/extra/yassl/taocrypt/src/file.cpp @@ -98,9 +98,9 @@ FileSink::~FileSink() // fill source from file sink -void FileSink::put(Source& source) +size_t FileSink::put(Source& source) { - fwrite(source.get_buffer(), 1, source.size(), file_); + return fwrite(source.get_buffer(), 1, source.size(), file_); } diff --git a/extra/yassl/taocrypt/src/integer.cpp b/extra/yassl/taocrypt/src/integer.cpp index bfced6d0c74..15deb59d4f3 100644 --- a/extra/yassl/taocrypt/src/integer.cpp +++ b/extra/yassl/taocrypt/src/integer.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2012, Oracle and/or its affiliates 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 diff --git a/extra/yassl/taocrypt/src/misc.cpp b/extra/yassl/taocrypt/src/misc.cpp index 5ffa2a2a07a..1a4dd4a52d3 100644 --- a/extra/yassl/taocrypt/src/misc.cpp +++ b/extra/yassl/taocrypt/src/misc.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2010, Oracle and/or its affiliates 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 @@ -175,6 +175,15 @@ word Crop(word value, unsigned int size) #ifdef TAOCRYPT_X86ASM_AVAILABLE +#ifdef NOT_USED +#ifndef _MSC_VER + static jmp_buf s_env; + static void SigIllHandler(int) + { + longjmp(s_env, 1); + } +#endif +#endif bool HaveCpuId() { diff --git a/extra/yassl/taocrypt/src/twofish.cpp b/extra/yassl/taocrypt/src/twofish.cpp index 4ff1304a4cd..4ae493624dc 100644 --- a/extra/yassl/taocrypt/src/twofish.cpp +++ b/extra/yassl/taocrypt/src/twofish.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2006, 2010, Oracle and/or its affiliates 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 @@ -54,7 +54,8 @@ void Twofish::Process(byte* out, const byte* in, word32 sz) out += BLOCK_SIZE; in += BLOCK_SIZE; } - else if (mode_ == CBC) { + else if (mode_ == CBC) + { if (dir_ == ENCRYPTION) while (blocks--) { r_[0] ^= *(word32*)in; diff --git a/extra/yassl/taocrypt/test/test.cpp b/extra/yassl/taocrypt/test/test.cpp index 4cd5dba8ac6..807f91f32ae 100644 --- a/extra/yassl/taocrypt/test/test.cpp +++ b/extra/yassl/taocrypt/test/test.cpp @@ -1,24 +1,10 @@ -/* - Copyright (C) 2006, 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. -*/ - // test.cpp // test taocrypt functionality +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <string.h> #include <stdio.h> diff --git a/extra/yassl/testsuite/test.hpp b/extra/yassl/testsuite/test.hpp index 1f10095b945..559ebe54f1b 100644 --- a/extra/yassl/testsuite/test.hpp +++ b/extra/yassl/testsuite/test.hpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2006, 2010, Oracle and/or its affiliates. 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 |