-/* $OpenBSD: dhtest.c,v 1.6 2021/11/18 15:07:28 tb Exp $ */
+/* $OpenBSD: dhtest.c,v 1.7 2022/01/12 08:58:12 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
BIO_puts(out, "the g value is not a generator\n");
BIO_puts(out, "\np =");
- BN_print(out, a->p);
+ BN_print(out, DH_get0_p(a));
BIO_puts(out, "\ng =");
- BN_print(out, a->g);
+ BN_print(out, DH_get0_g(a));
BIO_puts(out, "\n");
if (!DH_generate_key(a))
goto err;
BIO_puts(out, "pri 1=");
- BN_print(out, a->priv_key);
+ BN_print(out, DH_get0_priv_key(a));
BIO_puts(out, "\npub 1=");
- BN_print(out, a->pub_key);
+ BN_print(out, DH_get0_pub_key(a));
BIO_puts(out, "\n");
alen = DH_size(a);
if ((abuf = malloc(alen)) == NULL)
err(1, "malloc");
- aout = DH_compute_key(abuf, a->pub_key, a);
+ aout = DH_compute_key(abuf, DH_get0_pub_key(a), a);
BIO_puts(out, "key1 =");
for (i=0; i<aout; i++) {