diff --git a/Makefile b/Makefile index 70d826b..20d6992 100644 --- a/Makefile +++ b/Makefile @@ -173,5 +173,8 @@ asn1oid.o: asn1oid.c asn1.h ldap_match_sre.o: ldap_match_sre.c ldap.h +privatekey.pem: + openssl genrsa -out $@ + windoze: $(MAKE) DIET= CROSS=i686-mingw32- asn1dump diff --git a/scan_certificate.c b/scan_certificate.c index 33f70e8..6107782 100644 --- a/scan_certificate.c +++ b/scan_certificate.c @@ -26,6 +26,16 @@ struct x509cert { struct x509signature sig; }; +struct rsaprivatekey { + size_t* modulus,* publicExponent,* privateExponent,* prime1,* prime2,* exponent1,* exponent2,* coefficient; + struct string otherPrimeInfos; + size_t* freewhendone; +}; + +struct dsaprivatekey { +} + + void printasn1(const char* buf,const char* max); static int findindn(struct string* dn,enum x509_oid id,struct string* dest) { @@ -113,12 +123,6 @@ parseerror: return l; } -struct rsaprivatekey { - size_t* modulus,* publicExponent,* privateExponent,* prime1,* prime2,* exponent1,* exponent2,* coefficient; - struct string otherPrimeInfos; - size_t* freewhendone; -}; - size_t scan_rsaprivatekey(const char* cert, size_t l, struct rsaprivatekey* C, char** freewhendone) { char* c; size_t maxdigits,ret; diff --git a/scan_ldapsearchfilter.c b/scan_ldapsearchfilter.c index 895034f..a6016fa 100644 --- a/scan_ldapsearchfilter.c +++ b/scan_ldapsearchfilter.c @@ -39,17 +39,17 @@ size_t scan_ldapsearchfilter(const char* src,const char* max,struct Filter** f) if (tc!=PRIVATE || (tt!=CONSTRUCTED && tag!=7) || tag>9) goto error; if (!(tmp=scan_asn1length(src+res,max,&len))) goto error; res+=tmp; - if (src+res+len>=max) goto error; + nmax=src+res+len; + if (nmax>max) goto error; if (!(*f=malloc(sizeof(struct Filter)))) goto error; (*f)->next=0; (*f)->x=0; (*f)->substrings=0; - nmax=src+res+len; switch ((*f)->type=tag) { case 0: /* and [0] SET OF Filter, */ case 1: /* or [1] SET OF Filter, */ (*f)->x=0; - while (src+resx; if (!(tmp=scan_ldapsearchfilter(src+res,nmax,&(*f)->x))) { if (F) { /* OK, end of sequence */