change #include to move foo.h to libowfat/foo.h (needs current libowfat now)

This commit is contained in:
leitner
2017-04-21 16:23:38 +00:00
parent 5664e1796a
commit 1d95650489
56 changed files with 183 additions and 164 deletions

View File

@@ -1,7 +1,7 @@
#DEBUG=1
#COVERAGE=1
all: t1 t2 parse dumpidx idx2ldif addindex bindrequest tinyldap \
all: libowfat-warning t1 t2 parse dumpidx idx2ldif addindex bindrequest tinyldap \
tinyldap_standalone tinyldap_debug ldapclient ldapclient_str \
md5password mysql2ldif acl dumpacls ldapdelete asn1dump tls.a x # t6 # t
@@ -76,6 +76,14 @@ endif
%: %.c
$(DIET) $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lowfat ${LIBS}
.PHONY: libowfat-warning
libowfat-warning:
@echo "#include <textcode.h>" > a.c
@($(DIET) $(CC) $(CFLAGS) -c a.c >/dev/null 2>&1 && echo "WARNING: libowfat has moved the header files from foo.h to libowfat/foo.h\nWARNING: you still have foo.h! Please update your libowfat!") || exit 0
@echo "#include <libowfat/textcode.h>" > a.c
@$(DIET) $(CC) $(CFLAGS) -c a.c >/dev/null 2>&1 || echo "WARNING: this package needs libowfat; get it from https://www.fefe.de/libowfat/"
@rm -f a.c a.o
t1 parse: ldif.a storage.a
t2: ldap.a asn1.a
t3 t4 t5 addindex: storage.a

2
THANKS
View File

@@ -18,3 +18,5 @@ At least one of them looks like it might be exploitable if you are not
using dietlibc.
Georg Lehner found problems in the indexing code.
Simon Rettberg found a double free in an error path.

39
acl.c
View File

@@ -2,20 +2,20 @@
#define MAIN
#include "ldap.h"
#include <buffer.h>
#include <stralloc.h>
#include <str.h>
#include <uint32.h>
#include <libowfat/buffer.h>
#include <libowfat/stralloc.h>
#include <libowfat/str.h>
#include <string.h>
#include <errmsg.h>
#include <fmt.h>
#include <byte.h>
#include <mmap.h>
#include <case.h>
#include <uint16.h>
#include <uint32.h>
#include <open.h>
#include <libowfat/errmsg.h>
#include <libowfat/fmt.h>
#include <libowfat/byte.h>
#include <libowfat/mmap.h>
#include <libowfat/case.h>
#include <libowfat/uint16.h>
#include <libowfat/uint32.h>
#include <libowfat/open.h>
#include <unistd.h>
#include <assert.h>
const char Any[]="*";
const char Self[]="self";
@@ -306,6 +306,11 @@ int marshal(const char* map,size_t filelen,const char* filename) {
buffer_putulong(buffer_1,filters);
buffer_putsflush(buffer_1," filters.\n");
if (acls==0) {
buffer_putsflush(buffer_1,"No ACLs defined. We are done here.\n");
exit(0);
}
F=malloc(sizeof(*F)*(filters+1));
filter_offset=filelen+(filters+4)*sizeof(*F); /* 2 uints for index header, 1 uint filters_count, then filter_count+1 uint32 in F */
@@ -332,6 +337,11 @@ nomem:
}
attribute_count=uint32_read(map+4);
attrtab=5*4+uint32_read(map+16);
if (attribute_count == 0) {
buffer_putsflush(buffer_2,"malformed data file (attribute_count zero!?)\n");
exit(1);
}
/* here we need to have each attribute mentioned in any ACL
* point to the proper offset in the data file. But what if an ACL
* mentions an attribute that never occurs in any of the records? In
@@ -345,7 +355,7 @@ nomem:
for (a=root; a; a=a->next) {
unsigned int l=0;
// printf("a->anum = %lu\nsizeof(*a->attrs) = %lu\n",a->anum,sizeof(*a->attrs));
if (!(a->attrs=malloc(a->anum*sizeof(*a->attrs))))
if (!(a->attrs=calloc(a->anum,sizeof(*a->attrs))))
goto nomem;
a->attrs[l]=a->attrib; ++l;
if (a->attrib!=Any) {
@@ -354,6 +364,7 @@ nomem:
a->attrib[k]=0;
a->attrs[l]=a->attrib+k+1;
}
assert(l==a->anum); // this is for the benefit of clang's static analyzer
for (k=0; k<a->anum; ++k) {
int found=0;
for (j=0; j<attribute_count; ++j) {
@@ -457,6 +468,7 @@ nomem:
y.len); /* marshalled acls */
if (write(fd,tmp,8)!=8) {
shortwrite:
free(A); free(F);
ftruncate(fd,filelen);
close(fd);
diesys(1,"short write");
@@ -481,6 +493,7 @@ shortwrite:
/* write marshalled acl data */
if (write(fd,y.s,y.len) != (ssize_t)y.len) goto shortwrite;
}
free(A); free(F);
close(fd);
return 0;
}

