Commit Graph

193 Commits

Author SHA1 Message Date
Hans Leidekker 6f2c4bac58 rpcrt4: Don't remove the authorization header if the scheme is Basic. 2013-09-11 16:10:01 +02:00
Hans Leidekker 9ea95f4105 rpcrt4: Add support for NTLM and Negotiate. 2013-09-05 13:26:15 +02:00
Marcus Meissner d138a1e43d rpcrt4: Free url in error paths (Coverity). 2013-09-02 18:03:49 +02:00
Hans Leidekker 0b900f2fd4 rpcrt4: Only accept status code HTTP_STATUS_OK. 2013-08-28 16:14:36 +02:00
Hans Leidekker 35468903cd rpcrt4: Don't follow HTTP redirects. 2013-08-28 16:14:36 +02:00
Hans Leidekker 9d213312f1 rpcrt4: Remove an unneeded parameter from RPCRT4_BuildHttpConnectHeader. 2013-08-28 16:14:36 +02:00
Hans Leidekker a2f6e92acd rpcrt4: Add support for session cookies. 2013-08-28 16:14:36 +02:00
Hans Leidekker d5b2c8e943 rpcrt4: Try to authorize with the first HTTP request instead of waiting for a challenge. 2013-08-20 13:01:28 +02:00
Hans Leidekker 30c00ea16d rpcrt4: Specify INTERNET_FLAG_NO_CACHE_WRITE for the HTTP transport pipes. 2013-05-31 16:39:31 +02:00
Hans Leidekker 9967aed09d rpcrt4: Use the right port for https connections. 2013-03-25 16:27:17 +01:00
Andrew Talbot 49992c3a5e rpcrt4: Avoid signed-unsigned integer comparisons. 2013-02-26 11:26:58 +01:00
Hans Leidekker 164ddbca8c rpcrt4: Accept HTTP idle packets while waiting for the second prepare header. 2013-02-21 18:02:40 +01:00
Alexandre Julliard af734f9623 rpcrt4: Fix wrap-around bug in tick count comparison. 2013-01-24 15:15:16 +01:00
Frédéric Delanoy 9c63a30c25 rpcrt4: Fix resources leaks. 2012-10-31 16:12:27 +01:00
Jacek Caban ee40973b2b rpcrt4: Moved sending echo request to separated function. 2012-08-15 12:18:31 +02:00
Jacek Caban 07cb28c641 rpcrt4: Fixed memory leak. 2012-08-15 12:18:24 +02:00
Jacek Caban cbdb58476a rpcrt4: Added cancelling support for all HTTP requests. 2012-08-15 12:18:20 +02:00
Jacek Caban 1de4129b0a rpcrt4: Properly handle async HTTP failures. 2012-08-14 17:42:07 +02:00
Jacek Caban 9eeedc2723 rpcrt4: Optimize buffer allocation in rpcrt4_ncacn_http_read. 2012-08-14 17:42:07 +02:00
Jacek Caban 5e6aca7955 rpcrt4: Use helper for handling async call wait. 2012-08-14 17:42:06 +02:00
Jacek Caban cba1cfc645 rpcrt4: Added prepare_async_request helper. 2012-08-14 17:42:06 +02:00
Alexandre Julliard d2ca9f4b02 rpcrt4: Add ref counting to RPC connections, and grab a reference while processing an RPC packet. 2012-02-14 17:59:27 +01:00
Francois Gouget 86d8217aea rpcrt4: Give a name to the critical sections. 2011-11-14 20:15:26 +01:00
Bernhard Loos c2feafb96c rpcrt4: Switch to non-overlapped named pipe operations and use a thread for the async listen operation. 2011-09-19 17:59:35 +02:00
Bernhard Loos a57312d873 rpcrt4: The named pipe can be used for multiple operations at the same time, so use overlapped operations for ReadFile and WriteFile. 2011-09-14 17:28:38 +02:00
Bernhard Loos d599813b74 rpcrt4: Create pipes with FLAG_OVERLAPPED. 2011-07-15 16:25:18 +02:00
Damjan Jovanovic ec2f513690 rpcrt4: Implement RpcNetworkInqProtseqs. 2011-06-28 16:45:56 -05:00
Damjan Jovanovic acc112bad7 rpcrt4: Implement RpcProtseqVectorFree. 2011-06-20 19:32:02 +02:00
Rob Shearman f823f2181e rpcrt4: Override inquire_auth_client for ncalrpc transport to always indicate that the connection is authenticated. 2009-12-14 12:19:37 +01:00
Rob Shearman 3dbf356f8f rpcrt4: Allow the authentication details of the client to be transport-specific. 2009-12-14 12:19:33 +01:00
Rob Shearman d918587f1d rpcrt4: Implement client impersonation. 2009-12-14 12:19:27 +01:00
Rob Shearman 95026f9d6b rpcrt4: Override authentication functions for ncalrpc protocol to do nothing.
The protocol is local only and therefore encryption/decryption isn't
necessary to keep the data private, and methods are built into the
protocol for impersonating the user of the calling thread.
2009-12-14 12:19:21 +01:00
Rob Shearman deae193ac8 rpcrt4: Allow the connection to override the authentication mechanism for a connection type. 2009-12-14 12:19:16 +01:00
Rob Shearman ceb7fda374 rpcrt4: Fix rpcrt4_conn_tcp_read and rpcrt4_conn_tcp_write for reading/writing zero-sized data. 2009-12-14 12:18:47 +01:00
Hans Leidekker 4b33527f51 rpcrt4: Correct spelling of RPC_C_QOS_IDENTITY_STATIC and RPC_C_QOS_IDENTITY_DYNAMIC. 2009-11-04 13:07:56 +01:00
Alexandre Julliard e01420d72a rpcrt4: Assign a unique id to the connection instead of changing it for each message. 2009-08-18 20:15:01 +02:00
Alexandre Julliard aded9e4091 rpcrt4: Fix compiler warnings on 64-bit. 2009-05-28 11:56:30 +02:00
Francois Gouget 082147d906 rpcrt4: Remove WINAPI on static functions where not needed. 2009-05-06 12:20:10 +02:00
Rob Shearman 324b4d0243 rpcrt4: Add a Win32 implementation of ncacn_ip_tcp transport. 2009-04-08 16:01:42 +02:00
Rob Shearman 06c2982a39 rpcrt4: Factor out non-Win32 compatible parts of the ncacn_ip_tcp client code to allow it to be compiled in. 2009-04-08 16:01:34 +02:00
Rob Shearman ce747f3fac rpcrt4: Compile in RPC over HTTP support even if HAVE_SOCKETPAIR is not defined. 2009-04-07 14:53:34 +02:00
Rob Shearman 317edfd7da rpcrt4: Free the memory allocated for the protseq and endpoint strings allocated in RpcServerUseProtseq* functions.
Make a copy of the protseq string in alloc_serverprotoseq to simplify
memory management in higher-level functions.
2009-03-30 13:58:01 +02:00
Rob Shearman 524a99a2da rpcrt4: Ensure that only the IP/IPv6 address families are considered in rpcrt4_protseq_ncacn_ip_tcp_open_endpoint/rpcrt4_ncacn_ip_tcp_open. 2009-03-26 16:11:07 +01:00
Rob Shearman a42d4dbfb6 rpcrt4: Allow listening on dynamically generated ncacn_ip_tcp endpoints. 2009-03-26 16:10:59 +01:00
Alexandre Julliard ce3ce9be8f rpcrt4: Disable HTTP support if we don't have socketpair and related networking functions. 2009-03-26 14:02:01 +01:00
Huw Davies eaf4492c70 rpcrt4: Dynamically allocate the buffer if the fixed size one isn't large enough. Don't return an inappropriate error if we fail to get the status text, it's only used for diagnostics. 2009-03-26 11:50:50 +01:00
Rob Shearman 5f6ae94ad0 rpcrt4: Implement RPC over HTTP support.
CodeWeavers did this work for supporting the optional HTTP connection
method of Outlook 2003/2007 (must be running with Windows versions set
to XP or higher to see this option).

