From patchwork Fri May 10 17:30:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 163909 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:142:0:0:0:0 with SMTP id j2csp2670217ilr; Fri, 10 May 2019 10:34:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhoLSFGuprbrGjw2tDM2gKjJcLze488/7124ReHC5sVbLjDVQc9Ga+T4s7hML+84j+9Fd+ X-Received: by 2002:a50:e101:: with SMTP id h1mr12788949edl.180.1557509697144; Fri, 10 May 2019 10:34:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557509697; cv=none; d=google.com; s=arc-20160816; b=VQuCH0yKjiJsmmBb6dcGbEQ4mqMCz9eVFFaxf0a6VxvHfCMXsju3/Is7QdUDleDQGi ljTbdaSWwYn/l+kf0aa6hjfqhnjM6kJXpkMVklpVEeCRdnL8UvfPAuQNg2tKE3Y6TUeh Db3zwOp8dGP8rgqx/xPt3JJhP6zT9OE9U5g1yiKzbl8xsvcPdtZizsg9jSM6yqz14v5l AAMRTFH4wkxAafAKDU4exuSky+47UZFZG9WnNk7OaFIgCUd6TUDVcJR41YF8uPeUU5y5 UZa80E1irO1dIrf7QWr58EcKFSw3sYTx2mJa4VgHPon1ZBWbkKNXlbBxVianC2u6/9dB IfzA== 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=z+TkCJ+Ncy1KMgA4q+7eFD+GiqzlCrNmhclplUZOTOM=; b=cbNU9dtv8Eql4LAVzyhdSs0LNwm5NYbmY8ZCf7IDwxCx4YaCXdiavg+nKSyFn5wJLQ e32RY0f77fKJWk5IbpLqicNLtWau5EqLPwFz7tDPGgXxBUdfpO5NtCaWdFUyX4kbDAEm xvAvVfwniQk06VuhbIOcip9uWcJynZTnbsDwBNp6nBupgWuO4g8l5P8GUe3pfHH6ctku WZpiaCGDtAM56Y8e1LUCaC0Avlml44Cz+QSD3wVH+vzltwWStVfCDT+2vT5rPsN2zDP0 hvfCaJIa8KmiwFFj8sdMoi3vvcydeKlxPg3MM+lsZi0X9hKgPYyrPiFBh3MwzBh+sPbR QCkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=j3X58ZE1; 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 r47si3713150eda.363.2019.05.10.10.34.56 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 10 May 2019 10:34:57 -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=j3X58ZE1; 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]:47508 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hP9Q8-00025u-3U for patch@linaro.org; Fri, 10 May 2019 13:34:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hP9MM-0007Mt-7F for qemu-devel@nongnu.org; Fri, 10 May 2019 13:31:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hP9ML-00062F-8d for qemu-devel@nongnu.org; Fri, 10 May 2019 13:31:02 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:42232) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hP9ML-00061w-2q for qemu-devel@nongnu.org; Fri, 10 May 2019 13:31:01 -0400 Received: by mail-pg1-x542.google.com with SMTP id 145so3326791pgg.9 for ; Fri, 10 May 2019 10:31:01 -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=z+TkCJ+Ncy1KMgA4q+7eFD+GiqzlCrNmhclplUZOTOM=; b=j3X58ZE1k7hy5YSY4BDHgwcCYZD3EhMDS84VcsG7JsqgUAFqVeGU42oVDvrITnrB8H 5vDR+S35M/tU3ca9/dbv5x9qFGWivH4Dk3W54Oz1gdKw+LqRVM4oXGxh0g95w+3xz4T3 m+ongJtMi+ZGN3TKijgLFYU1JudIKbnmF14IO74uQfLkHs5HaaosdtmCYKEMpbcStM5P MHw2/Lvh2L9dHR8IEIIruB7TcxBCt/gUk5MG/g6RnkXCRBRCDhVcNwswn0x07khxV1UP 1d8tYyjn3orljsVlnVcJ3Ly+0DCaCMT+LPFyD8zn88gQppRRmzqZtkznDIeEpi9jmJck jW0g== 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=z+TkCJ+Ncy1KMgA4q+7eFD+GiqzlCrNmhclplUZOTOM=; b=TQArVo5MjwkLw6hNzLdilmwlQK4lqlntV+/qqhpHiHzhwzWZrm6CCcr5bD/gmJhVnT 6qH8SBxve6u8BTvlcK/R9JWSX+zbl+Yt2FJdLbW8Oe1+hCSwGnKIH7FRkBBxHswJ90zw WPvYc5pyUpQ8dl8ucbTdIQUT6yc/iF2JNoRLQwzmeie6i070soOWgmB4qF3X6bN8vmSF 7n1lNYWS3UaW0xGS6BskckGtYtv5RLFscXeevVEdEc9AiI5L/zXkRqu0OvTzjHm9YZYh GNlaeYLBLkqvV7wNlcQv5Hsft6O1yHrND39mrkYfCivOF42zPjO9SMdrgeKLBQNbX6h4 SxoA== X-Gm-Message-State: APjAAAV/beMcNeDEfmTCqjTQhoLvmj6QNAmclQps8Gi+9hovdJymHMYz O1OBJ6NRYKdVUhiMRL6D5FAyFj6lyQ0= X-Received: by 2002:aa7:842f:: with SMTP id q15mr16120205pfn.161.1557509459887; Fri, 10 May 2019 10:30:59 -0700 (PDT) Received: from localhost.localdomain (97-113-13-231.tukw.qwest.net. [97.113.13.231]) by smtp.gmail.com with ESMTPSA id v64sm7936792pfv.106.2019.05.10.10.30.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 May 2019 10:30:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 10 May 2019 10:30:31 -0700 Message-Id: <20190510173049.28171-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190510173049.28171-1-richard.henderson@linaro.org> References: <20190510173049.28171-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::542 Subject: [Qemu-devel] [PATCH v6 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: , 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