summaryrefslogtreecommitdiff
path: root/usr.sbin/ldapd
diff options
context:
space:
mode:
authorrob <rob@cvs.openbsd.org>2018-06-27 13:22:18 +0000
committerrob <rob@cvs.openbsd.org>2018-06-27 13:22:18 +0000
commit54034ca4b88d51aca69a9cc9682a7b1981323de3 (patch)
tree67f9a9e0a29a7605e8ed57a6e6168786df1d25d1 /usr.sbin/ldapd
parent82aad79f5b94b07c4c1d0444fbd4a389e6d93456 (diff)
Synchronize correct processing of BER_TYPE_EOC. Fixes support for empty LDAP
passwords. A similar fix was applied to snmpd in 2010 (rev 1.23). Pointers from Reyk. Ok claudio@
Diffstat (limited to 'usr.sbin/ldapd')
-rw-r--r--usr.sbin/ldapd/ber.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ldapd/ber.c b/usr.sbin/ldapd/ber.c
index 02d1b7d2020..2a3988db5ce 100644
--- a/usr.sbin/ldapd/ber.c
+++ b/usr.sbin/ldapd/ber.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ber.c,v 1.13 2018/02/08 18:02:06 jca Exp $ */
+/* $OpenBSD: ber.c,v 1.14 2018/06/27 13:22:17 rob Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@vantronix.net>
@@ -874,7 +874,8 @@ ber_calc_len(struct ber_element *root)
size += ber_calc_len(root->be_next);
/* This is an empty element, do not use a minimal size */
- if (root->be_type == BER_TYPE_EOC && root->be_len == 0)
+ if (root->be_class == BER_CLASS_UNIVERSAL &&
+ root->be_type == BER_TYPE_EOC && root->be_len == 0)
return (0);
return (root->be_len + size);