aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/.gitignore5
-rw-r--r--lib/hipe/arm/hipe_arm_pp.erl17
-rw-r--r--lib/odbc/AUTHORS3
-rw-r--r--lib/odbc/c_src/odbcserver.c142
-rw-r--r--lib/odbc/c_src/odbcserver.h1
-rw-r--r--lib/odbc/doc/src/databases.xml8
-rw-r--r--lib/odbc/doc/src/getting_started.xml16
-rw-r--r--lib/odbc/doc/src/notes.xml58
-rw-r--r--lib/odbc/doc/src/odbc.xml2
-rw-r--r--lib/odbc/src/odbc.erl10
-rw-r--r--lib/odbc/src/odbc_internal.hrl1
-rw-r--r--lib/odbc/vsn.mk2
-rw-r--r--lib/public_key/vsn.mk6
-rw-r--r--lib/ssl/doc/src/new_ssl.xml22
-rw-r--r--lib/ssl/src/ssl.erl3
-rw-r--r--lib/ssl/src/ssl_connection.erl3
-rw-r--r--lib/ssl/test/ssl_basic_SUITE.erl141
-rw-r--r--lib/ssl/test/ssl_test_lib.erl14
-rw-r--r--lib/ssl/test/ssl_to_openssl_SUITE.erl2
-rw-r--r--lib/ssl/vsn.mk7
-rw-r--r--lib/test_server/src/ts_run.erl60
-rw-r--r--lib/xmerl/doc/src/notes.xml24
-rw-r--r--lib/xmerl/vsn.mk9
-rwxr-xr-xmake/fakefop14
24 files changed, 448 insertions, 122 deletions
diff --git a/lib/.gitignore b/lib/.gitignore
index fc8a1c5568..a33916b3bf 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -141,6 +141,11 @@
# orber & cos* applications
+/orber/test/idl_output
+/cosEvent/test/idl_output
+/cosNotification/test/idl_output
+/cosTransactions/test/idl_output
+
/cosEvent/include/CosEventChannelAdmin.hrl
/cosEvent/include/CosEventChannelAdmin_ConsumerAdmin.hrl
/cosEvent/include/CosEventChannelAdmin_EventChannel.hrl
diff --git a/lib/hipe/arm/hipe_arm_pp.erl b/lib/hipe/arm/hipe_arm_pp.erl
index 7ce8421994..c4dde31188 100644
--- a/lib/hipe/arm/hipe_arm_pp.erl
+++ b/lib/hipe/arm/hipe_arm_pp.erl
@@ -1,20 +1,20 @@
%% -*- erlang-indent-level: 2 -*-
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2005-2010. All Rights Reserved.
+%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
@@ -246,6 +246,11 @@ stop_suffix(StOp) ->
'strb' -> "b"
end.
+imm8m_decode(Value, 0) ->
+ Value;
+imm8m_decode(Value, Rot) ->
+ (Value bsr (2 * Rot)) bor (Value bsl (2 * (16 - Rot))).
+
pp_temp(Dev, Temp=#arm_temp{reg=Reg, type=Type}) ->
case hipe_arm:temp_is_precoloured(Temp) of
true ->
@@ -292,7 +297,7 @@ pp_am1(Dev, Am1) ->
io:format(Dev, "#~w", [Imm5])
end;
{Imm8,Imm4} ->
- io:format(Dev, "#~w, 2*~w", [Imm8,Imm4])
+ io:format(Dev, "#~s", [to_hex(imm8m_decode(Imm8, Imm4))])
end.
pp_am2(Dev, #am2{src=Src,sign=Sign,offset=Am2Offset}) ->
diff --git a/lib/odbc/AUTHORS b/lib/odbc/AUTHORS
index 22813f36ce..38f72244ef 100644
--- a/lib/odbc/AUTHORS
+++ b/lib/odbc/AUTHORS
@@ -6,4 +6,5 @@ Original Authors:
Contributors:
Scott Lystig Fritchie - input/output variables for stored procedures
[email protected] - Some 64 bits adjustments
-Juhani R�nkimies - SQL_WCHAR and SQL_WVARCHAR support \ No newline at end of file
+Juhani R�nkimies - SQL_WCHAR and SQL_WVARCHAR support
+Juhani R�nkimies - TIMESTAMP support \ No newline at end of file
diff --git a/lib/odbc/c_src/odbcserver.c b/lib/odbc/c_src/odbcserver.c
index 5865cddcda..c9627e9d05 100644
--- a/lib/odbc/c_src/odbcserver.c
+++ b/lib/odbc/c_src/odbcserver.c
@@ -89,7 +89,8 @@
InOrOut = [ERL_ODBC_IN | ERL_ODBC_OUT | ERL_ODBC_INOUT]
Datatype - USER_INT | USER_SMALL_INT | {USER_DECIMAL, Precision, Scale} |
{USER_NMERIC, Precision, Scale} | {USER_CHAR, Max} | {USER_VARCHAR, Max} |
- {USER_WVARCHAR, Max} | {USER_FLOAT, Precision} | USER_REAL | USER_DOUBLE
+ {USER_WVARCHAR, Max} | {USER_FLOAT, Precision} | USER_REAL | USER_DOUBLE |
+ USER_TIMESTAMP
Scale - integer
Precision - integer
Max - integer
@@ -379,7 +380,7 @@ DWORD WINAPI database_handler(const char *port)
shutdown(socket, 2);
close_socket(socket);
clean_socket_lib();
- DO_EXIT(EXIT_SUCCESS);
+ /* Exit will be done by suervisor thread */
}
/* Description: Calls the appropriate function to handle the database
@@ -1080,6 +1081,7 @@ static db_result_msg encode_out_params(db_state *state,
int j = 0;
param_array column;
db_result_msg msg;
+ TIMESTAMP_STRUCT* ts;
msg = encode_empty_message();
ei_x_encode_tuple_header(&dynamic_buffer(state), 3);
@@ -1109,6 +1111,18 @@ static db_result_msg encode_out_params(db_state *state,
} else {
void* values = retrive_param_values(&column);
switch(column.type.c) {
+ case SQL_C_TYPE_TIMESTAMP:
+ ts = (TIMESTAMP_STRUCT*) values;
+ ei_x_encode_tuple_header(&dynamic_buffer(state), 2);
+ ei_x_encode_tuple_header(&dynamic_buffer(state), 3);
+ ei_x_encode_long(&dynamic_buffer(state), (long)(ts->year));
+ ei_x_encode_long(&dynamic_buffer(state), (long)(ts->month));
+ ei_x_encode_long(&dynamic_buffer(state), (long)(ts->day));
+ ei_x_encode_tuple_header(&dynamic_buffer(state), 3);
+ ei_x_encode_long(&dynamic_buffer(state), (long)(ts->hour));
+ ei_x_encode_long(&dynamic_buffer(state), (long)(ts->minute));
+ ei_x_encode_long(&dynamic_buffer(state), (long)(ts->second));
+ break;
case SQL_C_CHAR:
if binary_strings(state) {
ei_x_encode_binary(&dynamic_buffer(state),
@@ -1380,11 +1394,24 @@ static db_result_msg encode_row_count(SQLINTEGER num_of_rows,
static void encode_column_dyn(db_column column, int column_nr,
db_state *state)
{
+ TIMESTAMP_STRUCT* ts;
if (column.type.len == 0 ||
column.type.strlen_or_indptr == SQL_NULL_DATA) {
ei_x_encode_atom(&dynamic_buffer(state), "null");
} else {
switch(column.type.c) {
+ case SQL_C_TYPE_TIMESTAMP:
+ ts = (TIMESTAMP_STRUCT*)column.buffer;
+ ei_x_encode_tuple_header(&dynamic_buffer(state), 2);
+ ei_x_encode_tuple_header(&dynamic_buffer(state), 3);
+ ei_x_encode_ulong(&dynamic_buffer(state), ts->year);
+ ei_x_encode_ulong(&dynamic_buffer(state), ts->month);
+ ei_x_encode_ulong(&dynamic_buffer(state), ts->day);
+ ei_x_encode_tuple_header(&dynamic_buffer(state), 3);
+ ei_x_encode_ulong(&dynamic_buffer(state), ts->hour);
+ ei_x_encode_ulong(&dynamic_buffer(state), ts->minute);
+ ei_x_encode_ulong(&dynamic_buffer(state), ts->second);
+ break;
case SQL_C_CHAR:
if binary_strings(state) {
ei_x_encode_binary(&dynamic_buffer(state),
@@ -1491,7 +1518,7 @@ static void encode_data_type(SQLINTEGER sql_type, SQLINTEGER size,
ei_x_encode_atom(&dynamic_buffer(state), "SQL_TYPE_TIME");
break;
case SQL_TYPE_TIMESTAMP:
- ei_x_encode_atom(&dynamic_buffer(state), "SQL_TYPE_TIMESTAMP");
+ ei_x_encode_atom(&dynamic_buffer(state), "sql_timestamp");
break;
case SQL_BIGINT:
ei_x_encode_atom(&dynamic_buffer(state), "SQL_BIGINT");
@@ -1542,8 +1569,10 @@ static Boolean decode_params(db_state *state, byte *buffer, int *index, param_ar
{
int erl_type, size;
long bin_size, l64;
+ long val;
param_array* param;
-
+ TIMESTAMP_STRUCT* ts;
+
ei_get_type(buffer, index, &erl_type, &size);
param = &(*params)[i];
@@ -1564,50 +1593,67 @@ static Boolean decode_params(db_state *state, byte *buffer, int *index, param_ar
}
break;
case SQL_C_WCHAR:
- ei_decode_binary(buffer, index, &(param->values.string[param->offset]), &bin_size);
- param->offset += param->type.len;
- param->type.strlen_or_indptr_array[j] = SQL_NTS;
- break;
+ ei_decode_binary(buffer, index, &(param->values.string[param->offset]), &bin_size);
+ param->offset += param->type.len;
+ param->type.strlen_or_indptr_array[j] = SQL_NTS;
+ break;
+ case SQL_C_TYPE_TIMESTAMP:
+ ts = (TIMESTAMP_STRUCT*) param->values.string;
+ ei_decode_tuple_header(buffer, index, &val);
+ ei_decode_long(buffer, index, &val);
+ ts[j].year = (SQLUSMALLINT)val;
+ ei_decode_long(buffer, index, &val);
+ ts[j].month = (SQLUSMALLINT)val;
+ ei_decode_long(buffer, index, &val);
+ ts[j].day = (SQLUSMALLINT)val;
+ ei_decode_long(buffer, index, &val);
+ ts[j].hour = (SQLUSMALLINT)val;
+ ei_decode_long(buffer, index, &val);
+ ts[j].minute = (SQLUSMALLINT)val;
+ ei_decode_long(buffer, index, &val);
+ ts[j].second = (SQLUSMALLINT)val;
+ ts[j].fraction = (SQLINTEGER)0;
+ break;
case SQL_C_SLONG:
- if(!((erl_type == ERL_SMALL_INTEGER_EXT) ||
- (erl_type == ERL_INTEGER_EXT) ||
- (erl_type == ERL_SMALL_BIG_EXT) ||
- (erl_type == ERL_LARGE_BIG_EXT))) {
- return FALSE;
- }
-
- if(ei_decode_long(buffer, index, &l64)) {
- return FALSE;
- }
-
- /* For 64-bit platforms we downcast 8-byte long
- * to 4-byte SQLINTEGER, checking for overflow */
-
- if(l64>INT_MAX || l64<INT_MIN) {
- return FALSE;
- }
+ if(!((erl_type == ERL_SMALL_INTEGER_EXT) ||
+ (erl_type == ERL_INTEGER_EXT) ||
+ (erl_type == ERL_SMALL_BIG_EXT) ||
+ (erl_type == ERL_LARGE_BIG_EXT))) {
+ return FALSE;
+ }
+
+ if(ei_decode_long(buffer, index, &l64)) {
+ return FALSE;
+ }
+
+ /* For 64-bit platforms we downcast 8-byte long
+ * to 4-byte SQLINTEGER, checking for overflow */
+
+ if(l64>INT_MAX || l64<INT_MIN) {
+ return FALSE;
+ }
param->values.integer[j]=(SQLINTEGER)l64;
break;
-
+
case SQL_C_DOUBLE:
- if((erl_type != ERL_FLOAT_EXT)) {
- return FALSE;
- }
- ei_decode_double(buffer, index, &(param->values.floating[j]));
- break;
-
+ if((erl_type != ERL_FLOAT_EXT)) {
+ return FALSE;
+ }
+ ei_decode_double(buffer, index, &(param->values.floating[j]));
+ break;
+
case SQL_C_BIT:
if((erl_type != ERL_ATOM_EXT)) {
- return FALSE;
+ return FALSE;
}
ei_decode_boolean(buffer, index, &(param->values.bool[j]));
break;
-
+
default:
- return FALSE;
+ return FALSE;
}
-
+
return TRUE;
}
@@ -1987,7 +2033,7 @@ static void init_driver(int erl_auto_commit_mode, int erl_trace_driver,
db_state *state)
{
- int auto_commit_mode, trace_driver, use_srollable_cursors;
+ int auto_commit_mode, trace_driver;
if(erl_auto_commit_mode == ON) {
auto_commit_mode = SQL_AUTOCOMMIT_ON;
@@ -2013,18 +2059,19 @@ static void init_driver(int erl_auto_commit_mode, int erl_trace_driver,
environment_handle(state),
&connection_handle(state))))
DO_EXIT(EXIT_ALLOC);
+ /* By default Erlang handles all timeouts */
if(!sql_success(SQLSetConnectAttr(connection_handle(state),
SQL_ATTR_CONNECTION_TIMEOUT,
(SQLPOINTER)TIME_OUT, 0)))
- DO_EXIT(EXIT_CONNECTION);
+ DO_EXIT(EXIT_CONNECTION);
if(!sql_success(SQLSetConnectAttr(connection_handle(state),
SQL_ATTR_AUTOCOMMIT,
(SQLPOINTER)auto_commit_mode, 0)))
- DO_EXIT(EXIT_CONNECTION);
+ DO_EXIT(EXIT_CONNECTION);
if(!sql_success(SQLSetConnectAttr(connection_handle(state),
SQL_ATTR_TRACE,
(SQLPOINTER)trace_driver, 0)))
- DO_EXIT(EXIT_CONNECTION);
+ DO_EXIT(EXIT_CONNECTION);
}
static void init_param_column(param_array *params, byte *buffer, int *index,
@@ -2126,6 +2173,14 @@ static void init_param_column(param_array *params, byte *buffer, int *index,
(byte *)safe_malloc(num_param_values * sizeof(byte) * params->type.len);
break;
+ case USER_TIMESTAMP:
+ params->type.sql = SQL_TYPE_TIMESTAMP;
+ params->type.len = sizeof(TIMESTAMP_STRUCT);
+ params->type.c = SQL_C_TYPE_TIMESTAMP;
+ params->type.col_size = (SQLUINTEGER)19;//;sizeof(TIMESTAMP_STRUCT);
+ params->values.string =
+ (TIMESTAMP_STRUCT *)safe_malloc(num_param_values * params->type.len);
+ break;
case USER_FLOAT:
params->type.sql = SQL_FLOAT;
params->type.c = SQL_C_DOUBLE;
@@ -2297,12 +2352,16 @@ static db_result_msg map_sql_2_c_column(db_column* column)
break;
case SQL_TYPE_DATE:
case SQL_TYPE_TIME:
- case SQL_TYPE_TIMESTAMP:
column -> type.len = (column -> type.col_size) +
sizeof(byte);
column -> type.c = SQL_C_CHAR;
column -> type.strlen_or_indptr = SQL_NTS;
break;
+ case SQL_TYPE_TIMESTAMP:
+ column -> type.len = sizeof(TIMESTAMP_STRUCT);
+ column -> type.c = SQL_C_TYPE_TIMESTAMP;
+ column -> type.strlen_or_indptr = (SQLINTEGER)NULL;
+ break;
case SQL_BIGINT:
column -> type.len = DEC_NUM_LENGTH;
column -> type.c = SQL_C_CHAR;
@@ -2389,6 +2448,7 @@ static void * retrive_param_values(param_array *Param)
switch(Param->type.c) {
case SQL_C_CHAR:
case SQL_C_WCHAR:
+ case SQL_C_TYPE_TIMESTAMP:
return (void *)Param->values.string;
case SQL_C_SLONG:
return (void *)Param->values.integer;
diff --git a/lib/odbc/c_src/odbcserver.h b/lib/odbc/c_src/odbcserver.h
index 3b5a2b4d4d..e6d8df1f58 100644
--- a/lib/odbc/c_src/odbcserver.h
+++ b/lib/odbc/c_src/odbcserver.h
@@ -113,6 +113,7 @@
#define USER_TINY_INT 11
#define USER_WCHAR 12
#define USER_WVARCHAR 13
+#define USER_TIMESTAMP 14
/*------------------------ TYPDEFS ----------------------------------*/
diff --git a/lib/odbc/doc/src/databases.xml b/lib/odbc/doc/src/databases.xml
index 2c1b932084..9776736909 100644
--- a/lib/odbc/doc/src/databases.xml
+++ b/lib/odbc/doc/src/databases.xml
@@ -99,7 +99,7 @@
<p>Note that when the value of the data to input is a string, it
has to be quoted with <c>'</c>. Example: </p>
<code type="none">
-\011odbc:sql_query(Ref, "INSERT INTO EMPLOYEE VALUES(1, 'Jane', 'Doe', 'F')").
+odbc:sql_query(Ref, "INSERT INTO EMPLOYEE VALUES(1, 'Jane', 'Doe', 'F')").
</code>
</note>
<p>You may also input data using <seealso marker="odbc#param_query">param_query/[3,4]</seealso> and then
@@ -198,7 +198,7 @@ when p >= 16 </cell>
</row>
<row>
<cell align="left" valign="middle">SQL_TYPE_TIMESTAMP </cell>
- <cell align="left" valign="middle">String </cell>
+ <cell align="left" valign="middle"> {{YY, MM, DD}, {HH, MM, SS}} </cell>
</row>
<row>
<cell align="left" valign="middle">SQL_LONGVARCHAR </cell>
@@ -262,8 +262,8 @@ when p >= 16 </cell>
customers of that department. </p>
<code type="none">
CREATE PROCEDURE DepartmentInfo (@DepartmentID INT) AS
-\011SELECT * FROM Employee WHERE department = @DepartmentID
-\011SELECT * FROM Customers WHERE department = @DepartmentID
+ SELECT * FROM Employee WHERE department = @DepartmentID
+ SELECT * FROM Customers WHERE department = @DepartmentID
</code>
</section>
diff --git a/lib/odbc/doc/src/getting_started.xml b/lib/odbc/doc/src/getting_started.xml
index 864c3a7b65..d543ef64d6 100644
--- a/lib/odbc/doc/src/getting_started.xml
+++ b/lib/odbc/doc/src/getting_started.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2002</year><year>2009</year>
+ <year>2002</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>Getting started</title>
@@ -108,15 +108,15 @@
to insert many rows in one go. </p>
<code type="none">
6 > odbc:param_query(Ref,"INSERT INTO EMPLOYEE (NR, FIRSTNAME, "
-\011 "LASTNAME, GENDER) VALUES(?, ?, ?, ?)",
-\011 [{sql_integer,[2,3,4,5,6,7,8]},
-\011 {{sql_varchar, 20},
+ "LASTNAME, GENDER) VALUES(?, ?, ?, ?)",
+ [{sql_integer,[2,3,4,5,6,7,8]},
+ {{sql_varchar, 20},
["John", "Monica", "Ross", "Rachel",
"Piper", "Prue", "Louise"]},
-\011 {{sql_varchar, 20},
+ {{sql_varchar, 20},
["Doe","Geller","Geller", "Green",
"Halliwell", "Halliwell", "Lane"]},
-\011 {{sql_char, 1}, ["M","F","M","F","F","F","F"]}]).
+ {{sql_char, 1}, ["M","F","M","F","F","F","F"]}]).
{updated, 7}
</code>
<p>Fetch all data in the table employee </p>
diff --git a/lib/odbc/doc/src/notes.xml b/lib/odbc/doc/src/notes.xml
index 29fed0e286..09d78c3248 100644
--- a/lib/odbc/doc/src/notes.xml
+++ b/lib/odbc/doc/src/notes.xml
@@ -20,7 +20,7 @@
under the License.
</legalnotice>
-
+
<title>ODBC Release Notes</title>
<prepared>otp_appnotes</prepared>
<docno>nil</docno>
@@ -30,41 +30,51 @@
</header>
<p>This document describes the changes made to the odbc application.
</p>
-
+
<section><title>ODBC 2.10.8</title>
-
- <section><title>Improvements and New Features</title>
- <list>
- <item>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
<p>
- ODBC now handles the types SQL_WCHAR and SQL_WVARCHAR.
- ODBC also has a new connection option to return all
- strings as binaries and also expect strings to be
- binaries in the param_query function. This provides some
- but not a full unicode support.</p>
+ ODBC now handles the types SQL_WCHAR and SQL_WVARCHAR.
+ Thanks to Juhani R�nkimies. ODBC also has a new
+ connection option to return all strings as binaries and
+ also expect strings to be binaries in the param_query
+ function. These changes provides some unicode support.</p>
<p>
- Own Id: OTP-7452</p>
+ Own Id: OTP-7452</p>
</item>
- </list>
- </section>
-
- </section>
-
- <section><title>ODBC 2.10.7</title>
-
- <section><title>Fixed Bugs and Malfunctions</title>
- <list>
<item>
<p>
- The odbc application can now be compiled on FreeBSD.
- (Thanks to Kenji Rikitake.)</p>
+ Now supports SQL_TYPE_TIMESTAMP on the format {{YY, MM,
+ DD}, {HH, MM, SS}}. Thanks to Juhani R�nkimies.</p>
+ <p>
+ *** POTENTIAL INCOMPATIBILITY ***</p>
<p>
- Own Id: OTP-8444</p>
+ Own Id: OTP-8511</p>
</item>
</list>
</section>
+</section>
+
+ <section><title>ODBC 2.10.7</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ The odbc application can now be compiled on FreeBSD.
+ (Thanks to Kenji Rikitake.)</p>
+ <p>
+ Own Id: OTP-8444</p>
+ </item>
+ </list>
+ </section>
+
+
<section><title>Improvements and New Features</title>
<list>
<item>
diff --git a/lib/odbc/doc/src/odbc.xml b/lib/odbc/doc/src/odbc.xml
index 3efbac8dd4..70d8cfbe22 100644
--- a/lib/odbc/doc/src/odbc.xml
+++ b/lib/odbc/doc/src/odbc.xml
@@ -311,7 +311,7 @@
capital letters, alas it is not currently supported by the
param_query function. Too know which Erlang data type
corresponds to an ODBC data type see the Erlang to ODBC
- data type<seealso marker="databases#type">mapping</seealso> in the User's Guide.</p>
+ data type <seealso marker="databases#type">mapping</seealso> in the User's Guide.</p>
</note>
</desc>
</func>
diff --git a/lib/odbc/src/odbc.erl b/lib/odbc/src/odbc.erl
index f8914639e6..eb27a471ec 100644
--- a/lib/odbc/src/odbc.erl
+++ b/lib/odbc/src/odbc.erl
@@ -931,6 +931,16 @@ fix_params({sql_double, InOut, Values}) ->
{?USER_DOUBLE, fix_inout(InOut), Values};
fix_params({sql_bit, InOut, Values}) ->
{?USER_BOOLEAN, fix_inout(InOut), Values};
+fix_params({'sql_timestamp', InOut, Values}) ->
+ NewValues =
+ case (catch
+ lists:map(fun({{Year,Month,Day},{Hour,Minute,Second}}) ->
+ {Year,Month,Day,Hour,Minute,Second}
+ end, Values)) of
+ Result ->
+ Result
+ end,
+ {?USER_TIMESTAMP, fix_inout(InOut), NewValues};
%% default is IN %%%
fix_params({Type, Values}) ->
fix_params({Type, in, Values}).
diff --git a/lib/odbc/src/odbc_internal.hrl b/lib/odbc/src/odbc_internal.hrl
index 10ed139338..aa60120f9a 100644
--- a/lib/odbc/src/odbc_internal.hrl
+++ b/lib/odbc/src/odbc_internal.hrl
@@ -71,6 +71,7 @@
-define(USER_TINY_INT, 11).
-define(USER_WCHAR, 12).
-define(USER_WVARCHAR, 13).
+-define(USER_TIMESTAMP, 14).
%% INPUT & OUTPUT TYPE
-define(IN, 0).
diff --git a/lib/odbc/vsn.mk b/lib/odbc/vsn.mk
index 7af25db25b..d813466437 100644
--- a/lib/odbc/vsn.mk
+++ b/lib/odbc/vsn.mk
@@ -1,6 +1,6 @@
ODBC_VSN = 2.10.8
-TICKETS = OTP-7452
+TICKETS = OTP-7452 OTP-8511
TICKETS_2.10.6 = \
OTP-8250 \
diff --git a/lib/public_key/vsn.mk b/lib/public_key/vsn.mk
index f4d5281e94..f395b919c6 100644
--- a/lib/public_key/vsn.mk
+++ b/lib/public_key/vsn.mk
@@ -1,6 +1,6 @@
-PUBLIC_KEY_VSN = 0.5
-
-TICKETS = OTP-8372
+PUBLIC_KEY_VSN = 0.6
+TICKETS = OTP-7046
+#TICKETS_o.5 = OTP-8372
#TICKETS_0.4 = OTP-8250
#TICKETS_0.3 = OTP-8100 OTP-8142
#TICKETS_0.2 = OTP-7860
diff --git a/lib/ssl/doc/src/new_ssl.xml b/lib/ssl/doc/src/new_ssl.xml
index b642280096..a83c2d1383 100644
--- a/lib/ssl/doc/src/new_ssl.xml
+++ b/lib/ssl/doc/src/new_ssl.xml
@@ -84,8 +84,6 @@
<item>New API functions are
ssl:shutdown/2, ssl:cipher_suites/[0,1] and
ssl:versions/0</item>
- <item>Diffie-Hellman keyexchange is
- not supported yet.</item>
<item>CRL and policy certificate
extensions are not supported yet. </item>
<item>Supported SSL/TLS-versions are SSL-3.0 and TLS-1.0 </item>
@@ -118,8 +116,8 @@
{fail_if_no_peer_cert, boolean()}
{depth, integer()} |
{certfile, path()} | {keyfile, path()} | {password, string()} |
- {cacertfile, path()} | {ciphers, ciphers()} | {ssl_imp, ssl_imp()}
- | {reuse_sessions, boolean()} | {reuse_session, fun()}
+ {cacertfile, path()} | {dhfile, path()} | {ciphers, ciphers()} |
+ {ssl_imp, ssl_imp()} | {reuse_sessions, boolean()} | {reuse_session, fun()}
</c></p>
<p><c>transportoption() = {CallbackModule, DataTag, ClosedTag}
@@ -262,6 +260,12 @@ end
CA certificates (trusted certificates used for verifying a peer
certificate). May be omitted if you do not want to verify
the peer.</item>
+
+ <tag>{dhfile, path()}</tag>
+ <item>Path to file containing PEM encoded Diffie Hellman parameters,
+ for the server to use if a cipher suite using Diffie Hellman key exchange
+ is negotiated. If not specified hardcode parameters will be used.
+ </item>
<tag>{ciphers, ciphers()}</tag>
<item>The function <c>ciphers_suites/0</c> can
@@ -491,6 +495,16 @@ end
</func>
<func>
+ <name>renegotiate(Socket) -> ok</name>
+ <fsummary> Initiates a new handshake.</fsummary>
+ <type>
+ <v>Socket = sslsocket()</v>
+ </type>
+ <desc><p>Initiates a new handshake.</p>
+ </desc>
+ </func>
+
+ <func>
<name>send(Socket, Data) -> ok | {error, Reason}</name>
<fsummary>Write data to a socket.</fsummary>
<type>
diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl
index 87a0939897..965e40a109 100644
--- a/lib/ssl/src/ssl.erl
+++ b/lib/ssl/src/ssl.erl
@@ -560,10 +560,11 @@ handle_options(Opts0, Role) ->
CbInfo = proplists:get_value(cb_info, Opts, {gen_tcp, tcp, tcp_closed}),
SslOptions = [versions, verify, verify_fun,
+ fail_if_no_peer_cert, verify_client_once,
depth, certfile, keyfile,
key, password, cacertfile, dhfile, ciphers,
debug, reuse_session, reuse_sessions, ssl_imp,
- cd_info, renegotiate_at],
+ cb_info, renegotiate_at],
SockOpts = lists:foldl(fun(Key, PropList) ->
proplists:delete(Key, PropList)
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl
index 4ec90600e9..dcf3331e6b 100644
--- a/lib/ssl/src/ssl_connection.erl
+++ b/lib/ssl/src/ssl_connection.erl
@@ -441,7 +441,8 @@ certify(#certificate{} = Cert,
Opts#ssl_options.verify,
Opts#ssl_options.verify_fun) of
{PeerCert, PublicKeyInfo} ->
- handle_peer_cert(PeerCert, PublicKeyInfo, State);
+ handle_peer_cert(PeerCert, PublicKeyInfo,
+ State#state{client_certificate_requested = false});
#alert{} = Alert ->
handle_own_alert(Alert, Version, certify_certificate, State),
{stop, normal, State}
diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl
index 8dc987e3ff..d1ee2ed77f 100644
--- a/lib/ssl/test/ssl_basic_SUITE.erl
+++ b/lib/ssl/test/ssl_basic_SUITE.erl
@@ -151,7 +151,7 @@ all(doc) ->
all(suite) ->
[app, connection_info, controlling_process, controller_dies,
peercert, connect_dist,
- peername, sockname, socket_options, versions, cipher_suites,
+ peername, sockname, socket_options, valid_ssl_options, versions, cipher_suites,
upgrade, upgrade_with_timeout, tcp_connect,
ipv6, ekeyfile, ecertfile, ecacertfile, eoptions, shutdown,
shutdown_write, shutdown_both, shutdown_error, ciphers,
@@ -159,8 +159,9 @@ all(suite) ->
server_verify_peer_passive,
server_verify_peer_active, server_verify_peer_active_once,
server_verify_none_passive, server_verify_none_active,
- server_verify_none_active_once,
- server_verify_no_cacerts, client_verify_none_passive,
+ server_verify_none_active_once, server_verify_no_cacerts,
+ server_require_peer_cert_ok, server_require_peer_cert_fail,
+ client_verify_none_passive,
client_verify_none_active, client_verify_none_active_once
%%, session_cache_process_list, session_cache_process_mnesia
,reuse_session, reuse_session_expired, server_does_not_want_to_reuse_session,
@@ -605,6 +606,59 @@ socket_options_result(Socket, Options, DefaultValues, NewOptions, NewValues) ->
ok.
%%--------------------------------------------------------------------
+valid_ssl_options(doc) ->
+ ["Test what happens when we give valid options"];
+
+valid_ssl_options(suite) ->
+ [];
+
+valid_ssl_options(Config) when is_list(Config) ->
+ ClientOpts = [{reuseaddr, true} | ?config(client_opts, Config)],
+ ServerOpts = [{reuseaddr, true} | ?config(server_opts, Config)],
+ {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
+ Port = ssl_test_lib:inet_port(ServerNode),
+
+ StartOk =
+ fun(Peer, Pid, TestOpt) ->
+ receive
+ {Pid, ok} when Peer =:= server ->
+ ok;
+ {Pid, {ok, _}} when Peer =:= client ->
+ ok;
+ {Pid, Error} ->
+ test_server:fail({Peer,
+ {option_being_tested, TestOpt},
+ {got, Error}})
+ end
+ end,
+
+ %% The following contains both documented and undocumented options as
+ %% listed in ssl:handle_options/2. It excludes file options which are
+ %% tested elsewhere (cacertfile, certfile, keyfile).
+ TestOpts = [{versions, []}, {verify, verify_none}, {verify_fun, fun(_) -> false end},
+ {fail_if_no_peer_cert, false}, {verify_client_once, false},
+ {depth, 1}, {key, undefined}, {password, "secret"}, {ciphers, []},
+ {reuse_sessions, true}, {reuse_session, fun(_,_,_,_) -> true end},
+ {renegotiate_at, 1000000000}, {debug, []},
+ {cb_info, {gen_tcp, tcp, tcp_closed}}],
+ [begin
+ Server =
+ ssl_test_lib:start_server_error([{node, ServerNode}, {port, Port},
+ {from, self()},
+ {options, [TestOpt | ServerOpts]}]),
+ Client =
+ ssl_test_lib:start_client_error([{node, ClientNode}, {port, Port},
+ {host, Hostname}, {from, self()},
+ {options, [TestOpt | ClientOpts]}]),
+ StartOk(server, Server, TestOpt),
+ StartOk(client, Client, TestOpt),
+ ssl_test_lib:close(Server),
+ ssl_test_lib:close(Client),
+ ok
+ end || TestOpt <- TestOpts],
+ ok.
+
+%%--------------------------------------------------------------------
versions(doc) ->
["Test API function versions/0"];
@@ -806,7 +860,7 @@ tcp_connect(Config) when is_list(Config) ->
Server = ssl_test_lib:start_upgrade_server([{node, ServerNode}, {port, 0},
{from, self()},
{timeout, 5000},
- {mfa, {?MODULE, should_close, []}},
+ {mfa, {?MODULE, dummy, []}},
{tcp_options, TcpOpts},
{ssl_options, ServerOpts}]),
Port = ssl_test_lib:inet_port(Server),
@@ -815,18 +869,20 @@ tcp_connect(Config) when is_list(Config) ->
test_server:format("Testcase ~p connected to Server ~p ~n", [self(), Server]),
gen_tcp:send(Socket, "<SOME GARBLED NON SSL MESSAGE>"),
- ssl_test_lib:check_result(Server, {error,esslerrssl}, tcp_closed, Socket),
-
+ receive
+ {tcp_closed, Socket} ->
+ receive
+ {Server, {error, Error}} ->
+ test_server:format("Error ~p", [Error])
+ end
+ end,
ssl_test_lib:close(Server).
-should_close(Socket) ->
- receive
- {ssl, Socket, closed} ->
- server_closed;
- Other ->
- exit({?LINE, Other})
- end.
+dummy(Socket) ->
+ %% Should not happen as the ssl connection will not be established
+ %% due to fatal handshake failiure
+ exit(kill).
%%--------------------------------------------------------------------
ipv6(doc) ->
@@ -1779,7 +1835,66 @@ server_verify_no_cacerts(Config) when is_list(Config) ->
| ServerOpts]}]),
ssl_test_lib:check_result(Server, {error, {eoptions, {cacertfile, ""}}}).
+
+%%--------------------------------------------------------------------
+
+server_require_peer_cert_ok(doc) ->
+ ["Test server option fail_if_no_peer_cert when peer sends cert"];
+
+server_require_peer_cert_ok(suite) ->
+ [];
+
+server_require_peer_cert_ok(Config) when is_list(Config) ->
+ ServerOpts = [{verify, verify_peer}, {fail_if_no_peer_cert, true}
+ | ?config(server_verification_opts, Config)],
+ ClientOpts = ?config(client_verification_opts, Config),
+ {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
+
+ Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
+ {from, self()},
+ {mfa, {?MODULE, send_recv_result, []}},
+ {options, [{active, false} | ServerOpts]}]),
+ Port = ssl_test_lib:inet_port(Server),
+ Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
+ {host, Hostname},
+ {from, self()},
+ {mfa, {?MODULE, send_recv_result, []}},
+ {options, [{active, false} | ClientOpts]}]),
+
+ ssl_test_lib:check_result(Server, ok, Client, ok),
+ ssl_test_lib:close(Server),
+ ssl_test_lib:close(Client).
+
+%%--------------------------------------------------------------------
+
+server_require_peer_cert_fail(doc) ->
+ ["Test server option fail_if_no_peer_cert when peer doesn't send cert"];
+
+server_require_peer_cert_fail(suite) ->
+ [];
+
+server_require_peer_cert_fail(Config) when is_list(Config) ->
+ ServerOpts = [{verify, verify_peer}, {fail_if_no_peer_cert, true}
+ | ?config(server_verification_opts, Config)],
+ BadClientOpts = ?config(client_opts, Config),
+ {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
+ Port = ssl_test_lib:inet_port(ServerNode),
+
+ Server = ssl_test_lib:start_server_error([{node, ServerNode}, {port, Port},
+ {from, self()},
+ {mfa, {?MODULE, send_recv_result, []}},
+ {options, [{active, false} | ServerOpts]}]),
+ Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
+ {host, Hostname},
+ {from, self()},
+ {mfa, {?MODULE, send_recv_result, []}},
+ {options, [{active, false} | BadClientOpts]}]),
+ ssl_test_lib:check_result(Server, {error, esslaccept},
+ Client, {error, esslconnect}),
+ ssl_test_lib:close(Server),
+ ssl_test_lib:close(Client).
+
%%--------------------------------------------------------------------
client_verify_none_passive(doc) ->
diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl
index f985058cd7..ee799c50c8 100644
--- a/lib/ssl/test/ssl_test_lib.erl
+++ b/lib/ssl/test/ssl_test_lib.erl
@@ -448,9 +448,19 @@ trigger_renegotiate(Socket, _, 0, Id) ->
test_server:sleep(1000),
case ssl:session_info(Socket) of
[{session_id, Id} | _ ] ->
+ %% If a warning alert is received
+ %% from openssl this may not be
+ %% an error!
fail_session_not_renegotiated;
- _ ->
- ok
+ %% Tests that uses this function will no reuse
+ %% sessions so if we get a new session id the
+ %% renegotiation has seceded.
+ [{session_id, _} | _ ] ->
+ ok;
+ {error, closed} ->
+ fail_session_fatal_alert_during_renegotiation;
+ {error, timeout} ->
+ fail_timeout
end;
trigger_renegotiate(Socket, ErlData, N, Id) ->
diff --git a/lib/ssl/test/ssl_to_openssl_SUITE.erl b/lib/ssl/test/ssl_to_openssl_SUITE.erl
index adb5b9cd13..624404b556 100644
--- a/lib/ssl/test/ssl_to_openssl_SUITE.erl
+++ b/lib/ssl/test/ssl_to_openssl_SUITE.erl
@@ -327,7 +327,7 @@ erlang_client_openssl_server_no_wrap_sequence_number(Config) when is_list(Config
{ClientNode, _, Hostname} = ssl_test_lib:run_where(Config),
- ErlData = "From erlang to openssl",
+ ErlData = "From erlang to openssl\n",
N = 10,
Port = ssl_test_lib:inet_port(node()),
diff --git a/lib/ssl/vsn.mk b/lib/ssl/vsn.mk
index bf67fcd257..0f3f8e95ec 100644
--- a/lib/ssl/vsn.mk
+++ b/lib/ssl/vsn.mk
@@ -17,8 +17,11 @@
# %CopyrightEnd%
#
-SSL_VSN = 3.10.9
-TICKETS = OTP-8510
+SSL_VSN = 3.11
+
+TICKETS = OTP-8517 OTP-7046 OTP-8557
+
+#TICKETS_3.10.9 = OTP-8510
#TICKETS_3.10.8 = OTP-8372 OTP-8441 OTP-8459
#TICKETS_3.10.7 = OTP-8260 OTP-8218 OTP-8250
diff --git a/lib/test_server/src/ts_run.erl b/lib/test_server/src/ts_run.erl
index 3461e1383c..1d611f501c 100644
--- a/lib/test_server/src/ts_run.erl
+++ b/lib/test_server/src/ts_run.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
@@ -392,7 +392,7 @@ make_test_suite(Vars, _Spec, State) ->
{ok, Cwd} = file:get_cwd(),
ok = file:set_cwd(TestDir),
- Result = (catch make:all(Erl_flags)),
+ Result = (catch make_all(Erl_flags)),
ok = file:set_cwd(Cwd),
case Result of
up_to_date ->
@@ -743,4 +743,52 @@ split_one(Path) ->
split_path(Path) ->
string:tokens(Path,";").
+%%
+%% Run make:all/1 if the test suite seems to be designed
+%% to be built/re-built by ts.
+%%
+make_all(Flags) ->
+ case filelib:is_regular("Emakefile") of
+ false ->
+ make_all_no_emakefile(Flags);
+ true ->
+ make:all(Flags)
+ end.
+
+make_all_no_emakefile(Flags) ->
+ case filelib:wildcard("*.beam") of
+ [] ->
+ %% Since there are no *.beam files, we will assume
+ %% that this test suite was designed to be built and
+ %% re-built by ts. Create an Emakefile so that
+ %% make:all/1 will be run the next time too
+ %% (in case a test suite is being interactively
+ %% developed).
+ create_emakefile(Flags, "*.erl");
+ [_|_] ->
+ %% There is no Emakefile and there already are
+ %% some *.beam files here. Assume that this test
+ %% suite was not designed to be re-built by ts.
+ %% Only create a Emakefile that will compile
+ %% generated *_SUITE_make files (if any).
+ create_emakefile(Flags, "*_SUITE_make.erl")
+ end.
+create_emakefile(Flags, Wc) ->
+ case filelib:wildcard(Wc) of
+ [] ->
+ %% There are no files to be built (i.e. not even any
+ %% generated *_SUITE_make.erl files). We must handle
+ %% this case specially, because make:all/1 will crash
+ %% on Emakefile with an empty list of modules.
+ io:put_chars("No Emakefile found - not running make:all/1\n"),
+ up_to_date;
+ [_|_]=Ms0 ->
+ io:format("Creating an Emakefile for compiling files matching ~s\n",
+ [Wc]),
+ Ms = [list_to_atom(filename:rootname(M, ".erl")) || M <- Ms0],
+ Make0 = {Ms,Flags},
+ Make = io_lib:format("~p. \n", [Make0]),
+ ok = file:write_file("Emakefile", Make),
+ make:all(Flags)
+ end.
diff --git a/lib/xmerl/doc/src/notes.xml b/lib/xmerl/doc/src/notes.xml
index 3106c72bd8..207f6fdf16 100644
--- a/lib/xmerl/doc/src/notes.xml
+++ b/lib/xmerl/doc/src/notes.xml
@@ -31,6 +31,30 @@
<p>This document describes the changes made to the Xmerl application.</p>
+<section><title>Xmerl 1.2.5</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ All Erlang files are now built by the test server instead of the test directory Makefile.
+ </p>
+ <p>
+ Erlang files in data directories are now built by the test suites instead of using
+ prebuilt versions under version control.
+ </p>
+ <p>
+ Removed a number of obsolete guards.
+ </p>
+ <p>
+ Own Id: OTP-8537
+ </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Xmerl 1.2.4</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/xmerl/vsn.mk b/lib/xmerl/vsn.mk
index 4162b52a80..83b9d4826f 100644
--- a/lib/xmerl/vsn.mk
+++ b/lib/xmerl/vsn.mk
@@ -17,14 +17,17 @@
# %CopyrightEnd%
#
-XMERL_VSN = 1.2.4
+XMERL_VSN = 1.2.5
TICKETS = \
- OTP-8343
+ OTP-8537
+
+TICKETS_1.2.5 = \
+ OTP-8537
TICKETS_1.2.4 = \
- OTP-8343
+ OTP-8343
TICKETS_1.2.3 = \
OTP-8251 \
diff --git a/make/fakefop b/make/fakefop
index ddda7a3762..bbe81ef3b1 100755
--- a/make/fakefop
+++ b/make/fakefop
@@ -3,6 +3,20 @@
# Copyright Tuncer Ayaz 2010. All Rights Reserved.
#
# %CopyrightBegin%
+#
+# Copyright Ericsson AB 2010. All Rights Reserved.
+#
+# The contents of this file are subject to the Erlang Public License,
+# Version 1.1, (the "License"); you may not use this file except in
+# compliance with the License. You should have received a copy of the
+# Erlang Public License along with this software. If not, it can be
+# retrieved online at http://www.erlang.org/.
+#
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+# the License for the specific language governing rights and limitations
+# under the License.
+#
# %CopyrightEnd%
#
# Author: Tuncer Ayaz