summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
0290c58)
openssl versions prior to 1.1.0 do not use an opaque pointer for
HMAC_CTX.
Signed-off-by: David Disseldorp <ddiss@suse.de>
http="no"
fi
if test "$disable_http" != "yes" && $(pkg-config --exists libcurl openssl); then
http="no"
fi
if test "$disable_http" != "yes" && $(pkg-config --exists libcurl openssl); then
- # http engine currently requires opaque HMAC_CTX present in openssl >= 1.1
if $(pkg-config --atleast-version=1.1.0 openssl); then
if $(pkg-config --atleast-version=1.1.0 openssl); then
- LIBS="$(pkg-config --libs libcurl openssl) $LIBS"
- http="yes"
+ output_sym "CONFIG_HAVE_OPAQUE_HMAC_CTX"
+ LIBS="$(pkg-config --libs libcurl openssl) $LIBS"
+ http="yes"
fi
print_config "http engine" "$http"
fi
print_config "http engine" "$http"
}
static void _hmac(unsigned char *md, void *key, int key_len, char *data) {
}
static void _hmac(unsigned char *md, void *key, int key_len, char *data) {
+#ifndef CONFIG_HAVE_OPAQUE_HMAC_CTX
+ HMAC_CTX _ctx;
+#endif
HMAC_CTX *ctx;
unsigned int hmac_len;
HMAC_CTX *ctx;
unsigned int hmac_len;
+#ifdef CONFIG_HAVE_OPAQUE_HMAC_CTX
+#else
+ ctx = &_ctx;
+#endif
HMAC_Init_ex(ctx, key, key_len, EVP_sha256(), NULL);
HMAC_Update(ctx, (unsigned char*)data, strlen(data));
HMAC_Final(ctx, md, &hmac_len);
HMAC_Init_ex(ctx, key, key_len, EVP_sha256(), NULL);
HMAC_Update(ctx, (unsigned char*)data, strlen(data));
HMAC_Final(ctx, md, &hmac_len);
+#ifdef CONFIG_HAVE_OPAQUE_HMAC_CTX
+#else
+ HMAC_CTX_cleanup(ctx);
+#endif
}
static int _curl_trace(CURL *handle, curl_infotype type,
}
static int _curl_trace(CURL *handle, curl_infotype type,