From 8561a852bb686858c5111607ff8bfb2bdb1d77c0 Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 14 Jan 2022 09:32:27 +0000 Subject: [PATCH] Simplify BN_mont test slightly using a new accessor. --- regress/lib/libcrypto/bn/mont/mont.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/regress/lib/libcrypto/bn/mont/mont.c b/regress/lib/libcrypto/bn/mont/mont.c index 2c311af4170..8b9b14a20e9 100644 --- a/regress/lib/libcrypto/bn/mont/mont.c +++ b/regress/lib/libcrypto/bn/mont/mont.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mont.c,v 1.5 2021/11/26 16:52:07 tb Exp $ */ +/* $OpenBSD: mont.c,v 1.6 2022/01/14 09:32:27 tb Exp $ */ /* * Copyright (c) 2014 Miodrag Vallat. @@ -36,7 +36,6 @@ main(int argc, char *argv[]) { DH *dh = NULL; BIGNUM *priv_key = NULL; - const BIGNUM *pub_key; unsigned char *key = NULL; unsigned char r[32 + 16 * 8]; size_t privsz; @@ -65,8 +64,7 @@ main(int argc, char *argv[]) key = malloc(DH_size(dh)); if (key == NULL) err(1, "malloc"); - DH_get0_key(dh, &pub_key, NULL); - if (DH_compute_key(key, pub_key, dh) == -1) + if (DH_compute_key(key, DH_get0_pub_key(dh), dh) == -1) goto err; free(key); -- 2.20.1