summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2014-03-18 19:34:04 +0100
committerSimon Rettberg2014-03-18 19:34:04 +0100
commit9defb2a22ceaeccb9bdd25e9ac65ee997a077c36 (patch)
treec94357531eb544c467ed754645321158d51d5f37
parentclan config (for address sanitizer use) (diff)
downloadldadp-9defb2a22ceaeccb9bdd25e9ac65ee997a077c36.tar.gz
ldadp-9defb2a22ceaeccb9bdd25e9ac65ee997a077c36.tar.xz
ldadp-9defb2a22ceaeccb9bdd25e9ac65ee997a077c36.zip
(Forgot commit) Add fmt_ldapbindrequeststring that takes struct string as arguments
-rw-r--r--fmt_ldapbindrequest.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fmt_ldapbindrequest.c b/fmt_ldapbindrequest.c
index 5e92bf2..b95c5f4 100644
--- a/fmt_ldapbindrequest.c
+++ b/fmt_ldapbindrequest.c
@@ -16,3 +16,15 @@ size_t fmt_ldapbindrequest(char* dest,long version,const char* name,const char*
if (add_of(sum,sum,l)) return (size_t)-1; if (dest) dest+=l;
return sum;
}
+
+size_t fmt_ldapbindrequeststring(char* dest,long version,const struct string* name,const struct string* simple) {
+ size_t l,sum;
+ sum=l=fmt_asn1INTEGER(dest,version);
+ if (dest) dest+=l;
+ l=fmt_asn1OCTETSTRING(dest,name->s,name->l);
+ if (add_of(sum,sum,l)) return (size_t)-1; if (dest) dest+=l;
+// sum+=l; if (dest) dest+=l;
+ l=fmt_asn1string(dest,PRIVATE,PRIMITIVE,0,simple->s,simple->l);
+ if (add_of(sum,sum,l)) return (size_t)-1; if (dest) dest+=l;
+ return sum;
+}