This was written before Microsoft publicly released a specification
for the RPC over HTTP protocol and so was developed by examining
traffic flowing between a Windows client and an IIS server.
2009-03-25 15:20:52 +01:00
Rob Shearman cdf509d71f rpcrt4: Fix crash when calling RpcServerUseProtseq for ncacn_np and ncalrpc.
Add tests for these protocol sequences and for ncacn_ip_tcp.
2009-03-24 13:12:11 +01:00
Juan Lang 76f4b9b053 rpcrt4: Don't abort reading from a pipe if a single read is short. 2009-02-09 12:09:01 +01:00
Andrew Talbot 273b40656b rpcrt4: Declare some functions static. 2009-01-19 13:36:26 +01:00
Alexandre Julliard 8e1b59cb9a rpcrt4: Disable TCP/IP connection support if we don't have socketpair. 2008-12-22 19:55:05 +01:00
Ricardo Filipe 16920c1da7 rpcrt4: Fixed dead increments (llvm/clang). 2008-11-19 12:15:37 +01:00
Andrew Talbot 99ae980c0d rpcrt4: Sign-compare warnings fix. 2008-11-07 10:56:48 +01:00
Alexandre Julliard 83b6c8a5fa rpcrt4: Convert source files to utf-8. 2008-10-18 19:20:44 +02:00
Rob Shearman 0a5e5a6e5b rpcrt4: Print a warning if connecting to a named pipe failed in rpcrt4_conn_open_pipe in the !wait case. 2008-08-18 14:36:33 +02:00
Rob Shearman ce085ed8ec rpcrt4: Check that strings in SMB, NB and pipe floors are nul-terminated before copying the data. 2008-08-18 14:35:43 +02:00
Rob Shearman 1e46fc672a rpcrt4: Fix the protid used in ncalrpc tower functions.
The epm tower for the ncalrpc protseq should have a floor with a
protid of EPM_PROTOCOL_PIPE instead of EPM_PROTOCOL_SMB.
2008-08-18 14:35:26 +02:00
Rob Shearman 498216fc11 rpcrt4: Fix crash in rpcrt4_ncalrpc_parse_top_of_tower due to unconditionally dereferencing networkaddr and endpoint variables.
These can be NULL when parts of the tower are not required.
2008-08-18 14:35:21 +02:00
Rob Shearman 54e904e780 rpcrt4: Fix crash calculation of tower size in rpcrt4_ncalrpc_get_top_of_tower.
The size depends on the length of the endpoint string, not the network
address string.
2008-08-18 14:35:15 +02:00
Alexandre Julliard 853db9a79d rpcrt4: Properly handle the case of a client having disconnected in rpcrt4_conn_listen_pipe. 2008-06-09 12:56:42 +02:00
Rob Shearman 8aeb2858e4 rpcrt4: Add a reference to the binding object in I_RpcNegotiateTransferSyntax and release the reference in I_RpcFreeBuffer.
This is needed because a context binding handle could be released on 
unmarshall, but it still needs to stay valid until the binding handle is 
no longer being used.

