sasl: Added initial stub functions for SSPI DIGEST-MD support

This commit is contained in:
Steve Holme 2014-04-02 21:21:12 +01:00
parent 3a92de5636
commit 2c49e96092
5 changed files with 85 additions and 3 deletions

View File

@ -44,7 +44,7 @@ CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c \
asyn-thread.c curl_gssapi.c curl_ntlm.c curl_ntlm_wb.c \
curl_ntlm_core.c curl_ntlm_msgs.c curl_sasl.c curl_multibyte.c \
hostcheck.c bundles.c conncache.c pipeline.c dotdot.c x509asn1.c \
http2.c $(VSOURCES)
http2.c sasl_sspi.c $(VSOURCES)
HHEADERS = arpa_telnet.h netrc.h file.h timeval.h hostip.h progress.h \
formdata.h cookie.h http.h sendf.h ftp.h url.h dict.h if2ip.h \

View File

@ -263,6 +263,7 @@ CURLcode Curl_sasl_create_cram_md5_message(struct SessionHandle *data,
return result;
}
#ifndef USE_WINDOWS_SSPI
/*
* sasl_decode_digest_md5_message()
*
@ -480,7 +481,9 @@ CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data,
return result;
}
#endif
#endif /* USE_WINDOWS_SSPI */
#endif /* CURL_DISABLE_CRYPTO_AUTH */
#ifdef USE_NTLM
/*

View File

@ -76,6 +76,14 @@ CURLcode Curl_sasl_create_cram_md5_message(struct SessionHandle *data,
const char *user,
const char *passwdp,
char **outptr, size_t *outlen);
#endif
#if !defined(CURL_DISABLE_CRYPTO_AUTH) || defined(USE_WINDOWS_SSPI)
/* This is used to decode a base64 encoded DIGEST-MD5 challange message */
CURLcode Curl_sasl_decode_digest_md5_message(const char *chlg64,
char *nonce, size_t nlen,
char *realm, size_t rlen,
char *alg, size_t alen);
/* This is used to generate a base64 encoded DIGEST-MD5 response message */
CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data,

71
lib/sasl_sspi.c Normal file
View File

@ -0,0 +1,71 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
* RFC2831 DIGEST-MD5 authentication
* RFC4422 Simple Authentication and Security Layer (SASL)
*
***************************************************************************/
#include "curl_setup.h"
#if defined(USE_WINDOWS_SSPI)
#include <curl/curl.h>
/* The last #include file should be: */
#include "memdebug.h"
/*
* Curl_sasl_create_digest_md5_message()
*
* This is used to generate an already encoded DIGEST-MD5 response message
* ready for sending to the recipient.
*
* Parameters:
*
* data [in] - The session handle.
* chlg64 [in] - Pointer to the base64 encoded challenge message.
* userp [in] - The user name.
* passdwp [in] - The user's password.
* service [in] - The service type such as www, smtp, pop or imap.
* outptr [in/out] - The address where a pointer to newly allocated memory
* holding the result will be stored upon completion.
* outlen [out] - The length of the output message.
*
* Returns CURLE_OK on success.
*/
CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data,
const char *chlg64,
const char *userp,
const char *passwdp,
const char *service,
char **outptr, size_t *outlen)
{
(void)data;
(void)chlg64;
(void)userp;
(void)passwdp;
(void)outptr;
(void)outlen;
return CURLE_NOT_BUILT_IN;
}
#endif /* USE_WINDOWS_SSPI */

View File

@ -39,7 +39,7 @@ SOURCE \
http_proxy.c non-ascii.c asyn-ares.c asyn-thread.c curl_gssapi.c \
curl_ntlm.c curl_ntlm_wb.c curl_ntlm_core.c curl_ntlm_msgs.c \
curl_sasl.c vtls/curl_schannel.c curl_multibyte.c \
vtls/curl_darwinssl.c bundles.c conncache.c
vtls/curl_darwinssl.c bundles.c conncache.c sasl_sspi
USERINCLUDE ../../../lib ../../../include/curl
#ifdef ENABLE_SSL