All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre McCurdy <armccurdy@gmail.com>
To: Alexander Kanavin <alex.kanavin@gmail.com>
Cc: OE Core mailing list <openembedded-core@lists.openembedded.org>
Subject: Re: [RFC PATCH 2/6] cryptodev-tests: port to openssl 1.1
Date: Tue, 4 Sep 2018 13:38:44 -0700	[thread overview]
Message-ID: <CAJ86T=XVPbDxD82w8h5ZgZNvf4sFKaYo9pBEWwT_aZjNTJYAdg@mail.gmail.com> (raw)
In-Reply-To: <1f7ed298deed1f23ccd6e67b4701985660abe575.1535451643.git.alex.kanavin@gmail.com>

On Tue, Aug 28, 2018 at 3:23 AM, Alexander Kanavin
<alex.kanavin@gmail.com> wrote:
> From: Alexander Kanavin <alexander.kanavin@linux.intel.com>
>
> This leaves openssh as the only recipe that requires openssl 1.0 (or libressl).
>
> Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
> ---
>  .../cryptodev/cryptodev-tests_1.9.bb               |   3 +-
>  .../files/0001-Port-tests-to-openssl-1.1.patch     | 103 +++++++++++++++++++++
>  2 files changed, 105 insertions(+), 1 deletion(-)
>  create mode 100644 meta/recipes-kernel/cryptodev/files/0001-Port-tests-to-openssl-1.1.patch
>
> diff --git a/meta/recipes-kernel/cryptodev/cryptodev-tests_1.9.bb b/meta/recipes-kernel/cryptodev/cryptodev-tests_1.9.bb
> index 9afb3de..617db6c 100644
> --- a/meta/recipes-kernel/cryptodev/cryptodev-tests_1.9.bb
> +++ b/meta/recipes-kernel/cryptodev/cryptodev-tests_1.9.bb
> @@ -2,10 +2,11 @@ require cryptodev.inc
>
>  SUMMARY = "A test suite for /dev/crypto device driver"
>
> -DEPENDS += "openssl10"
> +DEPENDS += "openssl"
>
>  SRC_URI += " \
>  file://0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch \
> +file://0001-Port-tests-to-openssl-1.1.patch \
>  "
>
>  EXTRA_OEMAKE='KERNEL_DIR="${STAGING_EXECPREFIXDIR}" PREFIX="${D}"'
> diff --git a/meta/recipes-kernel/cryptodev/files/0001-Port-tests-to-openssl-1.1.patch b/meta/recipes-kernel/cryptodev/files/0001-Port-tests-to-openssl-1.1.patch
> new file mode 100644
> index 0000000..c969126
> --- /dev/null
> +++ b/meta/recipes-kernel/cryptodev/files/0001-Port-tests-to-openssl-1.1.patch
> @@ -0,0 +1,103 @@
> +From 2fe4bdeb8cdd0b0f46d9caed807812855d51ea56 Mon Sep 17 00:00:00 2001
> +From: Alexander Kanavin <alex.kanavin@gmail.com>
> +Date: Wed, 28 Mar 2018 20:11:05 +0300
> +Subject: [PATCH] Port tests to openssl 1.1
> +
> +Upstream-Status: Accepted [https://github.com/cryptodev-linux/cryptodev-linux/pull/36]
> +Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
> +
> +---
> + tests/openssl_wrapper.c | 33 +++++++++++++++++++++++++++++++++
> + 1 file changed, 33 insertions(+)
> +
> +diff --git a/tests/openssl_wrapper.c b/tests/openssl_wrapper.c
> +index 038c58f..dea2496 100644
> +--- a/tests/openssl_wrapper.c
> ++++ b/tests/openssl_wrapper.c
> +@@ -4,6 +4,7 @@
> + #include <openssl/aes.h>
> + #include <openssl/evp.h>
> + #include <openssl/hmac.h>
> ++#include <openssl/opensslv.h>
> +
> + //#define DEBUG
> +
> +@@ -23,10 +24,17 @@ enum ctx_type {
> +       ctx_type_md,
> + };
> +
> ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L
> ++union openssl_ctx {
> ++      HMAC_CTX *hmac;
> ++      EVP_MD_CTX *md;
> ++};
> ++#else
> + union openssl_ctx {
> +       HMAC_CTX hmac;
> +       EVP_MD_CTX md;
> + };
> ++#endif
> +
> + struct ctx_mapping {
> +       __u32 ses;
> +@@ -63,6 +71,16 @@ static void remove_mapping(__u32 ses)
> +       switch (mapping->type) {
> +       case ctx_type_none:
> +               break;
> ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L
> ++      case ctx_type_hmac:
> ++              dbgp("%s: calling HMAC_CTX_free\n", __func__);
> ++              HMAC_CTX_free(mapping->ctx.hmac);
> ++              break;
> ++      case ctx_type_md:
> ++              dbgp("%s: calling EVP_MD_CTX_free\n", __func__);
> ++              EVP_MD_CTX_free(mapping->ctx.md);
> ++              break;
> ++#else
> +       case ctx_type_hmac:
> +               dbgp("%s: calling HMAC_CTX_cleanup\n", __func__);
> +               HMAC_CTX_cleanup(&mapping->ctx.hmac);
> +@@ -71,6 +89,7 @@ static void remove_mapping(__u32 ses)
> +               dbgp("%s: calling EVP_MD_CTX_cleanup\n", __func__);
> +               EVP_MD_CTX_cleanup(&mapping->ctx.md);
> +               break;
> ++#endif
> +       }
> +       memset(mapping, 0, sizeof(*mapping));
> + }
> +@@ -127,10 +146,17 @@ static int openssl_hmac(struct session_op *sess, struct crypt_op *cop)
> +
> +               mapping->ses = sess->ses;
> +               mapping->type = ctx_type_hmac;
> ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L
> ++              ctx = mapping->ctx.hmac;

Assigning the (uninitialised?) value of mapping->ctx.hmac to ctx here
looks redundant?

> ++
> ++              dbgp("calling HMAC_CTX_new");
> ++              ctx = HMAC_CTX_new();
> ++#else
> +               ctx = &mapping->ctx.hmac;
> +
> +               dbgp("calling HMAC_CTX_init");
> +               HMAC_CTX_init(ctx);
> ++#endif
> +               dbgp("calling HMAC_Init_ex");
> +               if (!HMAC_Init_ex(ctx, sess->mackey, sess->mackeylen,
> +                               sess_to_evp_md(sess), NULL)) {
> +@@ -172,10 +198,17 @@ static int openssl_md(struct session_op *sess, struct crypt_op *cop)
> +
> +               mapping->ses = sess->ses;
> +               mapping->type = ctx_type_md;
> ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L
> ++              ctx = mapping->ctx.md;

And same comment here.

> ++
> ++              dbgp("calling EVP_MD_CTX_new");
> ++              ctx = EVP_MD_CTX_new();
> ++#else
> +               ctx = &mapping->ctx.md;
> +
> +               dbgp("calling EVP_MD_CTX_init");
> +               EVP_MD_CTX_init(ctx);
> ++#endif
> +               dbgp("calling EVP_DigestInit");
> +               EVP_DigestInit(ctx, sess_to_evp_md(sess));
> +       }
> --
> 2.7.4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


  reply	other threads:[~2018-09-04 20:38 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-28 10:23 [RFC PATCH 0/6] openssl 1.1.1 update Alexander Kanavin
2018-08-28 10:23 ` [RFC PATCH 1/6] openssl: rename openssl 1.0.x to openssl10 and make openssl 1.1.x the default version Alexander Kanavin
2018-09-04 19:12   ` Martin Jansa
2018-09-04 20:35     ` Richard Purdie
2018-09-04 20:43       ` Khem Raj
2018-09-04 22:58         ` richard.purdie
2018-09-05  1:49           ` Khem Raj
2018-09-05  4:08             ` Andre McCurdy
2018-09-05  4:54               ` Khem Raj
2018-09-05  7:14                 ` Alexander Kanavin
2018-09-05  8:53                   ` Martin Jansa
2018-09-05 14:45                     ` Richard Purdie
2018-09-05 15:15                       ` Khem Raj
2018-09-05 15:45                         ` Andre McCurdy
2018-09-05 15:55                           ` Martin Jansa
2018-09-10 17:54                             ` Andre McCurdy
2018-09-10 18:09                               ` Khem Raj
2018-09-13  1:43   ` Andre McCurdy
2018-08-28 10:23 ` [RFC PATCH 2/6] cryptodev-tests: port to openssl 1.1 Alexander Kanavin
2018-09-04 20:38   ` Andre McCurdy [this message]
2018-09-05 14:15     ` Alexander Kanavin
2018-08-28 10:23 ` [RFC PATCH 3/6] openssl: update to 1.1.1 Alexander Kanavin
2018-09-03 22:53   ` Khem Raj
2018-09-04  3:17     ` Andre McCurdy
2018-09-04  4:26       ` Khem Raj
2018-08-28 10:23 ` [RFC PATCH 4/6] libressl: add a recipe to support openssh Alexander Kanavin
2018-08-28 10:23 ` [RFC PATCH 5/6] openssh: depend on libressl Alexander Kanavin
2018-08-28 10:23 ` [RFC PATCH 6/6] ca-certificates: update to 20180409 Alexander Kanavin
2018-08-29 14:30   ` Khem Raj
2018-08-29 14:47     ` Alexander Kanavin
2018-08-29 15:38       ` Khem Raj
2018-08-31  6:22 ` [RFC PATCH 0/6] openssl 1.1.1 update Khem Raj
2018-08-31  9:30   ` Alexander Kanavin
2018-08-31  9:38     ` Alexander Kanavin
2018-09-01  8:16       ` Khem Raj
2018-09-01  8:20 ` Khem Raj
2018-09-01  8:20   ` [OE-core] " Khem Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ86T=XVPbDxD82w8h5ZgZNvf4sFKaYo9pBEWwT_aZjNTJYAdg@mail.gmail.com' \
    --to=armccurdy@gmail.com \
    --cc=alex.kanavin@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.