fmt_asn1generic, see t10.c for example usage) add "generic" asn.1 dumper (in t10.c) fix some read off-by-one errors, minor cleanups add real OID support add bitstring support
24 lines
679 B
C
24 lines
679 B
C
#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;
|
|
}
|