]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
make struct key * argument of init_key_ctx const
authorSteffan Karger <steffan.karger@fox-it.com>
Mon, 23 Oct 2017 09:40:13 +0000 (11:40 +0200)
committerGert Doering <gert@greenie.muc.de>
Fri, 3 Nov 2017 18:28:02 +0000 (19:28 +0100)
This can be const, and should thus be const.  (Also, resolves a compiler
warning.)

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1508751613-23728-1-git-send-email-steffan.karger@fox-it.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15660.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/crypto.c
src/openvpn/crypto.h
src/openvpn/crypto_backend.h
src/openvpn/crypto_mbedtls.c
src/openvpn/crypto_openssl.c

index 03e880e279b27a313b70340a7e88fadf33c08c24..8a07a39f13728fb146991bde7786550e611e05f6 100644 (file)
@@ -842,7 +842,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)
 {
index 0cdd30fcd4b5e8bf32adab0da42c8404378e2673..d434b037da32c15bfd97480fa04d81a096be8e96 100644 (file)
@@ -317,7 +317,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);
 
index b7f519b5bacf865509aec3a3dd450ea8e35b00b5..24689dd66f7dac5ee0e538e52e43703ea1adb0e6 100644 (file)
@@ -323,7 +323,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);
 
 /**
index 0cb7f81151ddcfb1324d33737fd76588f22d9044..b35bbeb09b4778bd5b9b51b8f44e6d1ff1532430 100644 (file)
@@ -523,7 +523,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);
index 9e8d3f3e1f21e87c4ad516b9f778e758cbe59ebd..e5a6c6b451b8383f5107a850f4eb51980075822e 100644 (file)
@@ -665,7 +665,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);