summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2017-05-09 10:05:57 +0200
committerSimon Rettberg2017-05-09 10:05:57 +0200
commit8c081cb1fef6cdfdf4b3d42cc93e97d0d6a59d14 (patch)
tree890ea62f47af0a06db998142810851f618d27bca
parentDelete some more unused files (diff)
downloadldadp-8c081cb1fef6cdfdf4b3d42cc93e97d0d6a59d14.tar.gz
ldadp-8c081cb1fef6cdfdf4b3d42cc93e97d0d6a59d14.tar.xz
ldadp-8c081cb1fef6cdfdf4b3d42cc93e97d0d6a59d14.zip
Update tinyldap part
-rw-r--r--asn1.h2
-rw-r--r--bstrfirst.c2
-rw-r--r--bstrlen.c4
-rw-r--r--bstrstart.c2
-rw-r--r--fmt_asn1OID.c2
-rw-r--r--fmt_asn1bitstring.c2
-rw-r--r--fmt_asn1string.c2
-rw-r--r--fmt_asn1transparent.c2
-rw-r--r--fmt_ldapbindrequest.c4
-rw-r--r--fmt_ldapdeleterequest.c2
-rw-r--r--fmt_ldapresult.c2
-rw-r--r--fmt_ldapsearchfilterstring.c4
-rw-r--r--scan_ldapaddrequest.c4
-rw-r--r--scan_ldapmodifyrequest.c3
-rw-r--r--scan_ldapsearchfilter.c3
-rw-r--r--scan_ldapsearchrequest.c7
16 files changed, 24 insertions, 23 deletions
diff --git a/asn1.h b/asn1.h
index f74556e..56a2368 100644
--- a/asn1.h
+++ b/asn1.h
@@ -102,7 +102,7 @@ size_t fmt_asn1bitstring(char* dest,enum asn1_tagclass tc,enum asn1_tagtype tt,
/* write ASN.1 SET */
#define fmt_asn1SET(dest,l) fmt_asn1transparent(dest,UNIVERSAL,CONSTRUCTED,SET_OF,l)
-size_t fmt_asn1OID(char* dest,enum asn1_tagclass tc,enum asn1_tagtype tt,enum asn1_tag tag,const unsigned long* array,unsigned long len);
+size_t fmt_asn1OID(char* dest,enum asn1_tagclass tc,enum asn1_tagtype tt,enum asn1_tag tag,const size_t* array,size_t len);
/* conventions for the parser routines:
diff --git a/bstrfirst.c b/bstrfirst.c
index 4d8ab02..6039e14 100644
--- a/bstrfirst.c
+++ b/bstrfirst.c
@@ -1,5 +1,5 @@
#include "bstr.h"
-#include "uint32.h"
+#include <uint32.h>
const char* bstrfirst(const char* a) {
if (*a) return a; else return a+5;
diff --git a/bstrlen.c b/bstrlen.c
index 61825d5..58fe21a 100644
--- a/bstrlen.c
+++ b/bstrlen.c
@@ -1,7 +1,7 @@
#include <string.h>
#include "bstr.h"
-#include "uint32.h"
-#include "str.h"
+#include <uint32.h>
+#include <str.h>
size_t bstrlen(const char* a) {
if (*a) return str_len(a); else return uint32_read(a+1);
diff --git a/bstrstart.c b/bstrstart.c
index 5094d34..7c18418 100644
--- a/bstrstart.c
+++ b/bstrstart.c
@@ -1,5 +1,5 @@
#include "bstr.h"
-#include "uint32.h"
+#include <uint32.h>
size_t bstrstart(const char* a) {
if (*a) return 0; else return 5;
diff --git a/fmt_asn1OID.c b/fmt_asn1OID.c
index 6f6fc10..89382e6 100644
--- a/fmt_asn1OID.c
+++ b/fmt_asn1OID.c
@@ -1,6 +1,6 @@
#include "asn1.h"
-size_t fmt_asn1OID(char* dest,enum asn1_tagclass tc,enum asn1_tagtype tt,enum asn1_tag tag,const unsigned long* array,unsigned long len) {
+size_t fmt_asn1OID(char* dest,enum asn1_tagclass tc,enum asn1_tagtype tt,enum asn1_tag tag,const size_t* array,size_t len) {
size_t i,l,l2;
if (len<2) return 0;
for (l=1,i=2; i<len; ++i) {
diff --git a/fmt_asn1bitstring.c b/fmt_asn1bitstring.c
index 18df19d..c65a75f 100644
--- a/fmt_asn1bitstring.c
+++ b/fmt_asn1bitstring.c
@@ -1,5 +1,5 @@
#include "asn1.h"
-#include "byte.h"
+#include <byte.h>
/* like fmt_asn1string, but l is in BITS, not BYTES */
size_t fmt_asn1bitstring(char* dest,enum asn1_tagclass tc,enum asn1_tagtype tt,enum asn1_tag tag,const char* c,size_t l) {
diff --git a/fmt_asn1string.c b/fmt_asn1string.c
index e0ef6ac..1fab77f 100644
--- a/fmt_asn1string.c
+++ b/fmt_asn1string.c
@@ -1,5 +1,5 @@
#include "asn1.h"
-#include "byte.h"
+#include <byte.h>
size_t fmt_asn1string(char* dest,enum asn1_tagclass tc,enum asn1_tagtype tt,enum asn1_tag tag,const char* c,size_t l) {
size_t len;
diff --git a/fmt_asn1transparent.c b/fmt_asn1transparent.c
index d1f9895..d0ccd41 100644
--- a/fmt_asn1transparent.c
+++ b/fmt_asn1transparent.c
@@ -1,5 +1,5 @@
#include "asn1.h"
-#include "byte.h"
+#include <byte.h>
size_t fmt_asn1transparent(char* dest,enum asn1_tagclass tc,enum asn1_tagtype tt,enum asn1_tag tag,size_t l) {
size_t len,tmp;
diff --git a/fmt_ldapbindrequest.c b/fmt_ldapbindrequest.c
index 531f152..a5d2e18 100644
--- a/fmt_ldapbindrequest.c
+++ b/fmt_ldapbindrequest.c
@@ -1,7 +1,7 @@
#include <string.h>
#include "ldap.h"
#include <str.h>
-#include "rangecheck.h"
+#include <rangecheck.h>
size_t fmt_ldapbindrequest(char* dest,long version,const char* name,const char* simple) {
size_t l,sum;
@@ -15,7 +15,6 @@ size_t fmt_ldapbindrequest(char* dest,long version,const char* name,const char*
nlen=str_len(simple);
l=fmt_asn1string(dest,PRIVATE,PRIMITIVE,0,simple,nlen);
if (add_of(sum,sum,l)) return (size_t)-1;
- if (dest) dest+=l;
return sum;
}
@@ -29,6 +28,5 @@ size_t fmt_ldapbindrequeststring(char* dest,long version,const struct string* na
// 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;
}
diff --git a/fmt_ldapdeleterequest.c b/fmt_ldapdeleterequest.c
index 7690996..0775c88 100644
--- a/fmt_ldapdeleterequest.c
+++ b/fmt_ldapdeleterequest.c
@@ -1,6 +1,6 @@
#include <string.h>
#include "ldap.h"
-#include "byte.h"
+#include <byte.h>
size_t fmt_ldapdeleterequest(char* dest,const struct string* s) {
if (dest) byte_copy(dest,s->l,s->s);
diff --git a/fmt_ldapresult.c b/fmt_ldapresult.c
index b573089..6d2b79d 100644
--- a/fmt_ldapresult.c
+++ b/fmt_ldapresult.c
@@ -14,7 +14,7 @@ size_t fmt_ldapresult(char* dest,long result,const char* matcheddn,const char* e
if (referral && *referral) {
nlen=str_len(referral);
l=fmt_asn1OCTETSTRING(dest,referral,nlen);
- sum+=l; if (dest) dest+=l;
+ sum+=l;
}
return sum;
}
diff --git a/fmt_ldapsearchfilterstring.c b/fmt_ldapsearchfilterstring.c
index cd53ea3..71fe998 100644
--- a/fmt_ldapsearchfilterstring.c
+++ b/fmt_ldapsearchfilterstring.c
@@ -1,5 +1,5 @@
-#include "fmt.h"
-#include "byte.h"
+#include <fmt.h>
+#include <byte.h>
#include <str.h>
#include "ldap.h"
diff --git a/scan_ldapaddrequest.c b/scan_ldapaddrequest.c
index 9fb4b1d..d311324 100644
--- a/scan_ldapaddrequest.c
+++ b/scan_ldapaddrequest.c
@@ -1,7 +1,7 @@
#include <stdlib.h>
#include "ldap.h"
-#include "buffer.h"
-#include "byte.h"
+#include <buffer.h>
+#include <byte.h>
#if 0
AddRequest ::= [APPLICATION 8] SEQUENCE {
diff --git a/scan_ldapmodifyrequest.c b/scan_ldapmodifyrequest.c
index 832d629..8372908 100644
--- a/scan_ldapmodifyrequest.c
+++ b/scan_ldapmodifyrequest.c
@@ -28,7 +28,8 @@ size_t scan_ldapmodifyrequest(const char* src,const char* max,struct ModifyReque
max=src+res+oslen;
if (src+res>=max) goto error; /* need at least one record */
do {
- size_t islen, etmp;
+ size_t islen;
+ unsigned long etmp;
if (last) {
struct Modification* cur;
if (!(cur=malloc(sizeof(struct Modification)))) goto error;
diff --git a/scan_ldapsearchfilter.c b/scan_ldapsearchfilter.c
index 1a08141..0f3eb02 100644
--- a/scan_ldapsearchfilter.c
+++ b/scan_ldapsearchfilter.c
@@ -32,7 +32,8 @@
size_t scan_ldapsearchfilter(const char* src,const char* max,struct Filter** f) {
enum asn1_tagclass tc;
enum asn1_tagtype tt;
- size_t tag,len,res,tmp;
+ size_t len,res,tmp;
+ unsigned long tag;
const char* nmax;
*f=0;
if (!(res=scan_asn1tag(src,max,&tc,&tt,&tag))) goto error;
diff --git a/scan_ldapsearchrequest.c b/scan_ldapsearchrequest.c
index 3261b45..f8a366b 100644
--- a/scan_ldapsearchrequest.c
+++ b/scan_ldapsearchrequest.c
@@ -7,6 +7,7 @@ size_t scan_ldapsearchrequest(const char* src,const char* max,
size_t res,tmp;
unsigned long etmp;
signed long ltmp;
+ size_t stmp;
s->attributes=0;
s->filter=0;
if (!(res=scan_ldapstring(src,max,&s->baseObject))) goto error;
@@ -27,10 +28,10 @@ size_t scan_ldapsearchrequest(const char* src,const char* max,
if (!(tmp=scan_ldapsearchfilter(src+res,max,&s->filter))) goto error;
res+=tmp;
/* now for the attributelist */
- if (!(tmp=scan_asn1SEQUENCE(src+res,max,&etmp))) goto error;
+ if (!(tmp=scan_asn1SEQUENCE(src+res,max,&stmp))) goto error;
res+=tmp;
{
- const char* nmax=src+res+etmp;
+ const char* nmax=src+res+stmp;
//#define nmax max
struct AttributeDescriptionList** a=&s->attributes;
if (nmax>max) goto error;
@@ -39,7 +40,7 @@ size_t scan_ldapsearchrequest(const char* src,const char* max,
if (src+res==nmax) break;
if (!*a) *a=calloc(1,sizeof(struct AttributeDescriptionList));
if (!*a) goto error;
- if (!(tmp=scan_ldapstring(src+res,nmax,&(*a)->a))) { free(*a); *a=0; goto error; }
+ if (!(tmp=scan_ldapstring(src+res,nmax,&(*a)->a))) { goto error; }
res+=tmp;
a=&(*a)->next;
}