Re-use the previously unused RPCRT4_ExportBinding function as 
RPCRT4_AddRefBinding and rename RPCRT4_DestroyBinding to 
RPCRT4_ReleaseBinding to show that it's purpose is to release a 
reference count and destroy if necessary, not always destroy.
2008-04-01 19:11:00 +02:00
Dan Hipschman 764cf334d6 rpcrt4: Use correct count in rpcrt4_conn_np_write.
count is the total count passed into rpcrt4_conn_np_write.  If WriteFile
does a partial write it would end up writing too much subsequent times
through the loop.  All tests pass as before.
2008-03-20 14:27:34 +01:00
Rob Shearman a1e4bcda1a rpcrt4: Use closesocket to close sockets and define it to close on Unix platforms to make the code more portable. 2008-03-06 17:39:31 +01:00
Rob Shearman 0287289475 rpcrt4: Include ws2tcpip.h instead of Unix headers when targeting a build for Windows. 2008-02-25 13:27:54 +01:00
Rob Shearman 5f077bab07 rpcrt4: Implement asynchronous RPC support. 2008-01-21 12:41:51 +01:00
Rob Shearman 1a3d7c77a5 rpcrt4: Allow NULL networkaddr and endpoint in rpcrt4_np_get_top_of_tower.
Add tests for this.
2008-01-15 14:35:35 +01:00
Rob Shearman c370980dfa rpcrt4: Use send on a socket instead of write as it's more portable. 2008-01-09 12:25:46 +01:00
Rob Shearman 737510eeb6 rpcrt4: Move association code into a separate file. 2007-12-17 11:59:18 +01:00
Rob Shearman 22f530c835 rpcrt4: Make a server association when a bind packet is received in the server.
Support handing out association group IDs.
2007-12-17 11:59:13 +01:00
Rob Shearman 2bda19c6b0 rpcrt4: Return an error from rpcrt4_conn_tcp_read if recv returns 0. 2007-12-17 11:58:57 +01:00
Rob Shearman ba280fb1b0 rpcrt4: Fix a typo in rpcrt4_conn_tcp_read. 2007-12-14 12:27:09 +01:00
Rob Shearman 7092590c90 rpcrt4: Use an alertable wait in rpcrt4_protseq_np_wait_for_new_connection to fix a small memory leak flagged by Valgrind.
This is called only by the RPCRT4_server_thread so we don't have to 
worry about application user APCs being run at improper times.
2007-12-07 17:06:33 +01:00
Rob Shearman 867cc3c05f rpcrt4: Fix a memory leak when freeing an association by deleting the critical section. 2007-12-06 12:08:05 +01:00
Rob Shearman 5fb5fccac0 rpcrt4: Fix a memory leak in RpcAssoc_BindConnection. 2007-12-06 12:08:00 +01:00
Michael Stefaniuc 61ed0c99e6 rpcrt4: socket() returns -1 on error so check the return value against that. 2007-11-27 12:29:45 +01:00
Rob Shearman a51486c657 rpcrt4: Implement RpcCancelThread for the ncacn_ip_tcp protocol sequence. 2007-11-13 13:34:50 +01:00
Andrew Talbot 04e0986d60 rpcrt4: Constify some variables. 2007-08-22 11:58:13 +02:00
Rob Shearman 8a87d916b4 rpcrt4: Convert bind ack and nack reject reasons into RPC status codes when binding. 2007-07-23 11:48:13 +02:00
Rob Shearman c6dc14d81b rpcrt4: Make binding to an interface a function of RpcAssoc instead of
binding handles, since binding requires information from the
association and not from the binding handle.
2007-07-13 12:27:17 +02:00
Rob Shearman 680e35643d rpcrt4: Remove the unused AuthInfo field from the RpcAssoc structure and Used from RpcConnection. 2007-06-27 12:32:42 +02:00
Rob Shearman cbafe663b0 rpcrt4: Try a lot harder to resuse existing connections by comparing inside the RpcQualityOfService and RpcAuthInfo objects.
Store a copy of the SEC_WINNT_AUTH_IDENTITY structure passed in to
RpcBindingSetAuthInfo(Ex) to enable us to do this for RpcAuthInfo objects.
2007-06-25 23:21:54 +02:00
Rob Shearman 0ebcacca39 rpcrt4: Store the assoc_group_id field returned from the bind_ack packet and use it when creating further connections in the association group. 2007-06-25 23:21:53 +02:00
Andrew Talbot d5d056ef75 rpcrt4: Exclude unused headers. 2007-05-18 14:11:22 +02:00
Rob Shearman 763fe63213 rpcrt4: Use the correct authorization trailer length using information from the security provider.
Previously it was hardcoded to 16, so only the NTLM provider would work correctly.
2007-03-27 13:00:00 +02:00
Rob Shearman 88e9b3fad8 rpcrt4: Call InitializeSecurityContext from only one function.
This reduces the amount of code and ensures that the parameters passed 
to it stay the same, apart from the previous context and the output 
buffer description.
2007-03-27 12:42:05 +02:00
Rob Shearman adb7cca85c rpcrt4: Implement associations which are intermediary objects that track the relationship between the client and a given endpoint on the server.
Use these to encapsulate the connection pool so that the lifetimes of 
connections are properly handled again.
2007-03-27 12:39:05 +02:00
Rob Shearman 55a103ca5c rpcrt4: Use IPPROTO_TCP for SOL_TCP if SOL_TCP isn't defined.
Fixes compilation on *BSD systems.
2007-03-01 20:42:50 +01:00
Rob Shearman 829dfa8052 rpcrt4: Set TCP_NODELAY on the socket for the ncacn_ip_tcp transport to reduce latency. 2007-02-28 13:28:40 +01:00
Alexandre Julliard 639ffbfde7 rpcrt4: Enter new named pipe connections into the protocol connection list. 2007-02-12 14:13:22 +01:00
Rob Shearman 961455c7f0 rpcrt4: Stash away NetworkOptions passed in from the binding string so that transports can look at the string if needed. 2007-01-25 12:00:10 +01:00
Rob Shearman 2103bca4db rpcrt4: Fix a typo in rpcrt4_conn_open_pipe.
Fix a typo in rpcrt4_conn_open_pipe where the initial setting of dwFlags 
was done inside the switch statement instead of at the indented place of 
at the start of the block (thanks to Jan Zerebecki for noticing this bug).
2007-01-24 12:07:14 +01:00
Rob Shearman e6f4514512 rpcrt4: Try to avoid partial named pipe read/writes by looping. 2007-01-23 11:38:23 +01:00
Rob Shearman 0debcf5b1e rpcrt4: Handle security quality of service flags relevant to the ncacn_np protocol. 2007-01-22 12:01:57 +01:00
Rob Shearman 4b79a0252a rpcrt4: Track the security quality of service settings for bindings and connections. 2007-01-22 12:01:54 +01:00
Rob Shearman 48344f505b rpcrt4: Free the resource allocated by InitializeSecurityContext when the connection is closed. 2006-12-18 11:45:51 +01:00
Dmitry Timoshkov 8c3fdfea42 rpcrt4: Make some data const. 2006-12-14 20:11:34 +01:00
Rob Shearman 8bb10f1082 rpcrt4: Use SecInvalidateHandle and SecIsValidHandle for handling RpcConnection::ctx instead of setting/comparing the field to 0. 2006-11-15 11:25:57 +01:00
Rob Shearman 079b6b074c rpcrt4: Add a FIXME for unsupported client protocol sequences. 2006-11-15 11:25:35 +01:00
Rob Shearman 59a90143bf rpcrt4: Fix a comment and move a WARN to where it really indicates a problem, rather than falsely triggering on normal conditions. 2006-11-13 14:32:21 +01:00
Michael Stefaniuc de21efbadd rpcrt4: Win64 printf format warning fixes. 2006-11-10 11:31:59 +01:00