From patchwork Tue Oct 20 07:34:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 7442591 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 331F69F37F for ; Tue, 20 Oct 2015 07:35:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5A833206BE for ; Tue, 20 Oct 2015 07:35:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7E72020680 for ; Tue, 20 Oct 2015 07:35:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753118AbbJTHex (ORCPT ); Tue, 20 Oct 2015 03:34:53 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:37823 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752993AbbJTHeZ (ORCPT ); Tue, 20 Oct 2015 03:34:25 -0400 Received: by wicfv8 with SMTP id fv8so14785234wic.0; Tue, 20 Oct 2015 00:34:24 -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=BF58uPEMq1dTcsk3cBuIUTq84gUciy/Iqp7INyMnAYU=; b=vwHCBajfM8Y3BAtGgrnqTYb/8bCvq2SlG267sMsQ3skaUozXBOT2YDoH57LoiLxdFk oW+KUEgNnDgTbrlY7/2X1AgPT8Wg4Eu4B65zxQ8r8VswSCCAVjL9d9MBrii97tV+ypN7 LCwKHxAEhxq4J5a+6OgOY0j3LzUPd6PMgmTzKggjaAR1PHqfN1zxz7llQTfE2+PMfb8V iPSsQWSYOxfKoX7h9a3MlgsnxI9qe5AJnDZwlqDUSZ4INuWRhOBBUhVwhWEmRZO1Ltbb p11d51pOHJluJIooWbNR7HGuOuLKBGVR+bdoe0GyvQIIYo3FNpcVZhWBbywH0UUTuRWj i0kQ== X-Received: by 10.180.99.41 with SMTP id en9mr26850546wib.67.1445326464154; Tue, 20 Oct 2015 00:34:24 -0700 (PDT) Received: from Red.local (ANice-651-1-191-74.w83-197.abo.wanadoo.fr. [83.197.127.74]) by smtp.googlemail.com with ESMTPSA id q1sm2006209wje.39.2015.10.20.00.34.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Oct 2015 00:34:23 -0700 (PDT) From: LABBE Corentin To: davem@davemloft.net, herbert@gondor.apana.org.au Cc: LABBE Corentin , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/8] crypto: testmgr: Constify tested key/iv/plaintext/digest Date: Tue, 20 Oct 2015 09:34:03 +0200 Message-Id: <1445326444-11019-8-git-send-email-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.4.10 In-Reply-To: <1445326444-11019-1-git-send-email-clabbe.montjoie@gmail.com> References: <1445326444-11019-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, RP_MATCHES_RCVD, T_DKIM_INVALID, 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;