From patchwork Fri Aug 28 17:05:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 248599 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp1258904ilg; Fri, 28 Aug 2020 10:08:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgQAK7OuMsKsPCio/VEm1LE5Lzz8x+VSg6eB1RQ2O2FbRqN/kN3chJyozJrj5V96zHaUi4 X-Received: by 2002:a25:aca5:: with SMTP id x37mr3902102ybi.417.1598634506693; Fri, 28 Aug 2020 10:08:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598634506; cv=none; d=google.com; s=arc-20160816; b=dcxjM3csuCbU9+fD1YH/1mE+9QTmEUhpRxn8lAkxzebZu+bjxPiytkAPRIG4wlDuw+ ZqMILNJaYhQ3Shk7p0RPG1epYz8bHJ45pH6rmhkICBlaJKpNaLpzB0GNza0oDV3vlX36 nHR9me5OVDleIEES9+UK8GuedSMbR4p/2KHmM4gtoX+V0oUeH9ZxsSxHtSGjW/hu/ecR VNRiypWbUuDPhF8w4fdBCcEtAf2cfaZ21Uh+ZpVxoAlD8FnUtqoLQJlNZjzFwsyTibyM VQKxwDzimPaUrlnWOMNnm7TaYDXs6ZfL6hmiJSly+XKYf+RMvLAIcW+YVM1oNa+/LXa5 Id+w== 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=vkqjR+0dFjJx/RqSJg4ZuU6Fj06xiA2ZZSaXxPiNFoU=; b=XPAy/dcALwStXykM/HRLZM5IqgHDNrlDGqUh3DoOztypJ45JIec24p9MWZQEjmknhd 6S4V3wyj1vf4fLkwFzjLAKtgZINqEa06SZY2uY95R79+sg8bC6Jj40N3XOxIgn7M20oo aQ2JvZO+ghHzpW8gbjcm4vHt3I+8ZcRl3oiowdDSJB2qIF55q+Xx83cYo9HB4CNPouIt MfuW9u0HEKY+b5WYJgbWSlGSzxXf0SKXTQvpAzMywfb4eLtVijcb7HzdowSrZiOzQZ5g P6b6/XvQU4/2DnFbHTN1wGS1K9wuFboPt5y3hkza1yEOb8UMiWO8ZuvsPJ3CEtD5nozk T1YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JoSAFj7h; 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 g20si1502871ybh.158.2020.08.28.10.08.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Aug 2020 10:08:26 -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=JoSAFj7h; 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]:45924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBhrW-0001bb-3y for patch@linaro.org; Fri, 28 Aug 2020 13:08:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBhoj-0003bS-Iu for qemu-devel@nongnu.org; Fri, 28 Aug 2020 13:05:33 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:33688) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kBhoh-00030b-Vr for qemu-devel@nongnu.org; Fri, 28 Aug 2020 13:05:33 -0400 Received: by mail-pf1-x443.google.com with SMTP id u20so954807pfn.0 for ; Fri, 28 Aug 2020 10:05:31 -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=vkqjR+0dFjJx/RqSJg4ZuU6Fj06xiA2ZZSaXxPiNFoU=; b=JoSAFj7h/TcBC+QPk7eGl93Qqn79bJodTyFVU8QyWiKEeEiTkR6Zuwor5kqF7Pvqpt jEUFLyHIQwEFUSj6aOQi0QLeoDIYhlPAj9H/qfCt0Dw17iJwQDC4//VWZPtZJIHeihzz emLNPzforafvinCVoxfpq3qDrbpaXzEhzR6DrYupBk+v815j07a8RluYi1UjJ/Xrcev4 gU5/CJUIbTg2HYHBAu7hvKq2uw40+hjBWGqzrSxVl/Y34xdEGUNpagqPS6Q42ZcZvJQe NMKX/LNKiHpuLxJBmONit+5q7vfwpotyhWlsrg61nUsfIQJa0lxVXbrXWN/xu8pJo6jp TE2g== 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=vkqjR+0dFjJx/RqSJg4ZuU6Fj06xiA2ZZSaXxPiNFoU=; b=KiMwoEskkwvzXhBfCuGw0OJnnXJQZ5YE61s2aG2IPhKfJTxXqK5JopHEzYd3Qm73VD 7H+O88+GK9g2JbGbJhlfXnOD6T5Fhz5JGxc4ho6XsaCt7IwQN/3B46XDCamfFU1Jyz42 MwD/TNJwpBXi/Ko3pS2MysstzrvNteeF1asa1cD1kkLbPToM+me4Hey9D1V9BHWQooh8 QmkQDjaUO/O1vf9o0cDYeghzUIWw68WukWJG3r6W+HJWDq+Ar04lfp+rGHBQUvy4aekl +hGi4abUz8YSJoPZF+iDrzrvvPSPmHZHuEcTHFE/50OL6YgzvGMi8OOT97/OIpQVFv/J H2Zg== X-Gm-Message-State: AOAM533EaR5T45O6IkCBaiudjDeZDnwYstjEv2ODk+XAyBaSsJvJKKck ATbvZGHpdxL9CLV+VzPMOr21KZGJYhUXBw== X-Received: by 2002:a63:516:: with SMTP id 22mr1812863pgf.316.1598634330292; Fri, 28 Aug 2020 10:05:30 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id q12sm2277495pff.196.2020.08.28.10.05.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Aug 2020 10:05:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 04/16] crypto/nettle: Fix xts_encrypt arguments Date: Fri, 28 Aug 2020 10:05:11 -0700 Message-Id: <20200828170523.418603-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200828170523.418603-1-richard.henderson@linaro.org> References: <20200828170523.418603-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::443; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x443.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. Reviewed-by: Daniel P. Berrangé Signed-off-by: Richard Henderson --- crypto/cipher-nettle.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1 diff --git a/crypto/cipher-nettle.c.inc b/crypto/cipher-nettle.c.inc index 256931a823..0404cfc6da 100644 --- a/crypto/cipher-nettle.c.inc +++ b/crypto/cipher-nettle.c.inc @@ -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,