--- ansh/src/utils.c 2011/10/14 12:45:09 1.1.1.1.2.12 +++ ansh/src/utils.c 2011/10/14 13:23:49 1.1.1.1.2.13 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ - * $Id: utils.c,v 1.1.1.1.2.12 2011/10/14 12:45:09 misho Exp $ + * $Id: utils.c,v 1.1.1.1.2.13 2011/10/14 13:23:49 misho Exp $ * ************************************************************************* The ELWIX and AITNET software is distributed under the following @@ -206,6 +206,8 @@ icmpRecv(int s, u_int * __restrict seq, u_short * __re VERB(3) LOG("Channel SECURED:: Plain text communication not supported at this moment ..."); return ANSH_FLG_ERR; } + if (ntohl(hdr->ansh_nonce) != *crypted) + VERB(4) LOG("Detect change of nonce from %x to %x", *crypted, ntohl(hdr->ansh_nonce)); *crypted = ntohl(hdr->ansh_nonce); } @@ -384,6 +386,8 @@ _pkt_Recv(u_char * __restrict buf, int rlen, u_int * _ VERB(3) LOG("Channel SECURED:: Plain text communication not supported at this moment ..."); return ANSH_FLG_ERR; } + if (ntohl(hdr->ansh_nonce) != *crypted) + VERB(4) LOG("Detect change of nonce from %x to %x", *crypted, ntohl(hdr->ansh_nonce)); *crypted = ntohl(hdr->ansh_nonce); }