1 --- misc/neon-0.28.2/src/config.h 2009-06-24 12:49:38.000000000 +0200
2 +++ misc/build/neon-0.28.2/src/config.h 2009-06-24 12:46:45.000000000 +0200
6 +/* Define to specific EGD socket path */
9 +/* Define if EGD should be supported */
10 +/* #undef ENABLE_EGD */
12 +/* Define if GSS_C_NT_HOSTBASED_SERVICE is not defined otherwise */
13 +/* #undef GSS_C_NT_HOSTBASED_SERVICE */
15 +/* Define to 1 if you have the <arpa/inet.h> header file. */
17 +#define HAVE_ARPA_INET_H 1
20 +/* Define to 1 if you have the `bind_textdomain_codeset' function. */
21 +/* #undef HAVE_BIND_TEXTDOMAIN_CODESET 1 */
23 +/* Define to 1 if you have the declaration of `h_errno', and to 0 if you
26 +#define HAVE_DECL_H_ERRNO 1
29 +/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't.
32 +#define HAVE_DECL_STPCPY 1
35 +/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
38 +#define HAVE_DECL_STRERROR_R 1
41 +/* Define to 1 if you have the <dlfcn.h> header file. */
43 +#define HAVE_DLFCN_H 1
46 +/* Define to 1 if you have the <errno.h> header file. */
47 +#define HAVE_ERRNO_H 1
49 +/* Define if you have expat */
50 +/* #undef HAVE_EXPAT */
52 +/* Define to 1 if you have the `fstat64' function. */
55 +/* Define to 1 if you have the `gai_strerror' function. */
56 +#define HAVE_GAI_STRERROR 1
58 +/* Define if GnuTLS support is enabled */
59 +/* #undef HAVE_GNUTLS */
61 +/* Define to 1 if you have the `gnutls_session_get_data2' function. */
62 +/* #undef HAVE_GNUTLS_SESSION_GET_DATA2 */
64 +/* Define if GSSAPI support is enabled */
65 +/* #undef HAVE_GSSAPI */
67 +/* Define to 1 if you have the <gssapi/gssapi_generic.h> header file. */
68 +/* #undef HAVE_GSSAPI_GSSAPI_GENERIC_H */
70 +/* Define to 1 if you have the <gssapi/gssapi.h> header file. */
71 +/* #undef HAVE_GSSAPI_GSSAPI_H */
73 +/* Define to 1 if you have the <gssapi.h> header file. */
74 +/* #undef HAVE_GSSAPI_H */
76 +/* Define to 1 if you have the `gss_init_sec_context' function. */
77 +/* #undef HAVE_GSS_INIT_SEC_CONTEXT */
79 +/* Define to 1 if you have the `hstrerror' function. */
80 +/* #undef HAVE_HSTRERROR */
82 +/* Define to 1 if you have the `inet_ntop' function. */
84 +#define HAVE_INET_NTOP 1
87 +/* Define to 1 if you have the <inttypes.h> header file. */
89 +#define HAVE_INTTYPES_H 1
92 +/* Define to 1 if you have the `isatty' function. */
93 +#define HAVE_ISATTY 1
95 +/* Define to 1 if you have the <libintl.h> header file. */
96 +/* #undef HAVE_LIBINTL_H */
98 +/* Define if you have libxml */
99 +#define HAVE_LIBXML 1
101 +/* Define to 1 if you have the <libxml/parser.h> header file. */
102 +#define HAVE_LIBXML_PARSER_H 1
104 +/* Define to 1 if you have the <libxml/xmlversion.h> header file. */
105 +#define HAVE_LIBXML_XMLVERSION_H 1
107 +/* Define to 1 if you have the <limits.h> header file. */
108 +#define HAVE_LIMITS_H 1
110 +/* Define to 1 if you have the <locale.h> header file. */
111 +#define HAVE_LOCALE_H 1
113 +/* Define to 1 if you have the `lseek64' function. */
114 +#define HAVE_LSEEK64 1
116 +/* Define to 1 if you have the <memory.h> header file. */
117 +#define HAVE_MEMORY_H 1
119 +/* Define to 1 if you have the <netdb.h> header file. */
121 +#define HAVE_NETDB_H 1
124 +/* Define to 1 if you have the <netinet/in.h> header file. */
126 +#define HAVE_NETINET_IN_H 1
129 +/* Define to 1 if you have the <netinet/tcp.h> header file. */
131 +#define HAVE_NETINET_TCP_H 1
134 +/* Define if OpenSSL support is enabled */
135 +/* #undef HAVE_OPENSSL */
136 +#define HAVE_OPENSSL
137 +/* Define to 1 if you have the <openssl/opensslv.h> header file. */
138 +/* #undef HAVE_OPENSSL_OPENSSLV_H */
139 +#define HAVE_OPENSSL_OPENSSLV_H 1
140 +/* Define to 1 if you have the <openssl/ssl.h> header file. */
141 +/* #undef HAVE_OPENSSL_SSL_H */
142 +#define HAVE_OPENSSL_SSL_H 1
143 +/* Define to 1 if you have the `pipe' function. */
146 +/* Define to 1 if you have the `poll' function. */
149 +/* Define to 1 if you have the `pthread_mutex_init' function. */
150 +/* #undef HAVE_PTHREAD_MUTEX_INIT */
152 +/* Define to 1 if you have the `pthread_mutex_lock' function. */
153 +/* #undef HAVE_PTHREAD_MUTEX_LOCK */
155 +/* Define to 1 if you have the `setlocale' function. */
156 +#define HAVE_SETLOCALE 1
158 +/* Define to 1 if you have the `setsockopt' function. */
159 +#if defined (LINUX) || defined (WIN32)
160 +#define HAVE_SETSOCKOPT 1
163 +/* Define to 1 if you have the `setvbuf' function. */
164 +#define HAVE_SETVBUF 1
166 +/* Define to 1 if you have the `shutdown' function. */
168 +#define HAVE_SHUTDOWN 1
171 +/* Define to 1 if you have the `signal' function. */
172 +#define HAVE_SIGNAL 1
174 +/* Define to 1 if you have the <signal.h> header file. */
175 +#define HAVE_SIGNAL_H 1
177 +/* Define to 1 if you have the `snprintf' function. */
179 +#define HAVE_SNPRINTF 1
183 +#define snprintf _snprintf
186 +/* Define to 1 if you have the <socks.h> header file. */
187 +/* #undef HAVE_SOCKS_H */
189 +/* Define to 1 if you have the <stdarg.h> header file. */
190 +#define HAVE_STDARG_H 1
192 +/* Define to 1 if you have the <stdint.h> header file. */
193 +#define HAVE_STDINT_H 1
195 +/* Define to 1 if you have the <stdlib.h> header file. */
196 +#define HAVE_STDLIB_H 1
198 +/* Define to 1 if you have the `stpcpy' function. */
200 +#define HAVE_STPCPY 1
203 +/* Define to 1 if you have the `strcasecmp' function. */
205 +#define HAVE_STRCASECMP 1
209 +#define strcasecmp strcmpi
212 +/* Define to 1 if you have the `strerror_r' function. */
214 +#define HAVE_STRERROR_R 1
217 +/* Define to 1 if you have the <strings.h> header file. */
219 +#define HAVE_STRINGS_H 1
222 +/* Define to 1 if you have the <string.h> header file. */
223 +#define HAVE_STRING_H 1
225 +/* Define to 1 if you have the `strtoll' function. */
226 +#define HAVE_STRTOLL 1
228 +/* Define to 1 if you have the `strtoq' function. */
229 +/* #undef HAVE_STRTOQ */
231 +/* Define to 1 if `tm_gmtoff' is member of `struct tm'. */
233 +#define HAVE_STRUCT_TM_TM_GMTOFF 1
236 +/* Define to 1 if `__tm_gmtoff' is member of `struct tm'. */
237 +/* #undef HAVE_STRUCT_TM___TM_GMTOFF */
239 +/* Define to 1 if you have the <sys/limits.h> header file. */
240 +/* #undef HAVE_SYS_LIMITS_H */
242 +/* Define to 1 if you have the <sys/poll.h> header file. */
244 +#define HAVE_SYS_POLL_H 1
247 +/* Define to 1 if you have the <sys/select.h> header file. */
249 +#define HAVE_SYS_SELECT_H 1
252 +/* Define to 1 if you have the <sys/socket.h> header file. */
254 +#define HAVE_SYS_SOCKET_H 1
257 +/* Define to 1 if you have the <sys/stat.h> header file. */
258 +#define HAVE_SYS_STAT_H 1
260 +/* Define to 1 if you have the <sys/time.h> header file. */
262 +#define HAVE_SYS_TIME_H 1
265 +/* Define to 1 if you have the <sys/types.h> header file. */
266 +#define HAVE_SYS_TYPES_H 1
268 +/* Define if the timezone global is available */
270 +#define HAVE_TIMEZONE 1
273 +/* Use trio printf replacement library */
274 +/* #undef HAVE_TRIO */
276 +/* Define to 1 if you have the <trio.h> header file. */
277 +/* #undef HAVE_TRIO_H */
279 +/* Define to 1 if you have the <unistd.h> header file. */
281 +#define HAVE_UNISTD_H 1
284 +/* Define to 1 if you have the `usleep' function. */
286 +#define HAVE_USLEEP 1
289 +/* Define to 1 if you have the `vsnprintf' function. */
290 +#if defined( UNX ) || (defined(_MSC_VER) && (_MSC_VER > 1400))
291 +#define HAVE_VSNPRINTF 1
295 +#if (defined(_MSC_VER) && (_MSC_VER < 1500)) || defined(__MINGW32__)
296 +#define vsnprintf _vsnprintf
300 +/* Define to be location of localedir */
301 +/* #undef LOCALEDIR */
303 +/* Defined when neon is built as a library */
304 +#define NEON_IS_LIBRARY 1
306 +/* Define to be the neon version string */
307 +#define NEON_VERSION "0.28.2"
309 +/* Define to enable debugging */
310 +/* #undef NE_DEBUGGING */
312 +/* Define to be printf format string for off64_t */
313 +#define NE_FMT_OFF64_T "lld"
315 +/* Define to be printf format string for off_t */
316 +#define NE_FMT_OFF_T "ld"
318 +/* Define to be printf format string for size_t */
319 +#define NE_FMT_SIZE_T "u"
321 +/* Define to be printf format string for ssize_t */
322 +#define NE_FMT_SSIZE_T "d"
324 +/* Define to be printf format string for time_t */
325 +#define NE_FMT_TIME_T "ld"
327 +/* Defined if DAV is supported */
328 +#define NE_HAVE_DAV 1
330 +/* Defined if I18N is supported */
331 +/* #undef NE_HAVE_I18N 1 */
333 +/* Defined if IPV6 is supported */
334 +#define NE_HAVE_IPV6 1
336 +/* Defined if LFS is supported */
337 +#define NE_HAVE_LFS 1
339 +/* Defined if SOCKS is supported */
340 +/* #undef NE_HAVE_SOCKS */
342 +/* Defined if SSL is supported */
343 +/* #undef NE_HAVE_SSL */
345 +/* Defined if TS_SSL is supported */
346 +/* #undef NE_HAVE_TS_SSL */
348 +/* Defined if ZLIB is supported */
349 +/* #undef NE_HAVE_ZLIB */
351 +/* Define to be filename of an SSL CA root bundle */
352 +/* #undef NE_SSL_CA_BUNDLE */
354 +/* Define if poll() should be used */
356 +#define NE_USE_POLL 1
359 +/* Define to be neon library major version */
360 +#define NE_VERSION_MAJOR (0)
362 +/* Define to be neon library minor version */
363 +#define NE_VERSION_MINOR (28)
365 +/* Define to be neon library patch version */
366 +#define NE_VERSION_PATCH (2)
368 +/* Define to the address where bug reports for this package should be sent. */
369 +#define PACKAGE_BUGREPORT "neon@webdav.org"
371 +/* Define to the full name of this package. */
372 +#define PACKAGE_NAME "neon"
374 +/* Define to the full name and version of this package. */
375 +#define PACKAGE_STRING "neon 0.28.2"
377 +/* Define to the one symbol short name of this package. */
378 +#define PACKAGE_TARNAME "neon"
380 +/* Define to the version of this package. */
381 +#define PACKAGE_VERSION "0.28.2"
383 +/* The size of a `int', as computed by sizeof. */
384 +#define SIZEOF_INT 4
386 +/* The size of a `long', as computed by sizeof. */
387 +#define SIZEOF_LONG 4
389 +/* The size of a `long long', as computed by sizeof. */
390 +#define SIZEOF_LONG_LONG 8
392 +/* The size of a `off64_t', as computed by sizeof. */
393 +#define SIZEOF_OFF64_T 8
395 +/* The size of a `off_t', as computed by sizeof. */
396 +#define SIZEOF_OFF_T 4
398 +/* The size of a `size_t', as computed by sizeof. */
399 +#define SIZEOF_SIZE_T 4
401 +/* The size of a `ssize_t', as computed by sizeof. */
402 +#define SIZEOF_SSIZE_T 4
404 +/* The size of a `time_t', as computed by sizeof. */
405 +#define SIZEOF_TIME_T 4
407 +/* Define to 1 if you have the ANSI C header files. */
409 +#define STDC_HEADERS 1
412 +/* Define to 1 if strerror_r returns char *. */
414 +#define STRERROR_R_CHAR_P 1
417 +/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
418 +#define TIME_WITH_SYS_TIME 1
420 +/* Define if getaddrinfo supports AI_ADDRCONFIG */
421 +/* #undef USE_GAI_ADDRCONFIG */
423 +/* Define if getaddrinfo() should be used */
424 +#define USE_GETADDRINFO 1
426 +/* Define to 1 if your processor stores words with the most significant byte
427 + first (like Motorola and SPARC, unlike Intel and VAX). */
428 +#if defined (SOLARIS) && defined (SPARC)
429 +#define WORDS_BIGENDIAN 1
432 +/* Always defined to enable GNU extensions */
433 +#define _GNU_SOURCE 1
435 +/* Define to empty if `const' does not conform to ANSI C. */
438 +/* Define if in_addr_t is not available */
439 +/* #undef in_addr_t */
441 +/* Define to `__inline__' or `__inline' if that's what the C compiler
442 + calls it, or to nothing if 'inline' is not supported under any name. */
444 +#if defined (SOLARIS) && defined (__SUNPRO_C)
449 +/* Define to `long' if <sys/types.h> does not define. */
452 +/* Define to `int' if <sys/types.h> does not define. */
455 +/* Define to `unsigned' if <sys/types.h> does not define. */
459 +/* Enable leak-tracking versions of ne_*alloc when NEON_MEMLEAK is enabled */
461 +# include "memleak.h"
464 +#if defined(HAVE_STPCPY) && defined(HAVE_DECL_STPCPY) && !HAVE_DECL_STPCPY && !defined(stpcpy)
465 +char *stpcpy(char *, const char *);
472 +#define HAVE_MEMCPY 1
474 +#define strncasecmp strnicmp
475 +#define inline __inline
476 +#define WIN32_LEAN_AND_MEAN
489 --- misc/neon-0.28.2/src/makefile.mk 2009-06-24 12:49:38.000000000 +0200
490 +++ misc/build/neon-0.28.2/src/makefile.mk 2009-06-24 12:46:45.000000000 +0200
493 +PRJ=..$/..$/..$/..$/..
498 +EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
500 +# --- Settings -----------------------------------------------------
502 +.INCLUDE : settings.mk
504 +# --- Files --------------------------------------------------------
506 +CDEFS+=-DHAVE_CONFIG_H
508 +.IF "$(SYSTEM_LIBXML)" == "YES"
509 +CFLAGS+=-DSYSTEM_LIBXML $(LIBXML_CFLAGS)
514 + $(SLO)$/ne_207.obj \
515 + $(SLO)$/ne_acl.obj \
516 + $(SLO)$/ne_alloc.obj \
517 + $(SLO)$/ne_auth.obj \
518 + $(SLO)$/ne_basic.obj \
519 + $(SLO)$/ne_compress.obj \
520 + $(SLO)$/ne_dates.obj \
521 + $(SLO)$/ne_i18n.obj \
522 + $(SLO)$/ne_locks.obj \
523 + $(SLO)$/ne_md5.obj \
524 + $(SLO)$/ne_props.obj \
525 + $(SLO)$/ne_redirect.obj \
526 + $(SLO)$/ne_request.obj \
527 + $(SLO)$/ne_session.obj \
528 + $(SLO)$/ne_socket.obj \
529 + $(SLO)$/ne_string.obj \
530 + $(SLO)$/ne_uri.obj \
531 + $(SLO)$/ne_utils.obj \
532 + $(SLO)$/ne_xml.obj \
533 + $(SLO)$/ne_xmlreq.obj \
534 + $(SLO)$/ne_openssl.obj
537 +SLOFILES+=$(SLO)$/ne_sspi.obj
539 +SLOFILES+=$(SLO)$/ne_ntlm.obj
542 +# $(SLO)$/ne_gnutls.obj \
543 +# $(SLO)$/ne_stubssl.obj
545 +LIB1TARGET=$(SLB)$/$(TARGET).lib
546 +LIB1ARCHIV=$(LB)$/lib$(TARGET).a
547 +LIB1OBJFILES=$(SLOFILES)
549 +# --- Targets ------------------------------------------------------
551 +.INCLUDE : target.mk
552 --- misc/neon-0.28.2/src/ne_auth.c 2008-02-29 17:30:12.000000000 +0100
553 +++ misc/build/neon-0.28.2/src/ne_auth.c 2009-06-24 12:46:45.000000000 +0200
559 +#include "ne_ntlm.h"
562 #define HOOK_SERVER_ID "http://webdav.org/neon/hooks/server-auth"
563 #define HOOK_PROXY_ID "http://webdav.org/neon/hooks/proxy-auth"
570 + /* This is used for NTLM auth */
571 + ne_ntlm_context *ntlm_context;
573 /* These all used for Digest auth */
577 ne_sspi_destroy_context(sess->sspi_context);
578 sess->sspi_context = NULL;
581 + ne_ntlm_destroy_context(sess->ntlm_context);
582 + sess->ntlm_context = NULL;
584 + sess->protocol = NULL;
587 /* Returns client nonce string. */
589 int ntlm = ne_strcasecmp(parms->protocol->name, "NTLM") == 0;
591 char *response = NULL;
593 + char password[NE_ABUFSIZ];
595 NE_DEBUG(NE_DBG_HTTPAUTH, "auth: SSPI challenge.\n");
598 if (!sess->sspi_context) {
606 + /* Authentification needs more than one http request.
607 + * As long as authentification in progress use the existing credentials.
608 + * Otherwise get new credentials.*/
609 + if (!parms->opaque)
610 + if (get_credentials(sess, errmsg, attempt, parms, password)) {
611 + /* Failed to get credentials */
615 - status = ne_sspi_authenticate(sess->sspi_context, parms->opaque, &response);
616 + status = ne_sspi_authenticate(sess->sspi_context, parms->opaque, &response, sess->username, password);
626 +static char *request_ntlm(auth_session *sess, struct auth_request *request)
628 + char *token = ne_ntlm_getRequestToken(sess->ntlm_context);
630 + char * req = ne_concat(sess->protocol->name, " ", token, "\r\n", NULL);
638 +static int ntlm_challenge(auth_session *sess, int attempt,
639 + struct auth_challenge *parms,
640 + ne_buffer **errmsg)
644 + NE_DEBUG(NE_DBG_HTTPAUTH, "auth: NTLM challenge.\n");
646 + if (!parms->opaque) {
647 + char password[NE_ABUFSIZ];
649 + if (get_credentials(sess, errmsg, attempt, parms, password)) {
650 + /* Failed to get credentials */
654 + if (sess->ntlm_context) {
655 + status = ne_ntlm_destroy_context(sess->ntlm_context);
656 + sess->ntlm_context = NULL;
662 + status = ne_ntlm_create_context(&sess->ntlm_context,
670 + status = ne_ntlm_authenticate(sess->ntlm_context, parms->opaque);
677 +#endif /* HAVE_NTLM */
680 /* Examine a digest challenge: return 0 if it is a valid Digest challenge,
682 static int digest_challenge(auth_session *sess, int attempt,
683 @@ -1134,6 +1213,11 @@
684 sspi_challenge, request_sspi, NULL,
685 AUTH_FLAG_OPAQUE_PARAM|AUTH_FLAG_VERIFY_NON40x|AUTH_FLAG_CONN_AUTH },
688 + { NE_AUTH_NEGOTIATE, 30, "NTLM",
689 + ntlm_challenge, request_ntlm, NULL,
690 + AUTH_FLAG_OPAQUE_PARAM|AUTH_FLAG_VERIFY_NON40x|AUTH_FLAG_CONN_AUTH },
695 @@ -1431,6 +1515,11 @@
696 ne_sspi_clear_context(sess->sspi_context);
700 + if (sess->ntlm_context) {
701 + ne_ntlm_clear_context(sess->ntlm_context);
707 --- misc/neon-0.28.2/src/ne_defs.h 2006-10-24 21:40:09.000000000 +0200
708 +++ misc/build/neon-0.28.2/src/ne_defs.h 2009-06-24 12:46:45.000000000 +0200
712 /* define ssize_t for Win32 */
713 -#if defined(WIN32) && !defined(ssize_t)
714 +#if defined(WIN32) && !defined(ssize_t) && !defined(__MINGW32__)
718 --- misc/neon-0.28.2/src/ne_locks.h 2006-01-02 12:43:19.000000000 +0100
719 +++ misc/build/neon-0.28.2/src/ne_locks.h 2009-06-24 12:46:45.000000000 +0200
724 +# if defined __GNUC__
725 +# pragma GCC system_header
728 #include "ne_request.h" /* for ne_session + ne_request */
729 #include "ne_uri.h" /* for ne_uri */
731 --- misc/neon-0.28.2/src/ne_ntlm.c 2009-06-24 12:49:38.000000000 +0200
732 +++ misc/build/neon-0.28.2/src/ne_ntlm.c 2009-06-24 12:46:45.000000000 +0200
736 + Handling of NTLM Authentication
737 + Copyright (C) 2003, Daniel Stenberg <daniel@haxx.se>
738 + Copyright (C) 2009, Kai Sommerfeld <kso@openoffice.org>
740 + This library is free software; you can redistribute it and/or
741 + modify it under the terms of the GNU Library General Public
742 + License as published by the Free Software Foundation; either
743 + version 2 of the License, or (at your option) any later version.
745 + This library is distributed in the hope that it will be useful,
746 + but WITHOUT ANY WARRANTY; without even the implied warranty of
747 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
748 + Library General Public License for more details.
750 + You should have received a copy of the GNU Library General Public
751 + License along with this library; if not, write to the Free
752 + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
759 + http://davenport.sourceforge.net/ntlm.html
760 + http://www.innovation.ch/java/ntlm.html
764 +#include "ne_ntlm.h"
768 +#include "ne_string.h"
778 +struct ne_ntlm_context_s {
780 + unsigned char nonce[8];
783 + char *requestToken;
787 + NTLM_NONE, /* not a ntlm */
788 + NTLM_BAD, /* an ntlm, but one we don't like */
789 + NTLM_FIRST, /* the first 401-reply we got with NTLM */
790 + NTLM_FINE, /* an ntlm we act on */
792 + NTLM_LAST /* last entry in this enum, don't use */
795 +/* Flag bits definitions based on http://davenport.sourceforge.net/ntlm.html */
797 +#define NTLMFLAG_NEGOTIATE_UNICODE (1<<0)
798 +/* Indicates that Unicode strings are supported for use in security buffer
801 +#define NTLMFLAG_NEGOTIATE_OEM (1<<1)
802 +/* Indicates that OEM strings are supported for use in security buffer data. */
804 +#define NTLMFLAG_REQUEST_TARGET (1<<2)
805 +/* Requests that the server's authentication realm be included in the Type 2
808 +/* unknown (1<<3) */
809 +#define NTLMFLAG_NEGOTIATE_SIGN (1<<4)
810 +/* Specifies that authenticated communication between the client and server
811 + should carry a digital signature (message integrity). */
813 +#define NTLMFLAG_NEGOTIATE_SEAL (1<<5)
814 +/* Specifies that authenticated communication between the client and server
815 + should be encrypted (message confidentiality). */
817 +#define NTLMFLAG_NEGOTIATE_DATAGRAM_STYLE (1<<6)
818 +/* unknown purpose */
820 +#define NTLMFLAG_NEGOTIATE_LM_KEY (1<<7)
821 +/* Indicates that the LAN Manager session key should be used for signing and
822 + sealing authenticated communications. */
824 +#define NTLMFLAG_NEGOTIATE_NETWARE (1<<8)
825 +/* unknown purpose */
827 +#define NTLMFLAG_NEGOTIATE_NTLM_KEY (1<<9)
828 +/* Indicates that NTLM authentication is being used. */
830 +/* unknown (1<<10) */
831 +/* unknown (1<<11) */
833 +#define NTLMFLAG_NEGOTIATE_DOMAIN_SUPPLIED (1<<12)
834 +/* Sent by the client in the Type 1 message to indicate that a desired
835 + authentication realm is included in the message. */
837 +#define NTLMFLAG_NEGOTIATE_WORKSTATION_SUPPLIED (1<<13)
838 +/* Sent by the client in the Type 1 message to indicate that the client
839 + workstation's name is included in the message. */
841 +#define NTLMFLAG_NEGOTIATE_LOCAL_CALL (1<<14)
842 +/* Sent by the server to indicate that the server and client are on the same
843 + machine. Implies that the client may use a pre-established local security
844 + context rather than responding to the challenge. */
846 +#define NTLMFLAG_NEGOTIATE_ALWAYS_SIGN (1<<15)
847 +/* Indicates that authenticated communication between the client and server
848 + should be signed with a "dummy" signature. */
850 +#define NTLMFLAG_TARGET_TYPE_DOMAIN (1<<16)
851 +/* Sent by the server in the Type 2 message to indicate that the target
852 + authentication realm is a domain. */
854 +#define NTLMFLAG_TARGET_TYPE_SERVER (1<<17)
855 +/* Sent by the server in the Type 2 message to indicate that the target
856 + authentication realm is a server. */
858 +#define NTLMFLAG_TARGET_TYPE_SHARE (1<<18)
859 +/* Sent by the server in the Type 2 message to indicate that the target
860 + authentication realm is a share. Presumably, this is for share-level
861 + authentication. Usage is unclear. */
863 +#define NTLMFLAG_NEGOTIATE_NTLM2_KEY (1<<19)
864 +/* Indicates that the NTLM2 signing and sealing scheme should be used for
865 + protecting authenticated communications. */
867 +#define NTLMFLAG_REQUEST_INIT_RESPONSE (1<<20)
868 +/* unknown purpose */
870 +#define NTLMFLAG_REQUEST_ACCEPT_RESPONSE (1<<21)
871 +/* unknown purpose */
873 +#define NTLMFLAG_REQUEST_NONNT_SESSION_KEY (1<<22)
874 +/* unknown purpose */
876 +#define NTLMFLAG_NEGOTIATE_TARGET_INFO (1<<23)
877 +/* Sent by the server in the Type 2 message to indicate that it is including a
878 + Target Information block in the message. */
880 +/* unknown (1<24) */
881 +/* unknown (1<25) */
882 +/* unknown (1<26) */
883 +/* unknown (1<27) */
884 +/* unknown (1<28) */
886 +#define NTLMFLAG_NEGOTIATE_128 (1<<29)
887 +/* Indicates that 128-bit encryption is supported. */
889 +#define NTLMFLAG_NEGOTIATE_KEY_EXCHANGE (1<<30)
890 +/* unknown purpose */
892 +#define NTLMFLAG_NEGOTIATE_56 (1<<31)
893 +/* Indicates that 56-bit encryption is supported. */
896 +/* We need OpenSSL for the crypto lib to provide us with MD4 and DES */
898 +/* -- WIN32 approved -- */
905 +#include <openssl/des.h>
906 +#include <openssl/md4.h>
907 +#include <openssl/ssl.h>
909 +#if OPENSSL_VERSION_NUMBER < 0x00907001L
910 +#define DES_key_schedule des_key_schedule
911 +#define DES_cblock des_cblock
912 +#define DES_set_odd_parity des_set_odd_parity
913 +#define DES_set_key des_set_key
914 +#define DES_ecb_encrypt des_ecb_encrypt
916 +/* This is how things were done in the old days */
918 +#define DESKEYARG(x) x
920 +/* Modern version */
921 +#define DESKEYARG(x) *x
922 +#define DESKEY(x) &x
925 +/* Define this to make the type-3 message include the NT response message */
926 +#define USE_NTRESPONSES 1
929 + (*) = A "security buffer" is a triplet consisting of two shorts and one
932 + 1. a 'short' containing the length of the buffer in bytes
933 + 2. a 'short' containing the allocated space for the buffer in bytes
934 + 3. a 'long' containing the offset to the start of the buffer from the
935 + beginning of the NTLM message, in bytes.
938 +static ntlm ne_input_ntlm(ne_ntlm_context *ctx,
939 + const char *responseToken)
941 + if(responseToken) {
942 + /* We got a type-2 message here:
944 + Index Description Content
945 + 0 NTLMSSP Signature Null-terminated ASCII "NTLMSSP"
946 + (0x4e544c4d53535000)
947 + 8 NTLM Message Type long (0x02000000)
948 + 12 Target Name security buffer(*)
950 + 24 Challenge 8 bytes
951 + (32) Context (optional) 8 bytes (two consecutive longs)
952 + (40) Target Information (optional) security buffer(*)
953 + 32 (48) start of data block
955 + unsigned char * buffer = NULL;
957 + int size = ne_unbase64(responseToken, &buffer);
959 + ctx->state = NTLMSTATE_TYPE2; /* we got a type-2 */
962 + /* the nonce of interest is index [24 .. 31], 8 bytes */
963 + memcpy(ctx->nonce, &buffer[24], 8);
965 + /* at index decimal 20, there's a 32bit NTLM flag field */
967 + if (buffer) ne_free(buffer);
970 + if(ctx->state >= NTLMSTATE_TYPE1)
973 + ctx->state = NTLMSTATE_TYPE1; /* we should sent away a type-1 */
979 + * Turns a 56 bit key into the 64 bit, odd parity key and sets the key. The
980 + * key schedule ks is also set.
982 +static void setup_des_key(unsigned char *key_56,
983 + DES_key_schedule DESKEYARG(ks))
987 + key[0] = key_56[0];
988 + key[1] = ((key_56[0] << 7) & 0xFF) | (key_56[1] >> 1);
989 + key[2] = ((key_56[1] << 6) & 0xFF) | (key_56[2] >> 2);
990 + key[3] = ((key_56[2] << 5) & 0xFF) | (key_56[3] >> 3);
991 + key[4] = ((key_56[3] << 4) & 0xFF) | (key_56[4] >> 4);
992 + key[5] = ((key_56[4] << 3) & 0xFF) | (key_56[5] >> 5);
993 + key[6] = ((key_56[5] << 2) & 0xFF) | (key_56[6] >> 6);
994 + key[7] = (key_56[6] << 1) & 0xFF;
996 + DES_set_odd_parity(&key);
997 + DES_set_key(&key, ks);
1001 + * takes a 21 byte array and treats it as 3 56-bit DES keys. The
1002 + * 8 byte plaintext is encrypted with each key and the resulting 24
1003 + * bytes are stored in the results array.
1005 +static void calc_resp(unsigned char *keys,
1006 + unsigned char *plaintext,
1007 + unsigned char *results)
1009 + DES_key_schedule ks;
1011 + setup_des_key(keys, DESKEY(ks));
1012 + DES_ecb_encrypt((DES_cblock*) plaintext, (DES_cblock*) results,
1013 + DESKEY(ks), DES_ENCRYPT);
1015 + setup_des_key(keys+7, DESKEY(ks));
1016 + DES_ecb_encrypt((DES_cblock*) plaintext, (DES_cblock*) (results+8),
1017 + DESKEY(ks), DES_ENCRYPT);
1019 + setup_des_key(keys+14, DESKEY(ks));
1020 + DES_ecb_encrypt((DES_cblock*) plaintext, (DES_cblock*) (results+16),
1021 + DESKEY(ks), DES_ENCRYPT);
1025 + * Set up lanmanager and nt hashed passwords
1027 +static void mkhash(char *password,
1028 + unsigned char *nonce, /* 8 bytes */
1029 + unsigned char *lmresp /* must fit 0x18 bytes */
1030 +#ifdef USE_NTRESPONSES
1031 + , unsigned char *ntresp /* must fit 0x18 bytes */
1035 + unsigned char lmbuffer[21];
1036 +#ifdef USE_NTRESPONSES
1037 + unsigned char ntbuffer[21];
1039 + unsigned char *pw;
1040 + static const unsigned char magic[] = {
1041 + 0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25
1044 + int len = strlen(password);
1046 + /* make it fit at least 14 bytes */
1047 + pw = malloc(len<7?14:len*2);
1049 + return; /* this will lead to a badly generated package */
1054 + for (i=0; i<len; i++)
1055 + pw[i] = toupper(password[i]);
1061 + /* create LanManager hashed password */
1062 + DES_key_schedule ks;
1064 + setup_des_key(pw, DESKEY(ks));
1065 + DES_ecb_encrypt((DES_cblock *)magic, (DES_cblock *)lmbuffer,
1066 + DESKEY(ks), DES_ENCRYPT);
1068 + setup_des_key(pw+7, DESKEY(ks));
1069 + DES_ecb_encrypt((DES_cblock *)magic, (DES_cblock *)(lmbuffer+8),
1070 + DESKEY(ks), DES_ENCRYPT);
1072 + memset(lmbuffer+16, 0, 5);
1074 + /* create LM responses */
1075 + calc_resp(lmbuffer, nonce, lmresp);
1077 +#ifdef USE_NTRESPONSES
1079 + /* create NT hashed password */
1082 + len = strlen(password);
1084 + for (i=0; i<len; i++) {
1085 + pw[2*i] = password[i];
1090 + MD4_Update(&MD4, pw, 2*len);
1091 + MD4_Final(ntbuffer, &MD4);
1093 + memset(ntbuffer+16, 0, 8);
1096 + calc_resp(ntbuffer, nonce, ntresp);
1102 +#define SHORTPAIR(x) ((x) & 0xff), ((x) >> 8)
1103 +#define LONGQUARTET(x) ((x) & 0xff), (((x) >> 8)&0xff), \
1104 + (((x) >>16)&0xff), ((x)>>24)
1106 +/* this is for creating ntlm header output */
1107 +static int ne_output_ntlm(ne_ntlm_context *ctx)
1109 + const char *domain=""; /* empty */
1110 + const char *host=""; /* empty */
1111 + int domlen=strlen(domain);
1112 + int hostlen = strlen(host);
1113 + int hostoff; /* host name offset */
1114 + int domoff; /* domain name offset */
1116 + unsigned char ntlmbuf[256]; /* enough, unless the host/domain is very long */
1118 + if(!ctx->user || !ctx->passwd)
1119 + /* no user, no auth */
1120 + return 0; /* OK */
1122 + switch(ctx->state) {
1123 + case NTLMSTATE_TYPE1:
1124 + default: /* for the weird cases we (re)start here */
1126 + domoff = hostoff + hostlen;
1128 + /* Create and send a type-1 message:
1130 + Index Description Content
1131 + 0 NTLMSSP Signature Null-terminated ASCII "NTLMSSP"
1132 + (0x4e544c4d53535000)
1133 + 8 NTLM Message Type long (0x01000000)
1135 + 16 Supplied Domain security buffer(*)
1136 + 24 Supplied Workstation security buffer(*)
1137 + 32 start of data block
1141 + snprintf((char *)ntlmbuf, sizeof(ntlmbuf), "NTLMSSP%c"
1142 + "\x01%c%c%c" /* 32-bit type = 1 */
1143 + "%c%c%c%c" /* 32-bit NTLM flag field */
1144 + "%c%c" /* domain length */
1145 + "%c%c" /* domain allocated space */
1146 + "%c%c" /* domain name offset */
1147 + "%c%c" /* 2 zeroes */
1148 + "%c%c" /* host length */
1149 + "%c%c" /* host allocated space */
1150 + "%c%c" /* host name offset */
1151 + "%c%c" /* 2 zeroes */
1152 + "%s" /* host name */
1153 + "%s", /* domain string */
1154 + 0, /* trailing zero */
1155 + 0,0,0, /* part of type-1 long */
1158 + NTLMFLAG_NEGOTIATE_OEM| /* 2 */
1159 + NTLMFLAG_NEGOTIATE_NTLM_KEY /* 200 */
1160 + /* equals 0x0202 */
1162 + SHORTPAIR(domlen),
1163 + SHORTPAIR(domlen),
1164 + SHORTPAIR(domoff),
1166 + SHORTPAIR(hostlen),
1167 + SHORTPAIR(hostlen),
1168 + SHORTPAIR(hostoff),
1172 + /* initial packet length */
1173 + size = 32 + hostlen + domlen;
1175 + /* now keeper of the base64 encoded package size */
1176 + if (ctx->requestToken) ne_free(ctx->requestToken);
1177 + ctx->requestToken = ne_base64(ntlmbuf, size);
1181 + case NTLMSTATE_TYPE2:
1182 + /* We received the type-2 already, create a type-3 message:
1184 + Index Description Content
1185 + 0 NTLMSSP Signature Null-terminated ASCII "NTLMSSP"
1186 + (0x4e544c4d53535000)
1187 + 8 NTLM Message Type long (0x03000000)
1188 + 12 LM/LMv2 Response security buffer(*)
1189 + 20 NTLM/NTLMv2 Response security buffer(*)
1190 + 28 Domain Name security buffer(*)
1191 + 36 User Name security buffer(*)
1192 + 44 Workstation Name security buffer(*)
1193 + (52) Session Key (optional) security buffer(*)
1194 + (60) Flags (optional) long
1195 + 52 (64) start of data block
1203 + unsigned char lmresp[0x18]; /* fixed-size */
1204 +#ifdef USE_NTRESPONSES
1205 + unsigned char ntresp[0x18]; /* fixed-size */
1210 + user = strchr(ctx->user, '\\');
1212 + user = strchr(ctx->user, '/');
1215 + domain = ctx->user;
1216 + domlen = user - domain;
1221 + userlen = strlen(user);
1223 + mkhash(ctx->passwd, &ctx->nonce[0], lmresp
1224 +#ifdef USE_NTRESPONSES
1229 + domoff = 64; /* always */
1230 + useroff = domoff + domlen;
1231 + hostoff = useroff + userlen;
1232 + lmrespoff = hostoff + hostlen;
1233 + ntrespoff = lmrespoff + 0x18;
1235 + /* Create the big type-3 message binary blob */
1236 + size = snprintf((char *)ntlmbuf, sizeof(ntlmbuf),
1238 + "\x03%c%c%c" /* type-3, 32 bits */
1240 + "%c%c%c%c" /* LanManager length + allocated space */
1241 + "%c%c" /* LanManager offset */
1242 + "%c%c" /* 2 zeroes */
1244 + "%c%c" /* NT-response length */
1245 + "%c%c" /* NT-response allocated space */
1246 + "%c%c" /* NT-response offset */
1247 + "%c%c" /* 2 zeroes */
1249 + "%c%c" /* domain length */
1250 + "%c%c" /* domain allocated space */
1251 + "%c%c" /* domain name offset */
1252 + "%c%c" /* 2 zeroes */
1254 + "%c%c" /* user length */
1255 + "%c%c" /* user allocated space */
1256 + "%c%c" /* user offset */
1257 + "%c%c" /* 2 zeroes */
1259 + "%c%c" /* host length */
1260 + "%c%c" /* host allocated space */
1261 + "%c%c" /* host offset */
1262 + "%c%c%c%c%c%c" /* 6 zeroes */
1264 + "\xff\xff" /* message length */
1265 + "%c%c" /* 2 zeroes */
1267 + "\x01\x82" /* flags */
1268 + "%c%c" /* 2 zeroes */
1270 + /* domain string */
1273 + /* LanManager response */
1276 + 0, /* zero termination */
1277 + 0,0,0, /* type-3 long, the 24 upper bits */
1279 + SHORTPAIR(0x18), /* LanManager response length, twice */
1281 + SHORTPAIR(lmrespoff),
1284 +#ifdef USE_NTRESPONSES
1285 + SHORTPAIR(0x18), /* NT-response length, twice */
1291 + SHORTPAIR(ntrespoff),
1294 + SHORTPAIR(domlen),
1295 + SHORTPAIR(domlen),
1296 + SHORTPAIR(domoff),
1299 + SHORTPAIR(userlen),
1300 + SHORTPAIR(userlen),
1301 + SHORTPAIR(useroff),
1304 + SHORTPAIR(hostlen),
1305 + SHORTPAIR(hostlen),
1306 + SHORTPAIR(hostoff),
1307 + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1313 + /* size is now 64 */
1315 + ntlmbuf[62]=ntlmbuf[63]=0;
1317 + /* Make sure that the user and domain strings fit in the target buffer
1318 + before we copy them there. */
1319 + if(size + userlen + domlen >= sizeof(ntlmbuf)) {
1323 + memcpy(&ntlmbuf[size], domain, domlen);
1326 + memcpy(&ntlmbuf[size], user, userlen);
1329 + /* we append the binary hashes to the end of the blob */
1330 + if(size < ((int)sizeof(ntlmbuf) - 0x18)) {
1331 + memcpy(&ntlmbuf[size], lmresp, 0x18);
1335 +#ifdef USE_NTRESPONSES
1336 + if(size < ((int)sizeof(ntlmbuf) - 0x18)) {
1337 + memcpy(&ntlmbuf[size], ntresp, 0x18);
1342 + ntlmbuf[56] = size & 0xff;
1343 + ntlmbuf[57] = size >> 8;
1345 + /* convert the binary blob into base64 */
1346 + ctx->requestToken = ne_base64(ntlmbuf, size);
1348 + ctx->state = NTLMSTATE_TYPE3; /* we sent a type-3 */
1352 + case NTLMSTATE_TYPE3:
1353 + /* connection is already authenticated,
1354 + * don't send a header in future requests */
1355 + if (ctx->requestToken) ne_free(ctx->requestToken);
1356 + ctx->requestToken = NULL;
1360 + return 0; /* OK */
1363 +int ne_ntlm_create_context(ne_ntlm_context **context, const char *userName, const char *password)
1365 + if (context == NULL) {
1368 + ne_ntlm_context *ctx = ne_calloc(sizeof(ne_ntlm_context));
1370 + ctx->state = NTLMSTATE_NONE;
1371 + ctx->user = ne_strdup(userName);
1372 + ctx->passwd = ne_strdup(password);
1379 +int ne_ntlm_destroy_context(ne_ntlm_context *context)
1381 + if (context != NULL) {
1382 + if (context->user)
1383 + ne_free(context->user);
1385 + if (context->passwd)
1386 + ne_free(context->passwd);
1388 + if (context->requestToken)
1389 + ne_free(context->requestToken);
1396 +int ne_ntlm_clear_context(ne_ntlm_context *context)
1401 +int ne_ntlm_authenticate(ne_ntlm_context *context, const char *responseToken)
1403 + if (context == NULL) {
1406 + if (context->state <= NTLMSTATE_TYPE3) {
1407 + ntlm ntlmstatus = ne_input_ntlm(context, responseToken);
1409 + if (ntlmstatus != NTLM_FINE) {
1414 + return ne_output_ntlm(context);
1417 +char *ne_ntlm_getRequestToken(ne_ntlm_context *context)
1419 + if (context == NULL) {
1422 + if (context->requestToken) {
1423 + char *ret = ne_strdup(context->requestToken);
1424 + ne_free(context->requestToken);
1425 + context->requestToken = NULL;
1433 +#endif /* HAVE_OPENSSL */
1434 +#endif /* HAVE_NTLM */
1435 --- misc/neon-0.28.2/src/ne_ntlm.h 2009-06-24 12:49:38.000000000 +0200
1436 +++ misc/build/neon-0.28.2/src/ne_ntlm.h 2009-06-24 12:46:45.000000000 +0200
1440 + Handling of NTLM Authentication
1441 + Copyright (C) 2009, Kai Sommerfeld <kso@openoffice.org>
1443 + This library is free software; you can redistribute it and/or
1444 + modify it under the terms of the GNU Library General Public
1445 + License as published by the Free Software Foundation; either
1446 + version 2 of the License, or (at your option) any later version.
1448 + This library is distributed in the hope that it will be useful,
1449 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1450 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1451 + Library General Public License for more details.
1453 + You should have received a copy of the GNU Library General Public
1454 + License along with this library; if not, write to the Free
1455 + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
1456 + MA 02111-1307, USA
1462 +#include "config.h"
1464 +/* PRIVATE TO NEON -- NOT PART OF THE EXTERNAL API. */
1468 +typedef struct ne_ntlm_context_s ne_ntlm_context;
1470 +int ne_ntlm_create_context(ne_ntlm_context **context, const char *userName, const char *password);
1472 +int ne_ntlm_destroy_context(ne_ntlm_context *context);
1474 +int ne_ntlm_clear_context(ne_ntlm_context *context);
1476 +int ne_ntlm_authenticate(ne_ntlm_context *context, const char *responseToken);
1478 +char *ne_ntlm_getRequestToken(ne_ntlm_context *context);
1480 +#endif /* HAVE_NTLM */
1482 +#endif /* NE_NTLM_H */
1483 --- misc/neon-0.28.2/src/ne_socket.c 2008-02-28 14:19:19.000000000 +0100
1484 +++ misc/build/neon-0.28.2/src/ne_socket.c 2009-06-24 12:49:13.000000000 +0200
1487 #ifdef USE_GETADDRINFO
1488 #include <ws2tcpip.h>
1489 +#include <Wspiapi.h>
1493 --- misc/neon-0.28.2/src/ne_sspi.c 2007-08-10 17:26:08.000000000 +0200
1494 +++ misc/build/neon-0.28.2/src/ne_sspi.c 2009-06-24 12:46:45.000000000 +0200
1495 @@ -202,9 +202,48 @@
1503 + * Simplification wrapper arround AcquireCredentialsHandle as most of
1504 + * the parameters do not change.
1506 +static int acquireCredentialsHandleForUsername(CredHandle * credentials, char *package, const char *username, const char *password)
1508 + SECURITY_STATUS status;
1509 + TimeStamp timestamp;
1511 + const char *domain = "";
1514 + SecPkgInfo *secPackInfo;
1515 + SEC_WINNT_AUTH_IDENTITY *nameAndPwd = NULL;
1516 + int bytesReceived = 0, bytesSent = 0;
1518 + nameAndPwd = (SEC_WINNT_AUTH_IDENTITY *) malloc( sizeof(SEC_WINNT_AUTH_IDENTITY) );
1519 + memset( nameAndPwd, '\0', sizeof (*nameAndPwd) );
1520 + nameAndPwd->Domain = (unsigned char *) _strdup( domain? domain: "" );
1521 + nameAndPwd->DomainLength = domain? strlen( domain ): 0;
1522 + nameAndPwd->User = (unsigned char *) _strdup( username? username: "" );
1523 + nameAndPwd->UserLength = username? strlen( username ): 0;
1524 + nameAndPwd->Password = (unsigned char *) _strdup( password? password: "" );
1525 + nameAndPwd->PasswordLength = password? strlen( password ): 0;
1526 + nameAndPwd->Flags = SEC_WINNT_AUTH_IDENTITY_ANSI;
1528 + status = pSFT->AcquireCredentialsHandle( NULL, package, SECPKG_CRED_OUTBOUND,
1529 + NULL, nameAndPwd, NULL, NULL, credentials, ×tamp );
1531 + if (status != SEC_E_OK) {
1532 + NE_DEBUG(NE_DBG_HTTPAUTH,
1533 + "sspi: AcquireCredentialsHandle [fail] [%x].\n", status);
1542 * Wrapper arround initializeSecurityContext. Supplies several
1543 * default parameters as well as logging in case of errors.
1545 * Processes received authentication tokens as well as supplies the
1548 -int ne_sspi_authenticate(void *context, const char *base64Token, char **responseToken)
1549 +int ne_sspi_authenticate(void *context, const char *base64Token, char **responseToken, const char* username, const char* password)
1551 SecBufferDesc outBufferDesc;
1552 SecBuffer outBuffer;
1553 @@ -560,14 +599,23 @@
1555 /* Reset any existing context since we are starting over */
1556 resetContext(sspiContext);
1558 + if (strlen(username) != 0) {
1559 + if (acquireCredentialsHandleForUsername
1560 + (&sspiContext->credentials, sspiContext->mechanism, username, password) != SEC_E_OK) {
1561 + freeBuffer(&outBufferDesc);
1562 + NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: acquireCredentialsHandleForUsername failed.\n");
1566 + if (acquireCredentialsHandle
1567 + (&sspiContext->credentials, sspiContext->mechanism) != SEC_E_OK) {
1568 + freeBuffer(&outBufferDesc);
1569 + NE_DEBUG(NE_DBG_HTTPAUTH, "sspi: acquireCredentialsHandle failed.\n");
1574 - if (acquireCredentialsHandle
1575 - (&sspiContext->credentials, sspiContext->mechanism) != SEC_E_OK) {
1576 - freeBuffer(&outBufferDesc);
1577 - NE_DEBUG(NE_DBG_HTTPAUTH,
1578 - "sspi: acquireCredentialsHandle failed.\n");
1583 initializeSecurityContext(&sspiContext->credentials, NULL,
1584 --- misc/neon-0.28.2/src/ne_sspi.h 2006-02-12 13:05:14.000000000 +0100
1585 +++ misc/build/neon-0.28.2/src/ne_sspi.h 2009-06-24 12:46:45.000000000 +0200
1587 int ne_sspi_clear_context(void *context);
1589 int ne_sspi_authenticate(void *context, const char *base64Token,
1590 - char **responseToken);
1591 + char **responseToken, const char* username, const char* password);
1593 #endif /* HAVE_SSPI */
1595 --- misc/neon-0.28.2/src/ne_uri.c 2007-12-05 12:04:47.000000000 +0100
1596 +++ misc/build/neon-0.28.2/src/ne_uri.c 2009-06-24 12:46:45.000000000 +0200
1598 #include "ne_alloc.h"
1601 -/* URI ABNF from RFC 3986: */
1602 +/* URI ABNF from RFC 3986: (TKR: SharePoint is contradictory to this RFC. So I fix it here. )*/
1604 #define PS (0x0001) /* "+" */
1605 #define PC (0x0002) /* "%" */
1608 #define OT (0x4000) /* others */
1610 +/* TKR new symbol */
1611 +#define WS (0x8000) /* Whitespaces ( Space, Tab ) */
1613 #define URI_ALPHA (AL)
1614 #define URI_DIGIT (DG)
1617 /* pchar = unreserved / pct-encoded / sub-delims / ":" / "@" */
1618 #define URI_PCHAR (URI_UNRESERVED | PC | URI_SUBDELIM | CL | AT)
1619 /* invented: segchar = pchar / "/" */
1620 -#define URI_SEGCHAR (URI_PCHAR | FS)
1621 +/* (TKR) WS added */
1622 +#define URI_SEGCHAR (URI_PCHAR | FS | WS)
1623 /* query = *( pchar / "/" / "?" ) */
1624 #define URI_QUERY (URI_PCHAR | FS | QU)
1625 /* fragment == query */
1626 #define URI_FRAGMENT URI_QUERY
1628 /* any characters which should be path-escaped: */
1629 -#define URI_ESCAPE ((URI_GENDELIM & ~(FS)) | URI_SUBDELIM | OT | PC)
1630 +#define URI_ESCAPE ((URI_GENDELIM & ~(FS)) | URI_SUBDELIM | OT | WS | PC)
1632 static const unsigned int uri_chars[256] = {
1633 /* 0xXX x0 x2 x4 x6 x8 xA xC xE */
1634 -/* 0x */ OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT,
1635 +/* 0x */ OT, OT, OT, OT, OT, OT, OT, OT, OT, WS, OT, OT, OT, OT, OT, OT,
1636 /* 1x */ OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT, OT,
1637 -/* 2x */ OT, SD, OT, GD, SD, PC, SD, SD, SD, SD, SD, PS, SD, DS, DT, FS,
1638 +/* 2x */ WS, SD, OT, GD, SD, PC, SD, SD, SD, SD, SD, PS, SD, DS, DT, FS,
1639 /* 3x */ DG, DG, DG, DG, DG, DG, DG, DG, DG, DG, CL, SD, OT, SD, OT, QU,
1640 /* 4x */ AT, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL,
1641 /* 5x */ AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, GD, OT, GD, OT, US,