From patchwork Thu Aug 13 03:25:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247660 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp928284ilo; Wed, 12 Aug 2020 20:32:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXl3t+Pc+xs1Mo/xp7lpeYk0RVYXY+h2dd1rbm05HpdBcS7KAxelXQ9Seyh9UZ6RM5i+KZ X-Received: by 2002:a25:9885:: with SMTP id l5mr4021810ybo.0.1597289564706; Wed, 12 Aug 2020 20:32:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597289564; cv=none; d=google.com; s=arc-20160816; b=j+l69lXbrGZgJMeYpsL49xI98HkRR/cDdnDACQa87fcmVbwehkBohh3ikysCWQ1li2 f08GmA6ti7K7NShLfcbvJdwc0WTuockD8HdA0LtjoJO2HXJh6nqfBJiH8RDkyLUk3y58 MgAaScZwBjRGHAh4WpXa1msSc7m7k66g7s+awcfpyrXo7WF9/zsxOiR3Mz2XtdvWsWPU 9gAZQABxPNeJMujk4feKqiIFPCzxr2WwqcmGn52+M6JzolLtpS2yIEM17RCXGlRokAK3 T/CLH6R7zhg+6OAAHPyi3MaDhK8XHy0jUwezWtJgLDXeDlpoIOPBZ9zIEULQTyERHnDb /eeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ImTBoljSR0RaUjSJjrJWKxIahll20+RRkJQ8nrvuQtI=; b=KEUT4fhBEn/68H9gIATA6D0vpDPGoob7kRDTo1+tbd5MfWhYiyB8Vd5sDKetX7WZNk 1QR7HESz7xmvTzKkNpf0pQOSybzG5nYiQSEilSzGlMOo9woYGRlGbW9XQU4NAeuNepbx Mkq3eROJSPeZ3NrjdzuJl4WDZVoCiYSTAerVSKdHGTRRsS1TXRkVHzeQosvH4BQZZmOm R4JUQu6o4EHItfP3tujUX/BlBlz69DvTaD9HW7AVsTDrmYS8j0uGtrTPi3zsUu7SVYw5 FDyB9qgaj9t6/dCg2SPU4yu49u8oiBzlsCXas84eP5e/1s4Kd81TCJXyRdbJWxfEgX/e Ic8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VC9yvrh7; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i4si3966200ybt.186.2020.08.12.20.32.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Aug 2020 20:32:44 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VC9yvrh7; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k63yu-00078D-5n for patch@linaro.org; Wed, 12 Aug 2020 23:32:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k63sF-0004uM-Pg for qemu-devel@nongnu.org; Wed, 12 Aug 2020 23:25:51 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:42111) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k63sE-00006C-4e for qemu-devel@nongnu.org; Wed, 12 Aug 2020 23:25:51 -0400 Received: by mail-pl1-x642.google.com with SMTP id f5so2005777plr.9 for ; Wed, 12 Aug 2020 20:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ImTBoljSR0RaUjSJjrJWKxIahll20+RRkJQ8nrvuQtI=; b=VC9yvrh7WYWQ/2B/c9VNsrpO09UnQnqXEZH7UNV2tBZt/dWCND9105BX8OX5NZgxad fZE3FBIRocKFmtZZj42izi03vcSaF68xdglAvh/sjvTG6WbNXYXJvlJrzSBYWALBVXX6 1q+IiDOksvjLAOgLJm94SAaS6+7aUyYeX5OhR5t24tv9qmi/DNKiWBPwNBD67qBDCn9E kgEj6gboCa56rjV9Q4lpmU024NsCjzkPRHZ0C1SMBRIJR/z0X3RyN42Z8l1EmXAEGIbt HwOHcrDH6d/HU6ZfAJef9+SjYsmAAhMS3tO/IxNtjYfWFn7mbsukGD0KOPPFSluK5uH7 2OgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ImTBoljSR0RaUjSJjrJWKxIahll20+RRkJQ8nrvuQtI=; b=Y8I/NKNAUBayBCjgqwaMGfKG1Ac9vZ8uyrCyFuga6s8Yvs749HrVbtAzUH8dRDFc5C jQ1WB1RzofZBsQErBR2G7E2N4EZ2xRxBWvJWSJvX0zv6se6Vu8IGoxwiDWwlz3JFWJ83 agqTcNdYYRPHqrDNekcHZwAwJk0VKE2MFAGXFuJRhkl6XwCJQzXc3sKlszsrU7THOGjD 8L31r4xEjM4smn4zYOwnOUggjAdXZy+THjA1fNJT1Tf//RUvgWUILg9M9NxWhP53/2oq b3+1uQiwm3SPiV78Xa/oL/Y6aHLYzjQ5tDkFoLgRJzTxL2GGj0EjCsXeQvdI0d8jpeCN dSow== X-Gm-Message-State: AOAM533I9+lajnDrzzR3plQ5E/5Z/xjcJJhOyuSXJa0oXmmAm1G2GyBG OQxVrtSujiob7lf1pkP9qqj71EsqhMc= X-Received: by 2002:a17:90a:e60d:: with SMTP id j13mr3139889pjy.216.1597289148196; Wed, 12 Aug 2020 20:25:48 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id m19sm3633164pgd.21.2020.08.12.20.25.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2020 20:25:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 06/17] crypto/nettle: Fix xts_encrypt arguments Date: Wed, 12 Aug 2020 20:25:26 -0700 Message-Id: <20200813032537.2888593-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200813032537.2888593-1-richard.henderson@linaro.org> References: <20200813032537.2888593-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::642; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x642.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: berrange@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The fourth argument to xts_encrypt should be the decrypt callback; we were accidentally passing encrypt twice. Signed-off-by: Richard Henderson --- crypto/cipher-nettle.inc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1 Reviewed-by: Daniel P. Berrangé diff --git a/crypto/cipher-nettle.inc.c b/crypto/cipher-nettle.inc.c index 256931a823..0404cfc6da 100644 --- a/crypto/cipher-nettle.inc.c +++ b/crypto/cipher-nettle.inc.c @@ -632,7 +632,7 @@ qcrypto_nettle_cipher_encrypt(QCryptoCipher *cipher, case QCRYPTO_CIPHER_MODE_XTS: #ifdef CONFIG_QEMU_PRIVATE_XTS xts_encrypt(ctx->ctx, ctx->ctx_tweak, - ctx->alg_encrypt_wrapper, ctx->alg_encrypt_wrapper, + ctx->alg_encrypt_wrapper, ctx->alg_decrypt_wrapper, ctx->iv, len, out, in); #else xts_encrypt_message(ctx->ctx, ctx->ctx_tweak,