summaryrefslogtreecommitdiff
path: root/contrib/ntp/ntpq/ntpq.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2016-12-22 16:19:05 +0000
committerXin LI <delphij@FreeBSD.org>2016-12-22 16:19:05 +0000
commitb06b7e647fe7b4eefbd29369cf0c24e1902bf72a (patch)
treed18590df36faea870c6827c64a75516475938e4d /contrib/ntp/ntpq/ntpq.c
parent8c7ff71d356bdceffa6cd5b5017c65d0d63d9abc (diff)
Notes
Diffstat (limited to 'contrib/ntp/ntpq/ntpq.c')
-rw-r--r--contrib/ntp/ntpq/ntpq.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/contrib/ntp/ntpq/ntpq.c b/contrib/ntp/ntpq/ntpq.c
index ed5c65fca1949..91364de4ba8bd 100644
--- a/contrib/ntp/ntpq/ntpq.c
+++ b/contrib/ntp/ntpq/ntpq.c
@@ -34,6 +34,7 @@
#include "openssl/evp.h"
#include "openssl/objects.h"
#include "openssl/err.h"
+#include "libssl_compat.h"
#endif
#include <ssl_applink.c>
@@ -3582,7 +3583,7 @@ static void list_md_fn(const EVP_MD *m, const char *from, const char *to, void *
size_t len, n;
const char *name, *cp, **seen;
struct hstate *hstate = arg;
- EVP_MD_CTX ctx;
+ EVP_MD_CTX *ctx;
u_int digest_len;
u_char digest[EVP_MAX_MD_SIZE];
@@ -3613,8 +3614,10 @@ static void list_md_fn(const EVP_MD *m, const char *from, const char *to, void *
* Keep this consistent with keytype_from_text() in ssl_init.c.
*/
- EVP_DigestInit(&ctx, EVP_get_digestbyname(name));
- EVP_DigestFinal(&ctx, digest, &digest_len);
+ ctx = EVP_MD_CTX_new();
+ EVP_DigestInit(ctx, EVP_get_digestbyname(name));
+ EVP_DigestFinal(ctx, digest, &digest_len);
+ EVP_MD_CTX_free(ctx);
if (digest_len > (MAX_MAC_LEN - sizeof(keyid_t)))
return;