diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/dh/dh_gen.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/lib/libcrypto/dh/dh_gen.c b/src/lib/libcrypto/dh/dh_gen.c index 6b49a2875a..b331b32dd1 100644 --- a/src/lib/libcrypto/dh/dh_gen.c +++ b/src/lib/libcrypto/dh/dh_gen.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dh_gen.c,v 1.17 2022/01/07 09:27:13 tb Exp $ */ | 1 | /* $OpenBSD: dh_gen.c,v 1.18 2023/04/13 14:57:00 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 | * |
@@ -67,6 +67,7 @@ | |||
67 | #include <openssl/dh.h> | 67 | #include <openssl/dh.h> |
68 | #include <openssl/err.h> | 68 | #include <openssl/err.h> |
69 | 69 | ||
70 | #include "bn_local.h" | ||
70 | #include "dh_local.h" | 71 | #include "dh_local.h" |
71 | 72 | ||
72 | static int dh_builtin_genparams(DH *ret, int prime_len, int generator, | 73 | static int dh_builtin_genparams(DH *ret, int prime_len, int generator, |
@@ -179,3 +180,21 @@ err: | |||
179 | } | 180 | } |
180 | return ok; | 181 | return ok; |
181 | } | 182 | } |
183 | |||
184 | DH * | ||
185 | DH_generate_parameters(int prime_len, int generator, | ||
186 | void (*callback)(int, int, void *), void *cb_arg) | ||
187 | { | ||
188 | BN_GENCB cb; | ||
189 | DH *ret = NULL; | ||
190 | |||
191 | if ((ret = DH_new()) == NULL) | ||
192 | return NULL; | ||
193 | |||
194 | BN_GENCB_set_old(&cb, callback, cb_arg); | ||
195 | |||
196 | if (DH_generate_parameters_ex(ret, prime_len, generator, &cb)) | ||
197 | return ret; | ||
198 | DH_free(ret); | ||
199 | return NULL; | ||
200 | } | ||