NetBSD Problem Report #30355
From mouse@Sparkle.Rodents.Montreal.QC.CA Fri May 27 23:00:48 2005
Return-Path: <mouse@Sparkle.Rodents.Montreal.QC.CA>
Received: from Sparkle.Rodents.Montreal.QC.CA (Sparkle.Rodents.Montreal.QC.CA [216.46.5.7])
by narn.netbsd.org (Postfix) with ESMTP id 10A7963B121
for <gnats-bugs@gnats.NetBSD.org>; Fri, 27 May 2005 23:00:48 +0000 (UTC)
Message-Id: <200505272300.TAA23237@Sparkle.Rodents.Montreal.QC.CA>
Date: Fri, 27 May 2005 19:00:41 -0400 (EDT)
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
Reply-To: mouse@Rodents.Montreal.QC.CA
To: gnats-bugs@netbsd.org
Subject: crypto(4) ioctl names wrong
X-Send-Pr-Version: 3.95
>Number: 30355
>Category: lib
>Synopsis: crypto(4) gets ioctl names wrong
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: lib-bug-people
>State: closed
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Fri May 27 23:01:00 +0000 2005
>Closed-Date: Sat Sep 23 20:39:18 +0000 2006
>Last-Modified: Sat Sep 23 20:40:01 +0000 2006
>Originator: der Mouse
>Release: NetBSD 2.0
>Organization:
Dis-
>Environment:
Any 2.0. Reading crypto.4 makes me think -current has the same
problem but to a lesser extent.
>Description:
Some of the ioctl names in crypt(4) are wrong. In particular,
I see CRIOCGSESSION mentioned, when it's actually CIOCGSESSION.
In 2.0, this is true of the "IOCTL Request Descriptiosn" list;
in both 2.0 and -current (crypto.4,v 1.8), the BUGS section has
the same mistake, and additionally calls CIOCCRYPT CRIOCRYPT.
Both versions show CRIOCGET when it's actually CRIOGET.
The inconsistency between CRIOGET and the CIOC* ioctls is odd,
but (since it's documented) survivable. I'd prefer to see it
explicitly called out, though.
>How-To-Repeat:
Look at the manpage. Compare it to cryptodev.h.
>Fix:
This fixes all the above. It's relative to crypto.4,v 1.8.
For 2.0, a little additional patching is called for, to fix the
instance of CRIOCGSESSION in the ioctl list.
--- orig/crypto.4 Fri Apr 15 06:24:56 2005
+++ new/crypto.4 Fri May 27 18:52:16 2005
@@ -112,7 +112,7 @@
.\"
.Bl -tag -width CIOCFKEY
.\"
-.It Dv CRIOCGET Fa int *fd
+.It Dv CRIOGET Fa int *fd
Clone the fd argument to
.Xr ioctl 4 ,
yielding a new file descriptor which can be used to create
@@ -120,7 +120,7 @@
.\"
.It Dv CIOCGSESSION Fa struct session_op *sessp
Persistently bind a file descriptor returned by a previous
-.Dv CRIOCGET
+.Dv CRIOGET
to a session: that is, to the chosen privacy algorithm, integrity
algorithm, and keys specified in
.Fa sessp .
@@ -242,14 +242,20 @@
.Sh BUGS
Error checking and reporting is weak.
The values specified for symmetric-key key sizes to
-.Dv CRIOCGSESSION
+.Dv CIOCGSESSION
must exactly match the values expected by
.Xr opencrypto 9 .
The output buffer and MAC buffers supplied to
-.Dv CRIOCRYPT
+.Dv CIOCCRYPT
must follow whether privacy or integrity algorithms were specified for
session: if you request a
.No non- Ns Dv NULL
algorithm, you must supply a suitably-sized buffer.
.Pp
The scheme for passing arguments for asymmetric requests is Baroque.
+.Pp
+The naming inconsistency between
+.Dv CRIOGET
+and the various
+.Dv CIOC Ns \&*
+names is an unfortunate historical artifact.
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML mouse@rodents.montreal.qc.ca
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: elad@netbsd.org
State-Changed-When: Sat, 23 Sep 2006 20:39:18 +0000
State-Changed-Why:
patch applied, thanks!
From: Elad Efrat <elad@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: PR/30355 CVS commit: src/share/man/man4
Date: Sat, 23 Sep 2006 20:38:51 +0000 (UTC)
Module Name: src
Committed By: elad
Date: Sat Sep 23 20:38:51 UTC 2006
Modified Files:
src/share/man/man4: crypto.4
Log Message:
PR/30355: der Mouse: crypto(4) gets ioctl names wrong
Patch applied, thanks!
To generate a diff of this commit:
cvs rdiff -r1.9 -r1.10 src/share/man/man4/crypto.4
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.