summaryrefslogtreecommitdiff
path: root/ldap3/protocol/sasl/digestMd5.py
diff options
context:
space:
mode:
authorAndrej Shadura <andrew.shadura@collabora.co.uk>2020-11-30 12:16:10 +0100
committerAndrej Shadura <andrew.shadura@collabora.co.uk>2020-11-30 12:16:10 +0100
commitd7ea1d4c872a0ef39cce7a6bb6d2b9c9fd6c205e (patch)
tree509fcc27647de80e229c24babd4685ba04b45802 /ldap3/protocol/sasl/digestMd5.py
parent2bcee5c91d65796532aef1b15f6c8c0c16197aee (diff)
parent96fb2df0e33b34a4dbb75577de8589a8611759c4 (diff)
Update upstream source from tag 'upstream/2.8.1'
Update to upstream version '2.8.1' with Debian dir 4d1ac29b7ae225ca99fb367a07e2e8183bc94036
Diffstat (limited to 'ldap3/protocol/sasl/digestMd5.py')
-rw-r--r--ldap3/protocol/sasl/digestMd5.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ldap3/protocol/sasl/digestMd5.py b/ldap3/protocol/sasl/digestMd5.py
index 48235d6..520be3c 100644
--- a/ldap3/protocol/sasl/digestMd5.py
+++ b/ldap3/protocol/sasl/digestMd5.py
@@ -94,7 +94,7 @@ def sasl_digest_md5(connection, controls):
authz_id = connection.sasl_credentials[3].encode(charset) if connection.sasl_credentials[3] else b''
nonce = server_directives['nonce'].encode(charset)
cnonce = random_hex_string(16).encode(charset)
- uri = b'ldap/'
+ uri = b'ldap/' + connection.server.host.encode(charset)
qop = b'auth'
digest_response = b'username="' + user + b'",'
@@ -110,7 +110,7 @@ def sasl_digest_md5(connection, controls):
a0 = md5_h(b':'.join([user, realm, password]))
a1 = b':'.join([a0, nonce, cnonce, authz_id]) if authz_id else b':'.join([a0, nonce, cnonce])
- a2 = b'AUTHENTICATE:' + uri + (':00000000000000000000000000000000' if qop in [b'auth-int', b'auth-conf'] else b'')
+ a2 = b'AUTHENTICATE:' + uri + (b':00000000000000000000000000000000' if qop in [b'auth-int', b'auth-conf'] else b'')
digest_response += b'response="' + md5_hex(md5_kd(md5_hex(md5_h(a1)), b':'.join([nonce, b'00000001', cnonce, qop, md5_hex(md5_h(a2))]))) + b'"'