From patchwork Sun Oct 22 22:40:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steffan Karger X-Patchwork-Id: 35 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director6.mail.ord1d.rsapps.net ([172.28.255.1]) by backend31.mail.ord1d.rsapps.net (Dovecot) with LMTP id 6/lfE8i97Vn1UAAAgoeIoA for ; Mon, 23 Oct 2017 06:00:40 -0400 Received: from proxy1.mail.ord1c.rsapps.net ([172.28.255.1]) by director6.mail.ord1d.rsapps.net (Dovecot) with LMTP id UWtsA8i97VnKSAAAhgvE6Q ; Mon, 23 Oct 2017 06:00:40 -0400 Received: from smtp16.gate.ord1c ([172.28.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy1.mail.ord1c.rsapps.net (Dovecot) with LMTP id JpSCOXi97VlgTgAA2VeTtA ; Mon, 23 Oct 2017 06:00:40 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-MessageSniffer-Scan-Result: 0 X-MessageSniffer-Rules: 0-298-1004-1220-w 0-298-1004-1584-w 0-298-0-11215-f X-CMAE-Scan-Result: 0 X-CNFS-Analysis: v=2.2 cv=DZxVkblW c=1 sm=1 tr=0 a=Q8DxjiC8O3VT/NpP1XjEZQ==:117 a=Q8DxjiC8O3VT/NpP1XjEZQ==:17 a=pofcsEjOxUsA:10 a=kj9zAlcOel0A:10 a=02M-m0pO-4AA:10 a=WiVod9pSvdkA:10 a=Y4BXLp1PAAAA:8 a=9sSjY8p1AAAA:8 a=P_JWiMecAAAA:8 a=FP58Ms26AAAA:8 a=RBdgyKkt1wwp5hdKuUgA:9 a=CjuIK1q_8ugA:10 a=-FEs8UIgK8oA:10 a=NWVoK91CQyQA:10 a=byfke0vc68LhOSAAcvKj:22 a=ub54wNWiXv_DzeFsgEJW:22 a=D0-HAvA3Hk9NMREbgwuX:22 X-Orig-To: justin@openvpn.net X-Originating-Ip: [216.34.181.88] Authentication-Results: smtp16.gate.ord1c.rsapps.net; iprev=pass policy.iprev="216.34.181.88"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=fox-it.com X-Classification-ID: 0635fd2e-b7d9-11e7-a7f6-bc305bf036a4-1-1 Received: from [216.34.181.88] ([216.34.181.88:5072] helo=lists.sourceforge.net) by smtp16.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.1.56364 r(Core:4.2.1.14)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 33/C5-02648-7CDBDE95; Mon, 23 Oct 2017 06:00:39 -0400 Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.89) (envelope-from ) id 1e6ZWm-0002eQ-8A; Mon, 23 Oct 2017 10:00:12 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtps (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.89) (envelope-from ) id 1e6ZWk-0002eI-LL for openvpn-devel@lists.sourceforge.net; Mon, 23 Oct 2017 10:00:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=b5bklFYakedeAhrM15kPSPc2Hb6lY5L+xAQROFdHPxw=; b=Bi8QL1fjPJJBX6s0B+d3/4MuPRmceorJLyF5o7vTkG+jtTYla5ur8PxyqMk3KCtDKS50m5GioyTbcfa5mpfSv86SgMIf7bgfzo4ukEBT6ULGwtgTbwTGKkgPppsapARAaQgBKeIEu2M9FTA0OqKWkK7FH/sggJgOkJLabpLpkdI=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=b5bklFYakedeAhrM15kPSPc2Hb6lY5L+xAQROFdHPxw=; b=NHWe/i11dj3j7AzixSYERXLJfn3XXEO1jZVjG/Wjf6afGUGWsuhyLy4poctSY6Ntyy8p84IDF53Lv5dI0VYH/Abiv2cS6cT8Cmz0BIvApYRcMw6sSoc9bFHNNidnAYj8g45t9d8A2/AETsjeb94U38Jkxp6asE3RoMHfm8q7f+M=; Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of fox-it.com designates 178.250.144.131 as permitted sender) client-ip=178.250.144.131; envelope-from=steffan.karger@fox-it.com; helo=ns2.fox-it.com; Received: from ns2.fox-it.com ([178.250.144.131]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1e6ZWi-0004wh-ET for openvpn-devel@lists.sourceforge.net; Mon, 23 Oct 2017 10:00:10 +0000 Received: from FOXDFT52.FOX.local (unknown [10.0.0.129]) by ns2.fox-it.com (Postfix) with ESMTPS id 8FD571C41CF for ; Mon, 23 Oct 2017 11:40:43 +0200 (CEST) Received: from steffan-fox.fox.local (10.0.3.167) by FOXDFT52.FOX.local (10.0.0.129) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Mon, 23 Oct 2017 11:40:43 +0200 From: Steffan Karger To: Date: Mon, 23 Oct 2017 11:40:13 +0200 Message-ID: <1508751613-23728-1-git-send-email-steffan.karger@fox-it.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-ClientProxiedBy: FOXDFT52.FOX.local (10.0.0.129) To FOXDFT52.FOX.local (10.0.0.129) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Headers-End: 1e6ZWi-0004wh-ET Subject: [Openvpn-devel] [PATCH] make struct key * argument of init_key_ctx const X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox This can be const, and should thus be const. (Also, resolves a compiler warning.) Signed-off-by: Steffan Karger --- src/openvpn/crypto.c | 2 +- src/openvpn/crypto.h | 2 +- src/openvpn/crypto_backend.h | 2 +- src/openvpn/crypto_mbedtls.c | 2 +- src/openvpn/crypto_openssl.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openvpn/crypto.c b/src/openvpn/crypto.c index 704ec71..566a1f6 100644 --- a/src/openvpn/crypto.c +++ b/src/openvpn/crypto.c @@ -826,7 +826,7 @@ init_key_type(struct key_type *kt, const char *ciphername, /* given a key and key_type, build a key_ctx */ void -init_key_ctx(struct key_ctx *ctx, struct key *key, +init_key_ctx(struct key_ctx *ctx, const struct key *key, const struct key_type *kt, int enc, const char *prefix) { diff --git a/src/openvpn/crypto.h b/src/openvpn/crypto.h index 86b2863..8fbfdf0 100644 --- a/src/openvpn/crypto.h +++ b/src/openvpn/crypto.h @@ -321,7 +321,7 @@ void init_key_type(struct key_type *kt, const char *ciphername, * Key context functions */ -void init_key_ctx(struct key_ctx *ctx, struct key *key, +void init_key_ctx(struct key_ctx *ctx, const struct key *key, const struct key_type *kt, int enc, const char *prefix); diff --git a/src/openvpn/crypto_backend.h b/src/openvpn/crypto_backend.h index 4644ca0..07e7358 100644 --- a/src/openvpn/crypto_backend.h +++ b/src/openvpn/crypto_backend.h @@ -334,7 +334,7 @@ void cipher_ctx_free(cipher_ctx_t *ctx); * @param enc Whether to encrypt or decrypt (either * \c MBEDTLS_OP_ENCRYPT or \c MBEDTLS_OP_DECRYPT). */ -void cipher_ctx_init(cipher_ctx_t *ctx, uint8_t *key, int key_len, +void cipher_ctx_init(cipher_ctx_t *ctx, const uint8_t *key, int key_len, const cipher_kt_t *kt, int enc); /** diff --git a/src/openvpn/crypto_mbedtls.c b/src/openvpn/crypto_mbedtls.c index c6a2c26..adef7ce 100644 --- a/src/openvpn/crypto_mbedtls.c +++ b/src/openvpn/crypto_mbedtls.c @@ -563,7 +563,7 @@ cipher_ctx_free(mbedtls_cipher_context_t *ctx) } void -cipher_ctx_init(mbedtls_cipher_context_t *ctx, uint8_t *key, int key_len, +cipher_ctx_init(mbedtls_cipher_context_t *ctx, const uint8_t *key, int key_len, const mbedtls_cipher_info_t *kt, const mbedtls_operation_t operation) { ASSERT(NULL != kt && NULL != ctx); diff --git a/src/openvpn/crypto_openssl.c b/src/openvpn/crypto_openssl.c index 439d8df..61d610d 100644 --- a/src/openvpn/crypto_openssl.c +++ b/src/openvpn/crypto_openssl.c @@ -677,7 +677,7 @@ cipher_ctx_free(EVP_CIPHER_CTX *ctx) } void -cipher_ctx_init(EVP_CIPHER_CTX *ctx, uint8_t *key, int key_len, +cipher_ctx_init(EVP_CIPHER_CTX *ctx, const uint8_t *key, int key_len, const EVP_CIPHER *kt, int enc) { ASSERT(NULL != kt && NULL != ctx);