Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/opencrypto Some const poisoning.



details:   https://anonhg.NetBSD.org/src/rev/bd34409e56e4
branches:  trunk
changeset: 550998:bd34409e56e4
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Aug 27 00:20:56 2003 +0000

description:
Some const poisoning.

diffstat:

 sys/opencrypto/cryptosoft.c |   8 ++--
 sys/opencrypto/cryptosoft.h |   6 ++--
 sys/opencrypto/skipjack.c   |   6 ++--
 sys/opencrypto/skipjack.h   |   4 +-
 sys/opencrypto/xform.c      |  64 ++++++++++++++++++++++----------------------
 sys/opencrypto/xform.h      |   6 ++--
 6 files changed, 47 insertions(+), 47 deletions(-)

diffs (truncated from 321 to 300 lines):

diff -r dc939f8a8236 -r bd34409e56e4 sys/opencrypto/cryptosoft.c
--- a/sys/opencrypto/cryptosoft.c       Wed Aug 27 00:12:37 2003 +0000
+++ b/sys/opencrypto/cryptosoft.c       Wed Aug 27 00:20:56 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cryptosoft.c,v 1.7 2003/08/26 15:03:26 thorpej Exp $ */
+/*     $NetBSD: cryptosoft.c,v 1.8 2003/08/27 00:20:56 thorpej Exp $ */
 /*     $FreeBSD: src/sys/opencrypto/cryptosoft.c,v 1.2.2.1 2002/11/21 23:34:23 sam Exp $       */
 /*     $OpenBSD: cryptosoft.c,v 1.35 2002/04/26 08:43:50 deraadt Exp $ */
 
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cryptosoft.c,v 1.7 2003/08/26 15:03:26 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cryptosoft.c,v 1.8 2003/08/27 00:20:56 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -37,7 +37,7 @@
 #include <opencrypto/cryptosoft.h>
 #include <opencrypto/xform.h>
 
