mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 15:48:49 -05:00
Dan Fandrich added the --disable-crypto-auth option to configure to allow
libcurl to build without Digest support. (I figure it should also explicitly disable Negotiate and NTLM.)
This commit is contained in:
parent
1b02ad5e8a
commit
94043b1150
19
configure.ac
19
configure.ac
@ -1473,6 +1473,25 @@ AC_HELP_STRING([--disable-debug],[Disable debug options]),
|
|||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
dnl ************************************************************
|
||||||
|
dnl disable cryptographic authentication
|
||||||
|
dnl
|
||||||
|
AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
|
||||||
|
AC_ARG_ENABLE(crypto-auth,
|
||||||
|
AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
|
||||||
|
AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
|
||||||
|
[ case "$enableval" in
|
||||||
|
no)
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
|
||||||
|
AC_SUBST(CURL_DISABLE_CRYPTO_AUTH)
|
||||||
|
;;
|
||||||
|
*) AC_MSG_RESULT(yes)
|
||||||
|
;;
|
||||||
|
esac ],
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
)
|
||||||
|
|
||||||
AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
|
AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile \
|
AC_CONFIG_FILES([Makefile \
|
||||||
|
14
lib/http.c
14
lib/http.c
@ -330,6 +330,7 @@ Curl_http_output_auth(struct connectdata *conn,
|
|||||||
}
|
}
|
||||||
data->state.authproxy.done = TRUE;
|
data->state.authproxy.done = TRUE;
|
||||||
}
|
}
|
||||||
|
#ifndef CURL_DISABLE_CRYPTO_AUTH
|
||||||
else if(data->state.authproxy.want == CURLAUTH_DIGEST) {
|
else if(data->state.authproxy.want == CURLAUTH_DIGEST) {
|
||||||
auth=(char *)"Digest";
|
auth=(char *)"Digest";
|
||||||
result = Curl_output_digest(conn,
|
result = Curl_output_digest(conn,
|
||||||
@ -339,7 +340,7 @@ Curl_http_output_auth(struct connectdata *conn,
|
|||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
infof(data, "Proxy auth using %s with user '%s'\n",
|
infof(data, "Proxy auth using %s with user '%s'\n",
|
||||||
auth, conn->proxyuser?conn->proxyuser:"");
|
auth, conn->proxyuser?conn->proxyuser:"");
|
||||||
}
|
}
|
||||||
@ -373,6 +374,7 @@ Curl_http_output_auth(struct connectdata *conn,
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
#ifndef CURL_DISABLE_CRYPTO_AUTH
|
||||||
if(data->state.authhost.picked == CURLAUTH_DIGEST) {
|
if(data->state.authhost.picked == CURLAUTH_DIGEST) {
|
||||||
auth=(char *)"Digest";
|
auth=(char *)"Digest";
|
||||||
result = Curl_output_digest(conn,
|
result = Curl_output_digest(conn,
|
||||||
@ -381,8 +383,9 @@ Curl_http_output_auth(struct connectdata *conn,
|
|||||||
(unsigned char *)path);
|
(unsigned char *)path);
|
||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
}
|
} else
|
||||||
else if(data->state.authhost.picked == CURLAUTH_BASIC) {
|
#endif
|
||||||
|
if(data->state.authhost.picked == CURLAUTH_BASIC) {
|
||||||
if(conn->bits.user_passwd &&
|
if(conn->bits.user_passwd &&
|
||||||
!checkheaders(data, "Authorization:")) {
|
!checkheaders(data, "Authorization:")) {
|
||||||
auth=(char *)"Basic";
|
auth=(char *)"Basic";
|
||||||
@ -489,6 +492,7 @@ CURLcode Curl_http_input_auth(struct connectdata *conn,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef CURL_DISABLE_CRYPTO_AUTH
|
||||||
if(checkprefix("Digest", start)) {
|
if(checkprefix("Digest", start)) {
|
||||||
CURLdigest dig;
|
CURLdigest dig;
|
||||||
*availp |= CURLAUTH_DIGEST;
|
*availp |= CURLAUTH_DIGEST;
|
||||||
@ -504,7 +508,9 @@ CURLcode Curl_http_input_auth(struct connectdata *conn,
|
|||||||
data->state.authproblem = TRUE;
|
data->state.authproblem = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(checkprefix("Basic", start)) {
|
else
|
||||||
|
#endif
|
||||||
|
if(checkprefix("Basic", start)) {
|
||||||
*availp |= CURLAUTH_BASIC;
|
*availp |= CURLAUTH_BASIC;
|
||||||
authp->avail |= CURLAUTH_BASIC;
|
authp->avail |= CURLAUTH_BASIC;
|
||||||
if(authp->picked == CURLAUTH_BASIC) {
|
if(authp->picked == CURLAUTH_BASIC) {
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
#ifndef CURL_DISABLE_HTTP
|
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_CRYPTO_AUTH)
|
||||||
/* -- WIN32 approved -- */
|
/* -- WIN32 approved -- */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
|
#ifndef CURL_DISABLE_CRYPTO_AUTH
|
||||||
|
|
||||||
#ifndef USE_SSLEAY
|
#ifndef USE_SSLEAY
|
||||||
/* This code segment is only used if OpenSSL is not provided, as if it is
|
/* This code segment is only used if OpenSSL is not provided, as if it is
|
||||||
we use the MD5-function provided there instead. No good duplicating
|
we use the MD5-function provided there instead. No good duplicating
|
||||||
@ -346,3 +348,5 @@ void Curl_md5it(unsigned char *outbuffer, /* 16 bytes */
|
|||||||
MD5_Update(&ctx, input, strlen((char *)input));
|
MD5_Update(&ctx, input, strlen((char *)input));
|
||||||
MD5_Final(outbuffer, &ctx);
|
MD5_Final(outbuffer, &ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -250,7 +250,9 @@ CURLcode Curl_close(struct SessionHandle *data)
|
|||||||
}
|
}
|
||||||
Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
|
Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
|
||||||
|
|
||||||
|
#ifndef CURL_DISABLE_CRYPTO_AUTH
|
||||||
Curl_digest_cleanup(data);
|
Curl_digest_cleanup(data);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* free the connection cache */
|
/* free the connection cache */
|
||||||
|
Loading…
Reference in New Issue
Block a user