From patchwork Fri Mar 15 03:26:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 160385 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp16272686jad; Thu, 14 Mar 2019 20:48:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqzkZejyfQPNOTH7IuW3qfkFjDvOS9GRgLznQNYWGrgrfuY/XglktfWoWQWf3eWsqLOiMCVo X-Received: by 2002:adf:ea88:: with SMTP id s8mr786790wrm.127.1552621729388; Thu, 14 Mar 2019 20:48:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552621729; cv=none; d=google.com; s=arc-20160816; b=TK0RJb0XcL5AyQipCuTGiYjJ3R64FkDguMwocsh54VY2qblvua2h8izPi8JczL7K2z 27Mse2/x51RyVQZxadfVwD46YC/aXnNcGn7zYY0xSTlXn/dBKxq0Gsd5s2yVby+oRiL3 RkGWOVFzSxkE3aQgGNhGWQ0L11Zh0Z4bOeYHGlKfWUKWNZm2EkDhyF/gzK5cEAKaMGSM sIfD1OULwMA4+dIgl+fIAYuYxQr7DIWVwc33g6BCYKJGOJAobqTr2seZrGjp/Vk+nxsA s4wRFIQ53ocpYo7m1kGskiJgGe9/LOvIjXTXSxMqVwHVha2scDUQrSEEkZxgOf9PxE/i oISw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=3QYzFsN6jbxcwP0/vCb7AXuYGCKiZNCkQHkIg1Hel4k=; b=kcep6drGitTNeTcJu+p2OSehpOu5GCpXojVeTcIK77vp0Xg5cbVhYzsXJDOQNwIr5B PgCqIbXP5Sw4hrWCaU9UKrB2qBl1JbOmEjdN8Mj7YbIOCaZ2706Rrb8gGclGq5n7WFpt 0rQKkhWONGox+3VGyq1HXDASo6J/IzXr2MHeEAyTXsjM9Gr0J7iR9+QnXZjmf8tnqAqE 1Y5IPlbZ7xqHkaDUSVwUeaFoZilzt4QHlEhwfk3Tn+ccg6BKYrYGNVp0ksYXMqtwiYvi g61mUtWYsYJqKehngICj7Kx1LVF8PLDAEW0+yp+CzwA+WHB/1sVe1INhgEU/w4utMVB7 ckDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="qWQzU/Tj"; 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 s6si470025wrn.330.2019.03.14.20.48.49 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 14 Mar 2019 20:48:49 -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="qWQzU/Tj"; 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]:48883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4dpw-00082x-A2 for patch@linaro.org; Thu, 14 Mar 2019 23:48:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h4dcL-0005E9-BB for qemu-devel@nongnu.org; Thu, 14 Mar 2019 23:34:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h4dUW-0002o7-N0 for qemu-devel@nongnu.org; Thu, 14 Mar 2019 23:26:41 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:46725) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h4dUW-0002nM-Ec for qemu-devel@nongnu.org; Thu, 14 Mar 2019 23:26:40 -0400 Received: by mail-pf1-x444.google.com with SMTP id s23so5258127pfe.13 for ; Thu, 14 Mar 2019 20:26:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=3QYzFsN6jbxcwP0/vCb7AXuYGCKiZNCkQHkIg1Hel4k=; b=qWQzU/TjLIRGNMLg6WUmMkkx5OhbIvT1r1jC7ybaTc630onWjVhYpBoqUrKDIeqbjI RUnVc0NOT+oLRCzo1WqDq7VXL8vaeG/KTUsP2+IYETiFOitaxhk95utiu2De3ahXezmb PG7j6VWwmJD3Z5T0sO/b91qwvCuz0kZOyHD4RZ0MrBMp9fHquCcRQme/mUI4eTmitTxk Pza1up/K1NmG60JO8CqcSZynCHKeFGYEZdWNVJgFyjpX/gskqzkdFMjf9FyWkr2ZSsyc eaxRJMFHpNEKUNcMbIfy7KgyFLvCfpWcUydNwRCmrkJzE4bipmd+F68rHqRXOc8QAo8V TPKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3QYzFsN6jbxcwP0/vCb7AXuYGCKiZNCkQHkIg1Hel4k=; b=p6iNvQt9Aifw0ed/9Vgg91zp/yJFtqDVEe10H7hOMJFJCyUi7HTjzhH/HPRq6H7HcY kmih2xEu0/cpwEX1b6zQqbIyGN81SMYLwm/sI/YtN7KFzzdwgKhbKgdokCnNIr9bQDQe i2NqTpWG1XnJ4980fxaj/7vIXtXW8u4nCcdrq3R6hZGBAc0pqp82He6rhndGJAacj2re G70LtAogcjdteKrgvjCKQqdUbjf8B+6QO3Fma4+UoaYcHzhS1SNxlAatfoDV7OlnhDpQ cc4tX5q7qJhxL9nL7wJLlDB03kDa4Xe1ncqe96L0z0zVkDpDCHHgr+VFsk/qkJh3LXpL 3uYg== X-Gm-Message-State: APjAAAUa9ofuOjnK+OTJdI6W3B3eCn8GzMvS2CyrQFU3l9bRdeQZblF5 CXJlNn0h6gCYZzP9dpwwrBGrP7Xr964= X-Received: by 2002:a17:902:1002:: with SMTP id b2mr1787557pla.248.1552620399243; Thu, 14 Mar 2019 20:26:39 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id d26sm690816pfn.86.2019.03.14.20.26.38 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Mar 2019 20:26:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 14 Mar 2019 20:26:12 -0700 Message-Id: <20190315032629.21234-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190315032629.21234-1-richard.henderson@linaro.org> References: <20190315032629.21234-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::444 Subject: [Qemu-devel] [PATCH v3 06/23] 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: , 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: 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.2 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