X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/84ef17ac0eecb3efc11a63c3f2c578ae78732c02..refs/heads/coverity_scan:/signature.c diff --git a/signature.c b/signature.c index 51651bf3..f10a90b9 100644 --- a/signature.c +++ b/signature.c @@ -15,17 +15,16 @@ * Original code by Hannes Gredler (hannes@gredler.at) */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif +#include -#include +#include "netdissect-stdinc.h" #include #include #include "netdissect.h" #include "signature.h" +#include "diag-control.h" #ifdef HAVE_LIBCRYPTO #include @@ -45,7 +44,7 @@ const struct tok signature_check_values[] = { * Compute a HMAC MD5 sum. * Taken from rfc2104, Appendix. */ -USES_APPLE_DEPRECATED_API +DIAG_OFF_DEPRECATION static void signature_compute_hmac_md5(const uint8_t *text, int text_len, unsigned char *key, unsigned int key_len, uint8_t *digest) @@ -81,8 +80,8 @@ signature_compute_hmac_md5(const uint8_t *text, int text_len, unsigned char *key */ /* start out by storing key in pads */ - memset(k_ipad, 0, sizeof k_ipad); - memset(k_opad, 0, sizeof k_opad); + memset(k_ipad, 0, sizeof(k_ipad)); + memset(k_opad, 0, sizeof(k_opad)); memcpy(k_ipad, key, key_len); memcpy(k_opad, key, key_len); @@ -108,7 +107,7 @@ signature_compute_hmac_md5(const uint8_t *text, int text_len, unsigned char *key MD5_Update(&context, digest, 16); /* then results of 1st hash */ MD5_Final(digest, &context); /* finish up 2nd pass */ } -USES_APPLE_RST +DIAG_ON_DEPRECATION /* * Verify a cryptographic signature of the packet. @@ -190,7 +189,7 @@ signature_verify(netdissect_options *ndo, const u_char *pptr, u_int plen, } else { /* No - print the computed signature. */ for (i = 0; i < sizeof(sig); ++i) { - ND_PRINT((ndo, "%02x", sig[i])); + ND_PRINT("%02x", sig[i]); } return (SIGNATURE_INVALID); @@ -205,10 +204,3 @@ signature_verify(netdissect_options *ndo _U_, const u_char *pptr _U_, return (CANT_CHECK_SIGNATURE); } #endif - -/* - * Local Variables: - * c-style: whitesmith - * c-basic-offset: 4 - * End: - */