Source-Changes-HG archive

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

[src/trunk]: src/sys Create modules for software crypto components.



details:   https://anonhg.NetBSD.org/src/rev/8aac70037ffa
branches:  trunk
changeset: 792363:8aac70037ffa
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Wed Jan 01 15:18:57 2014 +0000

description:
Create modules for software crypto components.

diffstat:

 sys/crypto/blowfish/bf_module.c    |  51 ++++++++++++++++++++++++++++++++++++++
 sys/crypto/blowfish/files.blowfish |   3 +-
 sys/crypto/camellia/camellia.c     |  21 ++++++++++++++-
 sys/crypto/cast128/cast128.c       |  27 ++++++++++++++++++-
 sys/crypto/des/des_module.c        |  51 ++++++++++++++++++++++++++++++++++++++
 sys/crypto/des/files.des           |   3 +-
 sys/crypto/skipjack/skipjack.c     |  25 ++++++++++++++++--
 sys/modules/Makefile               |   7 ++++-
 sys/modules/blowfish/Makefile      |  26 +++++++++++++++++++
 sys/modules/camellia/Makefile      |  10 +++++++
 sys/modules/cast128/Makefile       |  10 +++++++
 sys/modules/des/Makefile           |  15 +++++++++++
 sys/modules/skipjack/Makefile      |  10 +++++++
 13 files changed, 250 insertions(+), 9 deletions(-)

diffs (truncated from 395 to 300 lines):

diff -r 9ae9bef918c8 -r 8aac70037ffa sys/crypto/blowfish/bf_module.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/crypto/blowfish/bf_module.c   Wed Jan 01 15:18:57 2014 +0000
@@ -0,0 +1,51 @@
+/*     $NetBSD: bf_module.c,v 1.1 2014/01/01 15:18:57 pgoyette Exp $   */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Paul Goyette
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: bf_module.c,v 1.1 2014/01/01 15:18:57 pgoyette Exp $");
+
+#include <sys/errno.h>
+#include <sys/module.h>
+
+MODULE(MODULE_CLASS_MISC, blowfish, NULL);
+
+static int
+blowfish_modcmd(modcmd_t cmd, void *opaque)
+{
+
+       switch (cmd) {
+       case MODULE_CMD_INIT:
+               return 0;
+       case MODULE_CMD_FINI:
+               return 0;
+       default:
+               return ENOTTY;
+       }
+}
diff -r 9ae9bef918c8 -r 8aac70037ffa sys/crypto/blowfish/files.blowfish
--- a/sys/crypto/blowfish/files.blowfish        Wed Jan 01 08:41:52 2014 +0000
+++ b/sys/crypto/blowfish/files.blowfish        Wed Jan 01 15:18:57 2014 +0000
@@ -1,7 +1,8 @@
-#      $NetBSD: files.blowfish,v 1.3 2005/12/11 12:20:48 christos Exp $
+#      $NetBSD: files.blowfish,v 1.4 2014/01/01 15:18:57 pgoyette Exp $
 
 define blowfish
 
+file   crypto/blowfish/bf_module.c     blowfish
 file   crypto/blowfish/bf_ecb.c        blowfish
 file   crypto/blowfish/bf_enc.c        blowfish
 file   crypto/blowfish/bf_cbc.c        blowfish
diff -r 9ae9bef918c8 -r 8aac70037ffa sys/crypto/camellia/camellia.c
--- a/sys/crypto/camellia/camellia.c    Wed Jan 01 08:41:52 2014 +0000
+++ b/sys/crypto/camellia/camellia.c    Wed Jan 01 15:18:57 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: camellia.c,v 1.1 2011/05/05 17:38:36 drochner Exp $ */
+/* $NetBSD: camellia.c,v 1.2 2014/01/01 15:18:57 pgoyette Exp $ */
 
 /* camellia.h ver 1.1.0
  *
@@ -35,6 +35,9 @@
 #include <sys/cdefs.h>
 #include <sys/types.h>
 #include <sys/systm.h>
+#include <sys/errno.h>
+#include <sys/module.h>
+
 #include <crypto/camellia/camellia.h>
 
 
@@ -1321,3 +1324,19 @@
     PUTU32(plaintext+8,  tmp[2]);
     PUTU32(plaintext+12, tmp[3]);
 }
+
+MODULE(MODULE_CLASS_MISC, camellia, NULL);
+
+static int
+camellia_modcmd(modcmd_t cmd, void *opaque)
+{
+
+       switch (cmd) {
+       case MODULE_CMD_INIT:
+               return 0;
+       case MODULE_CMD_FINI:
+               return 0;
+       default:
+               return ENOTTY;
+       }
+}
diff -r 9ae9bef918c8 -r 8aac70037ffa sys/crypto/cast128/cast128.c
--- a/sys/crypto/cast128/cast128.c      Wed Jan 01 08:41:52 2014 +0000
+++ b/sys/crypto/cast128/cast128.c      Wed Jan 01 15:18:57 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cast128.c,v 1.9 2006/05/10 21:53:15 mrg Exp $  */
+/*     $NetBSD: cast128.c,v 1.10 2014/01/01 15:18:57 pgoyette Exp $    */
 /*      $OpenBSD: cast.c,v 1.2 2000/06/06 06:49:47 deraadt Exp $       */
 
 /*
@@ -9,9 +9,12 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cast128.c,v 1.9 2006/05/10 21:53:15 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cast128.c,v 1.10 2014/01/01 15:18:57 pgoyette Exp $");
 
 #include <sys/types.h>
+#include <sys/errno.h>
+#include <sys/module.h>
+
 #include <crypto/cast128/cast128.h>
 #include <crypto/cast128/cast128sb.h>
 
@@ -246,3 +249,23 @@
 }
 
 /* Made in Canada */
+
+#if defined(_KERNEL)
+
+MODULE(MODULE_CLASS_MISC, cast128, NULL);
+
+static int
+cast128_modcmd(modcmd_t cmd, void *opaque)
+{
+
+       switch (cmd) {
+       case MODULE_CMD_INIT:
+               return 0;
+       case MODULE_CMD_FINI:
+               return 0;
+       default:
+               return ENOTTY;
+       }
+}
+
+#endif /* defined(KERNEL) */
diff -r 9ae9bef918c8 -r 8aac70037ffa sys/crypto/des/des_module.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/crypto/des/des_module.c       Wed Jan 01 15:18:57 2014 +0000
@@ -0,0 +1,51 @@
+/*     $NetBSD: des_module.c,v 1.1 2014/01/01 15:18:57 pgoyette Exp $  */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Paul Goyette
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: des_module.c,v 1.1 2014/01/01 15:18:57 pgoyette Exp $");
+
+#include <sys/errno.h>
+#include <sys/module.h>
+
+MODULE(MODULE_CLASS_MISC, des, NULL);
+
+static int
+des_modcmd(modcmd_t cmd, void *opaque)
+{
+
+       switch (cmd) {
+       case MODULE_CMD_INIT:
+               return 0;
+       case MODULE_CMD_FINI:
+               return 0;
+       default:
+               return ENOTTY;
+       }
+}
diff -r 9ae9bef918c8 -r 8aac70037ffa sys/crypto/des/files.des
--- a/sys/crypto/des/files.des  Wed Jan 01 08:41:52 2014 +0000
+++ b/sys/crypto/des/files.des  Wed Jan 01 15:18:57 2014 +0000
@@ -1,7 +1,8 @@
-#      $NetBSD: files.des,v 1.1 2002/10/11 01:52:10 thorpej Exp $
+#      $NetBSD: files.des,v 1.2 2014/01/01 15:18:57 pgoyette Exp $
 
 define des
 
+file   crypto/des/des_module.c         des
 file   crypto/des/des_ecb.c            des
 file   crypto/des/des_setkey.c         des
 file   crypto/des/des_enc.c            des
diff -r 9ae9bef918c8 -r 8aac70037ffa sys/crypto/skipjack/skipjack.c
--- a/sys/crypto/skipjack/skipjack.c    Wed Jan 01 08:41:52 2014 +0000
+++ b/sys/crypto/skipjack/skipjack.c    Wed Jan 01 15:18:57 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: skipjack.c,v 1.3 2005/12/11 12:20:53 christos Exp $ */
+/*     $NetBSD: skipjack.c,v 1.4 2014/01/01 15:18:57 pgoyette Exp $ */
 /*     $OpenBSD: skipjack.c,v 1.3 2001/05/05 00:31:34 angelos Exp $    */
 
 /*
@@ -15,11 +15,14 @@
 */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: skipjack.c,v 1.3 2005/12/11 12:20:53 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: skipjack.c,v 1.4 2014/01/01 15:18:57 pgoyette Exp $");
 
+#include <sys/errno.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
 #include <sys/param.h>
+
 #include <crypto/skipjack/skipjack.h>
-#include <sys/malloc.h>
 #include <opencrypto/cryptodev.h>
 
 static const u_int8_t ftable[0x100] =
@@ -260,3 +263,19 @@
        plain [4] = wh3;  plain [5] = wl3;
        plain [6] = wh4;  plain [7] = wl4;
 }
+
+MODULE(MODULE_CLASS_MISC, skipjack, NULL);
+
+static int
+skipjack_modcmd(modcmd_t cmd, void *opaque)
+{
+
+       switch (cmd) {
+       case MODULE_CMD_INIT:
+               return 0;
+       case MODULE_CMD_FINI:
+               return 0;
+       default:
+               return ENOTTY;
+       }
+}
diff -r 9ae9bef918c8 -r 8aac70037ffa sys/modules/Makefile
--- a/sys/modules/Makefile      Wed Jan 01 08:41:52 2014 +0000
+++ b/sys/modules/Makefile      Wed Jan 01 15:18:57 2014 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.132 2013/12/29 16:32:32 pgoyette Exp $
+#      $NetBSD: Makefile,v 1.133 2014/01/01 15:18:57 pgoyette Exp $
 
 .include <bsd.own.mk>
 
@@ -8,7 +8,10 @@
 SUBDIR+=       accf_httpready
 SUBDIR+=       adosfs
 SUBDIR+=       aio
+SUBDIR+=       blowfish
 SUBDIR+=       bpf
+SUBDIR+=       camellia
+SUBDIR+=       cast128
 SUBDIR+=       ccd
 SUBDIR+=       cd9660
 SUBDIR+=       cgd
@@ -19,6 +22,7 @@
 SUBDIR+=       compat_ossaudio
 SUBDIR+=       coredump
 SUBDIR+=       dbcool
+SUBDIR+=       des
 SUBDIR+=       dk_subr
 SUBDIR+=       efs
 SUBDIR+=       ext2fs
@@ -78,6 +82,7 @@
 SUBDIR+=       secmodel_extensions
 SUBDIR+=       secmodel_overlay
 SUBDIR+=       securelevel



Home | Main Index | Thread Index | Old Index