diff options
Diffstat (limited to 'src/lib/libcrypto')
| -rw-r--r-- | src/lib/libcrypto/man/EVP_MD_nid.3 | 75 | 
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 | 
| 120 | and | 120 | returns the numerical identifier (NID) of | 
| 121 | .Fn EVP_MD_CTX_type | 121 | .Fa md . | 
| 122 | return the NID of the OBJECT IDENTIFIER representing the message digest. | 122 | The NID is an internal value which may or may not have | 
| 123 | For example | 123 | a corresponding ASN.1 OBJECT IDENTIFIER; see | 
| 124 | .Xr OBJ_nid2obj 3 | ||
| 125 | for details. | ||
| 126 | For example , | ||
| 124 | .Fn EVP_MD_type EVP_sha512() | 127 | .Fn EVP_MD_type EVP_sha512() | 
| 125 | returns | 128 | returns | 
| 126 | .Dv NID_sha512 . | 129 | .Dv NID_sha512 . | 
| 130 | .Fn EVP_MD_CTX_type | ||
| 131 | returns the NID of the message digest algorithm that | ||
| 132 | .Fa ctx | ||
| 133 | is configured to use. | ||
| 127 | These functions are normally used when setting ASN.1 OIDs. | 134 | These functions are normally used when setting ASN.1 OIDs. | 
| 128 | .Pp | 135 | .Pp | 
| 129 | .Fn EVP_MD_size | 136 | .Fn EVP_MD_size | 
| 130 | and | 137 | returns 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 | 
| 132 | return the size of the message digest when passed an | 140 | return the size of the hashes produced by the message digest algorithm that | 
| 133 | .Vt EVP_MD | 141 | .Fa ctx | 
| 134 | or an | 142 | is configured to use. | 
| 135 | .Vt EVP_MD_CTX | ||
| 136 | structure, i.e. the size of the hash. | ||
| 137 | .Pp | 143 | .Pp | 
| 138 | .Fn EVP_MD_block_size | 144 | .Fn EVP_MD_block_size | 
| 139 | and | 145 | returns the block size in bytes of | 
| 146 | .Fa md . | ||
| 140 | .Fn EVP_MD_CTX_block_size | 147 | .Fn EVP_MD_CTX_block_size | 
| 141 | return the block size of the message digest when passed an | 148 | returns the block size of the message digest algorithm that | 
| 142 | .Vt EVP_MD | 149 | .Fa ctx | 
| 143 | or an | 150 | is configured to use. | 
| 144 | .Vt EVP_MD_CTX | ||
| 145 | structure. | ||
| 146 | .Pp | 151 | .Pp | 
| 147 | .Fn EVP_MD_flags | 152 | .Fn EVP_MD_flags | 
| 148 | returns the | 153 | returns the message digest flags used by | 
| 149 | .Fa md | 154 | .Fa md . | 
| 150 | flags. | 155 | The meaning of the flags is described in the | 
| 151 | These are different from the | ||
| 152 | .Vt EVP_MD_CTX | ||
| 153 | ones. | ||
| 154 | See | ||
| 155 | .Xr EVP_MD_meth_set_flags 3 | 156 | .Xr EVP_MD_meth_set_flags 3 | 
| 156 | for more information. | 157 | manual page. | 
| 158 | Be careful to not confuse these flags with the unrelated | ||
| 159 | message 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 | 
| 159 | returns the NID of the public key signing algorithm associated with this | 163 | returns the NID of the public key signing algorithm associated with this | 
| 160 | digest. | 164 | digest. | 
| 161 | For example | 165 | For example, | 
| 162 | .Fn EVP_sha512 | 166 | .Xr EVP_sha512 3 | 
| 163 | is associated with RSA so this will return | 167 | is associated with RSA, so this returns | 
| 164 | .Dv NID_sha512WithRSAEncryption . | 168 | .Dv NID_sha512WithRSAEncryption . | 
| 165 | Since digests and signature algorithms are no longer linked, this | 169 | Since digests and signature algorithms are no longer linked, this | 
| 166 | function is only retained for compatibility reasons. | 170 | function 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 , | ||
| 170 | and | 174 | and | 
| 171 | .Fn EVP_MD_CTX_type | 175 | .Fn EVP_MD_CTX_block_size | 
| 172 | are implemented as macros. | 176 | are 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 | |||
| 211 | first appeared in OpenSSL 1.0.0 | 215 | first appeared in OpenSSL 1.0.0 | 
| 212 | and has been available since | 216 | and has been available since | 
| 213 | .Ox 4.9 . | 217 | .Ox 4.9 . | 
| 218 | .Sh CAVEATS | ||
| 219 | The behaviour of the functions taking an | ||
| 220 | .Vt EVP_MD_CTX | ||
| 221 | argument is undefined if they are called on a | ||
| 222 | .Fa ctx | ||
| 223 | that has no message digest configured yet, | ||
| 224 | for example one freshly returned from | ||
| 225 | .Xr EVP_MD_CTX_new 3 . | ||
| 226 | In that case, the program may for example be terminated by a | ||
| 227 | .Dv NULL | ||
| 228 | pointer access. | ||
