summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorschwarze <>2023-08-27 15:33:08 +0000
committerschwarze <>2023-08-27 15:33:08 +0000
commita99835855b43233ec3bafa94c62e9bd4915c38cf (patch)
tree6d19a9f18b878def4af8e2b452c79ade090c83a1 /src/lib
parentd0926c115d127cac7ceacf58752533ccf72e3735 (diff)
downloadopenbsd-a99835855b43233ec3bafa94c62e9bd4915c38cf.tar.gz
openbsd-a99835855b43233ec3bafa94c62e9bd4915c38cf.tar.bz2
openbsd-a99835855b43233ec3bafa94c62e9bd4915c38cf.zip
Move the weak SHA-1 and MD5 hashes out of EVP_DigestInit(3)
into a new EVP_sha1(3) manual page, and also mention EVP_md4(3) there. Using input from tb@ and jsing@, who like the general direction.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/EVP_DigestInit.355
-rw-r--r--src/lib/libcrypto/man/EVP_sha1.3121
-rw-r--r--src/lib/libcrypto/man/Makefile3
-rw-r--r--src/lib/libcrypto/man/evp.35
4 files changed, 138 insertions, 46 deletions
diff --git a/src/lib/libcrypto/man/EVP_DigestInit.3 b/src/lib/libcrypto/man/EVP_DigestInit.3
index 2d790cb2c0..54cc771b10 100644
--- a/src/lib/libcrypto/man/EVP_DigestInit.3
+++ b/src/lib/libcrypto/man/EVP_DigestInit.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: EVP_DigestInit.3,v 1.28 2023/08/14 14:22:32 schwarze Exp $ 1.\" $OpenBSD: EVP_DigestInit.3,v 1.29 2023/08/27 15:33:08 schwarze Exp $
2.\" full merge up to: OpenSSL 7f572e95 Dec 2 13:57:04 2015 +0000 2.\" full merge up to: OpenSSL 7f572e95 Dec 2 13:57:04 2015 +0000
3.\" selective merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100 3.\" selective merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100
4.\" 4.\"
@@ -70,7 +70,7 @@
70.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 70.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
71.\" OF THE POSSIBILITY OF SUCH DAMAGE. 71.\" OF THE POSSIBILITY OF SUCH DAMAGE.
72.\" 72.\"
73.Dd $Mdocdate: August 14 2023 $ 73.Dd $Mdocdate: August 27 2023 $
74.Dt EVP_DIGESTINIT 3 74.Dt EVP_DIGESTINIT 3
75.Os 75.Os
76.Sh NAME 76.Sh NAME
@@ -107,9 +107,6 @@
107.Nm EVP_MD_CTX_pkey_ctx , 107.Nm EVP_MD_CTX_pkey_ctx ,
108.Nm EVP_MD_CTX_set_pkey_ctx , 108.Nm EVP_MD_CTX_set_pkey_ctx ,
109.Nm EVP_md_null , 109.Nm EVP_md_null ,
110.Nm EVP_md5 ,
111.Nm EVP_md5_sha1 ,
112.Nm EVP_sha1 ,
113.Nm EVP_sha224 , 110.Nm EVP_sha224 ,
114.Nm EVP_sha256 , 111.Nm EVP_sha256 ,
115.Nm EVP_sha384 , 112.Nm EVP_sha384 ,
@@ -270,12 +267,6 @@
270.Ft const EVP_MD * 267.Ft const EVP_MD *
271.Fn EVP_md_null void 268.Fn EVP_md_null void
272.Ft const EVP_MD * 269.Ft const EVP_MD *
273.Fn EVP_md5 void
274.Ft const EVP_MD *
275.Fn EVP_md5_sha1 void
276.Ft const EVP_MD *
277.Fn EVP_sha1 void
278.Ft const EVP_MD *
279.Fn EVP_sha224 void 270.Fn EVP_sha224 void
280.Ft const EVP_MD * 271.Ft const EVP_MD *
281.Fn EVP_sha256 void 272.Fn EVP_sha256 void
@@ -413,7 +404,7 @@ from
413The 404The
414.Fa type 405.Fa type
415will typically be supplied by a function such as 406will typically be supplied by a function such as
416.Fn EVP_sha1 . 407.Fn EVP_sha512 .
417If 408If
418.Fa impl 409.Fa impl
419is 410is
@@ -537,9 +528,9 @@ and
537.Fn EVP_MD_CTX_type 528.Fn EVP_MD_CTX_type
538return the NID of the OBJECT IDENTIFIER representing the message digest. 529return the NID of the OBJECT IDENTIFIER representing the message digest.
539For example 530For example
540.Fn EVP_MD_type EVP_sha1() 531.Fn EVP_MD_type EVP_sha512()
541returns 532returns
542.Dv NID_sha1 . 533.Dv NID_sha512 .
543These functions are normally used when setting ASN.1 OIDs. 534These functions are normally used when setting ASN.1 OIDs.
544.Pp 535.Pp
545.Fn EVP_MD_CTX_md_data 536.Fn EVP_MD_CTX_md_data
@@ -563,9 +554,9 @@ for more information.
563returns the NID of the public key signing algorithm associated with this 554returns the NID of the public key signing algorithm associated with this
564digest. 555digest.
565For example 556For example
566.Fn EVP_sha1 557.Fn EVP_sha512
567is associated with RSA so this will return 558is associated with RSA so this will return
568.Dv NID_sha1WithRSAEncryption . 559.Dv NID_sha512WithRSAEncryption .
569Since digests and signature algorithms are no longer linked, this 560Since digests and signature algorithms are no longer linked, this
570function is only retained for compatibility reasons. 561function is only retained for compatibility reasons.
571.Pp 562.Pp
@@ -619,8 +610,6 @@ is dissociated from it as described above, but no new
619.Vt EVP_PKEY_CTX 610.Vt EVP_PKEY_CTX
620is assigned. 611is assigned.
621.Pp 612.Pp
622.Fn EVP_md5 ,
623.Fn EVP_sha1 ,
624.Fn EVP_sha224 , 613.Fn EVP_sha224 ,
625.Fn EVP_sha256 , 614.Fn EVP_sha256 ,
626.Fn EVP_sha384 , 615.Fn EVP_sha384 ,
@@ -629,7 +618,7 @@ and
629.Fn EVP_ripemd160 618.Fn EVP_ripemd160
630return 619return
631.Vt EVP_MD 620.Vt EVP_MD
632structures for the MD5, SHA1, SHA224, SHA256, SHA384, SHA512 and 621structures for the SHA224, SHA256, SHA384, SHA512 and
633RIPEMD160 digest algorithms respectively. 622RIPEMD160 digest algorithms respectively.
634.Pp 623.Pp
635.Fn EVP_sha512_224 624.Fn EVP_sha512_224
@@ -640,11 +629,6 @@ return an
640structure that provides the truncated SHA512 variants SHA512/224 and SHA512/256, 629structure that provides the truncated SHA512 variants SHA512/224 and SHA512/256,
641respectively. 630respectively.
642.Pp 631.Pp
643.Fn EVP_md5_sha1
644returns an
645.Vt EVP_MD
646structure that provides concatenated MD5 and SHA1 message digests.
647.Pp
648.Fn EVP_md_null 632.Fn EVP_md_null
649is a "null" message digest that does nothing: 633is a "null" message digest that does nothing:
650i.e. the hash it returns is of zero length. 634i.e. the hash it returns is of zero length.
@@ -671,9 +655,6 @@ in preference to the low-level interfaces.
671This is because the code then becomes transparent to the digest used and 655This is because the code then becomes transparent to the digest used and
672much more flexible. 656much more flexible.
673.Pp 657.Pp
674New applications should use the SHA2 digest algorithms such as SHA256.
675The other digest algorithms are still in common use.
676.Pp
677For most applications the 658For most applications the
678.Fa impl 659.Fa impl
679parameter to 660parameter to
@@ -757,10 +738,7 @@ if
757is 738is
758.Dv NULL . 739.Dv NULL .
759.Pp 740.Pp
760.Fn EVP_md_null , 741.Fn EVP_md_null
761.Fn EVP_md5 ,
762.Fn EVP_md5_sha1 ,
763.Fn EVP_sha1 ,
764and 742and
765.Fn EVP_ripemd160 743.Fn EVP_ripemd160
766return pointers to the corresponding 744return pointers to the corresponding
@@ -830,6 +808,7 @@ main(int argc, char *argv[])
830.Xr EVP_MD_meth_new 3 , 808.Xr EVP_MD_meth_new 3 ,
831.Xr EVP_PKEY_CTX_set_signature_md 3 , 809.Xr EVP_PKEY_CTX_set_signature_md 3 ,
832.Xr EVP_PKEY_meth_set_signctx 3 , 810.Xr EVP_PKEY_meth_set_signctx 3 ,
811.Xr EVP_sha1 3 ,
833.Xr EVP_sha3_224 3 , 812.Xr EVP_sha3_224 3 ,
834.Xr EVP_SignInit 3 , 813.Xr EVP_SignInit 3 ,
835.Xr EVP_sm3 3 , 814.Xr EVP_sm3 3 ,
@@ -847,10 +826,8 @@ main(int argc, char *argv[])
847.Fn EVP_DigestInit , 826.Fn EVP_DigestInit ,
848.Fn EVP_DigestUpdate , 827.Fn EVP_DigestUpdate ,
849.Fn EVP_DigestFinal , 828.Fn EVP_DigestFinal ,
850.Dv EVP_MAX_MD_SIZE ,
851.Fn EVP_md5 ,
852and 829and
853.Fn EVP_sha1 830.Dv EVP_MAX_MD_SIZE
854first appeared in SSLeay 0.5.1. 831first appeared in SSLeay 0.5.1.
855.Fn EVP_MD_size 832.Fn EVP_MD_size
856first appeared in SSLeay 0.6.6. 833first appeared in SSLeay 0.6.6.
@@ -869,8 +846,6 @@ first appeared in SSLeay 0.8.1.
869.Fn EVP_MD_block_size , 846.Fn EVP_MD_block_size ,
870.Fn EVP_MD_CTX_size , 847.Fn EVP_MD_CTX_size ,
871.Fn EVP_MD_CTX_block_size , 848.Fn EVP_MD_CTX_block_size ,
872.Fn EVP_rc4_40 ,
873.Fn EVP_rc2_40_cbc ,
874and 849and
875.Fn EVP_ripemd160 850.Fn EVP_ripemd160
876first appeared in SSLeay 0.9.0. 851first appeared in SSLeay 0.9.0.
@@ -920,9 +895,8 @@ first appeared in OpenSSL 1.1.0 and has been available since
920.Pp 895.Pp
921.Fn EVP_MD_CTX_new , 896.Fn EVP_MD_CTX_new ,
922.Fn EVP_MD_CTX_reset , 897.Fn EVP_MD_CTX_reset ,
923.Fn EVP_MD_CTX_free ,
924and 898and
925.Fn EVP_md5_sha1 899.Fn EVP_MD_CTX_free
926first appeared in OpenSSL 1.1.0 and have been available since 900first appeared in OpenSSL 1.1.0 and have been available since
927.Ox 6.3 . 901.Ox 6.3 .
928.Pp 902.Pp
@@ -940,8 +914,3 @@ and
940.Fn EVP_sha512_256 914.Fn EVP_sha512_256
941first appeared in OpenSSL 1.1.1 and have been available since 915first appeared in OpenSSL 1.1.1 and have been available since
942.Ox 7.4 . 916.Ox 7.4 .
943.Pp
944The link between digests and signing algorithms was fixed in OpenSSL 1.0
945and later, so now
946.Fn EVP_sha1
947can be used with RSA and DSA.
diff --git a/src/lib/libcrypto/man/EVP_sha1.3 b/src/lib/libcrypto/man/EVP_sha1.3
new file mode 100644
index 0000000000..43898a5f6a
--- /dev/null
+++ b/src/lib/libcrypto/man/EVP_sha1.3
@@ -0,0 +1,121 @@
1.\" $OpenBSD: EVP_sha1.3,v 1.1 2023/08/27 15:33:08 schwarze Exp $
2.\"
3.\" Copyright (c) 2023 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: August 27 2023 $
18.Dt EVP_SHA1 3
19.Os
20.Sh NAME
21.Nm EVP_sha1 ,
22.Nm EVP_md5 ,
23.Nm EVP_md5_sha1 ,
24.Nm EVP_md4
25.Nd legacy message digest algorithms
26.Sh SYNOPSIS
27.In openssl/evp.h
28.Ft const EVP_MD *
29.Fn EVP_sha1 void
30.Ft const EVP_MD *
31.Fn EVP_md5 void
32.Ft const EVP_MD *
33.Fn EVP_md5_sha1 void
34.Ft const EVP_MD *
35.Fn EVP_md4 void
36.Sh DESCRIPTION
37The following message digest algorithms are cryptographically broken.
38None of them should be used in new code unless there is no way around it.
39.Pp
40.Fn EVP_sha1
41implements the SHA-1 algorithm and produces 160 bits of output
42from a given input.
43Examples of protocols and software still requiring it
44include OCSP, DNS, and the
45.Sy git
46version control system.
47.Pp
48.Fn EVP_md5
49implements the MD5 algorithm and produces 128 bits of output
50from a given input.
51It is still occasionally used when no security is required
52but a fast hash algorithm is beneficial.
53.Pp
54.Fn EVP_md5_sha1
55produces concatenated MD5 and SHA-1 message digests.
56Do not use this except where it is required for the historic SSLv3 protocol.
57.Pp
58.Fn EVP_md4
59implements the MD4 algorithm and produces 128 bits of output
60from a given input.
61It has been marked as
62.Dq historic
63by the Internet Engineering Task Force since 2011.
64.Sh RETURN VALUES
65These functions return pointers to static
66.Vt EVP_MD
67objects implementing the hash functions.
68.Sh SEE ALSO
69.Xr evp 3 ,
70.Xr EVP_DigestInit 3 ,
71.Xr EVP_MD_meth_new 3
72.Sh STANDARDS
73.Rs
74.%A T. Polk
75.%A L. Chen
76.%A S. Turner
77.%A P. Hoffman
78.%T Security Considerations for the SHA-0 and SHA-1 Message-Digest Algorithms
79.%R RFC 6194
80.%D March 2011
81.Re
82.Pp
83.Rs
84.%A S. Turner
85.%A L. Chen
86.%T Updated Security Considerations for the MD5 Message-Digest\
87 and the HMAC-MD5 Algorithms
88.%R RFC 6151
89.%D March 2011
90.Re
91.Pp
92.Rs
93.%A S. Turner
94.%A L. Chen
95.%T MD4 to Historic Status
96.%R RFC 6150
97.%D March 2011
98.Re
99.Pp
100.Rs
101.%A P. Kocher
102.%A P. Karlton
103.%A A. Freier
104.%T The Secure Sockets Layer (SSL) Protocol Version 3.0
105.%R RFC 6101
106.%D August 2011
107.Re
108.Sh HISTORY
109.Fn EVP_sha1
110and
111.Fn EVP_md5
112first appeared in SSLeay 0.5.1 and have been available since
113.Ox 2.4 .
114.Pp
115.Fn EVP_md4
116first appeared in OpenSSL 0.9.6 and has been available since
117.Ox 2.9 .
118.Pp
119.Fn EVP_md5_sha1
120first appeared in OpenSSL 1.1.0 and has been available since
121.Ox 6.3 .
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile
index 24b53b9eb1..2c243f7fec 100644
--- a/src/lib/libcrypto/man/Makefile
+++ b/src/lib/libcrypto/man/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.263 2023/08/25 18:22:41 schwarze Exp $ 1# $OpenBSD: Makefile,v 1.264 2023/08/27 15:33:08 schwarze Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
@@ -205,6 +205,7 @@ MAN= \
205 EVP_chacha20.3 \ 205 EVP_chacha20.3 \
206 EVP_des_cbc.3 \ 206 EVP_des_cbc.3 \
207 EVP_rc4.3 \ 207 EVP_rc4.3 \
208 EVP_sha1.3 \
208 EVP_sha3_224.3 \ 209 EVP_sha3_224.3 \
209 EVP_sm3.3 \ 210 EVP_sm3.3 \
210 EVP_sm4_cbc.3 \ 211 EVP_sm4_cbc.3 \
diff --git a/src/lib/libcrypto/man/evp.3 b/src/lib/libcrypto/man/evp.3
index 92a6c6a416..d53fa94fe1 100644
--- a/src/lib/libcrypto/man/evp.3
+++ b/src/lib/libcrypto/man/evp.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: evp.3,v 1.19 2023/08/25 18:22:41 schwarze Exp $ 1.\" $OpenBSD: evp.3,v 1.20 2023/08/27 15:33:08 schwarze Exp $
2.\" full merge up to: OpenSSL man7/evp 24a535ea Sep 22 13:14:20 2020 +0100 2.\" full merge up to: OpenSSL man7/evp 24a535ea Sep 22 13:14:20 2020 +0100
3.\" 3.\"
4.\" This file was written by Ulf Moeller <ulf@openssl.org>, 4.\" This file was written by Ulf Moeller <ulf@openssl.org>,
@@ -51,7 +51,7 @@
51.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
52.\" OF THE POSSIBILITY OF SUCH DAMAGE. 52.\" OF THE POSSIBILITY OF SUCH DAMAGE.
53.\" 53.\"
54.Dd $Mdocdate: August 25 2023 $ 54.Dd $Mdocdate: August 27 2023 $
55.Dt EVP 3 55.Dt EVP 3
56.Os 56.Os
57.Sh NAME 57.Sh NAME
@@ -234,6 +234,7 @@ operations are more efficient using the high-level interfaces.
234.Xr EVP_PKEY_verify_recover 3 , 234.Xr EVP_PKEY_verify_recover 3 ,
235.Xr EVP_rc4 3 , 235.Xr EVP_rc4 3 ,
236.Xr EVP_SealInit 3 , 236.Xr EVP_SealInit 3 ,
237.Xr EVP_sha1 3 ,
237.Xr EVP_sha3_224 3 , 238.Xr EVP_sha3_224 3 ,
238.Xr EVP_SignInit 3 , 239.Xr EVP_SignInit 3 ,
239.Xr EVP_sm3 3 , 240.Xr EVP_sm3 3 ,