-u_int8_t hmac_ipad_buffer[64] = {
+const u_int8_t hmac_ipad_buffer[64] = {
        0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
        0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
        0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36,
@@ -48,7 +48,7 @@
        0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36
 };
 
-u_int8_t hmac_opad_buffer[64] = {
+const u_int8_t hmac_opad_buffer[64] = {
        0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
        0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
        0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C,
diff -r dc939f8a8236 -r bd34409e56e4 sys/opencrypto/cryptosoft.h
--- a/sys/opencrypto/cryptosoft.h       Wed Aug 27 00:12:37 2003 +0000
+++ b/sys/opencrypto/cryptosoft.h       Wed Aug 27 00:20:56 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cryptosoft.h,v 1.1 2003/07/25 21:12:45 jonathan Exp $ */
+/*     $NetBSD: cryptosoft.h,v 1.2 2003/08/27 00:20:56 thorpej Exp $ */
 /*     $OpenBSD: cryptosoft.h,v 1.10 2002/04/22 23:10:09 deraadt Exp $ */
 
 /*
@@ -58,8 +58,8 @@
 };
 
 #ifdef _KERNEL
-extern u_int8_t hmac_ipad_buffer[64];
-extern u_int8_t hmac_opad_buffer[64];
+extern const u_int8_t hmac_ipad_buffer[64];
+extern const u_int8_t hmac_opad_buffer[64];
 void   swcr_init(void);
 #endif /* _KERNEL */
 
diff -r dc939f8a8236 -r bd34409e56e4 sys/opencrypto/skipjack.c
--- a/sys/opencrypto/skipjack.c Wed Aug 27 00:12:37 2003 +0000
+++ b/sys/opencrypto/skipjack.c Wed Aug 27 00:20:56 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: skipjack.c,v 1.1 2003/07/25 21:12:48 jonathan Exp $ */
+/*     $NetBSD: skipjack.c,v 1.2 2003/08/27 00:20:56 thorpej Exp $ */
 /*     $OpenBSD: skipjack.c,v 1.3 2001/05/05 00:31:34 angelos Exp $    */
 
 /* 
@@ -15,7 +15,7 @@
 */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: skipjack.c,v 1.1 2003/07/25 21:12:48 jonathan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: skipjack.c,v 1.2 2003/08/27 00:20:56 thorpej Exp $");
 
 #include <sys/param.h>
 #include <opencrypto/skipjack.h>
@@ -67,7 +67,7 @@
  * k0, k1..k9
  */
 void
-subkey_table_gen (u_int8_t *key, u_int8_t **key_tables)
+subkey_table_gen (const u_int8_t *key, u_int8_t **key_tables)
 {
        int i, k;
 
diff -r dc939f8a8236 -r bd34409e56e4 sys/opencrypto/skipjack.h
--- a/sys/opencrypto/skipjack.h Wed Aug 27 00:12:37 2003 +0000
+++ b/sys/opencrypto/skipjack.h Wed Aug 27 00:20:56 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: skipjack.h,v 1.1 2003/07/25 21:12:48 jonathan Exp $ */
+/*     $NetBSD: skipjack.h,v 1.2 2003/08/27 00:20:56 thorpej Exp $ */
 /*     $OpenBSD: skipjack.h,v 1.3 2002/03/14 01:26:51 millert Exp $    */
 
 /* 
@@ -16,4 +16,4 @@
 
 extern void skipjack_forwards(u_int8_t *plain, u_int8_t *cipher, u_int8_t **key);
 extern void skipjack_backwards(u_int8_t *cipher, u_int8_t *plain, u_int8_t **key);
-extern void subkey_table_gen(u_int8_t *key, u_int8_t **key_tables);
+extern void subkey_table_gen(const u_int8_t *key, u_int8_t **key_tables);
diff -r dc939f8a8236 -r bd34409e56e4 sys/opencrypto/xform.c
--- a/sys/opencrypto/xform.c    Wed Aug 27 00:12:37 2003 +0000
+++ b/sys/opencrypto/xform.c    Wed Aug 27 00:20:56 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xform.c,v 1.8 2003/08/27 00:05:28 thorpej Exp $ */
+/*     $NetBSD: xform.c,v 1.9 2003/08/27 00:20:56 thorpej Exp $ */
 /*     $FreeBSD: src/sys/opencrypto/xform.c,v 1.1.2.1 2002/11/21 23:34:23 sam Exp $    */
 /*     $OpenBSD: xform.c,v 1.19 2002/08/16 22:47:25 dhartmei Exp $     */
 
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xform.c,v 1.8 2003/08/27 00:05:28 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform.c,v 1.9 2003/08/27 00:20:56 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -68,15 +68,15 @@
 
 static void null_encrypt(caddr_t, u_int8_t *);
 static void null_decrypt(caddr_t, u_int8_t *);
-static int null_setkey(u_int8_t **, u_int8_t *, int);
+static int null_setkey(u_int8_t **, const u_int8_t *, int);
 static void null_zerokey(u_int8_t **);
 
-static int des1_setkey(u_int8_t **, u_int8_t *, int);
-static int des3_setkey(u_int8_t **, u_int8_t *, int);
-static int blf_setkey(u_int8_t **, u_int8_t *, int);
-static int cast5_setkey(u_int8_t **, u_int8_t *, int);
-static  int skipjack_setkey(u_int8_t **, u_int8_t *, int);
-static  int rijndael128_setkey(u_int8_t **, u_int8_t *, int);
+static int des1_setkey(u_int8_t **, const u_int8_t *, int);
+static int des3_setkey(u_int8_t **, const u_int8_t *, int);
+static int blf_setkey(u_int8_t **, const u_int8_t *, int);
+static int cast5_setkey(u_int8_t **, const u_int8_t *, int);
+static  int skipjack_setkey(u_int8_t **, const u_int8_t *, int);
+static  int rijndael128_setkey(u_int8_t **, const u_int8_t *, int);
 static void des1_encrypt(caddr_t, u_int8_t *);
 static void des3_encrypt(caddr_t, u_int8_t *);
 static void blf_encrypt(caddr_t, u_int8_t *);
@@ -97,22 +97,22 @@
 static void rijndael128_zerokey(u_int8_t **);
 
 static void null_init(void *);
-static int null_update(void *, u_int8_t *, u_int16_t);
+static int null_update(void *, const u_int8_t *, u_int16_t);
 static void null_final(u_int8_t *, void *);
 
-static int     MD5Update_int(void *, u_int8_t *, u_int16_t);
+static int     MD5Update_int(void *, const u_int8_t *, u_int16_t);
 static void    SHA1Init_int(void *);
-static int SHA1Update_int(void *, u_int8_t *, u_int16_t);
+static int SHA1Update_int(void *, const u_int8_t *, u_int16_t);
 static void SHA1Final_int(u_int8_t *, void *);
 
 
-static int RMD160Update_int(void *, u_int8_t *, u_int16_t);
-static int SHA1Update_int(void *, u_int8_t *, u_int16_t);
+static int RMD160Update_int(void *, const u_int8_t *, u_int16_t);
+static int SHA1Update_int(void *, const u_int8_t *, u_int16_t);
 static void SHA1Final_int(u_int8_t *, void *);
-static int RMD160Update_int(void *, u_int8_t *, u_int16_t);
-static int SHA256Update_int(void *, u_int8_t *, u_int16_t);
-static int SHA384Update_int(void *, u_int8_t *, u_int16_t);
-static int SHA512Update_int(void *, u_int8_t *, u_int16_t);
+static int RMD160Update_int(void *, const u_int8_t *, u_int16_t);
+static int SHA256Update_int(void *, const u_int8_t *, u_int16_t);
+static int SHA384Update_int(void *, const u_int8_t *, u_int16_t);
+static int SHA512Update_int(void *, const u_int8_t *, u_int16_t);
 
 static u_int32_t deflate_compress(u_int8_t *, u_int32_t, u_int8_t **);
 static u_int32_t deflate_decompress(u_int8_t *, u_int32_t, u_int8_t **);
@@ -287,7 +287,7 @@
 {
 }
 static int
-null_setkey(u_int8_t **sched, u_int8_t *key, int len)
+null_setkey(u_int8_t **sched, const u_int8_t *key, int len)
 {
        *sched = NULL;
        return 0;
@@ -317,7 +317,7 @@
 }
 
 static int
-des1_setkey(u_int8_t **sched, u_int8_t *key, int len)
+des1_setkey(u_int8_t **sched, const u_int8_t *key, int len)
 {
        des_key_schedule *p;
        int err;
@@ -361,7 +361,7 @@
 }
 
 static int
-des3_setkey(u_int8_t **sched, u_int8_t *key, int len)
+des3_setkey(u_int8_t **sched, const u_int8_t *key, int len)
 {
        des_key_schedule *p;
        int err;
@@ -411,7 +411,7 @@
 }
 
 static int
-blf_setkey(u_int8_t **sched, u_int8_t *key, int len)
+blf_setkey(u_int8_t **sched, const u_int8_t *key, int len)
 {
        int err;
 
@@ -457,7 +457,7 @@
 }
 
 static int
-cast5_setkey(u_int8_t **sched, u_int8_t *key, int len)
+cast5_setkey(u_int8_t **sched, const u_int8_t *key, int len)
 {
        int err;
 
@@ -493,7 +493,7 @@
 }
 
 static int
-skipjack_setkey(u_int8_t **sched, u_int8_t *key, int len)
+skipjack_setkey(u_int8_t **sched, const u_int8_t *key, int len)
 {
        int err;
 
@@ -545,7 +545,7 @@
 }
 
 static int
-rijndael128_setkey(u_int8_t **sched, u_int8_t *key, int len)
+rijndael128_setkey(u_int8_t **sched, const u_int8_t *key, int len)
 {
        int err;
 
@@ -580,7 +580,7 @@
 }
 
 static int
-null_update(void *ctx, u_int8_t *buf, u_int16_t len)
+null_update(void *ctx, const u_int8_t *buf, u_int16_t len)
 {
        return 0;
 }
@@ -593,14 +593,14 @@
 }
 
 static int
-RMD160Update_int(void *ctx, u_int8_t *buf, u_int16_t len)
+RMD160Update_int(void *ctx, const u_int8_t *buf, u_int16_t len)
 {
        RMD160Update(ctx, buf, len);
        return 0;
 }
 
 static int
-MD5Update_int(void *ctx, u_int8_t *buf, u_int16_t len)
+MD5Update_int(void *ctx, const u_int8_t *buf, u_int16_t len)
 {
        MD5Update(ctx, buf, len);
        return 0;
@@ -613,7 +613,7 @@
 }
 
 static int
-SHA1Update_int(void *ctx, u_int8_t *buf, u_int16_t len)
+SHA1Update_int(void *ctx, const u_int8_t *buf, u_int16_t len)
 {
        SHA1Update(ctx, buf, len);
        return 0;
@@ -626,21 +626,21 @@
 }
 
 static int
-SHA256Update_int(void *ctx, u_int8_t *buf, u_int16_t len)
+SHA256Update_int(void *ctx, const u_int8_t *buf, u_int16_t len)
 {
        SHA256_Update(ctx, buf, len);
        return 0;
 }
 
 static int
-SHA384Update_int(void *ctx, u_int8_t *buf, u_int16_t len)
+SHA384Update_int(void *ctx, const u_int8_t *buf, u_int16_t len)
 {
        SHA384_Update(ctx, buf, len);
        return 0;
 }
 
 static int
-SHA512Update_int(void *ctx, u_int8_t *buf, u_int16_t len)
+SHA512Update_int(void *ctx, const u_int8_t *buf, u_int16_t len)
 {
        SHA512_Update(ctx, buf, len);
        return 0;
diff -r dc939f8a8236 -r bd34409e56e4 sys/opencrypto/xform.h
--- a/sys/opencrypto/xform.h    Wed Aug 27 00:12:37 2003 +0000
+++ b/sys/opencrypto/xform.h    Wed Aug 27 00:20:56 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xform.h,v 1.4 2003/08/26 02:54:11 thorpej Exp $ */
+/*     $NetBSD: xform.h,v 1.5 2003/08/27 00:20:57 thorpej Exp $ */



Home | Main Index | Thread Index | Old Index