aboutsummaryrefslogtreecommitdiff
path: root/src/openvpn/crypto_backend.h
diff options
context:
space:
mode:
authorFrank Lichtenheld2024-03-27 17:26:21 +0100
committerGert Doering2024-03-31 15:59:47 +0200
commit4d907bf46a470ccbd2940b9ecb64d6502d9d86bf (patch)
tree2fe98ca48bcb19ae20f14d9f22a9fa084cb5d6d9 /src/openvpn/crypto_backend.h
parent4c71e816031f564f834df695b3fa717ea22720d2 (diff)
downloadopenvpn-4d907bf46a470ccbd2940b9ecb64d6502d9d86bf.zip
openvpn-4d907bf46a470ccbd2940b9ecb64d6502d9d86bf.tar.gz
crypto_backend: fix type of enc parameter
We had parts of a abstraction, but it wasn't consistent. GCC 13 now complains about the type mismatch with mbedtls now: crypto_mbedtls.c:568:1: error: conflicting types for ‘cipher_ctx_init’ due to enum/integer mismatch; have ‘void(mbedtls_cipher_context_t *, const uint8_t *, const char *, const mbedtls_operation_t)’ [...] [-Werror=enum-int-mismatch] crypto_backend.h:341:6: note: previous declaration of ‘cipher_ctx_init’ with type ‘void(cipher_ctx_t *, const uint8_t *, const char *, int)’ [...] Previous compiler versions did not complain. v2: - clean solution instead of quick solution. Fix the actual API definition Change-Id: If0dcdde30879fd6185efb2ad31399c1629c04d22 Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org> Message-Id: <20240327162621.1792414-1-frank@lichtenheld.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28498.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'src/openvpn/crypto_backend.h')
-rw-r--r--src/openvpn/crypto_backend.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/openvpn/crypto_backend.h b/src/openvpn/crypto_backend.h
index 8d37e64..c454c64 100644
--- a/src/openvpn/crypto_backend.h
+++ b/src/openvpn/crypto_backend.h
@@ -336,10 +336,10 @@ void cipher_ctx_free(cipher_ctx_t *ctx);
* @param key Buffer containing the key to use
* @param ciphername Ciphername of the cipher to use
* @param enc Whether to encrypt or decrypt (either
- * \c MBEDTLS_OP_ENCRYPT or \c MBEDTLS_OP_DECRYPT).
+ * \c OPENVPN_OP_ENCRYPT or \c OPENVPN_OP_DECRYPT).
*/
void cipher_ctx_init(cipher_ctx_t *ctx, const uint8_t *key,
- const char *cipername, int enc);
+ const char *cipername, crypto_operation_t enc);
/**
* Returns the size of the IV used by the cipher, in bytes, or 0 if no IV is