From owner-svn-ports-head@FreeBSD.ORG Sun Jan 11 14:10:34 2015 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 058DE64D; Sun, 11 Jan 2015 14:10:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9D7A7FB; Sun, 11 Jan 2015 14:10:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0BEAXAm045880; Sun, 11 Jan 2015 14:10:33 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0BEAX4B045879; Sun, 11 Jan 2015 14:10:33 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201501111410.t0BEAX4B045879@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Sun, 11 Jan 2015 14:10:33 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r376785 - head/security/sst/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2015 14:10:34 -0000 Author: tijl Date: Sun Jan 11 14:10:33 2015 New Revision: 376785 URL: https://svnweb.freebsd.org/changeset/ports/376785 QAT: https://qat.redports.org/buildarchive/r376785/ Log: Fix build when OpenSSL doesn't support SSL2/SSL3 PR: 195796 Modified: head/security/sst/files/patch-sst.c Modified: head/security/sst/files/patch-sst.c ============================================================================== --- head/security/sst/files/patch-sst.c Sun Jan 11 14:07:03 2015 (r376784) +++ head/security/sst/files/patch-sst.c Sun Jan 11 14:10:33 2015 (r376785) @@ -1,13 +1,16 @@ ---- sst.c 2000-05-04 15:47:28.000000000 -0400 -+++ sst.c 2013-06-20 08:55:27.000000000 -0400 -@@ -213,5 +213,5 @@ +--- sst.c.orig 2000-05-04 19:47:28 UTC ++++ sst.c +@@ -212,7 +212,7 @@ + ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** */ #ifndef lint -static char rcsid[] = "$Header: /local/src/local.bin/sst/SRC/RCS/sst.c,v 1.12 2000/05/04 19:47:26 pkern Exp $"; +static const char rcsid[] = "$Header: /local/src/local.bin/sst/SRC/RCS/sst.c,v 1.12 2000/05/04 19:47:26 pkern Exp $"; #endif -@@ -262,8 +262,8 @@ + #include +@@ -261,10 +261,10 @@ int timeout = 0; + int inetd = 0; int eofclnt = 0; -char *prog = "sst"; @@ -20,7 +23,9 @@ +const char *method = NULL; char certfbuf[MAXPATHLEN], ssldbuf[MAXPATHLEN]; -@@ -298,6 +298,6 @@ + char *certf = NULL, *pkeyf = NULL, *ssld = NULL; +@@ -297,8 +297,8 @@ pid_t pid = 0; + * Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. */ -void @@ -29,7 +34,9 @@ +ERR_log_errors(void) { unsigned long l; -@@ -315,6 +315,6 @@ + char buf[200]; +@@ -314,13 +314,17 @@ ERR_log_errors() + } } -void @@ -38,7 +45,7 @@ +show_SSL_errors(void) { if (logging) ERR_log_errors(); -@@ -322,4 +322,8 @@ + else ERR_print_errors_fp(stderr); } +#ifndef __GNUC__ @@ -47,14 +54,18 @@ + #define SHOW_x(L,F,x) { \ if (logging) syslog((L), "%s", (x)); \ -@@ -347,5 +351,5 @@ + else fprintf((F), "%d: %s\n", getpid(), (x)); } +@@ -346,7 +350,7 @@ show_SSL_errors() + #define SHOW_info2(f,a1,a2) SHOW_x2(LOG_DEBUG,tty,f,a1,a2) -char *usageopts[] = { +const char *usageopts[] = { "", " options:", -@@ -375,7 +379,8 @@ + " --------", +@@ -374,9 +378,10 @@ char *usageopts[] = { + NULL }; -usage() @@ -65,7 +76,9 @@ + const char **uop = usageopts; if (logging) { -@@ -390,6 +395,6 @@ + syslog(LOG_ERR, "usage: %s [ '--' ]", prog); +@@ -389,8 +394,8 @@ usage() + } /* reaper -- zombie prevention */ -void @@ -74,13 +87,17 @@ +reaper(int signal __attribute__((unused))) { int w; -@@ -415,4 +420,5 @@ + pid_t p; +@@ -414,6 +419,7 @@ reaper() + * * - EOF on rd when in server mode means the actual server has finished. */ +static void relay(ssl, sd, rd, wd) SSL *ssl; -@@ -523,20 +529,12 @@ + int sd, rd, wd; +@@ -522,22 +528,14 @@ done: + } if (verbose) { - if (sizeof(off_t) > 4) { @@ -106,7 +123,24 @@ +static void srvr_prep(ctx, ssl, sd) SSL_CTX **ctx; -@@ -610,6 +608,6 @@ + SSL **ssl; +@@ -556,10 +554,14 @@ int sd; + + if (method == NULL) + meth = SSLv23_server_method(); ++#ifndef OPENSSL_NO_SSL2 + else if (strcmp(method, "ssl2") == 0) + meth = SSLv2_server_method(); ++#endif ++#ifndef OPENSSL_NO_SSL3_METHOD + else if (strcmp(method, "ssl3") == 0) + meth = SSLv3_server_method(); ++#endif + else if (strcmp(method, "tls1") == 0) + meth = TLSv1_server_method(); + else +@@ -609,8 +611,8 @@ int sd; + SHOW_info1("client cert subject: %s", subj); SHOW_info1("client cert issuer: %s", issu); - Free(subj); @@ -115,14 +149,33 @@ + free(issu); /* -@@ -625,5 +623,5 @@ + * XXX ... +@@ -624,7 +626,7 @@ int sd; + } } - +static void clnt_prep(ctx, ssl, sd) SSL_CTX **ctx; -@@ -700,6 +698,6 @@ + SSL **ssl; +@@ -643,10 +645,14 @@ int sd; + + if (method == NULL) + meth = SSLv23_client_method(); ++#ifndef OPENSSL_NO_SSL2 + else if (strcmp(method, "ssl2") == 0) + meth = SSLv2_client_method(); ++#endif ++#ifndef OPENSSL_NO_SSL3_METHOD + else if (strcmp(method, "ssl3") == 0) + meth = SSLv3_client_method(); ++#endif + else if (strcmp(method, "tls1") == 0) + meth = TLSv1_client_method(); + else +@@ -699,8 +705,8 @@ int sd; + SHOW_info1("server cert subject: %s", subj); SHOW_info1("server cert issuer: %s", issu); - Free(subj); @@ -131,16 +184,21 @@ + free(issu); /* -@@ -714,5 +712,5 @@ + * XXX ... +@@ -713,7 +719,7 @@ int sd; + X509_free (server_cert); } - +int main(ac, av) int ac; -@@ -757,5 +755,4 @@ + char *av[]; +@@ -756,7 +762,6 @@ char *av[]; + if (logging) openlog(prog, LOG_PID, LOG_SSL); if (errflg) { -usage: usage(); exit(1); + }