for ac_func in \
SSL_get_client_random \
SSL_get_server_random \
+ HMAC_CTX_new \
+ HMAC_CTX_free \
+ ASN1_STRING_get0_data \
+ CONF_modules_load_file \
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
AC_CHECK_FUNCS( \
SSL_get_client_random \
SSL_get_server_random \
+ HMAC_CTX_new \
+ HMAC_CTX_free \
+ ASN1_STRING_get0_data \
+ CONF_modules_load_file \
)
CPPFLAGS="$old_CPPFLAGS"
fi
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
+/* Define to 1 if you have the `ASN1_STRING_get0_data' function. */
+#undef HAVE_ASN1_STRING_GET0_DATA
+
/* Define if your compiler supports the __bounded__ attribute (usually OpenBSD
gcc). */
#undef HAVE_ATTRIBUTE_BOUNDED
/* Define to 1 if you have the `collectdclient' library (-lcollectdclient). */
#undef HAVE_COLLECTDC_H
+/* Define to 1 if you have the `CONF_modules_load_file' function. */
+#undef HAVE_CONF_MODULES_LOAD_FILE
+
/* Do we have the crypt function */
#undef HAVE_CRYPT
/* Define to 1 if you have the <history.h> header file. */
#undef HAVE_HISTORY_H
+/* Define to 1 if you have the `HMAC_CTX_free' function. */
+#undef HAVE_HMAC_CTX_FREE
+
+/* Define to 1 if you have the `HMAC_CTX_new' function. */
+#undef HAVE_HMAC_CTX_NEW
+
/* Define if the function (or macro) htonll exists. */
#undef HAVE_HTONLL
# endif
#endif
+#ifdef HAVE_OPENSSL_HMAC_H
+# include <openssl/hmac.h>
+#endif
+
+#ifdef HAVE_OPENSSL_ASN1_H
+# include <openssl/asn1.h>
+#endif
+
+#ifdef HAVE_OPENSSL_CONF_H
+# include <openssl/conf.h>
+#endif
+
/*
* Don't look for winsock.h if we're on cygwin.
*/
typedef void(*sig_t)(int);
#endif
+#ifdef HAVE_OPENSSL_HMAC_H
+# ifndef HAVE_HMAC_CTX_NEW
+HMAC_CTX *HMAC_CTX_new(void);
+# endif
+# ifndef HAVE_HMAC_CTX_FREE
+void HMAC_CTX_free(HMAC_CTX *ctx);
+# endif
+#endif
+
+#ifdef HAVE_OPENSSL_ASN1_H
+# ifndef HAVE_ASN1_STRING_GET0_DATA
+static inline const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x)
+{
+ /*
+ * Trick the compiler into not issuing the warning on qualifier stripping.
+ * We know that ASN1_STRING_data doesn't change x, and we're casting
+ * the return value back to const immediately, so it's OK.
+ */
+ union {
+ const ASN1_STRING *c;
+ ASN1_STRING *nc;
+ } const_strip = {.c = x};
+ return ASN1_STRING_data(const_strip.nc);
+}
+# endif
+#endif
+
+#ifdef HAVE_OPENSSL_CONF_H
+# ifndef HAVE_CONF_MODULES_LOAD_FILE
+static inline int CONF_modules_load_file(const char *filename,
+ const char *appname,
+ unsigned long flags)
+{
+ (void)filename;
+ (void)flags;
+ return OPENSSL_config(appname);
+}
+# endif
+#endif
+
#ifdef __cplusplus
}
#endif
}
#endif
+#ifdef HAVE_OPENSSL_HMAC_H
+# ifndef HAVE_HMAC_CTX_NEW
+HMAC_CTX *HMAC_CTX_new(void)
+{
+ HMAC_CTX *ctx;
+ ctx = OPENSSL_malloc(sizeof(*ctx));
+ memset(ctx, 0, sizeof(*ctx));
+ if (ctx == NULL) {
+ return NULL;
+ }
+ HMAC_CTX_init(ctx);
+ return ctx;
+}
+# endif
+# ifndef HAVE_HMAC_CTX_FREE
+void HMAC_CTX_free(HMAC_CTX *ctx)
+{
+ if (ctx == NULL) {
+ return;
+ }
+ HMAC_CTX_cleanup(ctx);
+ OPENSSL_free(ctx);
+}
+# endif
+#endif
+
/** Call talloc strdup, setting the type on the new chunk correctly
*
* For some bizarre reason the talloc string functions don't set the