diff options
author | Dirk Meyer <dinoex@FreeBSD.org> | 2019-03-24 20:34:58 +0000 |
---|---|---|
committer | Dirk Meyer <dinoex@FreeBSD.org> | 2019-03-24 20:34:58 +0000 |
commit | 921ea56f18e568bc7768302937972b54c93a72f0 (patch) | |
tree | acb6c427c310559d230bd81b7a3cc3b0b4a93f39 /mail/sendmail | |
parent | 45fc5912750c67aefe26b90c8878aaa2eb496c88 (diff) | |
download | freebsd-ports-921ea56f18e568bc7768302937972b54c93a72f0.zip |
- cleanup patch
Diffstat (limited to 'mail/sendmail')
-rw-r--r-- | mail/sendmail/files/patch-tls.c | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/mail/sendmail/files/patch-tls.c b/mail/sendmail/files/patch-tls.c index 209beb5663e9..d97a19cb3b2c 100644 --- a/mail/sendmail/files/patch-tls.c +++ b/mail/sendmail/files/patch-tls.c @@ -34,7 +34,7 @@ static DH *get_dh512 __P((void)); static unsigned char dh512_p[] = -@@ -64,13 +84,19 @@ static DH * +@@ -64,13 +84,17 @@ static DH * get_dh512() { DH *dh = NULL; @@ -45,20 +45,17 @@ - dh->p = BN_bin2bn(dh512_p, sizeof(dh512_p), NULL); - dh->g = BN_bin2bn(dh512_g, sizeof(dh512_g), NULL); - if ((dh->p == NULL) || (dh->g == NULL)) -- return NULL; -+ dhp_bn = BN_bin2bn(dh512_p, sizeof(dh512_p), NULL); -+ dhg_bn = BN_bin2bn(dh512_g, sizeof(dh512_g), 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)) + { + DH_free(dh); -+ BN_free(dhp_bn); -+ BN_free(dhg_bn); -+ return(NULL); + return NULL; + } return dh; } -@@ -117,14 +143,17 @@ get_dh2048() +@@ -117,15 +141,16 @@ get_dh2048() }; static unsigned char dh2048_g[]={ 0x02, }; DH *dh; @@ -69,17 +66,17 @@ - dh->p=BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL); - dh->g=BN_bin2bn(dh2048_g,sizeof(dh2048_g),NULL); - if ((dh->p == NULL) || (dh->g == NULL)) -+ dhp_bn = BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL); -+ dhg_bn = BN_bin2bn(dh2048_g,sizeof(dh2048_g),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)) { DH_free(dh); -+ BN_free(dhp_bn); -+ BN_free(dhg_bn); - return(NULL); +- return(NULL); ++ return NULL; } return(dh); -@@ -708,6 +737,32 @@ load_certkey(ssl, srv, certfile, keyfile + } +@@ -708,6 +733,30 @@ load_certkey(ssl, srv, certfile, keyfile static char server_session_id_context[] = "sendmail8"; @@ -90,11 +87,9 @@ + unsigned long e; +{ + RSA *rsa = NULL; -+ BIGNUM *bn_rsa_r4; -+ int rc; ++ BIGNUM *bn_rsa_r4; + + bn_rsa_r4 = BN_new(); -+ rc = BN_set_word(bn_rsa_r4, e); + if ((bn_rsa_r4 != NULL) && BN_set_word(bn_rsa_r4, e) && (rsa = RSA_new()) != NULL) + { + if (!RSA_generate_key_ex(rsa, num, bn_rsa_r4, NULL)) @@ -112,7 +107,7 @@ /* 0.9.8a and b have a problem with SSL_OP_TLS_BLOCK_PADDING_BUG */ #if (OPENSSL_VERSION_NUMBER >= 0x0090800fL) # define SM_SSL_OP_TLS_BLOCK_PADDING_BUG 1 -@@ -926,7 +981,7 @@ inittls(ctx, req, options, srv, certfile +@@ -926,7 +975,7 @@ inittls(ctx, req, options, srv, certfile { /* get a pointer to the current certificate validation store */ store = SSL_CTX_get_cert_store(*ctx); /* does not fail */ @@ -121,7 +116,7 @@ if (crl_file != NULL) { if (BIO_read_filename(crl_file, CRLFile) >= 0) -@@ -1003,8 +1058,7 @@ inittls(ctx, req, options, srv, certfile +@@ -1003,8 +1052,7 @@ inittls(ctx, req, options, srv, certfile if (bitset(TLS_I_RSA_TMP, req) # if SM_CONF_SHM && ShmId != SM_SHM_NO_ID && @@ -131,7 +126,7 @@ # else /* SM_CONF_SHM */ && 0 /* no shared memory: no need to generate key now */ # endif /* SM_CONF_SHM */ -@@ -1209,9 +1263,10 @@ inittls(ctx, req, options, srv, certfile +@@ -1209,9 +1257,10 @@ inittls(ctx, req, options, srv, certfile if (tTd(96, 2)) sm_dprintf("inittls: Generating %d bit DH parameters\n", bits); @@ -144,7 +139,7 @@ dh = DSA_dup_DH(dsa); DSA_free(dsa); } -@@ -1744,7 +1799,7 @@ tmp_rsa_key(s, export, keylength) +@@ -1744,7 +1793,7 @@ tmp_rsa_key(s, export, keylength) if (rsa_tmp != NULL) RSA_free(rsa_tmp); @@ -153,7 +148,7 @@ if (rsa_tmp == NULL) { if (LogLevel > 0) -@@ -1971,9 +2026,9 @@ x509_verify_cb(ok, ctx) +@@ -1971,9 +2020,9 @@ x509_verify_cb(ok, ctx) { if (LogLevel > 13) tls_verify_log(ok, ctx, "x509"); |