View File

@@ -5,11 +5,11 @@
#include <string.h>
#include <strings.h>
#include <errno.h>
#include "buffer.h"
#include "mmap.h"
#include "uint32.h"
#include <libowfat/buffer.h>
#include <libowfat/mmap.h>
#include <libowfat/uint32.h>
#include "mstorage.h"
#include <errmsg.h>
#include <libowfat/errmsg.h>
#include <ctype.h>
#include <stdlib.h>

View File

@@ -1,8 +1,8 @@
#include <stdio.h>
#include <byte.h>
#include <libowfat/byte.h>
#include <stdlib.h>
#include "asn1.h"
#include "mmap.h"
#include <libowfat/mmap.h>
#include <ctype.h>
#include "printasn1.c"

6
auth.c
View File

@@ -14,9 +14,9 @@
#include <string.h>
#include "ldap.h"
#include "auth.h"
#include "str.h"
#include "textcode.h"
#include "byte.h"
#include <libowfat/str.h>
#include <libowfat/textcode.h>
#include <libowfat/byte.h>
int check_password(const char* fromdb,struct string* plaintext) {
if (str_start(fromdb,"{MD5}")) {

View File

@@ -1,6 +1,6 @@
#include <string.h>
#include "str.h"
#include "uint32.h"
#include <libowfat/str.h>
#include <libowfat/uint32.h>
int bstr_diff(const char* a,const char* b) {
const char* A,* B;

View File

@@ -1,6 +1,6 @@
#include <string.h>
#include "str.h"
#include "uint32.h"
#include <libowfat/str.h>
#include <libowfat/uint32.h>
#include "bstr.h"
int bstr_diff2(const char* a,const char* b,size_t blen) {

View File

@@ -1,5 +1,5 @@
#include "bstr.h"
#include "uint32.h"
#include <libowfat/uint32.h>
const char* bstrfirst(const char* a) {
if (*a) return a; else return a+5;

View File

@@ -1,7 +1,7 @@
#include <string.h>
#include "bstr.h"
#include "uint32.h"
#include "str.h"
#include <libowfat/uint32.h>
#include <libowfat/str.h>
size_t bstrlen(const char* a) {
if (*a) return str_len(a); else return uint32_read(a+1);

View File

@@ -1,5 +1,5 @@
#include "bstr.h"
#include "uint32.h"
#include <libowfat/uint32.h>
size_t bstrstart(const char* a) {
if (*a) return 0; else return 5;

View File

@@ -1,11 +1,11 @@
#include <stdlib.h>
#include <assert.h>
#include "buffer.h"
#include "mmap.h"
#include "uint16.h"
#include "uint32.h"
#include <libowfat/buffer.h>
#include <libowfat/mmap.h>
#include <libowfat/uint16.h>
#include <libowfat/uint32.h>
#include "ldap.h"
#include "byte.h"
#include <libowfat/byte.h>
int main(int argc,char* argv[]) {
unsigned long filelen;

View File

@@ -1,7 +1,7 @@
#include <stdlib.h>
#include "buffer.h"
#include "mmap.h"
#include "uint32.h"
#include <libowfat/buffer.h>
#include <libowfat/mmap.h>
#include <libowfat/uint32.h>
int main(int argc,char* argv[]) {
int verbose=0;

View File

@@ -1,5 +1,5 @@
#include "asn1.h"
#include "byte.h"
#include <libowfat/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) {

View File

@@ -1,5 +1,5 @@
#include "asn1.h"
#include "byte.h"
#include <libowfat/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;

View File

@@ -1,5 +1,5 @@
#include "asn1.h"
#include "byte.h"
#include <libowfat/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;

View File

@@ -1,7 +1,7 @@
#include <string.h>
#include "ldap.h"
#include "str.h"
#include "rangecheck.h"
#include <libowfat/str.h>
#include <libowfat/rangecheck.h>
size_t fmt_ldapbindrequest(char* dest,long version,const char* name,const char* simple) {
size_t l,sum;
@@ -15,6 +15,5 @@ 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;
}

View File

@@ -1,6 +1,6 @@
#include <string.h>
#include "ldap.h"
#include "byte.h"
#include <libowfat/byte.h>
size_t fmt_ldapdeleterequest(char* dest,const struct string* s) {
if (dest) byte_copy(dest,s->l,s->s);

View File

@@ -1,5 +1,5 @@
#include "ldap.h"
#include "str.h"
#include <libowfat/str.h>
size_t fmt_ldapresult(char* dest,long result,const char* matcheddn,const char* errormessage,const char* referral) {
size_t l,sum=0,nlen;
@@ -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;
}

View File

@@ -1,4 +1,4 @@
#include <byte.h>
#include <libowfat/byte.h>
#include "ldap.h"
#include <stdlib.h>

View File

@@ -1,6 +1,6 @@
#include "fmt.h"
#include "byte.h"
#include "str.h"
#include <libowfat/fmt.h>
#include <libowfat/byte.h>
#include <libowfat/str.h>
#include "ldap.h"
size_t fmt_ldapsearchfilterstring(char* dest,const struct Filter* f) {

View File

@@ -1,7 +1,8 @@
#include "tinytls.h"
#include "uint16.h"
#include "uint32.h"
#include <libowfat/uint16.h>
#include <libowfat/uint32.h>
#include <time.h>
#include <string.h>
size_t fmt_tls_clienthello(char* dest, struct ssl_context* sc) {
size_t hnextlen=sc->servername?strlen(sc->servername)+9:0;

View File

@@ -1,5 +1,5 @@
#include "tinytls.h"
#include "uint16.h"
#include <libowfat/uint16.h>
size_t fmt_tls_packet(char* dest,enum contenttype ct, size_t len) {
if (len>0xffff) return 0;

View File

@@ -1,5 +1,5 @@
#include "uint16.h"
#include "uint32.h"
#include <libowfat/uint16.h>
#include <libowfat/uint32.h>
#include "tinytls.h"
#include <stdio.h>
#include <string.h>
@@ -115,7 +115,7 @@ invalid:
sc->compressionmethod=0;
if (hostlen!=-1) {
char* sn;
if (!(sn=malloc(hostlen+1))) {
if ((sn=malloc(hostlen+1))) {
memcpy(sn,host,hostlen);
sn[hostlen]=0;
sc->servername=sn;

View File

@@ -1,11 +1,11 @@
#include <alloca.h>
#include <ctype.h>
#include <stdlib.h>
#include "buffer.h"
#include "mmap.h"
#include "uint32.h"
#include <libowfat/buffer.h>
#include <libowfat/mmap.h>
#include <libowfat/uint32.h>
#include "bstr.h"
#include "textcode.h"
#include <libowfat/textcode.h>
#include <assert.h>
static void dumpbstr(const char* c) {

View File

@@ -1,6 +1,7 @@
#include "tinytls.h"
#include "open.h"
#include <libowfat/open.h>
#include <unistd.h>
#include <string.h>
void init_tls_context_norandom(struct ssl_context* sc, const char* servername) {
memset(sc,0,sizeof *sc);

View File

@@ -1,8 +1,8 @@
#include "ldif.h"
#include "byte.h"
#include "str.h"
#include "uint32.h"
#include "case.h"
#include <libowfat/byte.h>
#include <libowfat/str.h>
#include <libowfat/uint32.h>
#include <libowfat/case.h>
#include <ctype.h>
#include <unistd.h>
#include <stdio.h>

View File

@@ -1,7 +1,7 @@
#include <unistd.h>
#include "ldap.h"
#include "byte.h"
#include "case.h"
#include <libowfat/byte.h>
#include <libowfat/case.h>
#include <ctype.h>
static int matchcasestr(struct string* a,struct string* b) {

View File

@@ -2,13 +2,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "byte.h"
#include "buffer.h"
#include <libowfat/byte.h>
#include <libowfat/buffer.h>
#include "ldap.h"
#include "socket.h"
#include "ip4.h"
#include "str.h"
#include "textcode.h"
#include <libowfat/socket.h>
#include <libowfat/ip4.h>
#include <libowfat/str.h>
#include <libowfat/textcode.h>
#include <fcntl.h>
#include <sys/socket.h>
@@ -254,7 +254,7 @@ nextmessage:
/* copy partial message */
copypartialandcontinue:
byte_copy(buf,len-cur,buf+cur);
len-=cur; cur=0;
len-=cur;
}
}

View File

@@ -1,13 +1,13 @@
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include "byte.h"
#include "buffer.h"
#include <libowfat/byte.h>
#include <libowfat/buffer.h>
#include "ldap.h"
#include "socket.h"
#include "ip4.h"
#include "str.h"
#include "open.h"
#include <libowfat/socket.h>
#include <libowfat/ip4.h>
#include <libowfat/str.h>
#include <libowfat/open.h>
#define BUFSIZE 8192

View File

@@ -2,13 +2,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "byte.h"
#include "buffer.h"
#include <libowfat/byte.h>
#include <libowfat/buffer.h>
#include "ldap.h"
#include "socket.h"
#include "ip4.h"
#include "str.h"
#include "textcode.h"
#include <libowfat/socket.h>
#include <libowfat/ip4.h>
#include <libowfat/str.h>
#include <libowfat/textcode.h>
#include <fcntl.h>
#include <sys/socket.h>
@@ -41,11 +41,6 @@ int main(int argc,char* argv[]) {
int sock;
char buf[BUFSIZE];
int len=0;
char* me;
if ((me=strrchr(argv[0],'/')))
++me;
else
me=argv[0];
if (argc<2) {
usage:

View File

@@ -1,19 +1,19 @@
#define _FILE_OFFSET_BITS 64
#include <alloca.h>
#include <buffer.h>
#include <scan.h>
#include <open.h>
#include <libowfat/buffer.h>
#include <libowfat/scan.h>
#include <libowfat/open.h>
#include <unistd.h>
#include <stdlib.h>
#include <ctype.h>
#include "mduptab.h"
#include "mstorage.h"
#include "str.h"
#include <libowfat/str.h>
#include "ldif.h"
#include "byte.h"
#include "textcode.h"
#include "stralloc.h"
#include "uint32.h"
#include <libowfat/byte.h>
#include <libowfat/textcode.h>
#include <libowfat/stralloc.h>
#include <libowfat/uint32.h>
mduptab_t attributes,classes;
mstorage_t stringtable;

View File

@@ -1,7 +1,7 @@
#include <string.h>
#include "case.h"
#include <libowfat/case.h>
#include "ldif.h"
#include "str.h"
#include <libowfat/str.h>
/* behave like strcmp, but also return 0 if s is a prefix of c. */
int matchcaseprefix(struct string* s,const char* c) {

View File

@@ -1,4 +1,4 @@
#include "case.h"
#include <libowfat/case.h>
#include "bstr.h"
#include "ldif.h"

View File

@@ -1,4 +1,4 @@
#include "byte.h"
#include <libowfat/byte.h>
#include "ldif.h"
#include "bstr.h"

View File

@@ -1,4 +1,4 @@
#include "byte.h"
#include <libowfat/byte.h>
#include "bstr.h"
#include "ldif.h"

View File

@@ -8,9 +8,9 @@
#define MD5Final MD5_Final
#endif
#include <string.h>
#include "buffer.h"
#include "str.h"
#include "textcode.h"
#include <libowfat/buffer.h>
#include <libowfat/str.h>
#include <libowfat/textcode.h>
int main(int argc,char* argv[]) {
unsigned char digest[17];

View File

@@ -1,10 +1,10 @@
#include <stdlib.h>
#include <string.h>
#include "str.h"
#include <libowfat/str.h>
#include "bstr.h"
#include "mstorage.h"
#include "mduptab.h"
#include "uint32.h"
#include <libowfat/uint32.h>
long mduptab_add(mduptab_t* t,const char* s,size_t len) {
unsigned int i;

View File

@@ -1,6 +1,6 @@
#include "mstorage.h"
#include "mduptab.h"
#include "str.h"
#include <libowfat/str.h>
long mduptab_adds(mduptab_t* t,const char* s) {
return mduptab_add(t,s,str_len(s));

View File

@@ -5,7 +5,7 @@
#include <fcntl.h>
#include <sys/shm.h>
#include <stdio.h>
#include "byte.h"
#include <libowfat/byte.h>
#include "mstorage.h"
#ifndef PAGE_SIZE

View File

@@ -1,4 +1,4 @@
#include "uint32.h"
#include <libowfat/uint32.h>
#include "mstorage.h"
/* this is tinyldap specific. If the data contains at least one 0-byte,

View File

@@ -1,9 +1,9 @@
#include <stralloc.h>
#include <buffer.h>
#include <array.h>
#include <fmt.h>
#include <errmsg.h>
#include <str.h>
#include <libowfat/stralloc.h>
#include <libowfat/buffer.h>
#include <libowfat/array.h>
#include <libowfat/fmt.h>
#include <libowfat/errmsg.h>
#include <libowfat/str.h>
#include <ctype.h>
#define _BSD_SOURCE

12
parse.c
View File

@@ -9,13 +9,13 @@
#include <sys/shm.h>
#include <stdlib.h>
#include <string.h>
#include "buffer.h"
#include <libowfat/buffer.h>
#include "ldif.h"
#include "mduptab.h"
#include "uint32.h"
#include "byte.h"
#include "fmt.h"
#include "errmsg.h"
#include <libowfat/uint32.h>
#include <libowfat/byte.h>
#include <libowfat/fmt.h>
#include <libowfat/errmsg.h>
/* these are defined in ldif_parse.c.
* We extern them here so we can initialize them.
@@ -280,7 +280,7 @@ writeerror:
len = outofs;
indices_offset=len;
len+=record_count*4;
// len+=record_count*4; // not actually needed after this
if (buffer_put(&outbuf,(char*)offsets,sizeof(uint32)*record_count)) diesys(1,"short write (disk full?)");
free(offsets);

View File

@@ -1,7 +1,7 @@
#include <stdlib.h>
#include "ldap.h"
#include "buffer.h"
#include "byte.h"
#include <libowfat/buffer.h>
#include <libowfat/byte.h>
#if 0
AddRequest ::= [APPLICATION 8] SEQUENCE {

View File

@@ -1,5 +1,5 @@
#include <stdlib.h>
#include <byte.h>
#include <libowfat/byte.h>
#include "ldap.h"
#if 0

View File

@@ -1,6 +1,6 @@
#include <stdlib.h>
#include "ldap.h"
#include "str.h"
#include <libowfat/str.h>
size_t scan_ldapsearchfilterstring(const char* src,struct Filter** f) {
char* s=(char*)src;

View File

@@ -39,7 +39,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); goto error; }
if (!(tmp=scan_ldapstring(src+res,nmax,&(*a)->a))) { goto error; }
res+=tmp;
a=&(*a)->next;
}

View File

@@ -1,8 +1,8 @@
#include <stdlib.h>
#include "str.h"
#include <libowfat/str.h>
#include "strduptab.h"
#include "strstorage.h"
#include "str.h"
#include <libowfat/str.h>
#define PAGESIZE 4096

View File

@@ -1,5 +1,5 @@
#include <stdlib.h>
#include "byte.h"
#include <libowfat/byte.h>
#include "strstorage.h"
#define PAGESIZE 4096

8
t1.c
View File

@@ -1,11 +1,11 @@
#include <buffer.h>
#include <scan.h>
#include <open.h>
#include <libowfat/buffer.h>
#include <libowfat/scan.h>
#include <libowfat/open.h>
#include <unistd.h>
#include <stdlib.h>
#include "strduptab.h"
#include "strstorage.h"
#include "str.h"
#include <libowfat/str.h>
/* how many attributes do we allow per record? */
#define ATTRIBS 8

2
t2.c
View File

@@ -1,7 +1,7 @@
#ifndef INCLUDE
#include <unistd.h>
#include <stdio.h>
#include "mmap.h"
#include <libowfat/mmap.h>
#include "ldap.h"
#endif

View File

@@ -2,21 +2,21 @@
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include "str.h"
#include "case.h"
#include "byte.h"
#include "buffer.h"
#include <libowfat/str.h>
#include <libowfat/case.h>
#include <libowfat/byte.h>
#include <libowfat/buffer.h>
#include "ldap.h"
#include "mduptab.h"
#include "ldif.h"
#include "open.h"
#include "mmap.h"
#include "uint32.h"
#include <libowfat/open.h>
#include <libowfat/mmap.h>
#include <libowfat/uint32.h>
#include "auth.h"
#include "bstr.h"
#ifdef STANDALONE
#include "socket.h"
#include "ip6.h"
#include <libowfat/socket.h>
#include <libowfat/ip6.h>
#ifdef __FreeBSD__
#include <sys/types.h>
#include <sys/wait.h>
@@ -24,16 +24,16 @@
#include <wait.h>
#endif
#endif
#include "case.h"
#include <libowfat/case.h>
#include <signal.h>
#include "uint16.h"
#include <libowfat/uint16.h>
#include "acl.h"
#include <ctype.h>
#include <assert.h>
#include <fcntl.h>
#include "errmsg.h"
#include "textcode.h"
#include "fmt.h"
#include <libowfat/errmsg.h>
#include <libowfat/textcode.h>
#include <libowfat/fmt.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>

View File

@@ -62,7 +62,7 @@ nocert:
x+=fmt_tls_serverhellodone(x);
}
r=WRITE_SERVERHELLO;
// r=WRITE_SERVERHELLO; // dead store because we fall through
sc->ofsinmessage=0;
// fall through

View File

@@ -1,8 +1,8 @@
#include "tinytls.h"
#include <stdlib.h>
#include "uint16.h"
#include "uint32.h"
#include "buffer.h"
#include <libowfat/uint16.h>
#include <libowfat/uint32.h>
#include <libowfat/buffer.h>
#include <string.h>
inline int puts(const char* s) {
@@ -35,7 +35,7 @@ tls_error_code tls_connect(uintptr_t fd,struct ssl_context* sc) {
puts("WRITE_CLIENTHELLO");
r=tls_dowrite(fd,sc);
if (r!=OK) return r;
r=READ_SERVERHELLO;
// r=READ_SERVERHELLO; // since we fall through, don't do dead store
sc->ofsinmessage=0;
// fall through
@@ -66,7 +66,7 @@ decodeerror:
sc->cipher=cipher;
sc->compressionmethod=0;
}
r=READ_CERT;
// r=READ_CERT; // since we fall through, this would be a dead store
sc->ofsinmessage=0;
// fall through
@@ -96,7 +96,7 @@ decodeerror:
}
}
r=READ_SERVERHELLODONE;
// r=READ_SERVERHELLODONE; // since we fall through, this would be a dead store
sc->ofsinmessage=0;
// fall through

View File

@@ -1,5 +1,5 @@
#include "tinytls.h"
#include "uint16.h"
#include <libowfat/uint16.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>

6
x.c
View File

@@ -1,7 +1,7 @@
#include "tinytls.h"
#include "errmsg.h"
#include "ip4.h"
#include "socket.h"
#include <libowfat/errmsg.h>
#include <libowfat/ip4.h>
#include <libowfat/socket.h>
#include <stdio.h>