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
18 lines
515 B
C
18 lines
515 B
C
#include "ldap.h"
|
|
|
|
size_t scan_ldapbindrequest(const char* src,const char* max,
|
|
unsigned long* version,struct string* name,
|
|
unsigned long* method) {
|
|
size_t res,tmp;
|
|
if (!(res=scan_asn1INTEGER(src,max,(signed long*)version))) return 0;
|
|
if (!(tmp=scan_ldapstring(src+res,max,name))) return 0;
|
|
res+=tmp;
|
|
{
|
|
enum asn1_tagclass tc;
|
|
enum asn1_tagtype tt;
|
|
if (!(tmp=scan_asn1tag(src+res,max,&tc,&tt,method))) return 0;
|
|
if (tc!=PRIVATE || tt!=PRIMITIVE) return 0;
|
|
}
|
|
return res;
|
|
}
|