Mercurial > hg > quicktun
comparison src/proto.nacltai.c @ 10:1e4ba8d8ffc2
Use strncat, fixed nacltai timestamp check
author | Ivo Smits <Ivo@UCIS.nl> |
---|---|
date | Sat, 04 Dec 2010 03:01:46 +0100 |
parents | cf9b44b46be5 |
children | 5be1ecb80cc9 |
comparison
equal
deleted
inserted
replaced
9:640f620a55cf | 10:1e4ba8d8ffc2 |
---|---|
139 fprintf(stderr, "Short packet received: %d\n", len); | 139 fprintf(stderr, "Short packet received: %d\n", len); |
140 return 0; | 140 return 0; |
141 } | 141 } |
142 len -= overhead; | 142 len -= overhead; |
143 taia_unpack((char*)(enc + crypto_box_BOXZEROBYTES - noncelength), &d->cdtaic); | 143 taia_unpack((char*)(enc + crypto_box_BOXZEROBYTES - noncelength), &d->cdtaic); |
144 if (d->cdtaic.sec.x <= d->cdtaip.sec.x || d->cdtaic.nano <= d->cdtaip.nano || d->cdtaic.atto <= d->cdtaip.atto) { | 144 if (d->cdtaic.sec.x <= d->cdtaip.sec.x && d->cdtaic.nano <= d->cdtaip.nano && d->cdtaic.atto <= d->cdtaip.atto) { |
145 fprintf(stderr, "Timestamp going back, ignoring packet\n"); | 145 fprintf(stderr, "Timestamp going back, ignoring packet\n"); |
146 return 0; | 146 return 0; |
147 } | 147 } |
148 memcpy(d->cdnonce + nonceoffset, enc + crypto_box_BOXZEROBYTES - noncelength, noncelength); | 148 memcpy(d->cdnonce + nonceoffset, enc + crypto_box_BOXZEROBYTES - noncelength, noncelength); |
149 memset(enc, 0, crypto_box_BOXZEROBYTES); | 149 memset(enc, 0, crypto_box_BOXZEROBYTES); |