From owner-svn-ports-head@freebsd.org Tue Nov 13 21:35:31 2018 Return-Path: Delivered-To: svn-ports-head@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 933691132D4F; Tue, 13 Nov 2018 21:35:31 +0000 (UTC) (envelope-from arved@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 069B37979C; Tue, 13 Nov 2018 21:35:31 +0000 (UTC) (envelope-from arved@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 D824315E9E; Tue, 13 Nov 2018 21:35:30 +0000 (UTC) (envelope-from arved@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wADLZUpD022508; Tue, 13 Nov 2018 21:35:30 GMT (envelope-from arved@FreeBSD.org) Received: (from arved@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wADLZUEt022506; Tue, 13 Nov 2018 21:35:30 GMT (envelope-from arved@FreeBSD.org) Message-Id: <201811132135.wADLZUEt022506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arved set sender to arved@FreeBSD.org using -f From: Tilman Keskinoz Date: Tue, 13 Nov 2018 21:35:30 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r484900 - in head/mail/enma: . files X-SVN-Group: ports-head X-SVN-Commit-Author: arved X-SVN-Commit-Paths: in head/mail/enma: . files X-SVN-Commit-Revision: 484900 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 069B37979C X-Spamd-Result: default: False [-103.07 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ALLOW_DOMAIN_WHITELIST(-100.00)[FreeBSD.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 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: Tue, 13 Nov 2018 21:35:31 -0000 Author: arved Date: Tue Nov 13 21:35:30 2018 New Revision: 484900 URL: https://svnweb.freebsd.org/changeset/ports/484900 Log: Fix build with openssl 1.1 PR: 233130 Submitted by: Yoshihiro Takahashi Added: head/mail/enma/files/patch-libsauth_src_dkimdigester.c (contents, props changed) head/mail/enma/files/patch-libsauth_src_dkimpublickey.c (contents, props changed) Modified: head/mail/enma/Makefile Modified: head/mail/enma/Makefile ============================================================================== --- head/mail/enma/Makefile Tue Nov 13 21:11:54 2018 (r484899) +++ head/mail/enma/Makefile Tue Nov 13 21:35:30 2018 (r484900) @@ -3,7 +3,7 @@ PORTNAME= enma PORTVERSION= 1.2.0 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= mail MASTER_SITES= SF/${PORTNAME}/ENMA/${PORTVERSION} Added: head/mail/enma/files/patch-libsauth_src_dkimdigester.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/enma/files/patch-libsauth_src_dkimdigester.c Tue Nov 13 21:35:30 2018 (r484900) @@ -0,0 +1,153 @@ +--- ./libsauth/src/dkimdigester.c.org 2011-10-16 17:08:36.000000000 +0900 ++++ ./libsauth/src/dkimdigester.c 2018-11-11 18:20:49.869300000 +0900 +@@ -32,12 +32,17 @@ + #include "dkimpolicybase.h" + #include "dkimdigester.h" + ++#if (OPENSSL_VERSION_NUMBER < 0x10100000L) ++#define EVP_MD_CTX_new EVP_MD_CTX_create ++#define EVP_MD_CTX_free EVP_MD_CTX_destroy ++#endif ++ + struct DkimDigester { + const DkimPolicyBase *policy; + const EVP_MD *digest_alg; + int pubkey_alg; +- EVP_MD_CTX header_digest; +- EVP_MD_CTX body_digest; ++ EVP_MD_CTX *header_digest; ++ EVP_MD_CTX *body_digest; + DkimCanonicalizer *canon; + /// body length limit. sig-l-tag itself. -1 for unlimited. + long long body_length_limit; +@@ -210,13 +215,23 @@ + if (NULL == self->canon) { + goto cleanup; + } // end if +- if (0 == EVP_DigestInit(&(self->header_digest), self->digest_alg)) { ++ if (NULL == (self->header_digest = EVP_MD_CTX_new())) { ++ DkimLogNoResource(self->policy); ++ DkimDigester_free(self); ++ return DSTAT_SYSERR_NORESOURCE; ++ } // end if ++ if (0 == EVP_DigestInit(self->header_digest, self->digest_alg)) { + DkimLogSysError(policy, "Digest Initialization (of header) failed"); + DkimDigester_logOpenSSLErrors(self); + SETDEREF(dstat, DSTAT_SYSERR_NORESOURCE); + goto cleanup; + } // end if +- if (0 == EVP_DigestInit(&(self->body_digest), self->digest_alg)) { ++ if (NULL == (self->body_digest = EVP_MD_CTX_new())) { ++ DkimLogNoResource(self->policy); ++ DkimDigester_free(self); ++ return DSTAT_SYSERR_NORESOURCE; ++ } // end if ++ if (0 == EVP_DigestInit(self->body_digest, self->digest_alg)) { + DkimLogSysError(policy, "Digest Initialization (of body) failed"); + DkimDigester_logOpenSSLErrors(self); + SETDEREF(dstat, DSTAT_SYSERR_NORESOURCE); +@@ -246,9 +261,14 @@ + if (NULL != self->canon) { + DkimCanonicalizer_free(self->canon); + } // end if +- (void) EVP_MD_CTX_cleanup(&(self->header_digest)); +- (void) EVP_MD_CTX_cleanup(&(self->body_digest)); + ++ if (NULL != self->header_digest) { ++ EVP_MD_CTX_free(self->header_digest); ++ } ++ if (NULL != self->body_digest) { ++ EVP_MD_CTX_free(self->body_digest); ++ } ++ + // No need to clean up "self->digest_alg" + + free(self); +@@ -289,7 +309,7 @@ + } // end if + + if (0 < srclen) { +- if (0 == EVP_DigestUpdate(&self->body_digest, buf, srclen)) { ++ if (0 == EVP_DigestUpdate(self->body_digest, buf, srclen)) { + DkimLogSysError(self->policy, "Digest update (of body) failed"); + DkimDigester_logOpenSSLErrors(self); + return DSTAT_SYSERR_DIGEST_UPDATE_FAILURE; +@@ -360,7 +380,7 @@ + // discard errors occurred in functions for debugging + (void) DkimDigester_dumpCanonicalizedHeader(self, canonbuf, canonsize); + +- if (0 == EVP_DigestUpdate(&self->header_digest, canonbuf, canonsize)) { ++ if (0 == EVP_DigestUpdate(self->header_digest, canonbuf, canonsize)) { + DkimLogSysError(self->policy, "Digest update (of header) failed"); + DkimDigester_logOpenSSLErrors(self); + return DSTAT_SYSERR_DIGEST_UPDATE_FAILURE; +@@ -487,7 +507,7 @@ + (void) DkimDigester_dumpCanonicalizedHeader(self, canonbuf, canonsize); + + // update digest +- if (0 == EVP_DigestUpdate(&self->header_digest, canonbuf, canonsize)) { ++ if (0 == EVP_DigestUpdate(self->header_digest, canonbuf, canonsize)) { + DkimLogSysError(self->policy, "Digest update (of signature header) failed"); + DkimDigester_logOpenSSLErrors(self); + return DSTAT_SYSERR_DIGEST_UPDATE_FAILURE; +@@ -524,9 +544,9 @@ + + // check if the type of the public key is suitable for the algorithm + // specified by sig-a-tag of the DKIM-Signature header. +- if (publickey->type != self->pubkey_alg) { ++ if (EVP_PKEY_base_id(publickey) != self->pubkey_alg) { + DkimLogPermFail(self->policy, "Public key algorithm mismatch: signature=0x%x, pubkey=0x%x", +- publickey->type, self->pubkey_alg); ++ EVP_PKEY_base_id(publickey), self->pubkey_alg); + return DSTAT_PERMFAIL_PUBLICKEY_TYPE_MISMATCH; + } // end if + +@@ -541,7 +561,7 @@ + if (DSTAT_OK != ret) { + return ret; + } // end if +- if (0 == EVP_DigestFinal(&self->body_digest, md, &mdlen)) { ++ if (0 == EVP_DigestFinal(self->body_digest, md, &mdlen)) { + DkimLogSysError(self->policy, "Digest finish (of body) failed"); + DkimDigester_logOpenSSLErrors(self); + return DSTAT_SYSERR_DIGEST_UPDATE_FAILURE; +@@ -573,7 +593,7 @@ + const XBuffer *headerhash = DkimSignature_getSignatureValue(signature); + signbuf = (const unsigned char *) XBuffer_getBytes(headerhash); + signlen = XBuffer_getSize(headerhash); +- int vret = EVP_VerifyFinal(&self->header_digest, signbuf, signlen, publickey); ++ int vret = EVP_VerifyFinal(self->header_digest, signbuf, signlen, publickey); + // EVP_VerifyFinal() returns 1 for a correct signature, 0 for failure and -1 if some other error occurred. + switch (vret) { + case 1: // the signature is correct +@@ -614,10 +634,10 @@ + assert(NULL != privatekey); + + // XXX signature と self の署名/ダイジェストアルゴリズムが一致しているか確認した方がいい +- if (privatekey->type != self->pubkey_alg) { ++ if (EVP_PKEY_base_id(privatekey) != self->pubkey_alg) { + DkimLogPermFail(self->policy, + "Public key algorithm mismatch: signature=0x%x, privatekey=0x%x", +- privatekey->type, self->pubkey_alg); ++ EVP_PKEY_base_id(privatekey), self->pubkey_alg); + return DSTAT_PERMFAIL_PUBLICKEY_TYPE_MISMATCH; + } // end if + +@@ -636,7 +656,7 @@ + unsigned char bodyhashbuf[EVP_MD_size(self->digest_alg)]; // EVP_MAX_MD_SIZE instead of EVP_MD_size() is safer(?) + unsigned int bodyhashlen; + bodyhashlen = EVP_MD_size(self->digest_alg); +- if (0 == EVP_DigestFinal(&self->body_digest, bodyhashbuf, &bodyhashlen)) { ++ if (0 == EVP_DigestFinal(self->body_digest, bodyhashbuf, &bodyhashlen)) { + DkimLogSysError(self->policy, "DigestFinal (of body) failed"); + DkimDigester_logOpenSSLErrors(self); + return DSTAT_SYSERR_DIGEST_UPDATE_FAILURE; +@@ -676,7 +696,7 @@ + + unsigned char signbuf[EVP_PKEY_size(privatekey)]; + unsigned int signlen; +- if (0 == EVP_SignFinal(&self->header_digest, signbuf, &signlen, privatekey)) { ++ if (0 == EVP_SignFinal(self->header_digest, signbuf, &signlen, privatekey)) { + DkimLogSysError(self->policy, "SignFinal (of body) failed"); + DkimDigester_logOpenSSLErrors(self); + return DSTAT_SYSERR_DIGEST_UPDATE_FAILURE; Added: head/mail/enma/files/patch-libsauth_src_dkimpublickey.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/enma/files/patch-libsauth_src_dkimpublickey.c Tue Nov 13 21:35:30 2018 (r484900) @@ -0,0 +1,16 @@ +--- ./libsauth/src/dkimpublickey.c.org 2018-11-11 18:07:34.804563000 +0900 ++++ ./libsauth/src/dkimpublickey.c 2018-11-11 17:48:47.356482000 +0900 +@@ -398,11 +398,11 @@ + // compare key type key-k-tag declared and stored in key-p-tag + switch (self->keytype) { + case DKIM_KEY_TYPE_RSA: +- if (EVP_PKEY_RSA != EVP_PKEY_type(self->pkey->type)) { ++ if (EVP_PKEY_RSA != EVP_PKEY_base_id(self->pkey)) { + DkimLogPermFail + (policy, + "key-k-tag and key-p-tag doesn't match: domain=%s, keyalg=0x%x, keytype=0x%x", +- domain, self->keytype, EVP_PKEY_type(self->pkey->type)); ++ domain, self->keytype, EVP_PKEY_base_id(self->pkey)); + SETDEREF(dstat, DSTAT_PERMFAIL_PUBLICKEY_TYPE_MISMATCH); + goto cleanup; + } // end if