summaryrefslogtreecommitdiffstats
path: root/crypto/dh
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2005-04-26 18:53:22 +0000
committerBodo Möller <bodo@openssl.org>2005-04-26 18:53:22 +0000
commitaa4ce7315f65fdf8940d5bc9e562aa478f0335d3 (patch)
tree204f2143da41bd1cdff17503baeab94ea58d4e89 /crypto/dh
parentc741b83762a9f318d515f32624caab6aedf8d2c5 (diff)
Fix various incorrect error function codes.
("perl util/ck_errf.pl */*.c */*/*.c" still reports many more.)
Diffstat (limited to 'crypto/dh')
-rw-r--r--crypto/dh/dh.h7
-rw-r--r--crypto/dh/dh_err.c7
-rw-r--r--crypto/dh/dh_gen.c4
-rw-r--r--crypto/dh/dh_key.c6
4 files changed, 13 insertions, 11 deletions
diff --git a/crypto/dh/dh.h b/crypto/dh/dh.h
index 991a018ef2..a933601245 100644
--- a/crypto/dh/dh.h
+++ b/crypto/dh/dh.h
@@ -198,12 +198,13 @@ void ERR_load_DH_strings(void);
/* Error codes for the DH functions. */
/* Function codes. */
+#define DH_F_COMPUTE_KEY 102
#define DH_F_DHPARAMS_PRINT 100
#define DH_F_DHPARAMS_PRINT_FP 101
-#define DH_F_DH_COMPUTE_KEY 102
-#define DH_F_DH_GENERATE_KEY 103
-#define DH_F_DH_GENERATE_PARAMETERS 104
+#define DH_F_DH_BUILTIN_GENPARAMS 106
#define DH_F_DH_NEW_METHOD 105
+#define DH_F_GENERATE_KEY 103
+#define DH_F_GENERATE_PARAMETERS 104
/* Reason codes. */
#define DH_R_BAD_GENERATOR 101
diff --git a/crypto/dh/dh_err.c b/crypto/dh/dh_err.c
index 83ccb41221..edce2c7036 100644
--- a/crypto/dh/dh_err.c
+++ b/crypto/dh/dh_err.c
@@ -70,12 +70,13 @@
static ERR_STRING_DATA DH_str_functs[]=
{
+{ERR_FUNC(DH_F_COMPUTE_KEY), "COMPUTE_KEY"},
{ERR_FUNC(DH_F_DHPARAMS_PRINT), "DHparams_print"},
{ERR_FUNC(DH_F_DHPARAMS_PRINT_FP), "DHparams_print_fp"},
-{ERR_FUNC(DH_F_DH_COMPUTE_KEY), "DH_compute_key"},
-{ERR_FUNC(DH_F_DH_GENERATE_KEY), "DH_generate_key"},
-{ERR_FUNC(DH_F_DH_GENERATE_PARAMETERS), "DH_generate_parameters"},
+{ERR_FUNC(DH_F_DH_BUILTIN_GENPARAMS), "DH_BUILTIN_GENPARAMS"},
{ERR_FUNC(DH_F_DH_NEW_METHOD), "DH_new_method"},
+{ERR_FUNC(DH_F_GENERATE_KEY), "GENERATE_KEY"},
+{ERR_FUNC(DH_F_GENERATE_PARAMETERS), "GENERATE_PARAMETERS"},
{0,NULL}
};
diff --git a/crypto/dh/dh_gen.c b/crypto/dh/dh_gen.c
index 1f805073cf..cfd5b11868 100644
--- a/crypto/dh/dh_gen.c
+++ b/crypto/dh/dh_gen.c
@@ -119,7 +119,7 @@ static int dh_builtin_genparams(DH *ret, int prime_len, int generator, BN_GENCB
if (generator <= 1)
{
- DHerr(DH_F_DH_GENERATE_PARAMETERS, DH_R_BAD_GENERATOR);
+ DHerr(DH_F_DH_BUILTIN_GENPARAMS, DH_R_BAD_GENERATOR);
goto err;
}
if (generator == DH_GENERATOR_2)
@@ -162,7 +162,7 @@ static int dh_builtin_genparams(DH *ret, int prime_len, int generator, BN_GENCB
err:
if (ok == -1)
{
- DHerr(DH_F_DH_GENERATE_PARAMETERS,ERR_R_BN_LIB);
+ DHerr(DH_F_DH_BUILTIN_GENPARAMS,ERR_R_BN_LIB);
ok=0;
}
diff --git a/crypto/dh/dh_key.c b/crypto/dh/dh_key.c
index 48e7be45c5..ad026cb861 100644
--- a/crypto/dh/dh_key.c
+++ b/crypto/dh/dh_key.c
@@ -148,7 +148,7 @@ static int generate_key(DH *dh)
ok=1;
err:
if (ok != 1)
- DHerr(DH_F_DH_GENERATE_KEY,ERR_R_BN_LIB);
+ DHerr(DH_F_GENERATE_KEY,ERR_R_BN_LIB);
if ((pub_key != NULL) && (dh->pub_key == NULL)) BN_free(pub_key);
if ((priv_key != NULL) && (dh->priv_key == NULL)) BN_free(priv_key);
@@ -170,7 +170,7 @@ static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
if (dh->priv_key == NULL)
{
- DHerr(DH_F_DH_COMPUTE_KEY,DH_R_NO_PRIVATE_VALUE);
+ DHerr(DH_F_COMPUTE_KEY,DH_R_NO_PRIVATE_VALUE);
goto err;
}
if ((dh->method_mont_p == NULL) && (dh->flags & DH_FLAG_CACHE_MONT_P))
@@ -183,7 +183,7 @@ static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
mont=(BN_MONT_CTX *)dh->method_mont_p;
if (!dh->meth->bn_mod_exp(dh, tmp, pub_key, dh->priv_key,dh->p,ctx,mont))
{
- DHerr(DH_F_DH_COMPUTE_KEY,ERR_R_BN_LIB);
+ DHerr(DH_F_COMPUTE_KEY,ERR_R_BN_LIB);
goto err;
}