summaryrefslogtreecommitdiff
path: root/sbin/iked
diff options
context:
space:
mode:
authortobhe <tobhe@cvs.openbsd.org>2021-02-25 20:13:25 +0000
committertobhe <tobhe@cvs.openbsd.org>2021-02-25 20:13:25 +0000
commit626f19e0a83021b0aeb665a0e1ab5cabe3d6407b (patch)
tree30ce375dc92ff7cdb2a3748bee7530aa754a3081 /sbin/iked
parent98392f8de3b2070ce592905bdd68379725b7559f (diff)
Constify cipher API.
ok markus@
Diffstat (limited to 'sbin/iked')
-rw-r--r--sbin/iked/crypto.c10
-rw-r--r--sbin/iked/iked.h10
2 files changed, 10 insertions, 10 deletions
diff --git a/sbin/iked/crypto.c b/sbin/iked/crypto.c
index 3115baa607b..8e7f90ee893 100644
--- a/sbin/iked/crypto.c
+++ b/sbin/iked/crypto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crypto.c,v 1.33 2021/02/04 19:59:15 tobhe Exp $ */
+/* $OpenBSD: crypto.c,v 1.34 2021/02/25 20:13:24 tobhe Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -486,7 +486,7 @@ cipher_new(uint8_t type, uint16_t id, uint16_t id_length)
}
struct ibuf *
-cipher_setkey(struct iked_cipher *encr, void *key, size_t keylen)
+cipher_setkey(struct iked_cipher *encr, const void *key, size_t keylen)
{
ibuf_release(encr->encr_key);
if ((encr->encr_key = ibuf_new(key, keylen)) == NULL) {
@@ -497,7 +497,7 @@ cipher_setkey(struct iked_cipher *encr, void *key, size_t keylen)
}
struct ibuf *
-cipher_setiv(struct iked_cipher *encr, void *iv, size_t len)
+cipher_setiv(struct iked_cipher *encr, const void *iv, size_t len)
{
ibuf_release(encr->encr_iv);
encr->encr_iv = NULL;
@@ -605,7 +605,7 @@ cipher_init_decrypt(struct iked_cipher *encr)
}
void
-cipher_aad(struct iked_cipher *encr, void *in, size_t inlen,
+cipher_aad(struct iked_cipher *encr, const void *in, size_t inlen,
size_t *outlen)
{
int olen = 0;
@@ -619,7 +619,7 @@ cipher_aad(struct iked_cipher *encr, void *in, size_t inlen,
}
int
-cipher_update(struct iked_cipher *encr, void *in, size_t inlen,
+cipher_update(struct iked_cipher *encr, const void *in, size_t inlen,
void *out, size_t *outlen)
{
int olen;
diff --git a/sbin/iked/iked.h b/sbin/iked/iked.h
index cda2e156fd9..0a2e659df3f 100644
--- a/sbin/iked/iked.h
+++ b/sbin/iked/iked.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: iked.h,v 1.186 2021/02/22 21:58:12 tobhe Exp $ */
+/* $OpenBSD: iked.h,v 1.187 2021/02/25 20:13:24 tobhe Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
@@ -908,17 +908,17 @@ size_t hash_length(struct iked_hash *);
struct iked_cipher *
cipher_new(uint8_t, uint16_t, uint16_t);
struct ibuf *
- cipher_setkey(struct iked_cipher *, void *, size_t);
+ cipher_setkey(struct iked_cipher *, const void *, size_t);
struct ibuf *
- cipher_setiv(struct iked_cipher *, void *, size_t);
+ cipher_setiv(struct iked_cipher *, const void *, size_t);
int cipher_settag(struct iked_cipher *, uint8_t *, size_t);
int cipher_gettag(struct iked_cipher *, uint8_t *, size_t);
void cipher_free(struct iked_cipher *);
int cipher_init(struct iked_cipher *, int);
int cipher_init_encrypt(struct iked_cipher *);
int cipher_init_decrypt(struct iked_cipher *);
-void cipher_aad(struct iked_cipher *, void *, size_t, size_t *);
-int cipher_update(struct iked_cipher *, void *, size_t, void *, size_t *);
+void cipher_aad(struct iked_cipher *, const void *, size_t, size_t *);
+int cipher_update(struct iked_cipher *, const void *, size_t, void *, size_t *);
int cipher_final(struct iked_cipher *);
size_t cipher_length(struct iked_cipher *);
size_t cipher_keylength(struct iked_cipher *);