diff options
Diffstat (limited to 'scan_ldapbindresponse.c')
-rw-r--r-- | scan_ldapbindresponse.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/scan_ldapbindresponse.c b/scan_ldapbindresponse.c new file mode 100644 index 0000000..1161ab1 --- /dev/null +++ b/scan_ldapbindresponse.c @@ -0,0 +1,23 @@ +#include "ldap.h" + +size_t scan_ldapbindresponse(const char* src,const char* max, + unsigned long* result,struct string* matcheddn, + struct string* errormessage,struct string* referral) { + size_t res,tmp; + if (!(res=scan_asn1ENUMERATED(src,max,result))) return 0; + if (!(tmp=scan_ldapstring(src+res,max,matcheddn))) return 0; + res+=tmp; + if (src+res<max) { + if (!(tmp=scan_ldapstring(src+res,max,errormessage))) return 0; + res+=tmp; + } else { + errormessage->s=0; errormessage->l=0; + } + if (src+res<max) { + if (!(tmp=scan_ldapstring(src+res,max,referral))) return res; + res+=tmp; + } else { + referral->s=0; referral->l=0; + } + return res; +} |