summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2018-02-13 20:54:10 +0000
committerschwarze <>2018-02-13 20:54:10 +0000
commit568784a83db25083ec71fc54554c25ec23b501da (patch)
tree8d2a1889ede3584eb0bfae1d93c3b9ec06917cdb
parent0fc470b585c54b396e7bd1205d8a79dcf2ee2278 (diff)
downloadopenbsd-568784a83db25083ec71fc54554c25ec23b501da.tar.gz
openbsd-568784a83db25083ec71fc54554c25ec23b501da.tar.bz2
openbsd-568784a83db25083ec71fc54554c25ec23b501da.zip
Add the missing RETURN VALUES section, mostly from Paul Yang
via OpenSSL commit 1f13ad31 Dec 25 17:50:39 2017 +0800, but fixing two bugs in his description. This commit also includes a few minor improvements to the description of DES_fcrypt(3), also from OpenSSL, tweaked by me.
-rw-r--r--src/lib/libcrypto/man/DES_set_key.349
1 files changed, 38 insertions, 11 deletions
diff --git a/src/lib/libcrypto/man/DES_set_key.3 b/src/lib/libcrypto/man/DES_set_key.3
index 0a9e7381bc..9e0236c698 100644
--- a/src/lib/libcrypto/man/DES_set_key.3
+++ b/src/lib/libcrypto/man/DES_set_key.3
@@ -1,12 +1,13 @@
1.\" $OpenBSD: DES_set_key.3,v 1.7 2017/02/09 03:43:05 dtucker Exp $ 1.\" $OpenBSD: DES_set_key.3,v 1.8 2018/02/13 20:54:10 schwarze Exp $
2.\" OpenSSL c7497f34 Aug 14 10:50:26 2014 -0400 2.\" full merge up to:
3.\" OpenSSL man3/DES_random_key 61f805c1 Jan 16 01:01:46 2018 +0800
3.\" 4.\"
4.\" -------------------------------------------------------------------------- 5.\" --------------------------------------------------------------------------
5.\" Major patches to this file were contributed by 6.\" Major patches to this file were contributed by
6.\" Ulf Moeller <ulf@openssl.org>, Ben Laurie <ben@openssl.org>, 7.\" Ulf Moeller <ulf@openssl.org>, Ben Laurie <ben@openssl.org>,
7.\" and Richard Levitte <levitte@openssl.org>. 8.\" and Richard Levitte <levitte@openssl.org>.
8.\" -------------------------------------------------------------------------- 9.\" --------------------------------------------------------------------------
9.\" Copyright (c) 2000, 2001 The OpenSSL Project. All rights reserved. 10.\" Copyright (c) 2000, 2001, 2017 The OpenSSL Project. All rights reserved.
10.\" 11.\"
11.\" Redistribution and use in source and binary forms, with or without 12.\" Redistribution and use in source and binary forms, with or without
12.\" modification, are permitted provided that the following conditions 13.\" modification, are permitted provided that the following conditions
@@ -114,7 +115,7 @@
114.\" copied and put under another distribution licence 115.\" copied and put under another distribution licence
115.\" [including the GNU Public Licence.] 116.\" [including the GNU Public Licence.]
116.\" 117.\"
117.Dd $Mdocdate: February 9 2017 $ 118.Dd $Mdocdate: February 13 2018 $
118.Dt DES_SET_KEY 3 119.Dt DES_SET_KEY 3
119.Os 120.Os
120.Sh NAME 121.Sh NAME
@@ -456,9 +457,6 @@ sets the parity of the passed
456.Fa key 457.Fa key
457to odd. 458to odd.
458.Pp 459.Pp
459.Fn DES_is_weak_key
460returns 1 if the passed key is a weak key or 0 if it is ok.
461.Pp
462The following routines mostly operate on an input and output stream of 460The following routines mostly operate on an input and output stream of
463.Vt DES_cblock Ns s . 461.Vt DES_cblock Ns s .
464.Pp 462.Pp
@@ -666,12 +664,16 @@ The following are DES-based transformations:
666is a fast version of the Unix 664is a fast version of the Unix
667.Xr crypt 3 665.Xr crypt 3
668function. 666function.
667The
668.Fa salt
669must be two ASCII characters.
670This version is different from the normal crypt in that the third
671parameter is the buffer that the return value is written into.
672It needs to be at least 14 bytes long.
673The fourteenth byte is set to NUL.
669This version takes only a small amount of space relative to other 674This version takes only a small amount of space relative to other
670fast crypt implementations. 675fast crypt implementations.
671This is different to the normal crypt in that the third parameter is the 676It is thread safe, unlike the normal crypt.
672buffer that the return value is written into.
673It needs to be at least 14 bytes long.
674This function is thread safe, unlike the normal crypt.
675.Pp 677.Pp
676.Fn DES_crypt 678.Fn DES_crypt
677is a faster replacement for the normal system 679is a faster replacement for the normal system
@@ -746,6 +748,31 @@ If set to
746If set to 748If set to
747.Dv DES_CBC_MODE 749.Dv DES_CBC_MODE
748DES_cbc_encrypt is used. 750DES_cbc_encrypt is used.
751.Sh RETURN VALUES
752.Fn DES_set_key ,
753.Fn DES_key_sched ,
754and
755.Fn DES_set_key_checked
756return 0 on success or a negative value on error.
757.Pp
758.Fn DES_is_weak_key
759returns 1 if the passed key is a weak key or 0 if it is ok.
760.Pp
761.Fn DES_cbc_cksum
762and
763.Fn DES_quad_cksum
764return a 4-byte integer representing the last 4 bytes of the checksum
765of the input.
766.Pp
767.Fn DES_fcrypt
768returns a pointer to the caller-provided buffer
769.Fa ret ,
770and
771.Fn DES_crypt
772returns a pointer to a static buffer.
773Both are allowed to return
774.Dv NULL
775to indicate failure, but currently, they cannot fail.
749.Sh SEE ALSO 776.Sh SEE ALSO
750.Xr crypt 3 , 777.Xr crypt 3 ,
751.Xr RAND_bytes 3 778.Xr RAND_bytes 3