]> git.ipfire.org Git - thirdparty/openssl.git/blame - crypto/dsa/dsa_depr.c
Update copyright year
[thirdparty/openssl.git] / crypto / dsa / dsa_depr.c
CommitLineData
d2e9e320 1/*
33388b44 2 * Copyright 2002-2020 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
f41ac0ee
P
15/*
16 * DSA low level APIs are deprecated for public use, but still ok for
17 * internal use.
18 */
19#include "internal/deprecated.h"
20
0f113f3e
MC
21/*
22 * Parameter generation follows the updated Appendix 2.2 for FIPS PUB 186,
23 * also Appendix 2.2 of FIPS PUB 186-1 (i.e. use SHA as defined in FIPS PUB
24 * 180-1)
25 */
474e469b 26#define xxxHASH EVP_sha1()
e9224c71 27
98186eb4 28#include <openssl/opensslconf.h>
effaf4de 29
705536e2
RS
30#include <stdio.h>
31#include <time.h>
32#include "internal/cryptlib.h"
33#include <openssl/evp.h>
34#include <openssl/bn.h>
35#include <openssl/dsa.h>
36#include <openssl/sha.h>
e9224c71
GT
37
38DSA *DSA_generate_parameters(int bits,
0f113f3e
MC
39 unsigned char *seed_in, int seed_len,
40 int *counter_ret, unsigned long *h_ret,
41 void (*callback) (int, int, void *),
42 void *cb_arg)
43{
44 BN_GENCB *cb;
45 DSA *ret;
e9224c71 46
0f113f3e
MC
47 if ((ret = DSA_new()) == NULL)
48 return NULL;
49 cb = BN_GENCB_new();
90945fa3 50 if (cb == NULL)
d6407083 51 goto err;
e9224c71 52
0f113f3e 53 BN_GENCB_set_old(cb, callback, cb_arg);
e9224c71 54
0f113f3e
MC
55 if (DSA_generate_parameters_ex(ret, bits, seed_in, seed_len,
56 counter_ret, h_ret, cb)) {
57 BN_GENCB_free(cb);
58 return ret;
59 }
60 BN_GENCB_free(cb);
d6407083 61err:
0f113f3e
MC
62 DSA_free(ret);
63 return NULL;
64}