summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortedu <>2014-12-08 20:46:04 +0000
committertedu <>2014-12-08 20:46:04 +0000
commit4b0b4fc5d98edef87738071b3784e13573327bab (patch)
treebd17ed91dd1ca0d5df30d9678cd1ec6e214ae8fa
parentc24b41d99ab7d9340b1e0bcaaaa030658a8e47e5 (diff)
downloadopenbsd-4b0b4fc5d98edef87738071b3784e13573327bab.tar.gz
openbsd-4b0b4fc5d98edef87738071b3784e13573327bab.tar.bz2
openbsd-4b0b4fc5d98edef87738071b3784e13573327bab.zip
delete documentation for deleted DES interfaces
-rw-r--r--src/lib/libc/crypt/Makefile.inc4
-rw-r--r--src/lib/libc/crypt/crypt.386
2 files changed, 3 insertions, 87 deletions
diff --git a/src/lib/libc/crypt/Makefile.inc b/src/lib/libc/crypt/Makefile.inc
index 2a06f73acc..bdca0bbf66 100644
--- a/src/lib/libc/crypt/Makefile.inc
+++ b/src/lib/libc/crypt/Makefile.inc
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile.inc,v 1.25 2014/12/08 20:36:18 tedu Exp $ 1# $OpenBSD: Makefile.inc,v 1.26 2014/12/08 20:46:04 tedu Exp $
2 2
3.PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/crypt ${LIBCSRCDIR}/crypt 3.PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/crypt ${LIBCSRCDIR}/crypt
4 4
@@ -6,8 +6,6 @@ SRCS+= crypt.c cryptutil.c arc4random.c arc4random_uniform.c \
6 blowfish.c bcrypt.c 6 blowfish.c bcrypt.c
7 7
8MAN+= crypt.3 crypt_checkpass.3 blowfish.3 arc4random.3 8MAN+= crypt.3 crypt_checkpass.3 blowfish.3 arc4random.3
9MLINKS+=crypt.3 setkey.3 crypt.3 encrypt.3
10MLINKS+=crypt.3 des_setkey.3 crypt.3 des_cipher.3
11MLINKS+=crypt.3 bcrypt_gensalt.3 crypt.3 bcrypt.3 9MLINKS+=crypt.3 bcrypt_gensalt.3 crypt.3 bcrypt.3
12MLINKS+=crypt_checkpass.3 crypt_newhash.3 10MLINKS+=crypt_checkpass.3 crypt_newhash.3
13MLINKS+=blowfish.3 blf_key.3 blowfish.3 blf_enc.3 11MLINKS+=blowfish.3 blf_key.3 blowfish.3 blf_enc.3
diff --git a/src/lib/libc/crypt/crypt.3 b/src/lib/libc/crypt/crypt.3
index 9a73c7a515..f6373c5125 100644
--- a/src/lib/libc/crypt/crypt.3
+++ b/src/lib/libc/crypt/crypt.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: crypt.3,v 1.43 2014/12/02 07:39:58 schwarze Exp $ 1.\" $OpenBSD: crypt.3,v 1.44 2014/12/08 20:46:04 tedu Exp $
2.\" 2.\"
3.\" FreeSec: libcrypt 3.\" FreeSec: libcrypt
4.\" 4.\"
@@ -31,32 +31,20 @@
31.\" 31.\"
32.\" Manual page, using -mandoc macros 32.\" Manual page, using -mandoc macros
33.\" 33.\"
34.Dd $Mdocdate: December 2 2014 $ 34.Dd $Mdocdate: December 8 2014 $
35.Dt CRYPT 3 35.Dt CRYPT 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
38.Nm crypt , 38.Nm crypt ,
39.Nm setkey ,
40.Nm encrypt ,
41.Nm des_setkey ,
42.Nm des_cipher ,
43.Nm bcrypt_gensalt , 39.Nm bcrypt_gensalt ,
44.Nm bcrypt 40.Nm bcrypt
45.Nd password hashing 41.Nd password hashing
46.Sh SYNOPSIS 42.Sh SYNOPSIS
47.In stdlib.h 43.In stdlib.h
48.Ft int
49.Fn setkey "const char *key"
50.Pp 44.Pp
51.In unistd.h 45.In unistd.h
52.Ft char * 46.Ft char *
53.Fn crypt "const char *key" "const char *setting" 47.Fn crypt "const char *key" "const char *setting"
54.Ft int
55.Fn encrypt "char *block" "int flag"
56.Ft int
57.Fn des_setkey "const char *key"
58.Ft int
59.Fn des_cipher "const char *in" "char *out" "int32_t salt" "int count"
60.In pwd.h 48.In pwd.h
61.Ft char * 49.Ft char *
62.Fn bcrypt_gensalt "u_int8_t log_rounds" 50.Fn bcrypt_gensalt "u_int8_t log_rounds"
@@ -189,82 +177,12 @@ The value returned is a NUL-terminated
189string, 20 or 13 bytes (plus NUL) in length, consisting of the 177string, 20 or 13 bytes (plus NUL) in length, consisting of the
190.Fa setting 178.Fa setting
191followed by the encoded 64-bit encryption. 179followed by the encoded 64-bit encryption.
192.Pp
193The functions
194.Fn encrypt ,
195.Fn setkey ,
196.Fn des_setkey ,
197and
198.Fn des_cipher
199provide access to the
200DES algorithm itself.
201.Fn setkey
202is passed a 64-byte array of binary values (numeric 0 or 1).
203A 56-bit key is extracted from this array by dividing the
204array into groups of 8, and ignoring the last bit in each group.
205That bit is reserved for a byte parity check by DES, but is ignored
206by these functions.
207.Pp
208The
209.Fa block
210argument to
211.Fn encrypt
212is also a 64-byte array of binary values.
213If the value of
214.Fa flag
215is 0,
216.Fa block
217is encrypted otherwise it is decrypted.
218The result is returned in the original array
219.Fa block
220after using the key specified by
221.Fn setkey
222to process it.
223.Pp
224The argument to
225.Fn des_setkey
226is a character array of length 8.
227The least significant bit (the parity bit) in each character is ignored,
228and the remaining bits are concatenated to form a 56-bit key.
229The function
230.Fn des_cipher
231encrypts (or decrypts if
232.Fa count
233is negative) the 64-bits stored in the 8 characters at
234.Fa in
235using
236.Xr abs 3
237of
238.Fa count
239iterations of DES
240and stores the 64-bit result in the 8 characters at
241.Fa out
242(which may be the same as
243.Fa in ) .
244The
245.Fa salt
246specifies perturbations to the DES
247E-box output as described above.
248.Pp
249The
250.Fn crypt ,
251.Fn setkey ,
252and
253.Fn des_setkey
254functions all manipulate the same key space.
255.Sh RETURN VALUES 180.Sh RETURN VALUES
256The function 181The function
257.Fn crypt 182.Fn crypt
258returns a pointer to the encrypted value on success, and 183returns a pointer to the encrypted value on success, and
259.Dv NULL 184.Dv NULL
260on failure. 185on failure.
261The functions
262.Fn setkey ,
263.Fn encrypt ,
264.Fn des_setkey ,
265and
266.Fn des_cipher
267return 0 on success and 1 on failure.
268.Sh SEE ALSO 186.Sh SEE ALSO
269.Xr encrypt 1 , 187.Xr encrypt 1 ,
270.Xr login 1 , 188.Xr login 1 ,