/*
* this will adjust ndo_packetp and ndo_snapend to new buffer!
*/
+USES_APPLE_DEPRECATED_API
int esp_print_decrypt_buffer_by_ikev2(netdissect_options *ndo,
int initiator,
u_char spii[8], u_char spir[8],
return 1;
}
+USES_APPLE_RST
static void esp_print_addsa(netdissect_options *ndo,
struct sa_list *sa, int sa_def)
* decode the form: SPINUM@IP <tab> ALGONAME:0xsecret
*/
+USES_APPLE_DEPRECATED_API
static int
espprint_decode_encalgo(netdissect_options *ndo,
char *decode, struct sa_list *sa)
return 1;
}
+USES_APPLE_RST
/*
* for the moment, ignore the auth algorith, just hard code the authenticator
esp_print_addsa(ndo, &sa1, sa_def);
}
+USES_APPLE_DEPRECATED_API
static void esp_init(netdissect_options *ndo _U_)
{
OpenSSL_add_all_algorithms();
EVP_add_cipher_alias(SN_des_ede3_cbc, "3des");
}
+USES_APPLE_RST
void esp_print_decodesecret(netdissect_options *ndo)
{
#endif
+#ifdef HAVE_LIBCRYPTO
+USES_APPLE_DEPRECATED_API
+#endif
int
esp_print(netdissect_options *ndo,
const u_char *bp, const int length, const u_char *bp2
fail:
return -1;
}
+#ifdef HAVE_LIBCRYPTO
+USES_APPLE_RST
+#endif
/*
* Local Variables:
}
#ifdef HAVE_LIBCRYPTO
+USES_APPLE_DEPRECATED_API
static int
tcp_verify_signature(const struct ip *ip, const struct tcphdr *tp,
const u_char *data, int length, const u_char *rcvsig)
else
return (SIGNATURE_INVALID);
}
+USES_APPLE_RST
#endif /* HAVE_LIBCRYPTO */
/*
* Compute a HMAC MD5 sum.
* Taken from rfc2104, Appendix.
*/
+USES_APPLE_DEPRECATED_API
static void
signature_compute_hmac_md5(const u_int8_t *text, int text_len, unsigned char *key,
unsigned int key_len, u_int8_t *digest)
MD5_Update(&context, digest, 16); /* then results of 1st hash */
MD5_Final(digest, &context); /* finish up 2nd pass */
}
+USES_APPLE_RST
#endif
#ifdef HAVE_LIBCRYPTO
#define FALSE 0
#endif
+/*
+ * The Apple deprecation workaround macros below were adopted from the
+ * FreeRADIUS server code under permission of Alan DeKok and Arran Cudbard-Bell.
+ */
+
+#define XSTRINGIFY(x) #x
+
+/*
+ * Macros for controlling warnings in GCC >= 4.2 and clang >= 2.8
+ */
+#define DIAG_JOINSTR(x,y) XSTRINGIFY(x ## y)
+#define DIAG_DO_PRAGMA(x) _Pragma (#x)
+
+#if defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402
+# define DIAG_PRAGMA(x) DIAG_DO_PRAGMA(GCC diagnostic x)
+# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406
+# define DIAG_OFF(x) DIAG_PRAGMA(push) DIAG_PRAGMA(ignored DIAG_JOINSTR(-W,x))
+# define DIAG_ON(x) DIAG_PRAGMA(pop)
+# else
+# define DIAG_OFF(x) DIAG_PRAGMA(ignored DIAG_JOINSTR(-W,x))
+# define DIAG_ON(x) DIAG_PRAGMA(warning DIAG_JOINSTR(-W,x))
+# endif
+#elif defined(__clang__) && ((__clang_major__ * 100) + __clang_minor__ >= 208)
+# define DIAG_PRAGMA(x) DIAG_DO_PRAGMA(clang diagnostic x)
+# define DIAG_OFF(x) DIAG_PRAGMA(push) DIAG_PRAGMA(ignored DIAG_JOINSTR(-W,x))
+# define DIAG_ON(x) DIAG_PRAGMA(pop)
+#else
+# define DIAG_OFF(x)
+# define DIAG_ON(x)
+#endif
+
+/*
+ * For dealing with APIs which are only deprecated in OSX (like the OpenSSL API)
+ */
+#ifdef __APPLE__
+# define USES_APPLE_DEPRECATED_API DIAG_OFF(deprecated-declarations)
+# define USES_APPLE_RST DIAG_ON(deprecated-declarations)
+#else
+# define USES_APPLE_DEPRECATED_API
+# define USES_APPLE_RST
+#endif
+
+/*
+ * end of Apple deprecation workaround macros
+ */
+
#endif /* tcpdump_stdinc_h */