--- embedaddon/dhcp/minires/ns_verify.c 2012/10/09 09:06:54 1.1.1.1 +++ embedaddon/dhcp/minires/ns_verify.c 2013/07/22 12:54:39 1.1.1.1.2.1 @@ -22,7 +22,7 @@ */ #ifndef lint -static const char rcsid[] = "$Id: ns_verify.c,v 1.1.1.1 2012/10/09 09:06:54 misho Exp $"; +static const char rcsid[] = "$Id: ns_verify.c,v 1.1.1.1.2.1 2013/07/22 12:54:39 misho Exp $"; #endif /* Import. */ @@ -154,7 +154,7 @@ ns_verify(u_char *msg, unsigned *msglen, void *k, u_int16_t fudge, sigfieldlen, id, otherfieldlen; dst_init(); - if (msg == NULL || msglen == NULL || *msglen < 0) + if (msg == NULL || msglen == NULL) return ISC_R_INVALIDARG; eom = msg + *msglen; @@ -167,7 +167,7 @@ ns_verify(u_char *msg, unsigned *msglen, void *k, /* Read the key name. */ n = dn_expand(msg, eom, cp, name, MAXDNAME); - if (n < 0) + if (n) return ISC_R_FORMERR; cp += n; @@ -186,7 +186,7 @@ ns_verify(u_char *msg, unsigned *msglen, void *k, /* Read the algorithm name. */ rdatastart = cp; n = dn_expand(msg, eom, cp, alg, MAXDNAME); - if (n < 0) + if (n) return ISC_R_FORMERR; if (ns_samename(alg, NS_TSIG_ALG_HMAC_MD5) != 1) return ISC_R_INVALIDKEY; @@ -284,7 +284,7 @@ ns_verify(u_char *msg, unsigned *msglen, void *k, n = dst_verify_data(SIG_MODE_FINAL, key, &ctx, NULL, 0, sigstart, sigfieldlen); - if (n < 0) + if (n) return ISC_R_BADSIG; if (sig != NULL && siglen != NULL) {