From patchwork Mon Oct 12 16:53:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 7377831 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 64EADBEEA4 for ; Mon, 12 Oct 2015 16:55:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 85A56208AF for ; Mon, 12 Oct 2015 16:55:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A68F32075A for ; Mon, 12 Oct 2015 16:55:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752133AbbJLQyh (ORCPT ); Mon, 12 Oct 2015 12:54:37 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:38521 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752069AbbJLQye (ORCPT ); Mon, 12 Oct 2015 12:54:34 -0400 Received: by wieq12 with SMTP id q12so29311802wie.1; Mon, 12 Oct 2015 09:54:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5YCf+aWBcMV3cjAF/l1auxD7qw2ENyPCk7TP6REMzbQ=; b=ZK3T4oUgSzJnoj7aZYW/6cXubQgJ4Nzlcmh2v4bhWbLtJfVPuWU9mL/A9lC85GbjQt otVLrLT6e/8iNXHEcWkUTaxplZ8ZQp46/4zfkw5wVSvf9C+OolJ1UK23HUptyiWwD9me VleacOkK2l5RZVB12bRbBrqojIZ8pFgWbRJbWOc39Iw+DU+qWwtHUZyC92KeJcPTfGtq hzIAarZSTIwrdmENh7Y+YMN35+ahnpCR9I124IfX9Yqidy3s/tIJQyKIJmp1uCHOQ1VP cH02jk6bTvmHSSKbz3ulzx5UDlEuep5jHCDqvzHtMGxNi5MAXTnOZ2x0B1q+YTcPNVTC r0jA== X-Received: by 10.194.239.167 with SMTP id vt7mr19418757wjc.110.1444668873392; Mon, 12 Oct 2015 09:54:33 -0700 (PDT) Received: from Red.local (ANice-651-1-429-185.w83-201.abo.wanadoo.fr. [83.201.253.185]) by smtp.googlemail.com with ESMTPSA id s16sm11548506wik.16.2015.10.12.09.54.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Oct 2015 09:54:33 -0700 (PDT) From: LABBE Corentin To: herbert@gondor.apana.org.au, davem@davemloft.net, thomas.lendacky@amd.com, geert+renesas@glider.be, ulf.hansson@linaro.org, wsa@the-dreams.de, keescook@chromium.org, maxime.ripard@free-electrons.com Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, LABBE Corentin Subject: [PATCH 7/8] crypto: testmgr: Constify tested key/iv/plaintext/digest Date: Mon, 12 Oct 2015 18:53:45 +0200 Message-Id: <1444668826-6531-8-git-send-email-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.4.9 In-Reply-To: <1444668826-6531-1-git-send-email-clabbe.montjoie@gmail.com> References: <1444668826-6531-1-git-send-email-clabbe.montjoie@gmail.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All key/iv/plaintext/digest in testmgr are constant data. Furthermore the testmgr will never modify thoses data. This patch set all members of xxx_testvec as pointer to const. Signed-off-by: LABBE Corentin --- crypto/testmgr.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/crypto/testmgr.h b/crypto/testmgr.h index 64b8a80..03b2f19 100644 --- a/crypto/testmgr.h +++ b/crypto/testmgr.h @@ -37,9 +37,9 @@ struct hash_testvec { /* only used with keyed hash algorithms */ - char *key; - char *plaintext; - char *digest; + const char *key; + const char *plaintext; + const char *digest; unsigned char tap[MAX_TAP]; unsigned short psize; unsigned char np; @@ -65,10 +65,10 @@ struct hash_testvec { */ struct cipher_testvec { - char *key; - char *iv; - char *input; - char *result; + const char *key; + const char *iv; + const char *input; + const char *result; unsigned short tap[MAX_TAP]; int np; unsigned char also_non_np; @@ -80,11 +80,11 @@ struct cipher_testvec { }; struct aead_testvec { - char *key; - char *iv; - char *input; - char *assoc; - char *result; + const char *key; + const char *iv; + const char *input; + const char *assoc; + const char *result; unsigned char tap[MAX_TAP]; unsigned char atap[MAX_TAP]; int np; @@ -99,10 +99,10 @@ struct aead_testvec { }; struct cprng_testvec { - char *key; - char *dt; - char *v; - char *result; + const char *key; + const char *dt; + const char *v; + const char *result; unsigned char klen; unsigned short dtlen; unsigned short vlen; @@ -126,7 +126,7 @@ struct drbg_testvec { }; struct akcipher_testvec { - unsigned char *key; + const unsigned char *key; unsigned char *m; unsigned char *c; unsigned int key_len;