Date: Sun, 24 Mar 2019 20:34:58 +0000 (UTC) From: Dirk Meyer <dinoex@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r496778 - head/mail/sendmail/files Message-ID: <201903242034.x2OKYw6r068063@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dinoex Date: Sun Mar 24 20:34:58 2019 New Revision: 496778 URL: https://svnweb.freebsd.org/changeset/ports/496778 Log: - cleanup patch Modified: head/mail/sendmail/files/patch-tls.c Modified: head/mail/sendmail/files/patch-tls.c ============================================================================== --- head/mail/sendmail/files/patch-tls.c Sun Mar 24 20:34:22 2019 (r496777) +++ head/mail/sendmail/files/patch-tls.c Sun Mar 24 20:34:58 2019 (r496778) @@ -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");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903242034.x2OKYw6r068063>