summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorschwarze <>2023-09-07 15:57:04 +0000
committerschwarze <>2023-09-07 15:57:04 +0000
commitdfa84a8260fbf7a4973ae27e125b3215b5150261 (patch)
tree81a34ff7577909618b0689ae0aeb902ed9b18882 /src/lib
parentac20bb42fcec4c75215a5bca5b62760f3476c869 (diff)
downloadopenbsd-dfa84a8260fbf7a4973ae27e125b3215b5150261.tar.gz
openbsd-dfa84a8260fbf7a4973ae27e125b3215b5150261.tar.bz2
openbsd-dfa84a8260fbf7a4973ae27e125b3215b5150261.zip
improve the descriptions of most functions
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/EVP_MD_nid.375
1 files changed, 45 insertions, 30 deletions
diff --git a/src/lib/libcrypto/man/EVP_MD_nid.3 b/src/lib/libcrypto/man/EVP_MD_nid.3
index 3083653590..950e7af930 100644
--- a/src/lib/libcrypto/man/EVP_MD_nid.3
+++ b/src/lib/libcrypto/man/EVP_MD_nid.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: EVP_MD_nid.3,v 1.1 2023/09/07 14:22:11 schwarze Exp $ 1.\" $OpenBSD: EVP_MD_nid.3,v 1.2 2023/09/07 15:57:04 schwarze Exp $
2.\" full merge up to: OpenSSL man3/EVP_DigestInit.pod 2.\" full merge up to: OpenSSL man3/EVP_DigestInit.pod
3.\" 24a535ea Sep 22 13:14:20 2020 +0100 3.\" 24a535ea Sep 22 13:14:20 2020 +0100
4.\" 4.\"
@@ -117,58 +117,62 @@
117.Fc 117.Fc
118.Sh DESCRIPTION 118.Sh DESCRIPTION
119.Fn EVP_MD_type 119.Fn EVP_MD_type
120and 120returns the numerical identifier (NID) of
121.Fn EVP_MD_CTX_type 121.Fa md .
122return the NID of the OBJECT IDENTIFIER representing the message digest. 122The NID is an internal value which may or may not have
123For example 123a corresponding ASN.1 OBJECT IDENTIFIER; see
124.Xr OBJ_nid2obj 3
125for details.
126For example ,
124.Fn EVP_MD_type EVP_sha512() 127.Fn EVP_MD_type EVP_sha512()
125returns 128returns
126.Dv NID_sha512 . 129.Dv NID_sha512 .
130.Fn EVP_MD_CTX_type
131returns the NID of the message digest algorithm that
132.Fa ctx
133is configured to use.
127These functions are normally used when setting ASN.1 OIDs. 134These functions are normally used when setting ASN.1 OIDs.
128.Pp 135.Pp
129.Fn EVP_MD_size 136.Fn EVP_MD_size
130and 137returns the size in bytes of the message digests (hashes) produced by
138.Fa md .
131.Fn EVP_MD_CTX_size 139.Fn EVP_MD_CTX_size
132return the size of the message digest when passed an 140return the size of the hashes produced by the message digest algorithm that
133.Vt EVP_MD 141.Fa ctx
134or an 142is configured to use.
135.Vt EVP_MD_CTX
136structure, i.e. the size of the hash.
137.Pp 143.Pp
138.Fn EVP_MD_block_size 144.Fn EVP_MD_block_size
139and 145returns the block size in bytes of
146.Fa md .
140.Fn EVP_MD_CTX_block_size 147.Fn EVP_MD_CTX_block_size
141return the block size of the message digest when passed an 148returns the block size of the message digest algorithm that
142.Vt EVP_MD 149.Fa ctx
143or an 150is configured to use.
144.Vt EVP_MD_CTX
145structure.
146.Pp 151.Pp
147.Fn EVP_MD_flags 152.Fn EVP_MD_flags
148returns the 153returns the message digest flags used by
149.Fa md 154.Fa md .
150flags. 155The meaning of the flags is described in the
151These are different from the
152.Vt EVP_MD_CTX
153ones.
154See
155.Xr EVP_MD_meth_set_flags 3 156.Xr EVP_MD_meth_set_flags 3
156for more information. 157manual page.
158Be careful to not confuse these flags with the unrelated
159message digest context flags that can be inspected with
160.Xr EVP_MD_CTX_test_flags 3 .
157.Pp 161.Pp
158.Fn EVP_MD_pkey_type 162.Fn EVP_MD_pkey_type
159returns the NID of the public key signing algorithm associated with this 163returns the NID of the public key signing algorithm associated with this
160digest. 164digest.
161For example 165For example,
162.Fn EVP_sha512 166.Xr EVP_sha512 3
163is associated with RSA so this will return 167is associated with RSA, so this returns
164.Dv NID_sha512WithRSAEncryption . 168.Dv NID_sha512WithRSAEncryption .
165Since digests and signature algorithms are no longer linked, this 169Since digests and signature algorithms are no longer linked, this
166function is only retained for compatibility reasons. 170function is only retained for compatibility reasons.
167.Pp 171.Pp
172.Fn EVP_MD_CTX_type ,
168.Fn EVP_MD_CTX_size , 173.Fn EVP_MD_CTX_size ,
169.Fn EVP_MD_CTX_block_size ,
170and 174and
171.Fn EVP_MD_CTX_type 175.Fn EVP_MD_CTX_block_size
172are implemented as macros. 176are implemented as macros.
173.Sh RETURN VALUES 177.Sh RETURN VALUES
174.Fn EVP_MD_type , 178.Fn EVP_MD_type ,
@@ -211,3 +215,14 @@ All these functions have been available since
211first appeared in OpenSSL 1.0.0 215first appeared in OpenSSL 1.0.0
212and has been available since 216and has been available since
213.Ox 4.9 . 217.Ox 4.9 .
218.Sh CAVEATS
219The behaviour of the functions taking an
220.Vt EVP_MD_CTX
221argument is undefined if they are called on a
222.Fa ctx
223that has no message digest configured yet,
224for example one freshly returned from
225.Xr EVP_MD_CTX_new 3 .
226In that case, the program may for example be terminated by a
227.Dv NULL
228pointer access.