diff options
author | schwarze <> | 2018-02-13 20:54:10 +0000 |
---|---|---|
committer | schwarze <> | 2018-02-13 20:54:10 +0000 |
commit | 568784a83db25083ec71fc54554c25ec23b501da (patch) | |
tree | 8d2a1889ede3584eb0bfae1d93c3b9ec06917cdb /src | |
parent | 0fc470b585c54b396e7bd1205d8a79dcf2ee2278 (diff) | |
download | openbsd-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.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/man/DES_set_key.3 | 49 |
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 |
457 | to odd. | 458 | to odd. |
458 | .Pp | 459 | .Pp |
459 | .Fn DES_is_weak_key | ||
460 | returns 1 if the passed key is a weak key or 0 if it is ok. | ||
461 | .Pp | ||
462 | The following routines mostly operate on an input and output stream of | 460 | The 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: | |||
666 | is a fast version of the Unix | 664 | is a fast version of the Unix |
667 | .Xr crypt 3 | 665 | .Xr crypt 3 |
668 | function. | 666 | function. |
667 | The | ||
668 | .Fa salt | ||
669 | must be two ASCII characters. | ||
670 | This version is different from the normal crypt in that the third | ||
671 | parameter is the buffer that the return value is written into. | ||
672 | It needs to be at least 14 bytes long. | ||
673 | The fourteenth byte is set to NUL. | ||
669 | This version takes only a small amount of space relative to other | 674 | This version takes only a small amount of space relative to other |
670 | fast crypt implementations. | 675 | fast crypt implementations. |
671 | This is different to the normal crypt in that the third parameter is the | 676 | It is thread safe, unlike the normal crypt. |
672 | buffer that the return value is written into. | ||
673 | It needs to be at least 14 bytes long. | ||
674 | This function is thread safe, unlike the normal crypt. | ||
675 | .Pp | 677 | .Pp |
676 | .Fn DES_crypt | 678 | .Fn DES_crypt |
677 | is a faster replacement for the normal system | 679 | is a faster replacement for the normal system |
@@ -746,6 +748,31 @@ If set to | |||
746 | If set to | 748 | If set to |
747 | .Dv DES_CBC_MODE | 749 | .Dv DES_CBC_MODE |
748 | DES_cbc_encrypt is used. | 750 | DES_cbc_encrypt is used. |
751 | .Sh RETURN VALUES | ||
752 | .Fn DES_set_key , | ||
753 | .Fn DES_key_sched , | ||
754 | and | ||
755 | .Fn DES_set_key_checked | ||
756 | return 0 on success or a negative value on error. | ||
757 | .Pp | ||
758 | .Fn DES_is_weak_key | ||
759 | returns 1 if the passed key is a weak key or 0 if it is ok. | ||
760 | .Pp | ||
761 | .Fn DES_cbc_cksum | ||
762 | and | ||
763 | .Fn DES_quad_cksum | ||
764 | return a 4-byte integer representing the last 4 bytes of the checksum | ||
765 | of the input. | ||
766 | .Pp | ||
767 | .Fn DES_fcrypt | ||
768 | returns a pointer to the caller-provided buffer | ||
769 | .Fa ret , | ||
770 | and | ||
771 | .Fn DES_crypt | ||
772 | returns a pointer to a static buffer. | ||
773 | Both are allowed to return | ||
774 | .Dv NULL | ||
775 | to 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 |