Bug 242862

Summary: mail/sendmail patch-tls.c breaks STARTTLS - sm_RSA_generate_key() returns NULL all the times
Product: Ports & Packages Reporter: Dan Lukes <dan+freebsd.org>
Component: Individual Port(s)Assignee: Dirk Meyer <dinoex>
Status: Closed FIXED    
Severity: Affects Only Me Flags: dinoex: maintainer-feedback+
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242861

Description Dan Lukes 2019-12-24 15:48:14 UTC
patch-tls.c introduces sm_RSA_generate_key() function used as replacement of original RSA_generate_key/RSA_generate_key_ex function.

Because of forgotten/excessive "return NULL" the function returns NULL all the times. As a result, server TLS initialisation fails and STARTTLS feature is not offered by server.

Lines
98 	+                       rsa = NULL;
99 	+               }
100 	+               return NULL;

should be

98 	+                       rsa = NULL;
99 	+               }
Comment 1 Dirk Meyer freebsd_committer freebsd_triage 2019-12-24 20:50:50 UTC
Thanks for reporting this.
Comment 2 commit-hook freebsd_committer freebsd_triage 2019-12-24 21:31:33 UTC
A commit references this bug:

Author: dinoex
Date: Tue Dec 24 21:30:57 UTC 2019
New revision: 520819
URL: https://svnweb.freebsd.org/changeset/ports/520819

Log:
  - fix RSA_generate_key
  PR:		242862
  Submitted by:	Dan Lukes

Changes:
  head/mail/sendmail/Makefile
  head/mail/sendmail/files/patch-tls.c
Comment 3 Dan Lukes 2019-12-25 10:28:31 UTC
My former PRs has been waiting years for someone's attention. This one has been accepted and committed within hours. Christmas day is simply a time of miracles. Thanks.