summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2023-08-12 06:23:59 +0000
committertb <>2023-08-12 06:23:59 +0000
commit8532495961e4df3e1e6cd866be1d162df72610ac (patch)
tree327469bf0d514dd7d9b586cecd7035b3ff624256 /src
parent7dd9dcbc7a655f702d9a2f3f641a158d5f2d2566 (diff)
downloadopenbsd-8532495961e4df3e1e6cd866be1d162df72610ac.tar.gz
openbsd-8532495961e4df3e1e6cd866be1d162df72610ac.tar.bz2
openbsd-8532495961e4df3e1e6cd866be1d162df72610ac.zip
Check that {DH,DSA}_get0_engine() returns NULL if OPENSSL_NO_ENGINE is
defined.
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libcrypto/dh/dhtest.c9
-rw-r--r--src/regress/lib/libcrypto/dsa/dsatest.c9
2 files changed, 16 insertions, 2 deletions
diff --git a/src/regress/lib/libcrypto/dh/dhtest.c b/src/regress/lib/libcrypto/dh/dhtest.c
index 7ddd118124..cfbfb98c55 100644
--- a/src/regress/lib/libcrypto/dh/dhtest.c
+++ b/src/regress/lib/libcrypto/dh/dhtest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dhtest.c,v 1.8 2023/07/28 13:05:59 tb Exp $ */ 1/* $OpenBSD: dhtest.c,v 1.9 2023/08/12 06:23:59 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -108,6 +108,13 @@ main(int argc, char *argv[])
108 if ((a = DH_new()) == NULL) 108 if ((a = DH_new()) == NULL)
109 goto err; 109 goto err;
110 110
111#ifdef OPENSSL_NO_ENGINE
112 if (DH_get0_engine(a) != NULL) {
113 fprintf(stderr, "ENGINE was not NULL\n");
114 goto err;
115 }
116#endif
117
111 if (!DH_generate_parameters_ex(a, 64, DH_GENERATOR_5, _cb)) 118 if (!DH_generate_parameters_ex(a, 64, DH_GENERATOR_5, _cb))
112 goto err; 119 goto err;
113 120
diff --git a/src/regress/lib/libcrypto/dsa/dsatest.c b/src/regress/lib/libcrypto/dsa/dsatest.c
index e5b56c08d0..b21f1b9750 100644
--- a/src/regress/lib/libcrypto/dsa/dsatest.c
+++ b/src/regress/lib/libcrypto/dsa/dsatest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsatest.c,v 1.7 2022/01/12 08:59:56 tb Exp $ */ 1/* $OpenBSD: dsatest.c,v 1.8 2023/08/12 06:23:59 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -143,6 +143,13 @@ main(int argc, char **argv)
143 if ((dsa = DSA_new()) == NULL) 143 if ((dsa = DSA_new()) == NULL)
144 goto end; 144 goto end;
145 145
146#ifdef OPENSSL_NO_ENGINE
147 if (DSA_get0_engine(dsa) != NULL) {
148 BIO_printf(bio_err, "ENGINE was not NULL\n");
149 goto end;
150 }
151#endif
152
146 if (!DSA_generate_parameters_ex(dsa, 512, seed, 20, &counter, &h, cb)) 153 if (!DSA_generate_parameters_ex(dsa, 512, seed, 20, &counter, &h, cb))
147 goto end; 154 goto end;
148 155