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
commit2a3488342441b3296995c8a9eca705a468d0eff0 (patch)
tree0ddd6422cb1fb658884e045a0527f7a24e4df58e /contrib/ntp/ntpq/ntpq.c
parent59570923bc07f0e74f90b47bd0e10dc5db508d4a (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 ed5c65fca194..91364de4ba8b 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;