Module Name:    src
Committed By:   riastradh
Date:           Sat Apr 25 12:55:05 UTC 2015

Modified Files:
        src/sys/dev: cgd_crypto.c cgd_crypto.h

Log Message:
Sprinkle const into cgd crypto API.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/cgd_crypto.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/cgd_crypto.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cgd_crypto.c
diff -u src/sys/dev/cgd_crypto.c:1.12 src/sys/dev/cgd_crypto.c:1.13
--- src/sys/dev/cgd_crypto.c:1.12	Mon Jun 24 04:21:20 2013
+++ src/sys/dev/cgd_crypto.c	Sat Apr 25 12:55:04 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd_crypto.c,v 1.12 2013/06/24 04:21:20 riastradh Exp $ */
+/* $NetBSD: cgd_crypto.c,v 1.13 2015/04/25 12:55:04 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgd_crypto.c,v 1.12 2013/06/24 04:21:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd_crypto.c,v 1.13 2015/04/25 12:55:04 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -126,8 +126,8 @@ static void
 cgd_cipher_uio_cbc(void *privdata, cipher_func cipher,
     struct uio *dstuio, struct uio *srcuio)
 {
-	struct iovec	*dst;
-	struct iovec	*src;
+	const struct iovec	*dst;
+	const struct iovec	*src;
 	int		 dstnum;
 	int		 dstoff = 0;
 	int		 srcnum;
@@ -140,7 +140,7 @@ cgd_cipher_uio_cbc(void *privdata, ciphe
 	for (;;) {
 		int	  l = MIN(dst->iov_len - dstoff, src->iov_len - srcoff);
 		u_int8_t *d = (u_int8_t *)dst->iov_base + dstoff;
-		u_int8_t *s = (u_int8_t *)src->iov_base + srcoff;
+		const u_int8_t *s = (const u_int8_t *)src->iov_base + srcoff;
 
 		cipher(privdata, d, s, l);
 
@@ -238,7 +238,7 @@ aes_cbc_dec_int(void *privdata, void *ds
 
 static void
 cgd_cipher_aes_cbc(void *privdata, struct uio *dstuio,
-    struct uio *srcuio, void *iv, int dir)
+    struct uio *srcuio, const void *iv, int dir)
 {
 	struct aes_privdata	*apd = privdata;
 	struct aes_encdata	 encd;
@@ -334,7 +334,7 @@ c3des_cbc_dec_int(void *privdata, void *
 
 static void
 cgd_cipher_3des_cbc(void *privdata, struct uio *dstuio,
-	struct uio *srcuio, void *iv, int dir)
+	struct uio *srcuio, const void *iv, int dir)
 {
 	struct	c3des_privdata *cp = privdata;
 	struct	c3des_encdata ce;
@@ -417,7 +417,7 @@ bf_cbc_dec_int(void *privdata, void *dst
 
 static void
 cgd_cipher_bf_cbc(void *privdata, struct uio *dstuio,
-    struct uio *srcuio, void *iv, int dir)
+    struct uio *srcuio, const void *iv, int dir)
 {
 	struct	bf_privdata *bp = privdata;
 	struct	bf_encdata be;

Index: src/sys/dev/cgd_crypto.h
diff -u src/sys/dev/cgd_crypto.h:1.7 src/sys/dev/cgd_crypto.h:1.8
--- src/sys/dev/cgd_crypto.h:1.7	Wed Dec  5 02:23:20 2012
+++ src/sys/dev/cgd_crypto.h	Sat Apr 25 12:55:04 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd_crypto.h,v 1.7 2012/12/05 02:23:20 christos Exp $ */
+/* $NetBSD: cgd_crypto.h,v 1.8 2015/04/25 12:55:04 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -38,7 +38,8 @@
 
 typedef void *(cfunc_init)(size_t, const void *, size_t *);
 typedef void  (cfunc_destroy)(void *);
-typedef void  (cfunc_cipher)(void *, struct uio *, struct uio *, void *, int);
+typedef void  (cfunc_cipher)(void *, struct uio *, struct uio *, const void *,
+				int);
 
 struct cryptfuncs {
 	const char	 *cf_name;	/* cipher name */

Reply via email to