From owner-svn-ports-all@freebsd.org Mon Sep 24 12:46:13 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C585510AB69A; Mon, 24 Sep 2018 12:46:13 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BDFC7F790; Mon, 24 Sep 2018 12:46:13 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76B59198CD; Mon, 24 Sep 2018 12:46:13 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8OCkDUK075968; Mon, 24 Sep 2018 12:46:13 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8OCkDtQ075967; Mon, 24 Sep 2018 12:46:13 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201809241246.w8OCkDtQ075967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Mon, 24 Sep 2018 12:46:13 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r480605 - head/security/cyrus-sasl2/files X-SVN-Group: ports-head X-SVN-Commit-Author: ume X-SVN-Commit-Paths: head/security/cyrus-sasl2/files X-SVN-Commit-Revision: 480605 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Sep 2018 12:46:14 -0000 Author: ume Date: Mon Sep 24 12:46:12 2018 New Revision: 480605 URL: https://svnweb.freebsd.org/changeset/ports/480605 Log: Add OpenSSL 1.1.0 support for saslauthd. There are the patches to support OpenSSL 1.1.0 in cyrus-sasl2 port, already. But, it was incomplete for saslauthd. PR: 231647 Submitted by: dewayne [...] heuristicsystems.com.au (with some modifications) Modified: head/security/cyrus-sasl2/files/patch-saslauthd_lak.c Modified: head/security/cyrus-sasl2/files/patch-saslauthd_lak.c ============================================================================== --- head/security/cyrus-sasl2/files/patch-saslauthd_lak.c Mon Sep 24 12:26:06 2018 (r480604) +++ head/security/cyrus-sasl2/files/patch-saslauthd_lak.c Mon Sep 24 12:46:12 2018 (r480605) @@ -10,3 +10,76 @@ #endif #define LDAP_DEPRECATED 1 +@@ -1715,20 +1718,28 @@ static int lak_base64_decode( + + int rc, i, tlen = 0; + char *text; +- EVP_ENCODE_CTX EVP_ctx; ++ EVP_ENCODE_CTX *enc_ctx = EVP_ENCODE_CTX_new(); ++ ++ if (enc_ctx == NULL) ++ return LAK_NOMEM; + + text = (char *)malloc(((strlen(src)+3)/4 * 3) + 1); +- if (text == NULL) ++ if (text == NULL) { ++ EVP_ENCODE_CTX_free(enc_ctx); + return LAK_NOMEM; ++ } + +- EVP_DecodeInit(&EVP_ctx); +- rc = EVP_DecodeUpdate(&EVP_ctx, text, &i, (char *)src, strlen(src)); ++ EVP_DecodeInit(enc_ctx); ++ rc = EVP_DecodeUpdate(enc_ctx, (unsigned char *) text, &i, (const unsigned char *)src, strlen(src)); + if (rc < 0) { ++ EVP_ENCODE_CTX_free(enc_ctx); + free(text); + return LAK_FAIL; + } + tlen += i; +- EVP_DecodeFinal(&EVP_ctx, text, &i); ++ EVP_DecodeFinal(enc_ctx, (unsigned char *) text, &i); ++ ++ EVP_ENCODE_CTX_free(enc_ctx); + + *ret = text; + if (rlen != NULL) +@@ -1744,7 +1755,7 @@ static int lak_check_hashed( + { + int rc, clen; + LAK_HASH_ROCK *hrock = (LAK_HASH_ROCK *) rock; +- EVP_MD_CTX mdctx; ++ EVP_MD_CTX *mdctx; + const EVP_MD *md; + unsigned char digest[EVP_MAX_MD_SIZE]; + char *cred; +@@ -1753,17 +1764,24 @@ static int lak_check_hashed( + if (!md) + return LAK_FAIL; + ++ mdctx = EVP_MD_CTX_new(); ++ if (!mdctx) ++ return LAK_NOMEM; ++ + rc = lak_base64_decode(hash, &cred, &clen); +- if (rc != LAK_OK) ++ if (rc != LAK_OK) { ++ EVP_MD_CTX_free(mdctx); + return rc; ++ } + +- EVP_DigestInit(&mdctx, md); +- EVP_DigestUpdate(&mdctx, passwd, strlen(passwd)); ++ EVP_DigestInit(mdctx, md); ++ EVP_DigestUpdate(mdctx, passwd, strlen(passwd)); + if (hrock->salted) { +- EVP_DigestUpdate(&mdctx, &cred[EVP_MD_size(md)], ++ EVP_DigestUpdate(mdctx, &cred[EVP_MD_size(md)], + clen - EVP_MD_size(md)); + } +- EVP_DigestFinal(&mdctx, digest, NULL); ++ EVP_DigestFinal(mdctx, digest, NULL); ++ EVP_MD_CTX_free(mdctx); + + rc = memcmp((char *)cred, (char *)digest, EVP_MD_size(md)); + free(cred);