Coverage Report

Created: 2025-04-22 06:18

/src/openssl/crypto/dsa/dsa_depr.c
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright 2002-2021 The OpenSSL Project Authors. All Rights Reserved.
3
 *
4
 * Licensed under the Apache License 2.0 (the "License").  You may not use
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
8
 */
9
10
/*
11
 * This file contains deprecated function(s) that are now wrappers to the new
12
 * version(s).
13
 */
14
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
21
#include <openssl/opensslconf.h>
22
23
#include <stdio.h>
24
#include <time.h>
25
#include "internal/cryptlib.h"
26
#include <openssl/evp.h>
27
#include <openssl/bn.h>
28
#include <openssl/dsa.h>
29
#include <openssl/sha.h>
30
31
DSA *DSA_generate_parameters(int bits,
32
                             unsigned char *seed_in, int seed_len,
33
                             int *counter_ret, unsigned long *h_ret,
34
                             void (*callback) (int, int, void *),
35
                             void *cb_arg)
36
0
{
37
0
    BN_GENCB *cb;
38
0
    DSA *ret;
39
40
0
    if ((ret = DSA_new()) == NULL)
41
0
        return NULL;
42
0
    cb = BN_GENCB_new();
43
0
    if (cb == NULL)
44
0
        goto err;
45
46
0
    BN_GENCB_set_old(cb, callback, cb_arg);
47
48
0
    if (DSA_generate_parameters_ex(ret, bits, seed_in, seed_len,
49
0
                                   counter_ret, h_ret, cb)) {
50
0
        BN_GENCB_free(cb);
51
0
        return ret;
52
0
    }
53
0
    BN_GENCB_free(cb);
54
0
err:
55
0
    DSA_free(ret);
56
0
    return NULL;
57
0
}