From b6789e75f24b2942fc4cc794d8ccf14693325cd3 Mon Sep 17 00:00:00 2001 From: mguessan Date: Wed, 3 Aug 2011 19:44:22 +0000 Subject: [PATCH] LDAP: send error on DIGEST-MD5 bind request git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1755 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/ldap/LdapConnection.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/java/davmail/ldap/LdapConnection.java b/src/java/davmail/ldap/LdapConnection.java index c5688e5c..5613f1c0 100644 --- a/src/java/davmail/ldap/LdapConnection.java +++ b/src/java/davmail/ldap/LdapConnection.java @@ -508,7 +508,13 @@ public class LdapConnection extends AbstractConnection { reqBer.parseSeq(null); ldapVersion = reqBer.parseInt(); userName = reqBer.parseString(isLdapV3()); - password = reqBer.parseStringWithTag(Ber.ASN_CONTEXT, isLdapV3(), null); + if (reqBer.peekByte() == (Ber.ASN_CONTEXT | Ber.ASN_CONSTRUCTOR | 3)) { + reqBer.parseSeq(null); + String mechanism = reqBer.parseString(isLdapV3()); + throw new IOException("Unsupported authentication mechanism: "+mechanism); + } else { + password = reqBer.parseStringWithTag(Ber.ASN_CONTEXT, isLdapV3(), null); + } if (userName.length() > 0 && password.length() > 0) { DavGatewayTray.debug(new BundleMessage("LOG_LDAP_REQ_BIND_USER", currentMessageId, userName));