From patchwork Fri May 17 02:39:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 164361 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1603071ili; Thu, 16 May 2019 19:45:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2yFUEdUt/TE+ywCBcpxXEv9S8lBoqYz7XMWu6NXE8rXtxj38Xto3SnSXBiFDaKwVz4xnu X-Received: by 2002:a50:9601:: with SMTP id y1mr41304235eda.27.1558061131008; Thu, 16 May 2019 19:45:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558061131; cv=none; d=google.com; s=arc-20160816; b=FoylQZRu11atZc4ERX0VNYltTTShDTDC/wLzhadDqmTOKZZZZSQEoJbCa3/tq2LTSw SQuai6yWLhbfPPSyL3bZQSBRPGN+sGWRLZWNmxPlPK1mwLh0gXNdX4iUoS2WbqIKLUE0 2PMMow0aTS7bJBAiCdKB6PTFuRWX+5YQ0Fj31kd4o/lheBVx6Y0PmxcQ6SLUTcEiA2up n4ejJl0KnUISVIxEwIWI82Rji4WB+CM26rHvd1VHqE5tK5t3oWjXNnGwwV8zWhgQ1bf3 2XMYJR7ldVjSUmxQmZCKuMvYnX8UTOarZecZY3okz2QGpK/sm1E2gwnX9cVYPA833pua jGfg== 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:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=z+TkCJ+Ncy1KMgA4q+7eFD+GiqzlCrNmhclplUZOTOM=; b=uwiQGg//Oz/e/DkIP+9K/w6Y1F4dFbl6z38odKu3mJijZeTBjUZmxZ6ScVGguGucnH sQYDnTnX/emUm48c37uj+38oZxuxKUCNJbMt7EzoXYYBm+qC6bpDqkVHeNlH2nOBln6f VR0aVKmFaMYQ16iRzCf3/nZ8QWR/I5cpbcUfX+VKLPTvSX3kUqkDh9OUzpKg4whLCPnx l+Vy2r5jgWaTqEb/Q7WHQyG+SxDK2Ul/nItlSZlK2sJoeTLaR2PJtrJIhQ3HariLOtSy YeIo65Qd50cGKsN0nFtA8Bvnai8Ft6y1+GSRxnNM6VSo9YTm4apTjapX0bxLRkiyJnbB 8qyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=yCHpTevO; 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=fail (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 z38si3596845edz.24.2019.05.16.19.45.30 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 16 May 2019 19:45:30 -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=fail header.i=@linaro.org header.s=google header.b=yCHpTevO; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:40188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRSs8-00028c-4l for patch@linaro.org; Thu, 16 May 2019 22:45:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRSmY-0005RX-CV for qemu-devel@nongnu.org; Thu, 16 May 2019 22:39:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRSmX-00024G-6L for qemu-devel@nongnu.org; Thu, 16 May 2019 22:39:38 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:43860) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hRSmX-00023Y-0l for qemu-devel@nongnu.org; Thu, 16 May 2019 22:39:37 -0400 Received: by mail-pg1-x544.google.com with SMTP id t22so2505773pgi.10 for ; Thu, 16 May 2019 19:39:36 -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=z+TkCJ+Ncy1KMgA4q+7eFD+GiqzlCrNmhclplUZOTOM=; b=yCHpTevOUWizQsywQjRausmmMeemkcHfBs7EqHrBNFtyycHabhIwUhvS4z5M1PI7yF MUWDLE5XAgP9j416ibx1kvlJlSRBoP7Dc52zzoBisZ88bWmQ+6GrkLlKMvQPKcu3hAQ4 On9aOx7EXlG5b4qg4HKd0FKPuB00nc7VAjEi5kILv2eaiICPu4tGO/8E2+uYeG1vjgE5 RYQkn/RCTPldThmgreRvRw1yJaSTmHM/eAQkjydeEv84F9jPqYXwJiMJz0wC9DQuqho/ tLs0xUpesL1/KMgrnf2iPjn/zqbeUP3DWftUcWLGubk/wjIVXAeLJ0nh/ZkdMAuTRTgb nJaA== 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=z+TkCJ+Ncy1KMgA4q+7eFD+GiqzlCrNmhclplUZOTOM=; b=un0FG8WhdPzMW5hI4gQSy35bMhkwVicISvb3uWDS8HBggdXwRtFUUJuZGoQpugxZIW UH7Tu2Gjy/hxyg/NtVh2XslOBjRoC9VCa2YVcDpzR6KSvBzOeZcH4hZNaXIQbzlbYQ+j SVtP862puoTqfNJUjE4qAIxXoGRmZTrs/BrhfhWlv1vF1ZMxh8Q4U2zawdRGlB4fTeKc gdXdhCPwWrKi3zx+U+SxXBkb4SpCfC3dBT6eh0LfMQqq4J2zgQckYq1x70fTA8LFQmCj yyaOxx3Prx45y0MGxmC+E1LBE7+BQXQH8+e3x/u8fZnVIhqbCLm+LDZUl2f1e19qdCPB +Kuw== X-Gm-Message-State: APjAAAW+rZAgoNV4NsnJQLkE0atSN/I2r/g6a4eopSC1qacfOXw99rhm wkznFZuDKkgXR0lPEeO4RCIsiIV5AFs= X-Received: by 2002:a62:4607:: with SMTP id t7mr58962052pfa.138.1558060775460; Thu, 16 May 2019 19:39:35 -0700 (PDT) Received: from localhost.localdomain (97-113-13-231.tukw.qwest.net. [97.113.13.231]) by smtp.gmail.com with ESMTPSA id w6sm6984152pge.30.2019.05.16.19.39.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 May 2019 19:39:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 16 May 2019 19:39:06 -0700 Message-Id: <20190517023924.1686-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190517023924.1686-1-richard.henderson@linaro.org> References: <20190517023924.1686-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::544 Subject: [Qemu-devel] [PATCH v8 07/25] crypto: Change the qcrypto_random_bytes buffer type to void* X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, berrange@redhat.com, armbru@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Using uint8_t* merely requires useless casts for use with other types to be filled with randomness. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Signed-off-by: Richard Henderson --- include/crypto/random.h | 2 +- crypto/random-gcrypt.c | 2 +- crypto/random-gnutls.c | 2 +- crypto/random-platform.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/include/crypto/random.h b/include/crypto/random.h index 8764ca0562..fde592904e 100644 --- a/include/crypto/random.h +++ b/include/crypto/random.h @@ -34,7 +34,7 @@ * * Returns 0 on success, -1 on error */ -int qcrypto_random_bytes(uint8_t *buf, +int qcrypto_random_bytes(void *buf, size_t buflen, Error **errp); diff --git a/crypto/random-gcrypt.c b/crypto/random-gcrypt.c index 9f1c9ee60e..7aea4ac81f 100644 --- a/crypto/random-gcrypt.c +++ b/crypto/random-gcrypt.c @@ -24,7 +24,7 @@ #include -int qcrypto_random_bytes(uint8_t *buf, +int qcrypto_random_bytes(void *buf, size_t buflen, Error **errp G_GNUC_UNUSED) { diff --git a/crypto/random-gnutls.c b/crypto/random-gnutls.c index 445fd6a30b..ed6c9ca12f 100644 --- a/crypto/random-gnutls.c +++ b/crypto/random-gnutls.c @@ -26,7 +26,7 @@ #include #include -int qcrypto_random_bytes(uint8_t *buf, +int qcrypto_random_bytes(void *buf, size_t buflen, Error **errp) { diff --git a/crypto/random-platform.c b/crypto/random-platform.c index cb3ca1bc09..66624106fe 100644 --- a/crypto/random-platform.c +++ b/crypto/random-platform.c @@ -64,8 +64,8 @@ int qcrypto_random_init(Error **errp) return 0; } -int qcrypto_random_bytes(uint8_t *buf G_GNUC_UNUSED, - size_t buflen G_GNUC_UNUSED, +int qcrypto_random_bytes(void *buf, + size_t buflen, Error **errp) { #ifdef _WIN32