summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2016-09-10 19:12:46 +0000
committerjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2016-09-10 19:12:46 +0000
commit93c4cb8ffab8bd76fa95545777d0bb1beae23e55 (patch)
tree7b033193d5d5cf6fd4c98fd047da2ae7866c192d /src
parent26889a1b940dfafe6d3673e2ef8446c4dcdf97f8 (diff)
downloadneon-93c4cb8ffab8bd76fa95545777d0bb1beae23e55.tar.gz
* src/ne_md5.h: Allow ne_md5_create_ctx to return NULL.
* src/ne_auth.c (auth_register): Disable Digest support without MD5 support. * test/auth.c (make_digest): Don't crash in above case. * test/util-tests.c (digest_md5, md5_alignment): Likewise. git-svn-id: http://svn.webdav.org/repos/projects/neon/trunk@1970 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Diffstat (limited to 'src')
-rw-r--r--src/ne_auth.c12
-rw-r--r--src/ne_md5.h4
2 files changed, 15 insertions, 1 deletions
diff --git a/src/ne_auth.c b/src/ne_auth.c
index 48a0cb5..96f34d3 100644
--- a/src/ne_auth.c
+++ b/src/ne_auth.c
@@ -1616,6 +1616,18 @@ static void auth_register(ne_session *sess, int isproxy, unsigned protomask,
protomask |= NE_AUTH_GSSAPI_ONLY | NE_AUTH_SSPI;
}
+ if (protomask | NE_AUTH_DIGEST) {
+ struct ne_md5_ctx *ctx = ne_md5_create_ctx();
+
+ if (ctx) {
+ ne_md5_destroy_ctx(ctx);
+ }
+ else {
+ NE_DEBUG(NE_DBG_HTTPAUTH, "auth: Disabling Digest support without MD5.\n");
+ protomask &= ~NE_AUTH_DIGEST;
+ }
+ }
+
ahs = ne_get_session_private(sess, id);
if (ahs == NULL) {
ahs = ne_calloc(sizeof *ahs);
diff --git a/src/ne_md5.h b/src/ne_md5.h
index 9a625bc..cb850bf 100644
--- a/src/ne_md5.h
+++ b/src/ne_md5.h
@@ -34,7 +34,9 @@ NE_BEGIN_DECLS
*/
struct ne_md5_ctx;
-/* Create structure containing state of computation. */
+/* Create structure containing state of computation. Can return NULL
+ * if the MD5 algorithm is prohibited (such as FIPS-enabled
+ * systems). */
extern struct ne_md5_ctx *ne_md5_create_ctx(void);
/* Starting with the result of former calls of this function (or the