From owner-svn-ports-all@freebsd.org Mon May 7 19:09:03 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 820C2FB9D85; Mon, 7 May 2018 19:09:03 +0000 (UTC) (envelope-from brnrd@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 2CA8F70311; Mon, 7 May 2018 19:09:03 +0000 (UTC) (envelope-from brnrd@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 2376E1F654; Mon, 7 May 2018 19:09:03 +0000 (UTC) (envelope-from brnrd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w47J93s0056865; Mon, 7 May 2018 19:09:03 GMT (envelope-from brnrd@FreeBSD.org) Received: (from brnrd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w47J92XZ056863; Mon, 7 May 2018 19:09:02 GMT (envelope-from brnrd@FreeBSD.org) Message-Id: <201805071909.w47J92XZ056863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brnrd set sender to brnrd@FreeBSD.org using -f From: Bernard Spil Date: Mon, 7 May 2018 19:09:02 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r469311 - head/databases/mysql56-server/files X-SVN-Group: ports-head X-SVN-Commit-Author: brnrd X-SVN-Commit-Paths: head/databases/mysql56-server/files X-SVN-Commit-Revision: 469311 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.25 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, 07 May 2018 19:09:03 -0000 Author: brnrd Date: Mon May 7 19:09:02 2018 New Revision: 469311 URL: https://svnweb.freebsd.org/changeset/ports/469311 Log: databases/mysql56-server: Fix build with LibreSSL PR: 227178 Approved by: mmokhi (maintainer) Added: head/databases/mysql56-server/files/patch-mysys__ssl_my__aes__openssl.cc (contents, props changed) head/databases/mysql56-server/files/patch-vio_viosslfactories.c (contents, props changed) Added: head/databases/mysql56-server/files/patch-mysys__ssl_my__aes__openssl.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/databases/mysql56-server/files/patch-mysys__ssl_my__aes__openssl.cc Mon May 7 19:09:02 2018 (r469311) @@ -0,0 +1,111 @@ +--- mysys_ssl/my_aes_openssl.cc.orig 2017-12-09 07:33:37 UTC ++++ mysys_ssl/my_aes_openssl.cc +@@ -108,33 +108,47 @@ int my_aes_encrypt(const unsigned char * + const unsigned char *key, uint32 key_length, + enum my_aes_opmode mode, const unsigned char *iv) + { +- EVP_CIPHER_CTX ctx; ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ EVP_CIPHER_CTX stack_ctx; ++ EVP_CIPHER_CTX *ctx= &stack_ctx; ++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */ ++ EVP_CIPHER_CTX *ctx= EVP_CIPHER_CTX_new(); ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + const EVP_CIPHER *cipher= aes_evp_type(mode); + int u_len, f_len; + /* The real key to be used for encryption */ + unsigned char rkey[MAX_AES_KEY_LENGTH / 8]; + my_aes_create_key(key, key_length, rkey, mode); + +- if (!cipher || (EVP_CIPHER_iv_length(cipher) > 0 && !iv)) ++ if (!ctx || !cipher || (EVP_CIPHER_iv_length(cipher) > 0 && !iv)) + return MY_AES_BAD_DATA; + +- if (!EVP_EncryptInit(&ctx, cipher, rkey, iv)) ++ if (!EVP_EncryptInit(ctx, cipher, rkey, iv)) + goto aes_error; /* Error */ +- if (!EVP_CIPHER_CTX_set_padding(&ctx, 1)) ++ if (!EVP_CIPHER_CTX_set_padding(ctx, 1)) + goto aes_error; /* Error */ +- if (!EVP_EncryptUpdate(&ctx, dest, &u_len, source, source_length)) ++ if (!EVP_EncryptUpdate(ctx, dest, &u_len, source, source_length)) + goto aes_error; /* Error */ + +- if (!EVP_EncryptFinal(&ctx, dest + u_len, &f_len)) ++ if (!EVP_EncryptFinal(ctx, dest + u_len, &f_len)) + goto aes_error; /* Error */ + +- EVP_CIPHER_CTX_cleanup(&ctx); ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ EVP_CIPHER_CTX_cleanup(ctx); ++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */ ++ EVP_CIPHER_CTX_free(ctx); ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + return u_len + f_len; + + aes_error: + /* need to explicitly clean up the error if we want to ignore it */ + ERR_clear_error(); +- EVP_CIPHER_CTX_cleanup(&ctx); ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ EVP_CIPHER_CTX_cleanup(ctx); ++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */ ++ EVP_CIPHER_CTX_free(ctx); ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ ++ + return MY_AES_BAD_DATA; + } + +@@ -145,7 +159,12 @@ int my_aes_decrypt(const unsigned char * + enum my_aes_opmode mode, const unsigned char *iv) + { + +- EVP_CIPHER_CTX ctx; ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ EVP_CIPHER_CTX stack_ctx; ++ EVP_CIPHER_CTX *ctx= &stack_ctx; ++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */ ++ EVP_CIPHER_CTX *ctx= EVP_CIPHER_CTX_new(); ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + const EVP_CIPHER *cipher= aes_evp_type(mode); + int u_len, f_len; + +@@ -156,24 +175,30 @@ int my_aes_decrypt(const unsigned char * + if (!cipher || (EVP_CIPHER_iv_length(cipher) > 0 && !iv)) + return MY_AES_BAD_DATA; + +- EVP_CIPHER_CTX_init(&ctx); +- +- if (!EVP_DecryptInit(&ctx, aes_evp_type(mode), rkey, iv)) ++ if (!EVP_DecryptInit(ctx, aes_evp_type(mode), rkey, iv)) + goto aes_error; /* Error */ +- if (!EVP_CIPHER_CTX_set_padding(&ctx, 1)) ++ if (!EVP_CIPHER_CTX_set_padding(ctx, 1)) + goto aes_error; /* Error */ +- if (!EVP_DecryptUpdate(&ctx, dest, &u_len, source, source_length)) ++ if (!EVP_DecryptUpdate(ctx, dest, &u_len, source, source_length)) + goto aes_error; /* Error */ +- if (!EVP_DecryptFinal_ex(&ctx, dest + u_len, &f_len)) ++ if (!EVP_DecryptFinal_ex(ctx, dest + u_len, &f_len)) + goto aes_error; /* Error */ + +- EVP_CIPHER_CTX_cleanup(&ctx); ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ EVP_CIPHER_CTX_cleanup(ctx); ++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */ ++ EVP_CIPHER_CTX_free(ctx); ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + return u_len + f_len; + + aes_error: + /* need to explicitly clean up the error if we want to ignore it */ + ERR_clear_error(); +- EVP_CIPHER_CTX_cleanup(&ctx); ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ EVP_CIPHER_CTX_cleanup(ctx); ++#else /* OPENSSL_VERSION_NUMBER < 0x10100000L */ ++ EVP_CIPHER_CTX_free(ctx); ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + return MY_AES_BAD_DATA; + } + Added: head/databases/mysql56-server/files/patch-vio_viosslfactories.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/databases/mysql56-server/files/patch-vio_viosslfactories.c Mon May 7 19:09:02 2018 (r469311) @@ -0,0 +1,27 @@ +--- vio/viosslfactories.c.orig 2017-12-09 07:33:37 UTC ++++ vio/viosslfactories.c +@@ -68,13 +68,20 @@ static DH *get_dh2048(void) + DH *dh; + if ((dh=DH_new())) + { +- dh->p=BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL); +- dh->g=BN_bin2bn(dh2048_g,sizeof(dh2048_g),NULL); +- if (! dh->p || ! dh->g) +- { ++ BIGNUM *p= BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL); ++ BIGNUM *g= BN_bin2bn(dh2048_g,sizeof(dh2048_g),NULL); ++ if (!p || !g ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L ++ || !DH_set0_pqg(dh, p, NULL, g) ++#endif /* OPENSSL_VERSION_NUMBER >= 0x10100000L */ ++ ) { + DH_free(dh); + dh=0; + } ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ dh->p= p; ++ dh->g= g; ++#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ + } + return(dh); + }