From bedd2e7ccb1595c23e159eaa952ae1b0b5a3d2ad Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Sat, 15 Mar 2014 01:49:50 +0100 Subject: Lean and mean initial commit Not much functionality yet --- scan_ldapbindrequest.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scan_ldapbindrequest.c (limited to 'scan_ldapbindrequest.c') diff --git a/scan_ldapbindrequest.c b/scan_ldapbindrequest.c new file mode 100644 index 0000000..0ce7e12 --- /dev/null +++ b/scan_ldapbindrequest.c @@ -0,0 +1,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!=PRIVATE || tt!=PRIMITIVE) return 0; + } + return res; +} -- cgit v1.2.3-55-g7522