diff options
author | tb <> | 2023-04-13 14:58:27 +0000 |
---|---|---|
committer | tb <> | 2023-04-13 14:58:27 +0000 |
commit | 444a1e2335883999b57e5f9b1f505b5915c2da3d (patch) | |
tree | 84160b4d188ae655a809e59d5e5a7626b39ef1f3 | |
parent | 12f90f16f2ff4d8099a1b84bd50ecea1111e9486 (diff) | |
download | openbsd-444a1e2335883999b57e5f9b1f505b5915c2da3d.tar.gz openbsd-444a1e2335883999b57e5f9b1f505b5915c2da3d.tar.bz2 openbsd-444a1e2335883999b57e5f9b1f505b5915c2da3d.zip |
Move DSA_generate_parameters() from dsa_depr.c to dsa_gen.c
Discussed with jsing
-rw-r--r-- | src/lib/libcrypto/dsa/dsa_depr.c | 21 | ||||
-rw-r--r-- | src/lib/libcrypto/dsa/dsa_gen.c | 23 |
2 files changed, 23 insertions, 21 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_depr.c b/src/lib/libcrypto/dsa/dsa_depr.c index b3f7ec0413..98a377e5b5 100644 --- a/src/lib/libcrypto/dsa/dsa_depr.c +++ b/src/lib/libcrypto/dsa/dsa_depr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dsa_depr.c,v 1.11 2023/04/09 19:10:23 tb Exp $ */ | 1 | /* $OpenBSD: dsa_depr.c,v 1.12 2023/04/13 14:58:27 tb Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -70,23 +70,4 @@ | |||
70 | 70 | ||
71 | #include "bn_local.h" | 71 | #include "bn_local.h" |
72 | 72 | ||
73 | DSA * | ||
74 | DSA_generate_parameters(int bits, unsigned char *seed_in, int seed_len, | ||
75 | int *counter_ret, unsigned long *h_ret, void (*callback)(int, int, void *), | ||
76 | void *cb_arg) | ||
77 | { | ||
78 | BN_GENCB cb; | ||
79 | DSA *ret; | ||
80 | |||
81 | if ((ret = DSA_new()) == NULL) | ||
82 | return NULL; | ||
83 | |||
84 | BN_GENCB_set_old(&cb, callback, cb_arg); | ||
85 | |||
86 | if (DSA_generate_parameters_ex(ret, bits, seed_in, seed_len, | ||
87 | counter_ret, h_ret, &cb)) | ||
88 | return ret; | ||
89 | DSA_free(ret); | ||
90 | return NULL; | ||
91 | } | ||
92 | #endif | 73 | #endif |
diff --git a/src/lib/libcrypto/dsa/dsa_gen.c b/src/lib/libcrypto/dsa/dsa_gen.c index 49b4561494..4a16278b5a 100644 --- a/src/lib/libcrypto/dsa/dsa_gen.c +++ b/src/lib/libcrypto/dsa/dsa_gen.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dsa_gen.c,v 1.28 2023/03/27 10:25:02 tb Exp $ */ | 1 | /* $OpenBSD: dsa_gen.c,v 1.29 2023/04/13 14:58:27 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 | * |
@@ -355,4 +355,25 @@ err: | |||
355 | 355 | ||
356 | return ok; | 356 | return ok; |
357 | } | 357 | } |
358 | |||
359 | DSA * | ||
360 | DSA_generate_parameters(int bits, unsigned char *seed_in, int seed_len, | ||
361 | int *counter_ret, unsigned long *h_ret, void (*callback)(int, int, void *), | ||
362 | void *cb_arg) | ||
363 | { | ||
364 | BN_GENCB cb; | ||
365 | DSA *ret; | ||
366 | |||
367 | if ((ret = DSA_new()) == NULL) | ||
368 | return NULL; | ||
369 | |||
370 | BN_GENCB_set_old(&cb, callback, cb_arg); | ||
371 | |||
372 | if (DSA_generate_parameters_ex(ret, bits, seed_in, seed_len, | ||
373 | counter_ret, h_ret, &cb)) | ||
374 | return ret; | ||
375 | DSA_free(ret); | ||
376 | return NULL; | ||
377 | } | ||
378 | |||
358 | #endif | 379 | #endif |