aboutsummaryrefslogtreecommitdiff
path: root/contrib/sendmail
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2020-02-27 22:36:16 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2020-02-27 22:36:16 +0000
commita5f8e6f658eb2b50b1ec165a4ed4a48b85b3ccce (patch)
treeac5d8b5ce93e11e3cb81c5584d42ebe5facbd0b4 /contrib/sendmail
parenta33b3343362411cd0ccdd9476322cc4662469232 (diff)
downloadsrc-a5f8e6f658eb2b50b1ec165a4ed4a48b85b3ccce.tar.gz
src-a5f8e6f658eb2b50b1ec165a4ed4a48b85b3ccce.zip
Notes
Diffstat (limited to 'contrib/sendmail')
-rw-r--r--contrib/sendmail/src/tls.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/contrib/sendmail/src/tls.c b/contrib/sendmail/src/tls.c
index 214f7788ed2f..43ef9712111c 100644
--- a/contrib/sendmail/src/tls.c
+++ b/contrib/sendmail/src/tls.c
@@ -83,20 +83,24 @@ static unsigned char dh512_g[] =
static DH *
get_dh512()
{
- DH *dh = NULL;
+ DH *dh;
BIGNUM *dhp_bn, *dhg_bn;
if ((dh = DH_new()) == NULL)
return NULL;
dhp_bn = BN_bin2bn(dh512_p, sizeof(dh512_p), NULL);
dhg_bn = BN_bin2bn(dh512_g, sizeof(dh512_g), NULL);
- if ((dhp_bn == NULL) || (dhg_bn == NULL) || !DH_set0_pqg(dh, dhp_bn, NULL, dhg_bn))
+ if ((dhp_bn == NULL) || (dhg_bn == NULL))
{
- DH_free(dh);
BN_free(dhp_bn);
BN_free(dhg_bn);
return NULL;
}
+ if (!DH_set0_pqg(dh, dhp_bn, NULL, dhg_bn))
+ {
+ DH_free(dh);
+ return NULL;
+ }
return dh;
}
@@ -149,13 +153,17 @@ get_dh2048()
return NULL;
dhp_bn = BN_bin2bn(dh2048_p, sizeof(dh2048_p), NULL);
dhg_bn = BN_bin2bn(dh2048_g, sizeof(dh2048_g), NULL);
- if ((dhp_bn == NULL) || (dhg_bn == NULL) || !DH_set0_pqg(dh, dhp_bn, NULL, dhg_bn))
+ if ((dhp_bn == NULL) || (dhg_bn == NULL))
{
- DH_free(dh);
BN_free(dhp_bn);
BN_free(dhg_bn);
return NULL;
}
+ if (!DH_set0_pqg(dh, dhp_bn, NULL, dhg_bn))
+ {
+ DH_free(dh);
+ return NULL;
+ }
return dh;
}
# endif /* !NO_DH */