summaryrefslogtreecommitdiffstats
path: root/scan_ldapbindrequest.c
blob: a5e83429b484f8a491b36e0ca8c495770e13bd34 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#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!=CONTEXT_SPECIFIC || tt!=PRIMITIVE) return 0;
  }
  return res;
}