From patchwork Wed Sep 16 00:12:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Barnett X-Patchwork-Id: 518142 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 519F91401B5 for ; Wed, 16 Sep 2015 10:13:37 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=J/MbCVOo; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 953BAA3546; Wed, 16 Sep 2015 00:13:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SAXhqVSU61JY; Wed, 16 Sep 2015 00:13:34 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 192B4A3521; Wed, 16 Sep 2015 00:13:34 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id D116C1CEAE4 for ; Wed, 16 Sep 2015 00:13:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id C5B3F26597 for ; Wed, 16 Sep 2015 00:13:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YWSIxwea1K+2 for ; Wed, 16 Sep 2015 00:13:29 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-io0-f172.google.com (mail-io0-f172.google.com [209.85.223.172]) by silver.osuosl.org (Postfix) with ESMTPS id 77836249CF for ; Wed, 16 Sep 2015 00:13:29 +0000 (UTC) Received: by iofh134 with SMTP id h134so215852439iof.0 for ; Tue, 15 Sep 2015 17:13:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BaH+/2S5VK8NBbLZDxTsvAhf+nKO2pMRQ5d41lQjVi8=; b=J/MbCVOob7Rg5dMI8O3vbZvyzvu1HIC5/x7WeTYUjYPAWC0NEfKuVNK9lvht10hFaS 1XUlYFnNMI/97cq0rwTVNMVgMfN1DX7PCcrUrvX3LvDTgxjMwU6c1ndekQAgRGNWmt3j XyIUj5p9wWiKLtbp0Ude+36UsEeNlxmT6j+KBZu4wWGLR/b41q666QdOs/PKRAcjcEtI wc+s5CpcWEzcaQI8IaXzkIVrPErR8pvcCmQ5877U8SFv7//4o1JS0bgJC7bz6C3bOK0m 1yGGyHbiuQjiyE/pCuOVjLLmebm5kRPYTMAD3YTaIMQvwb76k8tt3MbUxqMYF+WNWezl xRYg== X-Received: by 10.107.162.139 with SMTP id l133mr37035535ioe.49.1442362408774; Tue, 15 Sep 2015 17:13:28 -0700 (PDT) Received: from ryan-ubuntu.barnett.net (50-83-61-125.client.mchsi.com. [50.83.61.125]) by smtp.gmail.com with ESMTPSA id ql6sm766176igc.15.2015.09.15.17.13.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 Sep 2015 17:13:27 -0700 (PDT) From: Ryan Barnett To: buildroot@buildroot.org Date: Tue, 15 Sep 2015 19:12:27 -0500 Message-Id: <1442362348-14731-2-git-send-email-ryanbarnett3@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442362348-14731-1-git-send-email-ryanbarnett3@gmail.com> References: <1442362348-14731-1-git-send-email-ryanbarnett3@gmail.com> Cc: Thomas Petazzoni Subject: [Buildroot] [v2 1/2] openssl: use git formatted patches X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Using Git formatted patches makes it easier to adjust the patches when needed. Signed-off-by: Ryan Barnett CC: Thomas Petazzoni CC: Gustavo Zacarias CC: Arnout Vandecappelle --- Changes v1 to v2: - Move changes from patch 2/2 to here (suggested by Arnout) - Note: git automatically detects a delete and new file for patch 001 to 0001. So there is no rename since the changes to the file are greater than 50%. Signed-off-by: Ryan Barnett --- ...time-building-manpages-if-we-re-not-going.patch | 27 ++++++++ ...odev-Fix-issue-with-signature-generation.patch} | 71 +++++++++++++--------- package/openssl/001-do-not-build-docs.patch | 13 ---- 3 files changed, 69 insertions(+), 42 deletions(-) create mode 100644 package/openssl/0001-Dont-waste-time-building-manpages-if-we-re-not-going.patch rename package/openssl/{003-cryptodev-Fix-issue-with-signature-generation.patch => 0002-cryptodev-Fix-issue-with-signature-generation.patch} (82%) delete mode 100644 package/openssl/001-do-not-build-docs.patch diff --git a/package/openssl/0001-Dont-waste-time-building-manpages-if-we-re-not-going.patch b/package/openssl/0001-Dont-waste-time-building-manpages-if-we-re-not-going.patch new file mode 100644 index 0000000..f705863 --- /dev/null +++ b/package/openssl/0001-Dont-waste-time-building-manpages-if-we-re-not-going.patch @@ -0,0 +1,27 @@ +From e76a75ad2d420ff070db18cfe49c508011b11afd Mon Sep 17 00:00:00 2001 +From: Mike Frysinger +Date: Sat, 16 May 2015 18:53:51 +0200 +Subject: [1/2] Dont waste time building manpages if we're not going to use em. + +Signed-off-by: Thomas Petazzoni +Signed-off-by: Ryan Barnett +--- + Makefile.org | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.org b/Makefile.org +index 60f07cc..976ceaf 100644 +--- a/Makefile.org ++++ b/Makefile.org +@@ -527,7 +527,7 @@ dist: + dist_pem_h: + (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean) + +-install: all install_docs install_sw ++install: all install_sw + + install_sw: + @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \ +-- +1.9.1 + diff --git a/package/openssl/003-cryptodev-Fix-issue-with-signature-generation.patch b/package/openssl/0002-cryptodev-Fix-issue-with-signature-generation.patch similarity index 82% rename from package/openssl/003-cryptodev-Fix-issue-with-signature-generation.patch rename to package/openssl/0002-cryptodev-Fix-issue-with-signature-generation.patch index 19ed5e7..c5d05a5 100644 --- a/package/openssl/003-cryptodev-Fix-issue-with-signature-generation.patch +++ b/package/openssl/0002-cryptodev-Fix-issue-with-signature-generation.patch @@ -1,14 +1,24 @@ +From 16f5e2a8ec5909f94a91a87046cbed091ee880e1 Mon Sep 17 00:00:00 2001 +From: Gustavo Zacarias +Date: Sat, 16 May 2015 18:55:08 +0200 +Subject: [2/2] cryptodev: Fix issue with signature generation + Forward port of 0001-cryptodev-Fix-issue-with-signature-generation.patch from http://rt.openssl.org/Ticket/Display.html?id=2770&user=guest&pass=guest It was originally targetted at 1.0.2-beta3. Without this patch digest acceleration via cryptodev is broken. -Signed-off-by: Gustavo Zacarias +Signed-off-by: Thomas Petazzoni +Signed-off-by: Ryan Barnett +--- + crypto/engine/eng_cryptodev.c | 195 +++++++++++++++++++++++++++++++----------- + 1 file changed, 146 insertions(+), 49 deletions(-) -diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto/engine/eng_cryptodev.c ---- openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c 2015-01-28 14:59:58.146682462 -0300 -+++ openssl-1.0.2/crypto/engine/eng_cryptodev.c 2015-01-28 15:29:25.107649077 -0300 +diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c +index 926d95c..7021d9a 100644 +--- a/crypto/engine/eng_cryptodev.c ++++ b/crypto/engine/eng_cryptodev.c @@ -2,6 +2,7 @@ * Copyright (c) 2002 Bob Beck * Copyright (c) 2002 Theo de Raadt @@ -17,7 +27,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto * All rights reserved. * * Redistribution and use in source and binary forms, with or without -@@ -72,7 +73,6 @@ +@@ -72,7 +73,6 @@ struct dev_crypto_state { struct session_op d_sess; int d_fd; # ifdef USE_CRYPTODEV_DIGESTS @@ -25,7 +35,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto unsigned char digest_res[HASH_MAX_LEN]; char *mac_data; int mac_len; -@@ -189,8 +189,10 @@ +@@ -189,8 +189,10 @@ static struct { static struct { int id; int nid; @@ -37,7 +47,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto { CRYPTO_MD5_HMAC, NID_hmacWithMD5, 16 }, -@@ -198,15 +200,15 @@ +@@ -198,15 +200,15 @@ static struct { CRYPTO_SHA1_HMAC, NID_hmacWithSHA1, 20 }, { @@ -57,7 +67,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto { CRYPTO_MD5, NID_md5, 16 }, -@@ -214,6 +216,15 @@ +@@ -214,6 +216,15 @@ static struct { CRYPTO_SHA1, NID_sha1, 20 }, { @@ -73,7 +83,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto 0, NID_undef, 0 }, }; -@@ -288,13 +299,14 @@ +@@ -288,13 +299,14 @@ static int get_cryptodev_ciphers(const int **cnids) static int nids[CRYPTO_ALGORITHM_MAX]; struct session_op sess; int fd, i, count = 0; @@ -89,7 +99,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto for (i = 0; ciphers[i].id && count < CRYPTO_ALGORITHM_MAX; i++) { if (ciphers[i].nid == NID_undef) -@@ -327,18 +339,19 @@ +@@ -327,18 +339,19 @@ static int get_cryptodev_digests(const int **cnids) static int nids[CRYPTO_ALGORITHM_MAX]; struct session_op sess; int fd, i, count = 0; @@ -111,7 +121,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto sess.cipher = 0; if (ioctl(fd, CIOCGSESSION, &sess) != -1 && ioctl(fd, CIOCFSESSION, &sess.ses) != -1) -@@ -424,14 +437,14 @@ +@@ -424,14 +437,14 @@ cryptodev_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, cryp.ses = sess->ses; cryp.flags = 0; cryp.len = inl; @@ -129,7 +139,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto if (!ctx->encrypt) { iiv = in + inl - ctx->cipher->iv_len; memcpy(save_iv, iiv, ctx->cipher->iv_len); -@@ -483,7 +496,7 @@ +@@ -483,7 +496,7 @@ cryptodev_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, if ((state->d_fd = get_dev_crypto()) < 0) return (0); @@ -138,7 +148,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto sess->keylen = ctx->key_len; sess->cipher = cipher; -@@ -749,16 +762,6 @@ +@@ -749,16 +762,6 @@ static int digest_nid_to_cryptodev(int nid) return (0); } @@ -155,7 +165,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto static int cryptodev_digest_init(EVP_MD_CTX *ctx) { struct dev_crypto_state *state = ctx->md_data; -@@ -769,7 +772,6 @@ +@@ -769,7 +772,6 @@ static int cryptodev_digest_init(EVP_MD_CTX *ctx) printf("cryptodev_digest_init: Can't get digest \n"); return (0); } @@ -163,7 +173,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto memset(state, 0, sizeof(struct dev_crypto_state)); if ((state->d_fd = get_dev_crypto()) < 0) { -@@ -777,8 +779,8 @@ +@@ -777,8 +779,8 @@ static int cryptodev_digest_init(EVP_MD_CTX *ctx) return (0); } @@ -174,7 +184,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto sess->mac = digest; if (ioctl(state->d_fd, CIOCGSESSION, sess) < 0) { -@@ -794,8 +796,8 @@ +@@ -794,8 +796,8 @@ static int cryptodev_digest_init(EVP_MD_CTX *ctx) static int cryptodev_digest_update(EVP_MD_CTX *ctx, const void *data, size_t count) { @@ -184,7 +194,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto struct session_op *sess = &state->d_sess; if (!data || state->d_fd < 0) { -@@ -804,7 +806,7 @@ +@@ -804,7 +806,7 @@ static int cryptodev_digest_update(EVP_MD_CTX *ctx, const void *data, } if (!count) { @@ -193,7 +203,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto } if (!(ctx->flags & EVP_MD_CTX_FLAG_ONESHOT)) { -@@ -828,9 +830,9 @@ +@@ -828,9 +830,9 @@ static int cryptodev_digest_update(EVP_MD_CTX *ctx, const void *data, cryp.ses = sess->ses; cryp.flags = 0; cryp.len = count; @@ -205,7 +215,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto if (ioctl(state->d_fd, CIOCCRYPT, &cryp) < 0) { printf("cryptodev_digest_update: digest failed\n"); return (0); -@@ -844,8 +846,6 @@ +@@ -844,8 +846,6 @@ static int cryptodev_digest_final(EVP_MD_CTX *ctx, unsigned char *md) struct dev_crypto_state *state = ctx->md_data; struct session_op *sess = &state->d_sess; @@ -214,7 +224,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto if (!md || state->d_fd < 0) { printf("cryptodev_digest_final: illegal input\n"); return (0); -@@ -859,7 +859,7 @@ +@@ -859,7 +859,7 @@ static int cryptodev_digest_final(EVP_MD_CTX *ctx, unsigned char *md) cryp.len = state->mac_len; cryp.src = state->mac_data; cryp.dst = NULL; @@ -223,7 +233,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto if (ioctl(state->d_fd, CIOCCRYPT, &cryp) < 0) { printf("cryptodev_digest_final: digest failed\n"); return (0); -@@ -870,7 +870,7 @@ +@@ -870,7 +870,7 @@ static int cryptodev_digest_final(EVP_MD_CTX *ctx, unsigned char *md) memcpy(md, state->digest_res, ctx->digest->md_size); @@ -232,7 +242,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto } static int cryptodev_digest_cleanup(EVP_MD_CTX *ctx) -@@ -921,8 +921,8 @@ +@@ -921,8 +921,8 @@ static int cryptodev_digest_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from) digest = digest_nid_to_cryptodev(to->digest->type); @@ -243,7 +253,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto sess->mac = digest; dstate->d_fd = get_dev_crypto(); -@@ -947,32 +947,116 @@ +@@ -947,32 +947,116 @@ static int cryptodev_digest_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from) const EVP_MD cryptodev_sha1 = { NID_sha1, @@ -367,7 +377,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto }; # endif /* USE_CRYPTODEV_DIGESTS */ -@@ -992,6 +1076,18 @@ +@@ -992,6 +1076,18 @@ cryptodev_engine_digests(ENGINE *e, const EVP_MD **digest, case NID_sha1: *digest = &cryptodev_sha1; break; @@ -386,7 +396,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto default: # endif /* USE_CRYPTODEV_DIGESTS */ *digest = NULL; -@@ -1022,7 +1118,7 @@ +@@ -1022,7 +1118,7 @@ static int bn2crparam(const BIGNUM *a, struct crparam *crp) return (1); memset(b, 0, bytes); @@ -395,7 +405,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto crp->crp_nbits = bits; for (i = 0, j = 0; i < a->top; i++) { -@@ -1277,7 +1373,7 @@ +@@ -1277,7 +1373,7 @@ static DSA_SIG *cryptodev_dsa_do_sign(const unsigned char *dgst, int dlen, kop.crk_op = CRK_DSA_SIGN; /* inputs: dgst dsa->p dsa->q dsa->g dsa->priv_key */ @@ -404,7 +414,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto kop.crk_param[0].crp_nbits = dlen * 8; if (bn2crparam(dsa->p, &kop.crk_param[1])) goto err; -@@ -1317,7 +1413,7 @@ +@@ -1317,7 +1413,7 @@ cryptodev_dsa_verify(const unsigned char *dgst, int dlen, kop.crk_op = CRK_DSA_VERIFY; /* inputs: dgst dsa->p dsa->q dsa->g dsa->pub_key sig->r sig->s */ @@ -413,7 +423,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto kop.crk_param[0].crp_nbits = dlen * 8; if (bn2crparam(dsa->p, &kop.crk_param[1])) goto err; -@@ -1398,9 +1494,10 @@ +@@ -1398,9 +1494,10 @@ cryptodev_dh_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) goto err; kop.crk_iparams = 3; @@ -426,7 +436,7 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto if (ioctl(fd, CIOCKEY, &kop) == -1) { const DH_METHOD *meth = DH_OpenSSL(); -@@ -1470,7 +1567,7 @@ +@@ -1470,7 +1567,7 @@ void ENGINE_load_cryptodev(void) put_dev_crypto(fd); if (!ENGINE_set_id(engine, "cryptodev") || @@ -435,3 +445,6 @@ diff -Nura openssl-1.0.2.orig/crypto/engine/eng_cryptodev.c openssl-1.0.2/crypto !ENGINE_set_ciphers(engine, cryptodev_engine_ciphers) || !ENGINE_set_digests(engine, cryptodev_engine_digests) || !ENGINE_set_ctrl_function(engine, cryptodev_ctrl) || +-- +1.9.1 + diff --git a/package/openssl/001-do-not-build-docs.patch b/package/openssl/001-do-not-build-docs.patch deleted file mode 100644 index 135a9d3..0000000 --- a/package/openssl/001-do-not-build-docs.patch +++ /dev/null @@ -1,13 +0,0 @@ -Dont waste time building manpages if we're not going to use em. - ---- openssl/Makefile.org -+++ openssl/Makefile.org -@@ -792,7 +792,7 @@ - dist_pem_h: - (cd crypto/pem; $(MAKE) CC='${CC}' SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean) - --install: all install_docs install_sw -+install: all install_sw - - install_sw: - @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \