Source-Changes-HG archive

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

[src/trunk]: src Add opencrypto.9 manpage, manpage copied from OpenBSD (Angel...



details:   https://anonhg.NetBSD.org/src/rev/a60be58fe387
branches:  trunk
changeset: 556569:a60be58fe387
user:      lha <lha%NetBSD.org@localhost>
date:      Sat Dec 20 20:25:28 2003 +0000

description:
Add opencrypto.9 manpage, manpage copied from OpenBSD (Angelos D. Keromytis)
Some text added me (and thus all errors in the manpage are mine)

diffstat:

 distrib/sets/lists/comp/mi  |   28 +-
 share/man/man9/Makefile     |   15 +-
 share/man/man9/opencrypto.9 |  623 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 664 insertions(+), 2 deletions(-)

diffs (truncated from 726 to 300 lines):

diff -r 3a0c8fcefe07 -r a60be58fe387 distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi        Sat Dec 20 20:03:20 2003 +0000
+++ b/distrib/sets/lists/comp/mi        Sat Dec 20 20:25:28 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mi,v 1.647 2003/12/14 17:15:31 thorpej Exp $
+#      $NetBSD: mi,v 1.648 2003/12/20 20:25:28 lha Exp $
 ./usr/bin/addr2line            comp-debug-bin
 ./usr/bin/ar                   comp-util-bin
 ./usr/bin/as                   comp-util-bin
@@ -3626,6 +3626,18 @@
 ./usr/share/man/cat9/crfree.0          comp-sys-catman
 ./usr/share/man/cat9/crget.0           comp-sys-catman
 ./usr/share/man/cat9/crhold.0          comp-sys-catman
+./usr/share/man/cat9/crypto_dispatch.0 comp-sys-catman
+./usr/share/man/cat9/crypto_done.0     comp-sys-catman
+./usr/share/man/cat9/crypto_freereq.0  comp-sys-catman
+./usr/share/man/cat9/crypto_freesession.0      comp-sys-catman
+./usr/share/man/cat9/crypto_get_driverid.0     comp-sys-catman
+./usr/share/man/cat9/crypto_getreq.0   comp-sys-catman
+./usr/share/man/cat9/crypto_kdispatch.0        comp-sys-catman
+./usr/share/man/cat9/crypto_kdone.0    comp-sys-catman
+./usr/share/man/cat9/crypto_kregister.0        comp-sys-catman
+./usr/share/man/cat9/crypto_newsession.0       comp-sys-catman
+./usr/share/man/cat9/crypto_register.0 comp-sys-catman
+./usr/share/man/cat9/crypto_unregister.0       comp-sys-catman
 ./usr/share/man/cat9/ctxsw.0           comp-sys-catman
 ./usr/share/man/cat9/curcpu.0  comp-sys-catman
 ./usr/share/man/cat9/curproc.0 comp-sys-catman
@@ -3838,6 +3850,7 @@
 ./usr/share/man/cat9/namei.0           comp-sys-catman
 ./usr/share/man/cat9/need_resched.0            comp-sys-catman
 ./usr/share/man/cat9/nextrunqueue.0            comp-sys-catman
+./usr/share/man/cat9/opencrypto.0              comp-sys-catman
 ./usr/share/man/cat9/panic.0           comp-sys-catman
 ./usr/share/man/cat9/pci.0             comp-sys-catman
 ./usr/share/man/cat9/pci_conf_hook.0   comp-sys-catman
@@ -6831,6 +6844,18 @@
 ./usr/share/man/man9/crfree.9          comp-sys-man
 ./usr/share/man/man9/crget.9           comp-sys-man
 ./usr/share/man/man9/crhold.9          comp-sys-man
+./usr/share/man/man9/crypto_dispatch.9 comp-sys-man
+./usr/share/man/man9/crypto_done.9     comp-sys-man
+./usr/share/man/man9/crypto_freereq.9  comp-sys-man
+./usr/share/man/man9/crypto_freesession.9      comp-sys-man
+./usr/share/man/man9/crypto_get_driverid.9     comp-sys-man
+./usr/share/man/man9/crypto_getreq.9   comp-sys-man
+./usr/share/man/man9/crypto_kdispatch.9        comp-sys-man
+./usr/share/man/man9/crypto_kdone.9    comp-sys-man
+./usr/share/man/man9/crypto_kregister.9        comp-sys-man
+./usr/share/man/man9/crypto_newsession.9       comp-sys-man
+./usr/share/man/man9/crypto_register.9 comp-sys-man
+./usr/share/man/man9/crypto_unregister.9       comp-sys-man
 ./usr/share/man/man9/ctxsw.9           comp-sys-man
 ./usr/share/man/man9/curcpu.9  comp-sys-man
 ./usr/share/man/man9/curproc.9 comp-sys-man
@@ -7043,6 +7068,7 @@
 ./usr/share/man/man9/namei.9           comp-sys-man
 ./usr/share/man/man9/need_resched.9            comp-sys-man
 ./usr/share/man/man9/nextrunqueue.9            comp-sys-man
+./usr/share/man/man9/opencrypto.9              comp-sys-man
 ./usr/share/man/man9/panic.9           comp-sys-man
 ./usr/share/man/man9/pci.9             comp-sys-man
 ./usr/share/man/man9/pci_conf_hook.9   comp-sys-man
diff -r 3a0c8fcefe07 -r a60be58fe387 share/man/man9/Makefile
--- a/share/man/man9/Makefile   Sat Dec 20 20:03:20 2003 +0000
+++ b/share/man/man9/Makefile   Sat Dec 20 20:25:28 2003 +0000
@@ -1,4 +1,4 @@
-#       $NetBSD: Makefile,v 1.151 2003/12/04 19:57:38 atatat Exp $
+#       $NetBSD: Makefile,v 1.152 2003/12/20 20:25:28 lha Exp $
 
 #      Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -22,6 +22,7 @@
        kprintf.9 kthread.9 linedisc.9 lock.9 log.9 ltsleep.9 \
        malloc.9 mbuf.9 mca.9 memcmp.9 memcpy.9 memmove.9 memset.9 \
        microtime.9 mstohz.9 namecache.9 namei.9 need_resched.9 \
+       opencrypto.9 \
        panic.9 pci.9 pci_configure_bus.9 pci_intr.9 \
        pcmcia.9 pfil.9 physio.9 pmap.9 pmatch.9 pmc.9 \
        pool.9 pool_cache.9 powerhook_establish.9 ppsratecheck.9 \
@@ -288,6 +289,18 @@
 MLINKS+=namei.9 lookup.9 \
        namei.9 relookup.9 \
        namei.9 NDINIT.9
+MLINKS+=opencrypto.9 crypto_get_driverid.9 \
+       opencrypto.9 crypto_register.9 \
+       opencrypto.9 crypto_kregister.9 \
+       opencrypto.9 crypto_unregister.9 \
+       opencrypto.9 crypto_done.9 \
+       opencrypto.9 crypto_kdone.9 \
+       opencrypto.9 crypto_newsession.9 \
+       opencrypto.9 crypto_freesession.9 \
+       opencrypto.9 crypto_dispatch.9 \
+       opencrypto.9 crypto_kdispatch.9 \
+       opencrypto.9 crypto_getreq.9 \
+       opencrypto.9 crypto_freereq.9
 MLINKS+=pci.9 pci_conf_read.9 \
        pci.9 pci_conf_write.9 \
        pci.9 pci_conf_print.9 \
diff -r 3a0c8fcefe07 -r a60be58fe387 share/man/man9/opencrypto.9
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man9/opencrypto.9       Sat Dec 20 20:25:28 2003 +0000
@@ -0,0 +1,623 @@
+.\"    $OpenBSD: crypto.9,v 1.25 2003/07/11 13:47:41 jmc Exp $
+.\"    $NetBSD: opencrypto.9,v 1.1 2003/12/20 20:25:28 lha Exp $
+.\"
+.\" The author of this man page is Angelos D. Keromytis (angelos%cis.upenn.edu@localhost)
+.\"
+.\" Copyright (c) 2000, 2001 Angelos D. Keromytis
+.\"
+.\" Permission to use, copy, and modify this software with or without fee
+.\" is hereby granted, provided that this entire notice is included in
+.\" all source code copies of any software which is or includes a copy or
+.\" modification of this software.
+.\"
+.\" THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
+.\" IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
+.\" REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
+.\" MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
+.\" PURPOSE.
+.\"
+.Dd December 20, 2003
+.Dt OPENCRYPTO 9
+.Os
+.Sh NAME
+.Nm opencrypto ,
+.Nm crypto_get_driverid ,
+.Nm crypto_register ,
+.Nm crypto_kregister ,
+.Nm crypto_unregister ,
+.Nm crypto_done ,
+.Nm crypto_kdone ,
+.Nm crypto_newsession ,
+.Nm crypto_freesession ,
+.Nm crypto_dispatch ,
+.Nm crypto_kdispatch ,
+.Nm crypto_getreq ,
+.Nm crypto_freereq
+.Nd API for cryptographic services in the kernel
+.Sh SYNOPSIS
+.Fd #include <opencrypto/cryptodev.h>
+.Ft int32_t
+.Fn crypto_get_driverid "u_int32_t"
+.Ft int
+.Fn crypto_register "u_int32_t" "int" "u_int16_t" "u_int32_t" "int (*)(void *, u_int32_t *, struct cryptoini *)" "int (*)(void *, u_int32_t *)" "int (*)(u_int64_t)" "int (*)(struct cryptop *)" "void 
*"
+.Ft int
+.Fn crypto_kregister "u_int32_t" "int" "u_int32_t" "int (*)(void *, struct cryptkop *, int)" "void *"
+.Ft int
+.Fn crypto_unregister "u_int32_t" "int"
+.Ft void
+.Fn crypto_done "struct cryptop *"
+.Ft void
+.Fn crypto_kdone "struct cryptkop *"
+.Ft int
+.Fn crypto_newsession "u_int64_t *" "struct cryptoini *" "int"
+.Ft int
+.Fn crypto_freesession "u_int64_t"
+.Ft int
+.Fn crypto_dispatch "struct cryptop *"
+.Ft int
+.Fn crypto_kdispatch "struct cryptkop *"
+.Ft struct cryptop *
+.Fn crypto_getreq "int"
+.Ft void
+.Fn crypto_freereq "struct cryptop *"
+.Bd -literal
+
+#define EALG_MAX_BLOCK_LEN      16
+
+struct cryptoini {
+       int                cri_alg;
+       int                cri_klen;
+       int                cri_rnd;
+       caddr_t            cri_key;
+       u_int8_t           cri_iv[EALG_MAX_BLOCK_LEN];
+       struct cryptoini  *cri_next;
+};
+
+struct cryptodesc {
+       int                crd_skip;
+       int                crd_len;
+       int                crd_inject;
+       int                crd_flags;
+       struct cryptoini   CRD_INI;
+       struct cryptodesc *crd_next;
+};
+
+struct cryptop {
+       TAILQ_ENTRY(cryptop) crp_next;
+       u_int64_t          crp_sid;
+       int                crp_ilen;
+       int                crp_olen;
+       int                crp_etype;
+       int                crp_flags;
+       caddr_t            crp_buf;
+       caddr_t            crp_opaque;
+       struct cryptodesc *crp_desc;
+       int              (*crp_callback)(struct cryptop *);
+       caddr_t            crp_mac;
+};
+
+struct crparam {
+        caddr_t         crp_p;
+        u_int           crp_nbits;
+};
+
+#define CRK_MAXPARAM    8
+
+struct cryptkop {
+       TAILQ_ENTRY(cryptkop) krp_next;
+        u_int              krp_op;         /* ie. CRK_MOD_EXP or other */
+        u_int              krp_status;     /* return status */
+        u_short            krp_iparams;    /* # of input parameters */
+        u_short            krp_oparams;    /* # of output parameters */
+       u_int32_t          krp_hid;
+        struct crparam     krp_param[CRK_MAXPARAM];      /* kvm */
+        int               (*krp_callback)(struct cryptkop *);
+};
+.Ed
+.Sh DESCRIPTION
+.Nm
+is a framework for drivers of cryptographic hardware to register with
+the kernel so
+.Dq consumers
+(other kernel subsystems, and eventually
+users through an appropriate device) are able to make use of it.
+Drivers register with the framework the algorithms they support,
+and provide entry points (functions) the framework may call to
+establish, use, and tear down sessions.
+Sessions are used to cache cryptographic information in a particular driver
+(or associated hardware), so initialization is not needed with every request.
+Consumers of cryptographic services pass a set of
+descriptors that instruct the framework (and the drivers registered
+with it) of the operations that should be applied on the data (more
+than one cryptographic operation can be requested).
+.Pp
+Keying operations are supported as well.
+Unlike the symmetric operators described above,
+these sessionless commands perform mathematical operations using
+input and output parameters.
+.Pp
+Since the consumers may not be associated with a process, drivers may
+not use
+.Xr tsleep 9 .
+The same holds for the framework.
+Thus, a callback mechanism is used
+to notify a consumer that a request has been completed (the
+callback is specified by the consumer on an per-request basis).
+The callback is invoked by the framework whether the request was
+successfully completed or not.
+An error indication is provided in the latter case.
+A specific error code,
+.Er EAGAIN ,
+is used to indicate that a session number has changed and that the
+request may be re-submitted immediately with the new session number.
+Errors are only returned to the invoking function if not
+enough information to call the callback is available (meaning, there
+was a fatal error in verifying the arguments).
+For session initialization and teardown there is no callback mechanism used.
+.Pp
+The
+.Fn crypto_newsession
+routine is called by consumers of cryptographic services (such as the
+.Xr ipsec 4
+stack) that wish to establish a new session with the framework.
+On success, the first argument will contain the Session Identifier (SID).
+The second argument contains all the necessary information for
+the driver to establish the session.
+The third argument indicates whether a
+hardware driver should be used (1) or not (0).
+The various fields in the
+.Fa cryptoini
+structure are:
+.Bl -tag -width foobarmoocow
+.It Fa cri_alg
+Contains an algorithm identifier.
+Currently supported algorithms are:
+.Bd -literal
+CRYPTO_DES_CBC
+CRYPTO_3DES_CBC
+CRYPTO_BLF_CBC
+CRYPTO_CAST_CBC
+CRYPTO_SKIPJACK_CBC
+CRYPTO_MD5_HMAC
+CRYPTO_SHA1_HMAC
+CRYPTO_RIPEMD160_HMAC
+CRYPTO_MD5_KPDK
+CRYPTO_SHA1_KPDK
+CRYPTO_AES_CBC
+CRYPTO_ARC4
+CRYPTO_MD5
+CRYPTO_SHA1
+.Ed
+.Pp
+.It Fa cri_klen
+Specifies the length of the key in bits, for variable-size key
+algorithms.
+.It Fa cri_rnd
+Specifies the number of rounds to be used with the algorithm, for
+variable-round algorithms.



Home | Main Index | Thread Index | Old Index