diff options
| author | schwarze <> | 2021-07-03 17:04:51 +0000 |
|---|---|---|
| committer | schwarze <> | 2021-07-03 17:04:51 +0000 |
| commit | 1a1544c135b2932046e4ec6f3c09c7d6a690014b (patch) | |
| tree | e25e873ce1ca3a77931141ec9a6a54344716a42b /src | |
| parent | 70e6e6179f5b7c30c5e842ff74f348f67cedf838 (diff) | |
| download | openbsd-1a1544c135b2932046e4ec6f3c09c7d6a690014b.tar.gz openbsd-1a1544c135b2932046e4ec6f3c09c7d6a690014b.tar.bz2 openbsd-1a1544c135b2932046e4ec6f3c09c7d6a690014b.zip | |
Document X509_NAME_set(3).
It is not particularly well-designed and sets a number of traps for the
unwary, but it is a public API function in both OpenSSL and LibreSSL
and used at various places.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/man/d2i_X509_NAME.3 | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/src/lib/libcrypto/man/d2i_X509_NAME.3 b/src/lib/libcrypto/man/d2i_X509_NAME.3 index 3289ccb134..c2d4b7d1cd 100644 --- a/src/lib/libcrypto/man/d2i_X509_NAME.3 +++ b/src/lib/libcrypto/man/d2i_X509_NAME.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: d2i_X509_NAME.3,v 1.14 2018/03/27 17:35:50 schwarze Exp $ | 1 | .\" $OpenBSD: d2i_X509_NAME.3,v 1.15 2021/07/03 17:04:51 schwarze Exp $ |
| 2 | .\" checked up to: | 2 | .\" checked up to: |
| 3 | .\" OpenSSL crypto/d2i_X509_NAME 4692340e Jun 7 15:49:08 2016 -0400 and | 3 | .\" OpenSSL crypto/d2i_X509_NAME 4692340e Jun 7 15:49:08 2016 -0400 and |
| 4 | .\" OpenSSL man3/X509_NAME_get0_der 99d63d46 Oct 26 13:56:48 2016 -0400 | 4 | .\" OpenSSL man3/X509_NAME_get0_der 99d63d46 Oct 26 13:56:48 2016 -0400 |
| @@ -17,7 +17,7 @@ | |||
| 17 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 17 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 18 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 18 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 19 | .\" | 19 | .\" |
| 20 | .Dd $Mdocdate: March 27 2018 $ | 20 | .Dd $Mdocdate: July 3 2021 $ |
| 21 | .Dt D2I_X509_NAME 3 | 21 | .Dt D2I_X509_NAME 3 |
| 22 | .Os | 22 | .Os |
| 23 | .Sh NAME | 23 | .Sh NAME |
| @@ -25,6 +25,7 @@ | |||
| 25 | .Nm i2d_X509_NAME , | 25 | .Nm i2d_X509_NAME , |
| 26 | .Nm X509_NAME_get0_der , | 26 | .Nm X509_NAME_get0_der , |
| 27 | .Nm X509_NAME_dup , | 27 | .Nm X509_NAME_dup , |
| 28 | .Nm X509_NAME_set , | ||
| 28 | .Nm X509_NAME_hash , | 29 | .Nm X509_NAME_hash , |
| 29 | .Nm d2i_X509_NAME_ENTRY , | 30 | .Nm d2i_X509_NAME_ENTRY , |
| 30 | .Nm i2d_X509_NAME_ENTRY , | 31 | .Nm i2d_X509_NAME_ENTRY , |
| @@ -56,6 +57,11 @@ | |||
| 56 | .Fo X509_NAME_dup | 57 | .Fo X509_NAME_dup |
| 57 | .Fa "X509_NAME *val_in" | 58 | .Fa "X509_NAME *val_in" |
| 58 | .Fc | 59 | .Fc |
| 60 | .Ft int | ||
| 61 | .Fo X509_NAME_set | ||
| 62 | .Fa "X509_NAME **val_out" | ||
| 63 | .Fa "X509_NAME *val_in" | ||
| 64 | .Fc | ||
| 59 | .Ft unsigned long | 65 | .Ft unsigned long |
| 60 | .Fo X509_NAME_hash | 66 | .Fo X509_NAME_hash |
| 61 | .Fa "X509_NAME *val_in" | 67 | .Fa "X509_NAME *val_in" |
| @@ -108,6 +114,34 @@ by calling | |||
| 108 | and | 114 | and |
| 109 | .Fn d2i_X509_NAME . | 115 | .Fn d2i_X509_NAME . |
| 110 | .Pp | 116 | .Pp |
| 117 | .Fn X509_NAME_set | ||
| 118 | makes sure that | ||
| 119 | .Pf * Fa val_out | ||
| 120 | contains the same data as | ||
| 121 | .Fa val_in | ||
| 122 | after the call, except that it fails if | ||
| 123 | .Fa val_in | ||
| 124 | is | ||
| 125 | .Dv NULL . | ||
| 126 | If | ||
| 127 | .Pf * Fa val_out | ||
| 128 | is the same pointer as | ||
| 129 | .Fa val_in , | ||
| 130 | the function succeeds without changing anything. | ||
| 131 | Otherwise, it copies | ||
| 132 | .Fa val_in | ||
| 133 | using | ||
| 134 | .Fn X509_NAME_dup , | ||
| 135 | and in case of success, it frees | ||
| 136 | .Pf * Fa val_out | ||
| 137 | and sets it to a pointer to the the new object. | ||
| 138 | When the function fails, it never changes anything. | ||
| 139 | In any case, | ||
| 140 | .Fa val_in | ||
| 141 | remains valid and may or may not be the same pointer as | ||
| 142 | .Pf * Fa val_out | ||
| 143 | after the call. | ||
| 144 | .Pp | ||
| 111 | .Fn X509_NAME_hash | 145 | .Fn X509_NAME_hash |
| 112 | calculates a | 146 | calculates a |
| 113 | .Xr SHA1 3 | 147 | .Xr SHA1 3 |
| @@ -141,8 +175,10 @@ object or | |||
| 141 | .Dv NULL | 175 | .Dv NULL |
| 142 | if an error occurs. | 176 | if an error occurs. |
| 143 | .Pp | 177 | .Pp |
| 178 | .Fn X509_NAME_set | ||
| 179 | and | ||
| 144 | .Fn X509_NAME_get0_der | 180 | .Fn X509_NAME_get0_der |
| 145 | returns 1 on success or 0 if an error occurs. | 181 | return 1 on success or 0 if an error occurs. |
| 146 | .Pp | 182 | .Pp |
| 147 | .Fn X509_NAME_hash | 183 | .Fn X509_NAME_hash |
| 148 | returns the hash value or 0 if an error occurs. | 184 | returns the hash value or 0 if an error occurs. |
| @@ -184,6 +220,8 @@ first appeared in SSLeay 0.4.4. | |||
| 184 | and | 220 | and |
| 185 | .Fn X509_NAME_ENTRY_dup | 221 | .Fn X509_NAME_ENTRY_dup |
| 186 | first appeared in SSLeay 0.5.1. | 222 | first appeared in SSLeay 0.5.1. |
| 223 | .Fn X509_NAME_set | ||
| 224 | and | ||
| 187 | .Fn X509_NAME_hash | 225 | .Fn X509_NAME_hash |
| 188 | first appeared in SSLeay 0.8.0. | 226 | first appeared in SSLeay 0.8.0. |
| 189 | These functions have been available since | 227 | These functions have been available since |
