Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Feb 2020 19:40:29 +0000 (UTC)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r358404 - head/contrib/sendmail/src
Message-ID:  <202002271940.01RJeTsG036297@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hrs
Date: Thu Feb 27 19:40:29 2020
New Revision: 358404
URL: https://svnweb.freebsd.org/changeset/base/358404

Log:
  Fix broken STARTTLS when SharedMemoryKey is enabled.
  
  OpenSSL 1.1 API patch for sendmail had a bug which
  prevented sm_RSA_generate_key() function from working.
  This function is used to generate a temporary RSA key
  for a shared memory region used for TLS processing.
  Note that 12.0 and 12.1-RELEASE include this bug.
  
  This affects only if SM_CONF_SHM compile-time
  option (enabled by default) and SharedMemoryKey
  run-time option (not enabled by default) in a .cf file are
  specified.  The latter corresponds to confSHARED_MEMORY_KEY in
  a .mc file.
  
  PR:		242861
  MFC after:	3 days
  Differential Revision:	https://reviews.freebsd.org/D23734

Modified:
  head/contrib/sendmail/src/tls.c

Modified: head/contrib/sendmail/src/tls.c
==============================================================================
--- head/contrib/sendmail/src/tls.c	Thu Feb 27 19:40:20 2020	(r358403)
+++ head/contrib/sendmail/src/tls.c	Thu Feb 27 19:40:29 2020	(r358404)
@@ -745,18 +745,15 @@ sm_RSA_generate_key(num, e)
 {
 	RSA *rsa = NULL;
         BIGNUM *bn_rsa_r4;
-	int rc;
 
 	bn_rsa_r4 = BN_new();
-        rc = BN_set_word(bn_rsa_r4, RSA_F4);
-	if ((bn_rsa_r4 != NULL) && BN_set_word(bn_rsa_r4, RSA_F4) && (rsa = RSA_new()) != NULL)
+	if ((bn_rsa_r4 != NULL) && BN_set_word(bn_rsa_r4, e) && (rsa = RSA_new()) != NULL)
 	{
-		if (!RSA_generate_key_ex(rsa, RSA_KEYLENGTH, bn_rsa_r4, NULL))
+		if (!RSA_generate_key_ex(rsa, num, bn_rsa_r4, NULL))
 		{
 			RSA_free(rsa);
 			rsa = NULL;
 		}
-		return NULL;
 	}
 	BN_free(bn_rsa_r4);
 	return rsa;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002271940.01RJeTsG036297>