]>
Commit | Line | Data |
---|---|---|
d2e9e320 RS |
1 | /* |
2 | * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. | |
e9224c71 | 3 | * |
3cdbea65 | 4 | * Licensed under the Apache License 2.0 (the "License"). You may not use |
d2e9e320 RS |
5 | * this file except in compliance with the License. You can obtain a copy |
6 | * in the file LICENSE in the source distribution or at | |
7 | * https://www.openssl.org/source/license.html | |
e9224c71 GT |
8 | */ |
9 | ||
0f113f3e MC |
10 | /* |
11 | * This file contains deprecated function(s) that are now wrappers to the new | |
12 | * version(s). | |
13 | */ | |
e9224c71 | 14 | |
0f113f3e MC |
15 | /* |
16 | * Parameter generation follows the updated Appendix 2.2 for FIPS PUB 186, | |
17 | * also Appendix 2.2 of FIPS PUB 186-1 (i.e. use SHA as defined in FIPS PUB | |
18 | * 180-1) | |
19 | */ | |
474e469b | 20 | #define xxxHASH EVP_sha1() |
e9224c71 | 21 | |
98186eb4 | 22 | #include <openssl/opensslconf.h> |
fcd2d5a6 | 23 | #if OPENSSL_API_0_9_8 |
effaf4de RS |
24 | NON_EMPTY_TRANSLATION_UNIT |
25 | #else | |
26 | ||
27 | # include <stdio.h> | |
28 | # include <time.h> | |
29 | # include "internal/cryptlib.h" | |
30 | # include <openssl/evp.h> | |
31 | # include <openssl/bn.h> | |
32 | # include <openssl/dsa.h> | |
effaf4de | 33 | # include <openssl/sha.h> |
e9224c71 GT |
34 | |
35 | DSA *DSA_generate_parameters(int bits, | |
0f113f3e MC |
36 | unsigned char *seed_in, int seed_len, |
37 | int *counter_ret, unsigned long *h_ret, | |
38 | void (*callback) (int, int, void *), | |
39 | void *cb_arg) | |
40 | { | |
41 | BN_GENCB *cb; | |
42 | DSA *ret; | |
e9224c71 | 43 | |
0f113f3e MC |
44 | if ((ret = DSA_new()) == NULL) |
45 | return NULL; | |
46 | cb = BN_GENCB_new(); | |
90945fa3 | 47 | if (cb == NULL) |
d6407083 | 48 | goto err; |
e9224c71 | 49 | |
0f113f3e | 50 | BN_GENCB_set_old(cb, callback, cb_arg); |
e9224c71 | 51 | |
0f113f3e MC |
52 | if (DSA_generate_parameters_ex(ret, bits, seed_in, seed_len, |
53 | counter_ret, h_ret, cb)) { | |
54 | BN_GENCB_free(cb); | |
55 | return ret; | |
56 | } | |
57 | BN_GENCB_free(cb); | |
d6407083 | 58 | err: |
0f113f3e MC |
59 | DSA_free(ret); |
60 | return NULL; | |
61 | } | |
9d473aa2 | 62 | #endif |