summaryrefslogtreecommitdiffstats
path: root/crypto/dsa/dsa_gen.c
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>2008-12-26 17:17:21 +0000
committerBen Laurie <ben@openssl.org>2008-12-26 17:17:21 +0000
commit1457619e13a091fc8ff12c324e05603b30f10562 (patch)
treeef05712bff9a4581b60ed283b76c52378c79864b /crypto/dsa/dsa_gen.c
parentccf529928f0d032d8a83b54c0f7c546e59669811 (diff)
Remove misleading dead code. Constify. (Coverity ID 142)
Diffstat (limited to 'crypto/dsa/dsa_gen.c')
-rw-r--r--crypto/dsa/dsa_gen.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/crypto/dsa/dsa_gen.c b/crypto/dsa/dsa_gen.c
index 2435fc8bc7..0fcd25f8b0 100644
--- a/crypto/dsa/dsa_gen.c
+++ b/crypto/dsa/dsa_gen.c
@@ -82,7 +82,7 @@
#include "dsa_locl.h"
int DSA_generate_parameters_ex(DSA *ret, int bits,
- unsigned char *seed_in, int seed_len,
+ const unsigned char *seed_in, int seed_len,
int *counter_ret, unsigned long *h_ret, BN_GENCB *cb)
{
if(ret->meth->dsa_paramgen)
@@ -110,7 +110,7 @@ int DSA_generate_parameters_ex(DSA *ret, int bits,
}
int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits,
- const EVP_MD *evpmd, unsigned char *seed_in, size_t seed_len,
+ const EVP_MD *evpmd, const unsigned char *seed_in, size_t seed_len,
int *counter_ret, unsigned long *h_ret, BN_GENCB *cb)
{
int ok=0;
@@ -149,11 +149,7 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits,
seed_len = qsize; /* App. 2.2 of FIPS PUB 186 allows larger SEED,
* but our internal buffers are restricted to 160 bits*/
if (seed_in != NULL)
- {
memcpy(seed, seed_in, seed_len);
- /* set seed_in to NULL to avoid it being copied back */
- seed_in = NULL;
- }
if ((ctx=BN_CTX_new()) == NULL)
goto err;
@@ -335,7 +331,6 @@ err:
ok=0;
goto err;
}
- if (seed_in != NULL) memcpy(seed_in,seed, qsize);
if (counter_ret != NULL) *counter_ret=counter;
if (h_ret != NULL) *h_ret=h;
}