diff options
Diffstat (limited to 'src/lib/libssl/doc')
86 files changed, 0 insertions, 12087 deletions
diff --git a/src/lib/libssl/doc/BIO_f_ssl.3 b/src/lib/libssl/doc/BIO_f_ssl.3 deleted file mode 100644 index 876018a839..0000000000 --- a/src/lib/libssl/doc/BIO_f_ssl.3 +++ /dev/null | |||
| @@ -1,478 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: BIO_f_ssl.3,v 1.3 2015/06/18 22:51:05 doug Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: June 18 2015 $ | ||
| 5 | .Dt BIO_F_SSL 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm BIO_f_ssl , | ||
| 9 | .Nm BIO_set_ssl , | ||
| 10 | .Nm BIO_get_ssl , | ||
| 11 | .Nm BIO_set_ssl_mode , | ||
| 12 | .Nm BIO_set_ssl_renegotiate_bytes , | ||
| 13 | .Nm BIO_get_num_renegotiates , | ||
| 14 | .Nm BIO_set_ssl_renegotiate_timeout , | ||
| 15 | .Nm BIO_new_ssl , | ||
| 16 | .Nm BIO_new_ssl_connect , | ||
| 17 | .Nm BIO_new_buffer_ssl_connect , | ||
| 18 | .Nm BIO_ssl_copy_session_id , | ||
| 19 | .Nm BIO_ssl_shutdown | ||
| 20 | .Nd SSL BIO | ||
| 21 | .Sh SYNOPSIS | ||
| 22 | .In openssl/bio.h | ||
| 23 | .In openssl/ssl.h | ||
| 24 | .Ft BIO_METHOD * | ||
| 25 | .Fn BIO_f_ssl void | ||
| 26 | .Fd #define BIO_set_ssl(b,ssl,c) BIO_ctrl(b,BIO_C_SET_SSL,c,(char *)ssl) | ||
| 27 | .Fd #define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)sslp) | ||
| 28 | .Fd #define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL) | ||
| 29 | .Fd #define BIO_set_ssl_renegotiate_bytes(b,num) \ | ||
| 30 | BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL) | ||
| 31 | .Fd #define BIO_set_ssl_renegotiate_timeout(b,seconds) \ | ||
| 32 | BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL) | ||
| 33 | .Fd #define BIO_get_num_renegotiates(b) \ | ||
| 34 | BIO_ctrl(b,BIO_C_SET_SSL_NUM_RENEGOTIATES,0,NULL) | ||
| 35 | .Ft BIO * | ||
| 36 | .Fn BIO_new_ssl "SSL_CTX *ctx" "int client" | ||
| 37 | .Ft BIO * | ||
| 38 | .Fn BIO_new_ssl_connect "SSL_CTX *ctx" | ||
| 39 | .Ft BIO * | ||
| 40 | .Fn BIO_new_buffer_ssl_connect "SSL_CTX *ctx" | ||
| 41 | .Ft int | ||
| 42 | .Fn BIO_ssl_copy_session_id "BIO *to" "BIO *from" | ||
| 43 | .Ft void | ||
| 44 | .Fn BIO_ssl_shutdown "BIO *bio" | ||
| 45 | .Fd #define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL) | ||
| 46 | .Sh DESCRIPTION | ||
| 47 | .Fn BIO_f_ssl | ||
| 48 | returns the | ||
| 49 | .Vt SSL | ||
| 50 | .Vt BIO | ||
| 51 | method. | ||
| 52 | This is a filter | ||
| 53 | .Vt BIO | ||
| 54 | which is a wrapper around the OpenSSL | ||
| 55 | .Vt SSL | ||
| 56 | routines adding a | ||
| 57 | .Vt BIO | ||
| 58 | .Dq flavor | ||
| 59 | to SSL I/O. | ||
| 60 | .Pp | ||
| 61 | I/O performed on an | ||
| 62 | .Vt SSL | ||
| 63 | .Vt BIO | ||
| 64 | communicates using the SSL protocol with | ||
| 65 | the | ||
| 66 | .Vt SSL Ns 's | ||
| 67 | read and write | ||
| 68 | .Vt BIO Ns s. | ||
| 69 | If an SSL connection is not established then an attempt is made to establish | ||
| 70 | one on the first I/O call. | ||
| 71 | .Pp | ||
| 72 | If a | ||
| 73 | .Vt BIO | ||
| 74 | is appended to an | ||
| 75 | .Vt SSL | ||
| 76 | .Vt BIO | ||
| 77 | using | ||
| 78 | .Xr BIO_push 3 | ||
| 79 | it is automatically used as the | ||
| 80 | .Vt SSL | ||
| 81 | .Vt BIO Ns 's read and write | ||
| 82 | .Vt BIO Ns s. | ||
| 83 | .Pp | ||
| 84 | Calling | ||
| 85 | .Xr BIO_reset 3 | ||
| 86 | on an | ||
| 87 | .Vt SSL | ||
| 88 | .Vt BIO | ||
| 89 | closes down any current SSL connection by calling | ||
| 90 | .Xr SSL_shutdown 3 . | ||
| 91 | .Xr BIO_reset | ||
| 92 | is then sent to the next | ||
| 93 | .Vt BIO | ||
| 94 | in the chain; this will typically disconnect the underlying transport. | ||
| 95 | The | ||
| 96 | .Vt SSL | ||
| 97 | .Vt BIO | ||
| 98 | is then reset to the initial accept or connect state. | ||
| 99 | .Pp | ||
| 100 | If the close flag is set when an | ||
| 101 | .Vt SSL | ||
| 102 | .Vt BIO | ||
| 103 | is freed then the internal | ||
| 104 | .Vt SSL | ||
| 105 | structure is also freed using | ||
| 106 | .Xr SSL_free 3 . | ||
| 107 | .Pp | ||
| 108 | .Fn BIO_set_ssl | ||
| 109 | sets the internal | ||
| 110 | .Vt SSL | ||
| 111 | pointer of | ||
| 112 | .Vt BIO | ||
| 113 | .Fa b | ||
| 114 | to | ||
| 115 | .Fa ssl | ||
| 116 | using | ||
| 117 | the close flag | ||
| 118 | .Fa c . | ||
| 119 | .Pp | ||
| 120 | .Fn BIO_get_ssl | ||
| 121 | retrieves the | ||
| 122 | .Vt SSL | ||
| 123 | pointer of | ||
| 124 | .Vt BIO | ||
| 125 | .Fa b ; | ||
| 126 | it can then be manipulated using the standard SSL library functions. | ||
| 127 | .Pp | ||
| 128 | .Fn BIO_set_ssl_mode | ||
| 129 | sets the | ||
| 130 | .Vt SSL | ||
| 131 | .Vt BIO | ||
| 132 | mode to | ||
| 133 | .Fa client . | ||
| 134 | If | ||
| 135 | .Fa client | ||
| 136 | is 1, client mode is set. | ||
| 137 | If | ||
| 138 | .Fa client | ||
| 139 | is 0, server mode is set. | ||
| 140 | .Pp | ||
| 141 | .Fn BIO_set_ssl_renegotiate_bytes | ||
| 142 | sets the renegotiate byte count to | ||
| 143 | .Fa num . | ||
| 144 | When set after every | ||
| 145 | .Fa num | ||
| 146 | bytes of I/O (read and write) the SSL session is automatically renegotiated. | ||
| 147 | .Fa num | ||
| 148 | must be at least 512 bytes. | ||
| 149 | .Pp | ||
| 150 | .Fn BIO_set_ssl_renegotiate_timeout | ||
| 151 | sets the renegotiate timeout to | ||
| 152 | .Fa seconds . | ||
| 153 | When the renegotiate timeout elapses the session is automatically renegotiated. | ||
| 154 | .Pp | ||
| 155 | .Fn BIO_get_num_renegotiates | ||
| 156 | returns the total number of session renegotiations due to I/O or timeout. | ||
| 157 | .Pp | ||
| 158 | .Fn BIO_new_ssl | ||
| 159 | allocates an | ||
| 160 | .Vt SSL | ||
| 161 | .Vt BIO | ||
| 162 | using | ||
| 163 | .Vt SSL_CTX | ||
| 164 | .Va ctx | ||
| 165 | and using client mode if | ||
| 166 | .Fa client | ||
| 167 | is nonzero. | ||
| 168 | .Pp | ||
| 169 | .Fn BIO_new_ssl_connect | ||
| 170 | creates a new | ||
| 171 | .Vt BIO | ||
| 172 | chain consisting of an | ||
| 173 | .Vt SSL | ||
| 174 | .Vt BIO | ||
| 175 | (using | ||
| 176 | .Fa ctx ) | ||
| 177 | followed by a connect BIO. | ||
| 178 | .Pp | ||
| 179 | .Fn BIO_new_buffer_ssl_connect | ||
| 180 | creates a new | ||
| 181 | .Vt BIO | ||
| 182 | chain consisting of a buffering | ||
| 183 | .Vt BIO , | ||
| 184 | an | ||
| 185 | .Vt SSL | ||
| 186 | .Vt BIO | ||
| 187 | (using | ||
| 188 | .Fa ctx ) | ||
| 189 | and a connect | ||
| 190 | .Vt BIO . | ||
| 191 | .Pp | ||
| 192 | .Fn BIO_ssl_copy_session_id | ||
| 193 | copies an SSL session id between | ||
| 194 | .Vt BIO | ||
| 195 | chains | ||
| 196 | .Fa from | ||
| 197 | and | ||
| 198 | .Fa to . | ||
| 199 | It does this by locating the | ||
| 200 | .Vt SSL | ||
| 201 | .Vt BIO Ns s | ||
| 202 | in each chain and calling | ||
| 203 | .Xr SSL_copy_session_id 3 | ||
| 204 | on the internal | ||
| 205 | .Vt SSL | ||
| 206 | pointer. | ||
| 207 | .Pp | ||
| 208 | .Fn BIO_ssl_shutdown | ||
| 209 | closes down an SSL connection on | ||
| 210 | .Vt BIO | ||
| 211 | chain | ||
| 212 | .Fa bio . | ||
| 213 | It does this by locating the | ||
| 214 | .Vt SSL | ||
| 215 | .Vt BIO | ||
| 216 | in the | ||
| 217 | chain and calling | ||
| 218 | .Xr SSL_shutdown 3 | ||
| 219 | on its internal | ||
| 220 | .Vt SSL | ||
| 221 | pointer. | ||
| 222 | .Pp | ||
| 223 | .Fn BIO_do_handshake | ||
| 224 | attempts to complete an SSL handshake on the supplied | ||
| 225 | .Vt BIO | ||
| 226 | and establish the SSL connection. | ||
| 227 | It returns 1 if the connection was established successfully. | ||
| 228 | A zero or negative value is returned if the connection could not be | ||
| 229 | established; the call | ||
| 230 | .Xr BIO_should_retry 3 | ||
| 231 | should be used for non blocking connect | ||
| 232 | .Vt BIO Ns s | ||
| 233 | to determine if the call should be retried. | ||
| 234 | If an SSL connection has already been established this call has no effect. | ||
| 235 | .Sh NOTES | ||
| 236 | .Vt SSL | ||
| 237 | .Vt BIO Ns s | ||
| 238 | are exceptional in that if the underlying transport is non-blocking they can | ||
| 239 | still request a retry in exceptional circumstances. | ||
| 240 | Specifically this will happen if a session renegotiation takes place during a | ||
| 241 | .Xr BIO_read 3 | ||
| 242 | operation. | ||
| 243 | One case where this happens is when step up occurs. | ||
| 244 | .Pp | ||
| 245 | In OpenSSL 0.9.6 and later the SSL flag | ||
| 246 | .Dv SSL_AUTO_RETRY | ||
| 247 | can be set to disable this behaviour. | ||
| 248 | In other words, when this flag is set an | ||
| 249 | .Vt SSL | ||
| 250 | .Vt BIO | ||
| 251 | using a blocking transport will never request a retry. | ||
| 252 | .Pp | ||
| 253 | Since unknown | ||
| 254 | .Xr BIO_ctrl 3 | ||
| 255 | operations are sent through filter | ||
| 256 | .Vt BIO Ns s | ||
| 257 | the server name and port can be set using | ||
| 258 | .Xr BIO_set_host 3 | ||
| 259 | on the | ||
| 260 | .Vt BIO | ||
| 261 | returned by | ||
| 262 | .Fn BIO_new_ssl_connect | ||
| 263 | without having to locate the connect | ||
| 264 | .Vt BIO | ||
| 265 | first. | ||
| 266 | .Pp | ||
| 267 | Applications do not have to call | ||
| 268 | .Fn BIO_do_handshake | ||
| 269 | but may wish to do so to separate the handshake process from other I/O | ||
| 270 | processing. | ||
| 271 | .Sh RETURN VALUES | ||
| 272 | .\" XXX | ||
| 273 | This section is incomplete. | ||
| 274 | .Sh EXAMPLES | ||
| 275 | This SSL/TLS client example attempts to retrieve a page from an SSL/TLS web | ||
| 276 | server. | ||
| 277 | The I/O routines are identical to those of the unencrypted example in | ||
| 278 | .Xr BIO_s_connect 3 . | ||
| 279 | .Bd -literal | ||
| 280 | BIO *sbio, *out; | ||
| 281 | int len; | ||
| 282 | char tmpbuf[1024]; | ||
| 283 | SSL_CTX *ctx; | ||
| 284 | SSL *ssl; | ||
| 285 | |||
| 286 | ERR_load_crypto_strings(); | ||
| 287 | ERR_load_SSL_strings(); | ||
| 288 | OpenSSL_add_all_algorithms(); | ||
| 289 | |||
| 290 | /* | ||
| 291 | * We would seed the PRNG here if the platform didn't do it automatically | ||
| 292 | */ | ||
| 293 | |||
| 294 | ctx = SSL_CTX_new(SSLv23_client_method()); | ||
| 295 | |||
| 296 | /* | ||
| 297 | * We'd normally set some stuff like the verify paths and mode here because | ||
| 298 | * as things stand this will connect to any server whose certificate is | ||
| 299 | * signed by any CA. | ||
| 300 | */ | ||
| 301 | |||
| 302 | sbio = BIO_new_ssl_connect(ctx); | ||
| 303 | |||
| 304 | BIO_get_ssl(sbio, &ssl); | ||
| 305 | |||
| 306 | if (!ssl) { | ||
| 307 | fprintf(stderr, "Can't locate SSL pointer\en"); | ||
| 308 | /* whatever ... */ | ||
| 309 | } | ||
| 310 | |||
| 311 | /* Don't want any retries */ | ||
| 312 | SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY); | ||
| 313 | |||
| 314 | /* We might want to do other things with ssl here */ | ||
| 315 | |||
| 316 | BIO_set_conn_hostname(sbio, "localhost:https"); | ||
| 317 | |||
| 318 | out = BIO_new_fp(stdout, BIO_NOCLOSE); | ||
| 319 | if (BIO_do_connect(sbio) <= 0) { | ||
| 320 | fprintf(stderr, "Error connecting to server\en"); | ||
| 321 | ERR_print_errors_fp(stderr); | ||
| 322 | /* whatever ... */ | ||
| 323 | } | ||
| 324 | |||
| 325 | if (BIO_do_handshake(sbio) <= 0) { | ||
| 326 | fprintf(stderr, "Error establishing SSL connection\en"); | ||
| 327 | ERR_print_errors_fp(stderr); | ||
| 328 | /* whatever ... */ | ||
| 329 | } | ||
| 330 | |||
| 331 | /* Could examine ssl here to get connection info */ | ||
| 332 | |||
| 333 | BIO_puts(sbio, "GET / HTTP/1.0\en\en"); | ||
| 334 | for (;;) { | ||
| 335 | len = BIO_read(sbio, tmpbuf, 1024); | ||
| 336 | if(len <= 0) break; | ||
| 337 | BIO_write(out, tmpbuf, len); | ||
| 338 | } | ||
| 339 | BIO_free_all(sbio); | ||
| 340 | BIO_free(out); | ||
| 341 | .Ed | ||
| 342 | .Pp | ||
| 343 | Here is a simple server example. | ||
| 344 | It makes use of a buffering | ||
| 345 | .Vt BIO | ||
| 346 | to allow lines to be read from the | ||
| 347 | .Vt SSL | ||
| 348 | .Vt BIO | ||
| 349 | using | ||
| 350 | .Xr BIO_gets 3 . | ||
| 351 | It creates a pseudo web page containing the actual request from a client and | ||
| 352 | also echoes the request to standard output. | ||
| 353 | .Bd -literal | ||
| 354 | BIO *sbio, *bbio, *acpt, *out; | ||
| 355 | int len; | ||
| 356 | char tmpbuf[1024]; | ||
| 357 | SSL_CTX *ctx; | ||
| 358 | SSL *ssl; | ||
| 359 | |||
| 360 | ERR_load_crypto_strings(); | ||
| 361 | ERR_load_SSL_strings(); | ||
| 362 | OpenSSL_add_all_algorithms(); | ||
| 363 | |||
| 364 | /* Might seed PRNG here */ | ||
| 365 | |||
| 366 | ctx = SSL_CTX_new(SSLv23_server_method()); | ||
| 367 | |||
| 368 | if (!SSL_CTX_use_certificate_file(ctx,"server.pem",SSL_FILETYPE_PEM) | ||
| 369 | || !SSL_CTX_use_PrivateKey_file(ctx,"server.pem",SSL_FILETYPE_PEM) | ||
| 370 | || !SSL_CTX_check_private_key(ctx)) { | ||
| 371 | fprintf(stderr, "Error setting up SSL_CTX\en"); | ||
| 372 | ERR_print_errors_fp(stderr); | ||
| 373 | return 0; | ||
| 374 | } | ||
| 375 | |||
| 376 | /* | ||
| 377 | * Might do other things here like setting verify locations and DH and/or | ||
| 378 | * RSA temporary key callbacks | ||
| 379 | */ | ||
| 380 | |||
| 381 | /* New SSL BIO setup as server */ | ||
| 382 | sbio = BIO_new_ssl(ctx,0); | ||
| 383 | |||
| 384 | BIO_get_ssl(sbio, &ssl); | ||
| 385 | |||
| 386 | if (!ssl) { | ||
| 387 | fprintf(stderr, "Can't locate SSL pointer\en"); | ||
| 388 | /* whatever ... */ | ||
| 389 | } | ||
| 390 | |||
| 391 | /* Don't want any retries */ | ||
| 392 | SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY); | ||
| 393 | |||
| 394 | /* Create the buffering BIO */ | ||
| 395 | |||
| 396 | bbio = BIO_new(BIO_f_buffer()); | ||
| 397 | |||
| 398 | /* Add to chain */ | ||
| 399 | sbio = BIO_push(bbio, sbio); | ||
| 400 | |||
| 401 | acpt = BIO_new_accept("4433"); | ||
| 402 | |||
| 403 | /* | ||
| 404 | * By doing this when a new connection is established we automatically | ||
| 405 | * have sbio inserted into it. The BIO chain is now 'swallowed' by the | ||
| 406 | * accept BIO and will be freed when the accept BIO is freed. | ||
| 407 | */ | ||
| 408 | |||
| 409 | BIO_set_accept_bios(acpt,sbio); | ||
| 410 | |||
| 411 | out = BIO_new_fp(stdout, BIO_NOCLOSE); | ||
| 412 | |||
| 413 | /* Setup accept BIO */ | ||
| 414 | if (BIO_do_accept(acpt) <= 0) { | ||
| 415 | fprintf(stderr, "Error setting up accept BIO\en"); | ||
| 416 | ERR_print_errors_fp(stderr); | ||
| 417 | return 0; | ||
| 418 | } | ||
| 419 | |||
| 420 | /* Now wait for incoming connection */ | ||
| 421 | if (BIO_do_accept(acpt) <= 0) { | ||
| 422 | fprintf(stderr, "Error in connection\en"); | ||
| 423 | ERR_print_errors_fp(stderr); | ||
| 424 | return 0; | ||
| 425 | } | ||
| 426 | |||
| 427 | /* We only want one connection so remove and free accept BIO */ | ||
| 428 | |||
| 429 | sbio = BIO_pop(acpt); | ||
| 430 | |||
| 431 | BIO_free_all(acpt); | ||
| 432 | |||
| 433 | if (BIO_do_handshake(sbio) <= 0) { | ||
| 434 | fprintf(stderr, "Error in SSL handshake\en"); | ||
| 435 | ERR_print_errors_fp(stderr); | ||
| 436 | return 0; | ||
| 437 | } | ||
| 438 | |||
| 439 | BIO_puts(sbio, "HTTP/1.0 200 OK\er\enContent-type: text/plain\er\en\er\en"); | ||
| 440 | BIO_puts(sbio, "\er\enConnection Established\er\enRequest headers:\er\en"); | ||
| 441 | BIO_puts(sbio, "--------------------------------------------------\er\en"); | ||
| 442 | |||
| 443 | for (;;) { | ||
| 444 | len = BIO_gets(sbio, tmpbuf, 1024); | ||
| 445 | if (len <= 0) | ||
| 446 | break; | ||
| 447 | BIO_write(sbio, tmpbuf, len); | ||
| 448 | BIO_write(out, tmpbuf, len); | ||
| 449 | /* Look for blank line signifying end of headers */ | ||
| 450 | if ((tmpbuf[0] == '\er') || (tmpbuf[0] == '\en')) | ||
| 451 | break; | ||
| 452 | } | ||
| 453 | |||
| 454 | BIO_puts(sbio, "--------------------------------------------------\er\en"); | ||
| 455 | BIO_puts(sbio, "\er\en"); | ||
| 456 | |||
| 457 | /* Since there is a buffering BIO present we had better flush it */ | ||
| 458 | BIO_flush(sbio); | ||
| 459 | |||
| 460 | BIO_free_all(sbio); | ||
| 461 | .Ed | ||
| 462 | .Sh BUGS | ||
| 463 | In OpenSSL versions before 1.0.0 the | ||
| 464 | .Xr BIO_pop 3 | ||
| 465 | call was handled incorrectly: | ||
| 466 | the I/O BIO reference count was incorrectly incremented (instead of | ||
| 467 | decremented) and dissociated with the | ||
| 468 | .Vt SSL | ||
| 469 | .Vt BIO | ||
| 470 | even if the | ||
| 471 | .Vt SSL | ||
| 472 | .Vt BIO | ||
| 473 | was not | ||
| 474 | explicitly being popped (e.g., a pop higher up the chain). | ||
| 475 | Applications which included workarounds for this bug (e.g., freeing BIOs more | ||
| 476 | than once) should be modified to handle this fix or they may free up an already | ||
| 477 | freed | ||
| 478 | .Vt BIO . | ||
diff --git a/src/lib/libssl/doc/SSL_CIPHER_get_name.3 b/src/lib/libssl/doc/SSL_CIPHER_get_name.3 deleted file mode 100644 index ebc478f9c6..0000000000 --- a/src/lib/libssl/doc/SSL_CIPHER_get_name.3 +++ /dev/null | |||
| @@ -1,196 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CIPHER_get_name.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CIPHER_GET_NAME 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CIPHER_get_name , | ||
| 9 | .Nm SSL_CIPHER_get_bits , | ||
| 10 | .Nm SSL_CIPHER_get_version , | ||
| 11 | .Nm SSL_CIPHER_description | ||
| 12 | .Nd get SSL_CIPHER properties | ||
| 13 | .Sh SYNOPSIS | ||
| 14 | .In openssl/ssl.h | ||
| 15 | .Ft const char * | ||
| 16 | .Fn SSL_CIPHER_get_name "const SSL_CIPHER *cipher" | ||
| 17 | .Ft int | ||
| 18 | .Fn SSL_CIPHER_get_bits "const SSL_CIPHER *cipher" "int *alg_bits" | ||
| 19 | .Ft char * | ||
| 20 | .Fn SSL_CIPHER_get_version "const SSL_CIPHER *cipher" | ||
| 21 | .Ft char * | ||
| 22 | .Fn SSL_CIPHER_description "const SSL_CIPHER *cipher" "char *buf" "int size" | ||
| 23 | .Sh DESCRIPTION | ||
| 24 | .Fn SSL_CIPHER_get_name | ||
| 25 | returns a pointer to the name of | ||
| 26 | .Fa cipher . | ||
| 27 | If the | ||
| 28 | argument is the | ||
| 29 | .Dv NULL | ||
| 30 | pointer, a pointer to the constant value | ||
| 31 | .Qq NONE | ||
| 32 | is returned. | ||
| 33 | .Pp | ||
| 34 | .Fn SSL_CIPHER_get_bits | ||
| 35 | returns the number of secret bits used for | ||
| 36 | .Fa cipher . | ||
| 37 | If | ||
| 38 | .Fa alg_bits | ||
| 39 | is not | ||
| 40 | .Dv NULL , | ||
| 41 | it contains the number of bits processed by the | ||
| 42 | chosen algorithm. | ||
| 43 | If | ||
| 44 | .Fa cipher | ||
| 45 | is | ||
| 46 | .Dv NULL , | ||
| 47 | 0 is returned. | ||
| 48 | .Pp | ||
| 49 | .Fn SSL_CIPHER_get_version | ||
| 50 | returns a string which indicates the SSL/TLS protocol version that first | ||
| 51 | defined the cipher. | ||
| 52 | This is currently | ||
| 53 | .Qq SSLv2 | ||
| 54 | or | ||
| 55 | .Qq TLSv1/SSLv3 . | ||
| 56 | In some cases it should possibly return | ||
| 57 | .Qq TLSv1.2 | ||
| 58 | but the function does not; use | ||
| 59 | .Xr SSL_CIPHER_description 3 | ||
| 60 | instead. | ||
| 61 | If | ||
| 62 | .Fa cipher | ||
| 63 | is | ||
| 64 | .Dv NULL , | ||
| 65 | .Qq (NONE) | ||
| 66 | is returned. | ||
| 67 | .Pp | ||
| 68 | .Fn SSL_CIPHER_description | ||
| 69 | returns a textual description of the cipher used into the buffer | ||
| 70 | .Fa buf | ||
| 71 | of length | ||
| 72 | .Fa len | ||
| 73 | provided. | ||
| 74 | If | ||
| 75 | .Fa buf | ||
| 76 | is | ||
| 77 | .Dv NULL , | ||
| 78 | a buffer is allocated using | ||
| 79 | .Xr asprintf 3 ; | ||
| 80 | that buffer should be freed using the | ||
| 81 | .Xr free 3 | ||
| 82 | function. | ||
| 83 | If | ||
| 84 | .Fa len | ||
| 85 | is too small, or if | ||
| 86 | .Fa buf | ||
| 87 | is | ||
| 88 | .Dv NULL | ||
| 89 | and the allocation fails, a pointer to the string | ||
| 90 | .Qq Buffer too small | ||
| 91 | is returned. | ||
| 92 | .Sh NOTES | ||
| 93 | The number of bits processed can be different from the secret bits. | ||
| 94 | For example, an export cipher like EXP-RC4-MD5 has only 40 secret bits. | ||
| 95 | The algorithm does use the full 128 bits (which would be returned for | ||
| 96 | .Fa alg_bits ) , | ||
| 97 | but 88 bits are fixed. | ||
| 98 | The search space is hence only 40 bits. | ||
| 99 | .Pp | ||
| 100 | The string returned by | ||
| 101 | .Fn SSL_CIPHER_description | ||
| 102 | in case of success consists | ||
| 103 | of cleartext information separated by one or more blanks in the following | ||
| 104 | sequence: | ||
| 105 | .Bl -tag -width Ds | ||
| 106 | .It Aq Ar ciphername | ||
| 107 | Textual representation of the cipher name. | ||
| 108 | .It Aq Ar protocol version | ||
| 109 | Protocol version: | ||
| 110 | .Em SSLv2 , | ||
| 111 | .Em SSLv3 , | ||
| 112 | .Em TLSv1.2 . | ||
| 113 | The TLSv1.0 ciphers are flagged with SSLv3. | ||
| 114 | No new ciphers were added by TLSv1.1. | ||
| 115 | .It Kx= Ns Aq Ar key exchange | ||
| 116 | Key exchange method: | ||
| 117 | .Em RSA | ||
| 118 | (for export ciphers as | ||
| 119 | .Em RSA(512) | ||
| 120 | or | ||
| 121 | .Em RSA(1024) ) , | ||
| 122 | .Em DH | ||
| 123 | (for export ciphers as | ||
| 124 | .Em DH(512) | ||
| 125 | or | ||
| 126 | .Em DH(1024) ) , | ||
| 127 | .Em DH/RSA , | ||
| 128 | .Em DH/DSS , | ||
| 129 | .Em Fortezza . | ||
| 130 | .It Au= Ns Aq Ar authentication | ||
| 131 | Authentication method: | ||
| 132 | .Em RSA , | ||
| 133 | .Em DSS , | ||
| 134 | .Em DH , | ||
| 135 | .Em None . | ||
| 136 | .Em None | ||
| 137 | is the representation of anonymous ciphers. | ||
| 138 | .It Enc= Ns Aq Ar symmetric encryption method | ||
| 139 | Encryption method with number of secret bits: | ||
| 140 | .Em DES(40) , | ||
| 141 | .Em DES(56) , | ||
| 142 | .Em 3DES(168) , | ||
| 143 | .Em RC4(40) , | ||
| 144 | .Em RC4(56) , | ||
| 145 | .Em RC4(64) , | ||
| 146 | .Em RC4(128) , | ||
| 147 | .Em RC2(40) , | ||
| 148 | .Em RC2(56) , | ||
| 149 | .Em RC2(128) , | ||
| 150 | .Em IDEA(128) , | ||
| 151 | .Em Fortezza , | ||
| 152 | .Em None . | ||
| 153 | .It Mac= Ns Aq Ar message authentication code | ||
| 154 | Message digest: | ||
| 155 | .Em MD5 , | ||
| 156 | .Em SHA1 . | ||
| 157 | .It Aq Ar export flag | ||
| 158 | If the cipher is flagged exportable with respect to old US crypto | ||
| 159 | regulations, the word | ||
| 160 | .Dq export | ||
| 161 | is printed. | ||
| 162 | .El | ||
| 163 | .Sh RETURN VALUES | ||
| 164 | See | ||
| 165 | .Sx DESCRIPTION | ||
| 166 | .Sh EXAMPLES | ||
| 167 | Some examples for the output of | ||
| 168 | .Fn SSL_CIPHER_description : | ||
| 169 | .D1 "EDH-RSA-DES-CBC3-SHA SSLv3 Kx=DH Au=RSA Enc=3DES(168) Mac=SHA1" | ||
| 170 | .D1 "EDH-DSS-DES-CBC3-SHA SSLv3 Kx=DH Au=DSS Enc=3DES(168) Mac=SHA1" | ||
| 171 | .D1 "RC4-MD5 SSLv3 Kx=RSA Au=RSA Enc=RC4(128) Mac=MD5" | ||
| 172 | .D1 "EXP-RC4-MD5 SSLv3 Kx=RSA(512) Au=RSA Enc=RC4(40) Mac=MD5 export" | ||
| 173 | .Pp | ||
| 174 | A complete list can be retrieved by invoking the following command: | ||
| 175 | .Pp | ||
| 176 | .Dl $ openssl ciphers -v ALL | ||
| 177 | .Sh SEE ALSO | ||
| 178 | .Xr openssl 1 , | ||
| 179 | .Xr ssl 3 , | ||
| 180 | .Xr SSL_get_ciphers 3 , | ||
| 181 | .Xr SSL_get_current_cipher 3 | ||
| 182 | .Sh BUGS | ||
| 183 | If | ||
| 184 | .Fn SSL_CIPHER_description | ||
| 185 | is called with | ||
| 186 | .Fa cipher | ||
| 187 | being | ||
| 188 | .Dv NULL , | ||
| 189 | the library crashes. | ||
| 190 | .Pp | ||
| 191 | If | ||
| 192 | .Fn SSL_CIPHER_description | ||
| 193 | cannot handle a built-in cipher, | ||
| 194 | the according description of the cipher property is | ||
| 195 | .Qq unknown . | ||
| 196 | This case should not occur. | ||
diff --git a/src/lib/libssl/doc/SSL_COMP_add_compression_method.3 b/src/lib/libssl/doc/SSL_COMP_add_compression_method.3 deleted file mode 100644 index d683574dd3..0000000000 --- a/src/lib/libssl/doc/SSL_COMP_add_compression_method.3 +++ /dev/null | |||
| @@ -1,68 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_COMP_add_compression_method.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_COMP_ADD_COMPRESSION_METHOD 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_COMP_add_compression_method | ||
| 9 | .Nd handle SSL/TLS integrated compression methods | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft int | ||
| 13 | .Fn SSL_COMP_add_compression_method "int id" "COMP_METHOD *cm" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_COMP_add_compression_method | ||
| 16 | adds the compression method | ||
| 17 | .Fa cm | ||
| 18 | with the identifier | ||
| 19 | .Fa id | ||
| 20 | to the list of available compression methods. | ||
| 21 | This list is globally maintained for all SSL operations within this application. | ||
| 22 | It cannot be set for specific SSL_CTX or SSL objects. | ||
| 23 | .Sh NOTES | ||
| 24 | The TLS standard (or SSLv3) allows the integration of compression methods | ||
| 25 | into the communication. | ||
| 26 | The TLS RFC does however not specify compression methods or their corresponding | ||
| 27 | identifiers, so there is currently no compatible way to integrate compression | ||
| 28 | with unknown peers. | ||
| 29 | It is therefore currently not recommended to integrate compression into | ||
| 30 | applications. | ||
| 31 | Applications for non-public use may agree on certain compression methods. | ||
| 32 | Using different compression methods with the same identifier will lead to | ||
| 33 | connection failure. | ||
| 34 | .Pp | ||
| 35 | An OpenSSL client speaking a protocol that allows compression (SSLv3, TLSv1) | ||
| 36 | will unconditionally send the list of all compression methods enabled with | ||
| 37 | .Fn SSL_COMP_add_compression_method | ||
| 38 | to the server during the handshake. | ||
| 39 | Unlike the mechanisms to set a cipher list, there is no method available to | ||
| 40 | restrict the list of compression method on a per connection basis. | ||
| 41 | .Pp | ||
| 42 | An OpenSSL server will match the identifiers listed by a client against | ||
| 43 | its own compression methods and will unconditionally activate compression | ||
| 44 | when a matching identifier is found. | ||
| 45 | There is no way to restrict the list of compression methods supported on a per | ||
| 46 | connection basis. | ||
| 47 | .Pp | ||
| 48 | The OpenSSL library has the compression methods | ||
| 49 | .Fn COMP_rle | ||
| 50 | and (when especially enabled during compilation) | ||
| 51 | .Fn COMP_zlib | ||
| 52 | available. | ||
| 53 | .Sh WARNINGS | ||
| 54 | Once the identities of the compression methods for the TLS protocol have | ||
| 55 | been standardized, the compression API will most likely be changed. | ||
| 56 | Using it in the current state is not recommended. | ||
| 57 | .Sh RETURN VALUES | ||
| 58 | .Fn SSL_COMP_add_compression_method | ||
| 59 | may return the following values: | ||
| 60 | .Bl -tag -width Ds | ||
| 61 | .It 0 | ||
| 62 | The operation succeeded. | ||
| 63 | .It 1 | ||
| 64 | The operation failed. | ||
| 65 | Check the error queue to find out the reason. | ||
| 66 | .El | ||
| 67 | .Sh SEE ALSO | ||
| 68 | .Xr ssl 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_add_extra_chain_cert.3 b/src/lib/libssl/doc/SSL_CTX_add_extra_chain_cert.3 deleted file mode 100644 index c18d220643..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_add_extra_chain_cert.3 +++ /dev/null | |||
| @@ -1,45 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_add_extra_chain_cert.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_ADD_EXTRA_CHAIN_CERT 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_add_extra_chain_cert | ||
| 9 | .Nd add certificate to chain | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft long | ||
| 13 | .Fn SSL_CTX_add_extra_chain_cert "SSL_CTX ctx" "X509 *x509" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_CTX_add_extra_chain_cert | ||
| 16 | adds the certificate | ||
| 17 | .Fa x509 | ||
| 18 | to the certificate chain presented together with the certificate. | ||
| 19 | Several certificates can be added one after the other. | ||
| 20 | .Sh NOTES | ||
| 21 | When constructing the certificate chain, the chain will be formed from | ||
| 22 | these certificates explicitly specified. | ||
| 23 | If no chain is specified, the library will try to complete the chain from the | ||
| 24 | available CA certificates in the trusted CA storage, see | ||
| 25 | .Xr SSL_CTX_load_verify_locations 3 . | ||
| 26 | .Pp | ||
| 27 | The x509 certificate provided to | ||
| 28 | .Fn SSL_CTX_add_extra_chain_cert | ||
| 29 | will be freed by the library when the | ||
| 30 | .Vt SSL_CTX | ||
| 31 | is destroyed. | ||
| 32 | An application | ||
| 33 | .Em should not | ||
| 34 | free the | ||
| 35 | .Fa x509 | ||
| 36 | object. | ||
| 37 | .Sh RETURN VALUES | ||
| 38 | .Fn SSL_CTX_add_extra_chain_cert | ||
| 39 | returns 1 on success. | ||
| 40 | Check out the error stack to find out the reason for failure otherwise. | ||
| 41 | .Sh SEE ALSO | ||
| 42 | .Xr ssl 3 , | ||
| 43 | .Xr SSL_CTX_load_verify_locations 3 , | ||
| 44 | .Xr SSL_CTX_set_client_cert_cb 3 , | ||
| 45 | .Xr SSL_CTX_use_certificate 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_add_session.3 b/src/lib/libssl/doc/SSL_CTX_add_session.3 deleted file mode 100644 index 073b919dc1..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_add_session.3 +++ /dev/null | |||
| @@ -1,90 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_add_session.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_ADD_SESSION 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_add_session , | ||
| 9 | .Nm SSL_add_session , | ||
| 10 | .Nm SSL_CTX_remove_session , | ||
| 11 | .Nm SSL_remove_session | ||
| 12 | .Nd manipulate session cache | ||
| 13 | .Sh SYNOPSIS | ||
| 14 | .In openssl/ssl.h | ||
| 15 | .Ft int | ||
| 16 | .Fn SSL_CTX_add_session "SSL_CTX *ctx" "SSL_SESSION *c" | ||
| 17 | .Ft int | ||
| 18 | .Fn SSL_add_session "SSL_CTX *ctx" "SSL_SESSION *c" | ||
| 19 | .Ft int | ||
| 20 | .Fn SSL_CTX_remove_session "SSL_CTX *ctx" "SSL_SESSION *c" | ||
| 21 | .Ft int | ||
| 22 | .Fn SSL_remove_session "SSL_CTX *ctx" "SSL_SESSION *c" | ||
| 23 | .Sh DESCRIPTION | ||
| 24 | .Fn SSL_CTX_add_session | ||
| 25 | adds the session | ||
| 26 | .Fa c | ||
| 27 | to the context | ||
| 28 | .Fa ctx . | ||
| 29 | The reference count for session | ||
| 30 | .Fa c | ||
| 31 | is incremented by 1. | ||
| 32 | If a session with the same session id already exists, | ||
| 33 | the old session is removed by calling | ||
| 34 | .Xr SSL_SESSION_free 3 . | ||
| 35 | .Pp | ||
| 36 | .Fn SSL_CTX_remove_session | ||
| 37 | removes the session | ||
| 38 | .Fa c | ||
| 39 | from the context | ||
| 40 | .Fa ctx . | ||
| 41 | .Xr SSL_SESSION_free 3 | ||
| 42 | is called once for | ||
| 43 | .Fa c . | ||
| 44 | .Pp | ||
| 45 | .Fn SSL_add_session | ||
| 46 | and | ||
| 47 | .Fn SSL_remove_session | ||
| 48 | are synonyms for their | ||
| 49 | .Fn SSL_CTX_* | ||
| 50 | counterparts. | ||
| 51 | .Sh NOTES | ||
| 52 | When adding a new session to the internal session cache, it is examined | ||
| 53 | whether a session with the same session id already exists. | ||
| 54 | In this case it is assumed that both sessions are identical. | ||
| 55 | If the same session is stored in a different | ||
| 56 | .Vt SSL_SESSION | ||
| 57 | object, the old session is removed and replaced by the new session. | ||
| 58 | If the session is actually identical (the | ||
| 59 | .Vt SSL_SESSION | ||
| 60 | object is identical), | ||
| 61 | .Fn SSL_CTX_add_session | ||
| 62 | is a no-op, and the return value is 0. | ||
| 63 | .Pp | ||
| 64 | If a server | ||
| 65 | .Vt SSL_CTX | ||
| 66 | is configured with the | ||
| 67 | .Dv SSL_SESS_CACHE_NO_INTERNAL_STORE | ||
| 68 | flag then the internal cache will not be populated automatically by new | ||
| 69 | sessions negotiated by the SSL/TLS implementation, even though the internal | ||
| 70 | cache will be searched automatically for session-resume requests (the | ||
| 71 | latter can be suppressed by | ||
| 72 | .Dv SSL_SESS_CACHE_NO_INTERNAL_LOOKUP ) . | ||
| 73 | So the application can use | ||
| 74 | .Fn SSL_CTX_add_session | ||
| 75 | directly to have full control over the sessions that can be resumed if desired. | ||
| 76 | .Sh RETURN VALUES | ||
| 77 | The following values are returned by all functions: | ||
| 78 | .Bl -tag -width Ds | ||
| 79 | .It 0 | ||
| 80 | The operation failed. | ||
| 81 | In case of the add operation, it was tried to add the same (identical) session | ||
| 82 | twice. | ||
| 83 | In case of the remove operation, the session was not found in the cache. | ||
| 84 | .It 1 | ||
| 85 | The operation succeeded. | ||
| 86 | .El | ||
| 87 | .Sh SEE ALSO | ||
| 88 | .Xr ssl 3 , | ||
| 89 | .Xr SSL_CTX_set_session_cache_mode 3 , | ||
| 90 | .Xr SSL_SESSION_free 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_ctrl.3 b/src/lib/libssl/doc/SSL_CTX_ctrl.3 deleted file mode 100644 index a016845585..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_ctrl.3 +++ /dev/null | |||
| @@ -1,49 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_ctrl.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_CTRL 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_ctrl , | ||
| 9 | .Nm SSL_CTX_callback_ctrl , | ||
| 10 | .Nm SSL_ctrl , | ||
| 11 | .Nm SSL_callback_ctrl | ||
| 12 | .Nd internal handling functions for SSL_CTX and SSL objects | ||
| 13 | .Sh SYNOPSIS | ||
| 14 | .In openssl/ssl.h | ||
| 15 | .Ft long | ||
| 16 | .Fn SSL_CTX_ctrl "SSL_CTX *ctx" "int cmd" "long larg" "void *parg" | ||
| 17 | .Ft long | ||
| 18 | .Fn SSL_CTX_callback_ctrl "SSL_CTX *" "int cmd" "void (*fp)()" | ||
| 19 | .Ft long | ||
| 20 | .Fn SSL_ctrl "SSL *ssl" "int cmd" "long larg" "void *parg" | ||
| 21 | .Ft long | ||
| 22 | .Fn SSL_callback_ctrl "SSL *" "int cmd" "void (*fp)()" | ||
| 23 | .Sh DESCRIPTION | ||
| 24 | The | ||
| 25 | .Fn SSL_*_ctrl | ||
| 26 | family of functions is used to manipulate settings of | ||
| 27 | the | ||
| 28 | .Vt SSL_CTX | ||
| 29 | and | ||
| 30 | .Vt SSL | ||
| 31 | objects. | ||
| 32 | Depending on the command | ||
| 33 | .Fa cmd | ||
| 34 | the arguments | ||
| 35 | .Fa larg , | ||
| 36 | .Fa parg , | ||
| 37 | or | ||
| 38 | .Fa fp | ||
| 39 | are evaluated. | ||
| 40 | These functions should never be called directly. | ||
| 41 | All functionalities needed are made available via other functions or macros. | ||
| 42 | .Sh RETURN VALUES | ||
| 43 | The return values of the | ||
| 44 | .Fn SSL*_ctrl | ||
| 45 | functions depend on the command supplied via the | ||
| 46 | .Fn cmd | ||
| 47 | parameter. | ||
| 48 | .Sh SEE ALSO | ||
| 49 | .Xr ssl 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_flush_sessions.3 b/src/lib/libssl/doc/SSL_CTX_flush_sessions.3 deleted file mode 100644 index 9d3c52cdd5..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_flush_sessions.3 +++ /dev/null | |||
| @@ -1,57 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_flush_sessions.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_FLUSH_SESSIONS 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_flush_sessions , | ||
| 9 | .Nm SSL_flush_sessions | ||
| 10 | .Nd remove expired sessions | ||
| 11 | .Sh SYNOPSIS | ||
| 12 | .In openssl/ssl.h | ||
| 13 | .Ft void | ||
| 14 | .Fn SSL_CTX_flush_sessions "SSL_CTX *ctx" "long tm" | ||
| 15 | .Ft void | ||
| 16 | .Fn SSL_flush_sessions "SSL_CTX *ctx" "long tm" | ||
| 17 | .Sh DESCRIPTION | ||
| 18 | .Fn SSL_CTX_flush_sessions | ||
| 19 | causes a run through the session cache of | ||
| 20 | .Fa ctx | ||
| 21 | to remove sessions expired at time | ||
| 22 | .Fa tm . | ||
| 23 | .Pp | ||
| 24 | .Fn SSL_flush_sessions | ||
| 25 | is a synonym for | ||
| 26 | .Fn SSL_CTX_flush_sessions . | ||
| 27 | .Sh NOTES | ||
| 28 | If enabled, the internal session cache will collect all sessions established | ||
| 29 | up to the specified maximum number (see | ||
| 30 | .Fn SSL_CTX_sess_set_cache_size ) . | ||
| 31 | As sessions will not be reused ones they are expired, they should be | ||
| 32 | removed from the cache to save resources. | ||
| 33 | This can either be done automatically whenever 255 new sessions were | ||
| 34 | established (see | ||
| 35 | .Xr SSL_CTX_set_session_cache_mode 3 ) | ||
| 36 | or manually by calling | ||
| 37 | .Fn SSL_CTX_flush_sessions . | ||
| 38 | .Pp | ||
| 39 | The parameter | ||
| 40 | .Fa tm | ||
| 41 | specifies the time which should be used for the | ||
| 42 | expiration test, in most cases the actual time given by | ||
| 43 | .Fn time 0 | ||
| 44 | will be used. | ||
| 45 | .Pp | ||
| 46 | .Fn SSL_CTX_flush_sessions | ||
| 47 | will only check sessions stored in the internal cache. | ||
| 48 | When a session is found and removed, the | ||
| 49 | .Va remove_session_cb | ||
| 50 | is however called to synchronize with the external cache (see | ||
| 51 | .Xr SSL_CTX_sess_set_get_cb 3 ) . | ||
| 52 | .Sh RETURN VALUES | ||
| 53 | .Sh SEE ALSO | ||
| 54 | .Xr ssl 3 , | ||
| 55 | .Xr SSL_CTX_sess_set_get_cb 3 , | ||
| 56 | .Xr SSL_CTX_set_session_cache_mode 3 , | ||
| 57 | .Xr SSL_CTX_set_timeout 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_free.3 b/src/lib/libssl/doc/SSL_CTX_free.3 deleted file mode 100644 index 0b2f7a8247..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_free.3 +++ /dev/null | |||
| @@ -1,48 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_free.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_FREE 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_free | ||
| 9 | .Nd free an allocated SSL_CTX object | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft void | ||
| 13 | .Fn SSL_CTX_free "SSL_CTX *ctx" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_CTX_free | ||
| 16 | decrements the reference count of | ||
| 17 | .Fa ctx , | ||
| 18 | and removes the | ||
| 19 | .Vt SSL_CTX | ||
| 20 | object pointed to by | ||
| 21 | .Fa ctx | ||
| 22 | and frees up the allocated memory if the reference count has reached 0. | ||
| 23 | .Pp | ||
| 24 | It also calls the | ||
| 25 | .Xr free 3 Ns ing | ||
| 26 | procedures for indirectly affected items, if applicable: | ||
| 27 | the session cache, the list of ciphers, the list of Client CAs, | ||
| 28 | the certificates and keys. | ||
| 29 | .Sh WARNINGS | ||
| 30 | If a session-remove callback is set | ||
| 31 | .Pq Xr SSL_CTX_sess_set_remove_cb 3 , | ||
| 32 | this callback will be called for each session being freed from | ||
| 33 | .Fa ctx Ns 's | ||
| 34 | session cache. | ||
| 35 | This implies that all corresponding sessions from an external session cache are | ||
| 36 | removed as well. | ||
| 37 | If this is not desired, the user should explicitly unset the callback by | ||
| 38 | calling | ||
| 39 | .Fn SSL_CTX_sess_set_remove_cb ctx NULL | ||
| 40 | prior to calling | ||
| 41 | .Fn SSL_CTX_free . | ||
| 42 | .Sh RETURN VALUES | ||
| 43 | .Fn SSL_CTX_free | ||
| 44 | does not provide diagnostic information. | ||
| 45 | .Sh SEE ALSO | ||
| 46 | .Xr ssl 3 , | ||
| 47 | .Xr SSL_CTX_new 3 , | ||
| 48 | .Xr SSL_CTX_sess_set_get_cb 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_get_ex_new_index.3 b/src/lib/libssl/doc/SSL_CTX_get_ex_new_index.3 deleted file mode 100644 index 72bbb608fa..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_get_ex_new_index.3 +++ /dev/null | |||
| @@ -1,70 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_get_ex_new_index.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_GET_EX_NEW_INDEX 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_get_ex_new_index , | ||
| 9 | .Nm SSL_CTX_set_ex_data , | ||
| 10 | .Nm SSL_CTX_get_ex_data | ||
| 11 | .Nd internal application specific data functions | ||
| 12 | .Sh SYNOPSIS | ||
| 13 | .In openssl/ssl.h | ||
| 14 | .Ft int | ||
| 15 | .Fo SSL_CTX_get_ex_new_index | ||
| 16 | .Fa long argl | ||
| 17 | .Fa void *argp | ||
| 18 | .Fa CRYPTO_EX_new *new_func | ||
| 19 | .Fa CRYPTO_EX_dup *dup_func | ||
| 20 | .Fa CRYPTO_EX_free *free_func | ||
| 21 | .Fc | ||
| 22 | .Ft int | ||
| 23 | .Fn SSL_CTX_set_ex_data "SSL_CTX *ctx" "int idx" "void *arg" | ||
| 24 | .Ft void * | ||
| 25 | .Fn SSL_CTX_get_ex_data "const SSL_CTX *ctx" "int idx" | ||
| 26 | .Bd -literal | ||
| 27 | typedef int new_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad, | ||
| 28 | int idx, long argl, void *argp); | ||
| 29 | typedef void free_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad, | ||
| 30 | int idx, long argl, void *argp); | ||
| 31 | typedef int dup_func(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d, | ||
| 32 | int idx, long argl, void *argp); | ||
| 33 | .Ed | ||
| 34 | .Sh DESCRIPTION | ||
| 35 | Several OpenSSL structures can have application specific data attached to them. | ||
| 36 | These functions are used internally by OpenSSL to manipulate application | ||
| 37 | specific data attached to a specific structure. | ||
| 38 | .Pp | ||
| 39 | .Fn SSL_CTX_get_ex_new_index | ||
| 40 | is used to register a new index for application specific data. | ||
| 41 | .Pp | ||
| 42 | .Fn SSL_CTX_set_ex_data | ||
| 43 | is used to store application data at | ||
| 44 | .Fa arg | ||
| 45 | for | ||
| 46 | .Fa idx | ||
| 47 | into the | ||
| 48 | .Fa ctx | ||
| 49 | object. | ||
| 50 | .Pp | ||
| 51 | .Fn SSL_CTX_get_ex_data | ||
| 52 | is used to retrieve the information for | ||
| 53 | .Fa idx | ||
| 54 | from | ||
| 55 | .Fa ctx . | ||
| 56 | .Pp | ||
| 57 | A detailed description for the | ||
| 58 | .Fn *_get_ex_new_index | ||
| 59 | functionality can be found in | ||
| 60 | .Xr RSA_get_ex_new_index 3 . | ||
| 61 | The | ||
| 62 | .Fn *_get_ex_data | ||
| 63 | and | ||
| 64 | .Fn *_set_ex_data | ||
| 65 | functionality is described in | ||
| 66 | .Xr CRYPTO_set_ex_data 3 . | ||
| 67 | .Sh SEE ALSO | ||
| 68 | .Xr CRYPTO_set_ex_data 3 , | ||
| 69 | .Xr RSA_get_ex_new_index 3 , | ||
| 70 | .Xr ssl 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_get_verify_mode.3 b/src/lib/libssl/doc/SSL_CTX_get_verify_mode.3 deleted file mode 100644 index 12e21db6a3..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_get_verify_mode.3 +++ /dev/null | |||
| @@ -1,73 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_get_verify_mode.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_GET_VERIFY_MODE 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_get_verify_mode , | ||
| 9 | .Nm SSL_get_verify_mode , | ||
| 10 | .Nm SSL_CTX_get_verify_depth , | ||
| 11 | .Nm SSL_get_verify_depth , | ||
| 12 | .Nm SSL_get_verify_callback , | ||
| 13 | .Nm SSL_CTX_get_verify_callback | ||
| 14 | .Nd get currently set verification parameters | ||
| 15 | .Sh SYNOPSIS | ||
| 16 | .In openssl/ssl.h | ||
| 17 | .Ft int | ||
| 18 | .Fn SSL_CTX_get_verify_mode "const SSL_CTX *ctx" | ||
| 19 | .Ft int | ||
| 20 | .Fn SSL_get_verify_mode "const SSL *ssl" | ||
| 21 | .Ft int | ||
| 22 | .Fn SSL_CTX_get_verify_depth "const SSL_CTX *ctx" | ||
| 23 | .Ft int | ||
| 24 | .Fn SSL_get_verify_depth "const SSL *ssl" | ||
| 25 | .Ft int | ||
| 26 | .Fo "(*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))" | ||
| 27 | .Fa int "X509_STORE_CTX *" | ||
| 28 | .Fc | ||
| 29 | .Ft int | ||
| 30 | .Fo "(*SSL_get_verify_callback(const SSL *ssl))" | ||
| 31 | .Fa int "X509_STORE_CTX *" | ||
| 32 | .Fc | ||
| 33 | .Sh DESCRIPTION | ||
| 34 | .Fn SSL_CTX_get_verify_mode | ||
| 35 | returns the verification mode currently set in | ||
| 36 | .Fa ctx . | ||
| 37 | .Pp | ||
| 38 | .Fn SSL_get_verify_mode | ||
| 39 | returns the verification mode currently set in | ||
| 40 | .Fa ssl . | ||
| 41 | .Pp | ||
| 42 | .Fn SSL_CTX_get_verify_depth | ||
| 43 | returns the verification depth limit currently set | ||
| 44 | in | ||
| 45 | .Fa ctx . | ||
| 46 | If no limit has been explicitly set, | ||
| 47 | \(mi1 is returned and the default value will be used. | ||
| 48 | .Pp | ||
| 49 | .Fn SSL_get_verify_depth | ||
| 50 | returns the verification depth limit currently set in | ||
| 51 | .Fa ssl . | ||
| 52 | If no limit has been explicitly set, | ||
| 53 | \(mi1 is returned and the default value will be used. | ||
| 54 | .Pp | ||
| 55 | .Fn SSL_CTX_get_verify_callback | ||
| 56 | returns a function pointer to the verification callback currently set in | ||
| 57 | .Fa ctx . | ||
| 58 | If no callback was explicitly set, the | ||
| 59 | .Dv NULL | ||
| 60 | pointer is returned and the default callback will be used. | ||
| 61 | .Pp | ||
| 62 | .Fn SSL_get_verify_callback | ||
| 63 | returns a function pointer to the verification callback currently set in | ||
| 64 | .Fa ssl . | ||
| 65 | If no callback was explicitly set, the | ||
| 66 | .Dv NULL | ||
| 67 | pointer is returned and the default callback will be used. | ||
| 68 | .Sh RETURN VALUES | ||
| 69 | See | ||
| 70 | .Sx DESCRIPTION | ||
| 71 | .Sh SEE ALSO | ||
| 72 | .Xr ssl 3 , | ||
| 73 | .Xr SSL_CTX_set_verify 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_load_verify_locations.3 b/src/lib/libssl/doc/SSL_CTX_load_verify_locations.3 deleted file mode 100644 index 09884db5da..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_load_verify_locations.3 +++ /dev/null | |||
| @@ -1,161 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_load_verify_locations.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_LOAD_VERIFY_LOCATIONS 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_load_verify_locations | ||
| 9 | .Nd set default locations for trusted CA certificates | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft int | ||
| 13 | .Fo SSL_CTX_load_verify_locations | ||
| 14 | .Fa "SSL_CTX *ctx" "const char *CAfile" "const char *CApath" | ||
| 15 | .Fc | ||
| 16 | .Sh DESCRIPTION | ||
| 17 | .Fn SSL_CTX_load_verify_locations | ||
| 18 | specifies the locations for | ||
| 19 | .Fa ctx , | ||
| 20 | at which CA certificates for verification purposes are located. | ||
| 21 | The certificates available via | ||
| 22 | .Fa CAfile | ||
| 23 | and | ||
| 24 | .Fa CApath | ||
| 25 | are trusted. | ||
| 26 | .Sh NOTES | ||
| 27 | If | ||
| 28 | .Fa CAfile | ||
| 29 | is not | ||
| 30 | .Dv NULL , | ||
| 31 | it points to a file of CA certificates in PEM format. | ||
| 32 | The file can contain several CA certificates identified by sequences of: | ||
| 33 | .Bd -literal | ||
| 34 | -----BEGIN CERTIFICATE----- | ||
| 35 | ... (CA certificate in base64 encoding) ... | ||
| 36 | -----END CERTIFICATE----- | ||
| 37 | .Ed | ||
| 38 | Before, between, and after the certificates arbitrary text is allowed which can | ||
| 39 | be used, e.g., for descriptions of the certificates. | ||
| 40 | .Pp | ||
| 41 | The | ||
| 42 | .Fa CAfile | ||
| 43 | is processed on execution of the | ||
| 44 | .Fn SSL_CTX_load_verify_locations | ||
| 45 | function. | ||
| 46 | .Pp | ||
| 47 | If | ||
| 48 | .Fa CApath | ||
| 49 | is not NULL, it points to a directory containing CA certificates in PEM format. | ||
| 50 | The files each contain one CA certificate. | ||
| 51 | The files are looked up by the CA subject name hash value, | ||
| 52 | which must hence be available. | ||
| 53 | If more than one CA certificate with the same name hash value exist, | ||
| 54 | the extension must be different (e.g., | ||
| 55 | .Pa 9d66eef0.0 , | ||
| 56 | .Pa 9d66eef0.1 , | ||
| 57 | etc.). | ||
| 58 | The search is performed in the ordering of the extension number, | ||
| 59 | regardless of other properties of the certificates. | ||
| 60 | .Pp | ||
| 61 | The certificates in | ||
| 62 | .Fa CApath | ||
| 63 | are only looked up when required, e.g., when building the certificate chain or | ||
| 64 | when actually performing the verification of a peer certificate. | ||
| 65 | .Pp | ||
| 66 | When looking up CA certificates, the OpenSSL library will first search the | ||
| 67 | certificates in | ||
| 68 | .Fa CAfile , | ||
| 69 | then those in | ||
| 70 | .Fa CApath . | ||
| 71 | Certificate matching is done based on the subject name, the key identifier (if | ||
| 72 | present), and the serial number as taken from the certificate to be verified. | ||
| 73 | If these data do not match, the next certificate will be tried. | ||
| 74 | If a first certificate matching the parameters is found, | ||
| 75 | the verification process will be performed; | ||
| 76 | no other certificates for the same parameters will be searched in case of | ||
| 77 | failure. | ||
| 78 | .Pp | ||
| 79 | In server mode, when requesting a client certificate, the server must send | ||
| 80 | the list of CAs of which it will accept client certificates. | ||
| 81 | This list is not influenced by the contents of | ||
| 82 | .Fa CAfile | ||
| 83 | or | ||
| 84 | .Fa CApath | ||
| 85 | and must explicitly be set using the | ||
| 86 | .Xr SSL_CTX_set_client_CA_list 3 | ||
| 87 | family of functions. | ||
| 88 | .Pp | ||
| 89 | When building its own certificate chain, an OpenSSL client/server will try to | ||
| 90 | fill in missing certificates from | ||
| 91 | .Fa CAfile Ns / Fa CApath , | ||
| 92 | if the | ||
| 93 | certificate chain was not explicitly specified (see | ||
| 94 | .Xr SSL_CTX_add_extra_chain_cert 3 | ||
| 95 | and | ||
| 96 | .Xr SSL_CTX_use_certificate 3 ) . | ||
| 97 | .Sh WARNINGS | ||
| 98 | If several CA certificates matching the name, key identifier, and serial | ||
| 99 | number condition are available, only the first one will be examined. | ||
| 100 | This may lead to unexpected results if the same CA certificate is available | ||
| 101 | with different expiration dates. | ||
| 102 | If a | ||
| 103 | .Dq certificate expired | ||
| 104 | verification error occurs, no other certificate will be searched. | ||
| 105 | Make sure to not have expired certificates mixed with valid ones. | ||
| 106 | .Sh RETURN VALUES | ||
| 107 | The following return values can occur: | ||
| 108 | .Bl -tag -width Ds | ||
| 109 | .It 0 | ||
| 110 | The operation failed because | ||
| 111 | .Fa CAfile | ||
| 112 | and | ||
| 113 | .Fa CApath | ||
| 114 | are | ||
| 115 | .Dv NULL | ||
| 116 | or the processing at one of the locations specified failed. | ||
| 117 | Check the error stack to find out the reason. | ||
| 118 | .It 1 | ||
| 119 | The operation succeeded. | ||
| 120 | .El | ||
| 121 | .Sh EXAMPLES | ||
| 122 | Generate a CA certificate file with descriptive text from the CA certificates | ||
| 123 | .Pa ca1.pem | ||
| 124 | .Pa ca2.pem | ||
| 125 | .Pa ca3.pem : | ||
| 126 | .Bd -literal | ||
| 127 | #!/bin/sh | ||
| 128 | rm CAfile.pem | ||
| 129 | for i in ca1.pem ca2.pem ca3.pem; do | ||
| 130 | openssl x509 -in $i -text >> CAfile.pem | ||
| 131 | done | ||
| 132 | .Ed | ||
| 133 | .Pp | ||
| 134 | Prepare the directory /some/where/certs containing several CA certificates | ||
| 135 | for use as | ||
| 136 | .Fa CApath : | ||
| 137 | .Bd -literal | ||
| 138 | $ cd /some/where/certs | ||
| 139 | $ rm -f *.[0-9]* *.r[0-9]* | ||
| 140 | $ for c in *.pem; do | ||
| 141 | > [ "$c" = "*.pem" ] && continue | ||
| 142 | > hash=$(openssl x509 -noout -hash -in "$c") | ||
| 143 | > if egrep -q -- '-BEGIN( X509 | TRUSTED | )CERTIFICATE-' "$c"; then | ||
| 144 | > suf=0 | ||
| 145 | > while [ -e $hash.$suf ]; do suf=$(( $suf + 1 )); done | ||
| 146 | > ln -s "$c" $hash.$suf | ||
| 147 | > fi | ||
| 148 | > if egrep -q -- '-BEGIN X509 CRL-' "$c"; then | ||
| 149 | > suf=0 | ||
| 150 | > while [ -e $hash.r$suf ]; do suf=$(( $suf + 1 )); done | ||
| 151 | > ln -s "$c" $hash.r$suf | ||
| 152 | > fi | ||
| 153 | > done | ||
| 154 | .Ed | ||
| 155 | .Sh SEE ALSO | ||
| 156 | .Xr ssl 3 , | ||
| 157 | .Xr SSL_CTX_add_extra_chain_cert 3 , | ||
| 158 | .Xr SSL_CTX_set_cert_store 3 , | ||
| 159 | .Xr SSL_CTX_set_client_CA_list 3 , | ||
| 160 | .Xr SSL_CTX_use_certificate 3 , | ||
| 161 | .Xr SSL_get_client_CA_list 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_new.3 b/src/lib/libssl/doc/SSL_CTX_new.3 deleted file mode 100644 index d2c2b03452..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_new.3 +++ /dev/null | |||
| @@ -1,111 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_new.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_NEW 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_new , | ||
| 9 | .Nm SSLv3_method , | ||
| 10 | .Nm SSLv3_server_method , | ||
| 11 | .Nm SSLv3_client_method , | ||
| 12 | .Nm TLSv1_method , | ||
| 13 | .Nm TLSv1_server_method , | ||
| 14 | .Nm TLSv1_client_method , | ||
| 15 | .Nm TLSv1_1_method , | ||
| 16 | .Nm TLSv1_1_server_method , | ||
| 17 | .Nm TLSv1_1_client_method , | ||
| 18 | .Nm SSLv23_method , | ||
| 19 | .Nm SSLv23_server_method , | ||
| 20 | .Nm SSLv23_client_method | ||
| 21 | .Nd create a new SSL_CTX object as framework for TLS/SSL enabled functions | ||
| 22 | .Sh SYNOPSIS | ||
| 23 | .In openssl/ssl.h | ||
| 24 | .Ft SSL_CTX * | ||
| 25 | .Fn SSL_CTX_new "const SSL_METHOD *method" | ||
| 26 | .Sh DESCRIPTION | ||
| 27 | .Fn SSL_CTX_new | ||
| 28 | creates a new | ||
| 29 | .Vt SSL_CTX | ||
| 30 | object as framework to establish TLS/SSL enabled connections. | ||
| 31 | .Sh NOTES | ||
| 32 | The | ||
| 33 | .Vt SSL_CTX | ||
| 34 | object uses | ||
| 35 | .Fa method | ||
| 36 | as its connection method. | ||
| 37 | The methods exist in a generic type (for client and server use), | ||
| 38 | a server only type, and a client only type. | ||
| 39 | .Fa method | ||
| 40 | can be of the following types: | ||
| 41 | .Bl -tag -width Ds | ||
| 42 | .It Fn SSLv3_method void , Fn SSLv3_server_method void , \ | ||
| 43 | Fn SSLv3_client_method void | ||
| 44 | A TLS/SSL connection established with these methods will only understand the | ||
| 45 | SSLv3 protocol. | ||
| 46 | A client will send out SSLv3 client hello messages and will indicate that it | ||
| 47 | only understands SSLv3. | ||
| 48 | A server will only understand SSLv3 client hello messages. | ||
| 49 | Importantly, this means that it will not understand SSLv2 client hello messages | ||
| 50 | which are widely used for compatibility reasons; see | ||
| 51 | .Fn SSLv23_*_method . | ||
| 52 | .It Fn TLSv1_method void , Fn TLSv1_server_method void , \ | ||
| 53 | Fn TLSv1_client_method void | ||
| 54 | A TLS/SSL connection established with these methods will only understand the | ||
| 55 | TLSv1 protocol. | ||
| 56 | A client will send out TLSv1 client hello messages and will indicate that it | ||
| 57 | only understands TLSv1. | ||
| 58 | A server will only understand TLSv1 client hello messages. | ||
| 59 | Importantly, this means that it will not understand SSLv2 client hello messages | ||
| 60 | which are widely used for compatibility reasons; see | ||
| 61 | .Fn SSLv23_*_method . | ||
| 62 | It will also not understand SSLv3 client hello messages. | ||
| 63 | .It Fn SSLv23_method void , Fn SSLv23_server_method void , \ | ||
| 64 | Fn SSLv23_client_method void | ||
| 65 | A TLS/SSL connection established with these methods may understand the SSLv3, | ||
| 66 | TLSv1, TLSv1.1 and TLSv1.2 protocols. | ||
| 67 | .Pp | ||
| 68 | A client will send out TLSv1 client hello messages including extensions and | ||
| 69 | will indicate that it also understands TLSv1.1, TLSv1.2 and permits a fallback | ||
| 70 | to SSLv3. | ||
| 71 | A server will support SSLv3, TLSv1, TLSv1.1 and TLSv1.2 protocols. | ||
| 72 | This is the best choice when compatibility is a concern. | ||
| 73 | .El | ||
| 74 | .Pp | ||
| 75 | The list of protocols available can later be limited using the | ||
| 76 | .Dv SSL_OP_NO_SSLv3 , | ||
| 77 | .Dv SSL_OP_NO_TLSv1 , | ||
| 78 | .Dv SSL_OP_NO_TLSv1_1 , | ||
| 79 | and | ||
| 80 | .Dv SSL_OP_NO_TLSv1_2 | ||
| 81 | options of the | ||
| 82 | .Fn SSL_CTX_set_options | ||
| 83 | or | ||
| 84 | .Fn SSL_set_options | ||
| 85 | functions. | ||
| 86 | Using these options it is possible to choose, for example, | ||
| 87 | .Fn SSLv23_server_method | ||
| 88 | and be able to negotiate with all possible clients, | ||
| 89 | but to only allow newer protocols like TLSv1, TLSv1.1 or TLS v1.2. | ||
| 90 | .Pp | ||
| 91 | .Fn SSL_CTX_new | ||
| 92 | initializes the list of ciphers, the session cache setting, the callbacks, | ||
| 93 | the keys and certificates, and the options to its default values. | ||
| 94 | .Sh RETURN VALUES | ||
| 95 | The following return values can occur: | ||
| 96 | .Bl -tag -width Ds | ||
| 97 | .It Dv NULL | ||
| 98 | The creation of a new | ||
| 99 | .Vt SSL_CTX | ||
| 100 | object failed. | ||
| 101 | Check the error stack to find out the reason. | ||
| 102 | .It Pointer to an SSL_CTX object | ||
| 103 | The return value points to an allocated | ||
| 104 | .Vt SSL_CTX | ||
| 105 | object. | ||
| 106 | .El | ||
| 107 | .Sh SEE ALSO | ||
| 108 | .Xr ssl 3 , | ||
| 109 | .Xr SSL_accept 3 , | ||
| 110 | .Xr SSL_CTX_free 3 , | ||
| 111 | .Xr SSL_set_connect_state 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_sess_number.3 b/src/lib/libssl/doc/SSL_CTX_sess_number.3 deleted file mode 100644 index f3af4eab07..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_sess_number.3 +++ /dev/null | |||
| @@ -1,104 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_sess_number.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SESS_NUMBER 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_sess_number , | ||
| 9 | .Nm SSL_CTX_sess_connect , | ||
| 10 | .Nm SSL_CTX_sess_connect_good , | ||
| 11 | .Nm SSL_CTX_sess_connect_renegotiate , | ||
| 12 | .Nm SSL_CTX_sess_accept , | ||
| 13 | .Nm SSL_CTX_sess_accept_good , | ||
| 14 | .Nm SSL_CTX_sess_accept_renegotiate , | ||
| 15 | .Nm SSL_CTX_sess_hits , | ||
| 16 | .Nm SSL_CTX_sess_cb_hits , | ||
| 17 | .Nm SSL_CTX_sess_misses , | ||
| 18 | .Nm SSL_CTX_sess_timeouts , | ||
| 19 | .Nm SSL_CTX_sess_cache_full | ||
| 20 | .Nd obtain session cache statistics | ||
| 21 | .Sh SYNOPSIS | ||
| 22 | .In openssl/ssl.h | ||
| 23 | .Ft long | ||
| 24 | .Fn SSL_CTX_sess_number "SSL_CTX *ctx" | ||
| 25 | .Ft long | ||
| 26 | .Fn SSL_CTX_sess_connect "SSL_CTX *ctx" | ||
| 27 | .Ft long | ||
| 28 | .Fn SSL_CTX_sess_connect_good "SSL_CTX *ctx" | ||
| 29 | .Ft long | ||
| 30 | .Fn SSL_CTX_sess_connect_renegotiate "SSL_CTX *ctx" | ||
| 31 | .Ft long | ||
| 32 | .Fn SSL_CTX_sess_accept "SSL_CTX *ctx" | ||
| 33 | .Ft long | ||
| 34 | .Fn SSL_CTX_sess_accept_good "SSL_CTX *ctx" | ||
| 35 | .Ft long | ||
| 36 | .Fn SSL_CTX_sess_accept_renegotiate "SSL_CTX *ctx" | ||
| 37 | .Ft long | ||
| 38 | .Fn SSL_CTX_sess_hits "SSL_CTX *ctx" | ||
| 39 | .Ft long | ||
| 40 | .Fn SSL_CTX_sess_cb_hits "SSL_CTX *ctx" | ||
| 41 | .Ft long | ||
| 42 | .Fn SSL_CTX_sess_misses "SSL_CTX *ctx" | ||
| 43 | .Ft long | ||
| 44 | .Fn SSL_CTX_sess_timeouts "SSL_CTX *ctx" | ||
| 45 | .Ft long | ||
| 46 | .Fn SSL_CTX_sess_cache_full "SSL_CTX *ctx" | ||
| 47 | .Sh DESCRIPTION | ||
| 48 | .Fn SSL_CTX_sess_number | ||
| 49 | returns the current number of sessions in the internal session cache. | ||
| 50 | .Pp | ||
| 51 | .Fn SSL_CTX_sess_connect | ||
| 52 | returns the number of started SSL/TLS handshakes in client mode. | ||
| 53 | .Pp | ||
| 54 | .Fn SSL_CTX_sess_connect_good | ||
| 55 | returns the number of successfully established SSL/TLS sessions in client mode. | ||
| 56 | .Pp | ||
| 57 | .Fn SSL_CTX_sess_connect_renegotiate | ||
| 58 | returns the number of start renegotiations in client mode. | ||
| 59 | .Pp | ||
| 60 | .Fn SSL_CTX_sess_accept | ||
| 61 | returns the number of started SSL/TLS handshakes in server mode. | ||
| 62 | .Pp | ||
| 63 | .Fn SSL_CTX_sess_accept_good | ||
| 64 | returns the number of successfully established SSL/TLS sessions in server mode. | ||
| 65 | .Pp | ||
| 66 | .Fn SSL_CTX_sess_accept_renegotiate | ||
| 67 | returns the number of start renegotiations in server mode. | ||
| 68 | .Pp | ||
| 69 | .Fn SSL_CTX_sess_hits | ||
| 70 | returns the number of successfully reused sessions. | ||
| 71 | In client mode a session set with | ||
| 72 | .Xr SSL_set_session 3 | ||
| 73 | successfully reused is counted as a hit. | ||
| 74 | In server mode a session successfully retrieved from internal or external cache | ||
| 75 | is counted as a hit. | ||
| 76 | .Pp | ||
| 77 | .Fn SSL_CTX_sess_cb_hits | ||
| 78 | returns the number of successfully retrieved sessions from the external session | ||
| 79 | cache in server mode. | ||
| 80 | .Pp | ||
| 81 | .Fn SSL_CTX_sess_misses | ||
| 82 | returns the number of sessions proposed by clients that were not found in the | ||
| 83 | internal session cache in server mode. | ||
| 84 | .Pp | ||
| 85 | .Fn SSL_CTX_sess_timeouts | ||
| 86 | returns the number of sessions proposed by clients and either found in the | ||
| 87 | internal or external session cache in server mode, | ||
| 88 | but that were invalid due to timeout. | ||
| 89 | These sessions are not included in the | ||
| 90 | .Fn SSL_CTX_sess_hits | ||
| 91 | count. | ||
| 92 | .Pp | ||
| 93 | .Fn SSL_CTX_sess_cache_full | ||
| 94 | returns the number of sessions that were removed because the maximum session | ||
| 95 | cache size was exceeded. | ||
| 96 | .Sh RETURN VALUES | ||
| 97 | The functions return the values indicated in the | ||
| 98 | .Sx DESCRIPTION | ||
| 99 | section. | ||
| 100 | .Sh SEE ALSO | ||
| 101 | .Xr ssl 3 , | ||
| 102 | .Xr SSL_CTX_sess_set_cache_size 3 , | ||
| 103 | .Xr SSL_CTX_set_session_cache_mode 3 , | ||
| 104 | .Xr SSL_set_session 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_sess_set_cache_size.3 b/src/lib/libssl/doc/SSL_CTX_sess_set_cache_size.3 deleted file mode 100644 index 89d02dd32b..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_sess_set_cache_size.3 +++ /dev/null | |||
| @@ -1,55 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_sess_set_cache_size.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SESS_SET_CACHE_SIZE 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_sess_set_cache_size , | ||
| 9 | .Nm SSL_CTX_sess_get_cache_size | ||
| 10 | .Nd manipulate session cache size | ||
| 11 | .Sh SYNOPSIS | ||
| 12 | .In openssl/ssl.h | ||
| 13 | .Ft long | ||
| 14 | .Fn SSL_CTX_sess_set_cache_size "SSL_CTX *ctx" "long t" | ||
| 15 | .Ft long | ||
| 16 | .Fn SSL_CTX_sess_get_cache_size "SSL_CTX *ctx" | ||
| 17 | .Sh DESCRIPTION | ||
| 18 | .Fn SSL_CTX_sess_set_cache_size | ||
| 19 | sets the size of the internal session cache of context | ||
| 20 | .Fa ctx | ||
| 21 | to | ||
| 22 | .Fa t . | ||
| 23 | .Pp | ||
| 24 | .Fn SSL_CTX_sess_get_cache_size | ||
| 25 | returns the currently valid session cache size. | ||
| 26 | .Sh NOTES | ||
| 27 | The internal session cache size is | ||
| 28 | .Dv SSL_SESSION_CACHE_MAX_SIZE_DEFAULT , | ||
| 29 | currently 1024\(mu20, so that up to 20000 sessions can be held. | ||
| 30 | This size can be modified using the | ||
| 31 | .Fn SSL_CTX_sess_set_cache_size | ||
| 32 | call. | ||
| 33 | A special case is the size 0, which is used for unlimited size. | ||
| 34 | .Pp | ||
| 35 | When the maximum number of sessions is reached, | ||
| 36 | no more new sessions are added to the cache. | ||
| 37 | New space may be added by calling | ||
| 38 | .Xr SSL_CTX_flush_sessions 3 | ||
| 39 | to remove expired sessions. | ||
| 40 | .Pp | ||
| 41 | If the size of the session cache is reduced and more sessions are already in | ||
| 42 | the session cache, | ||
| 43 | old session will be removed the next time a session shall be added. | ||
| 44 | This removal is not synchronized with the expiration of sessions. | ||
| 45 | .Sh RETURN VALUES | ||
| 46 | .Fn SSL_CTX_sess_set_cache_size | ||
| 47 | returns the previously valid size. | ||
| 48 | .Pp | ||
| 49 | .Fn SSL_CTX_sess_get_cache_size | ||
| 50 | returns the currently valid size. | ||
| 51 | .Sh SEE ALSO | ||
| 52 | .Xr ssl 3 , | ||
| 53 | .Xr SSL_CTX_flush_sessions 3 , | ||
| 54 | .Xr SSL_CTX_sess_number 3 , | ||
| 55 | .Xr SSL_CTX_set_session_cache_mode 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_sess_set_get_cb.3 b/src/lib/libssl/doc/SSL_CTX_sess_set_get_cb.3 deleted file mode 100644 index 7a372138c1..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_sess_set_get_cb.3 +++ /dev/null | |||
| @@ -1,159 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_sess_set_get_cb.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SESS_SET_GET_CB 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_sess_set_new_cb , | ||
| 9 | .Nm SSL_CTX_sess_set_remove_cb , | ||
| 10 | .Nm SSL_CTX_sess_set_get_cb , | ||
| 11 | .Nm SSL_CTX_sess_get_new_cb , | ||
| 12 | .Nm SSL_CTX_sess_get_remove_cb , | ||
| 13 | .Nm SSL_CTX_sess_get_get_cb | ||
| 14 | .Nd provide callback functions for server side external session caching | ||
| 15 | .Sh SYNOPSIS | ||
| 16 | .In openssl/ssl.h | ||
| 17 | .Ft void | ||
| 18 | .Fo SSL_CTX_sess_set_new_cb | ||
| 19 | .Fa "SSL_CTX *ctx" | ||
| 20 | .Fa "int (*new_session_cb)(SSL *, SSL_SESSION *)" | ||
| 21 | .Fc | ||
| 22 | .Ft void | ||
| 23 | .Fo SSL_CTX_sess_set_remove_cb | ||
| 24 | .Fa "SSL_CTX *ctx" | ||
| 25 | .Fa "void (*remove_session_cb)(SSL_CTX *ctx, SSL_SESSION *)" | ||
| 26 | .Fc | ||
| 27 | .Ft void | ||
| 28 | .Fo SSL_CTX_sess_set_get_cb | ||
| 29 | .Fa "SSL_CTX *ctx" | ||
| 30 | .Fa "SSL_SESSION (*get_session_cb)(SSL *, unsigned char *, int, int *)" | ||
| 31 | .Fc | ||
| 32 | .Ft int | ||
| 33 | .Fo "(*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx))" | ||
| 34 | .Fa "struct ssl_st *ssl" | ||
| 35 | .Fa "SSL_SESSION *sess" | ||
| 36 | .Fc | ||
| 37 | .Ft void | ||
| 38 | .Fo "(*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx))" | ||
| 39 | .Fa "struct ssl_ctx_st *ctx" | ||
| 40 | .Fa "SSL_SESSION *sess" | ||
| 41 | .Fc | ||
| 42 | .Ft SSL_SESSION * | ||
| 43 | .Fo "(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))" | ||
| 44 | .Fa "struct ssl_st *ssl" | ||
| 45 | .Fa "unsigned char *data" | ||
| 46 | .Fa "int len" | ||
| 47 | .Fa "int *copy" | ||
| 48 | .Fc | ||
| 49 | .Ft int | ||
| 50 | .Fo "(*new_session_cb)" | ||
| 51 | .Fa "struct ssl_st *ssl" | ||
| 52 | .Fa "SSL_SESSION *sess" | ||
| 53 | .Fc | ||
| 54 | .Ft void | ||
| 55 | .Fo "(*remove_session_cb)" | ||
| 56 | .Fa "struct ssl_ctx_st *ctx" | ||
| 57 | .Fa "SSL_SESSION *sess" | ||
| 58 | .Fc | ||
| 59 | .Ft SSL_SESSION * | ||
| 60 | .Fo "(*get_session_cb)" | ||
| 61 | .Fa "struct ssl_st *ssl" | ||
| 62 | .Fa "unsigned char *data" | ||
| 63 | .Fa "int len" | ||
| 64 | .Fa "int *copy" | ||
| 65 | .Fc | ||
| 66 | .Sh DESCRIPTION | ||
| 67 | .Fn SSL_CTX_sess_set_new_cb | ||
| 68 | sets the callback function which is automatically called whenever a new session | ||
| 69 | was negotiated. | ||
| 70 | .Pp | ||
| 71 | .Fn SSL_CTX_sess_set_remove_cb | ||
| 72 | sets the callback function which is automatically called whenever a session is | ||
| 73 | removed by the SSL engine (because it is considered faulty or the session has | ||
| 74 | become obsolete because of exceeding the timeout value). | ||
| 75 | .Pp | ||
| 76 | .Fn SSL_CTX_sess_set_get_cb | ||
| 77 | sets the callback function which is called whenever a SSL/TLS client proposes | ||
| 78 | to resume a session but the session cannot be found in the internal session | ||
| 79 | cache (see | ||
| 80 | .Xr SSL_CTX_set_session_cache_mode 3 ) . | ||
| 81 | (SSL/TLS server only.) | ||
| 82 | .Pp | ||
| 83 | .Fn SSL_CTX_sess_get_new_cb , | ||
| 84 | .Fn SSL_CTX_sess_get_remove_cb , | ||
| 85 | and | ||
| 86 | .Fn SSL_CTX_sess_get_get_cb | ||
| 87 | retrieve the function pointers of the provided callback functions. | ||
| 88 | If a callback function has not been set, the | ||
| 89 | .Dv NULL | ||
| 90 | pointer is returned. | ||
| 91 | .Sh NOTES | ||
| 92 | In order to allow external session caching, synchronization with the internal | ||
| 93 | session cache is realized via callback functions. | ||
| 94 | Inside these callback functions, session can be saved to disk or put into a | ||
| 95 | database using the | ||
| 96 | .Xr d2i_SSL_SESSION 3 | ||
| 97 | interface. | ||
| 98 | .Pp | ||
| 99 | The | ||
| 100 | .Fn new_session_cb | ||
| 101 | function is called whenever a new session has been negotiated and session | ||
| 102 | caching is enabled (see | ||
| 103 | .Xr SSL_CTX_set_session_cache_mode 3 ) . | ||
| 104 | The | ||
| 105 | .Fn new_session_cb | ||
| 106 | is passed the | ||
| 107 | .Fa ssl | ||
| 108 | connection and the ssl session | ||
| 109 | .Fa sess . | ||
| 110 | If the callback returns 0, the session will be immediately removed again. | ||
| 111 | .Pp | ||
| 112 | The | ||
| 113 | .Fn remove_session_cb | ||
| 114 | is called whenever the SSL engine removes a session from the internal cache. | ||
| 115 | This happens when the session is removed because it is expired or when a | ||
| 116 | connection was not shut down cleanly. | ||
| 117 | It also happens for all sessions in the internal session cache when | ||
| 118 | .Xr SSL_CTX_free 3 | ||
| 119 | is called. | ||
| 120 | The | ||
| 121 | .Fn remove_session_cb | ||
| 122 | function is passed the | ||
| 123 | .Fa ctx | ||
| 124 | and the | ||
| 125 | .Vt ssl | ||
| 126 | session | ||
| 127 | .Fa sess . | ||
| 128 | It does not provide any feedback. | ||
| 129 | .Pp | ||
| 130 | The | ||
| 131 | .Fn get_session_cb | ||
| 132 | function is only called on SSL/TLS servers with the session id proposed by the | ||
| 133 | client. | ||
| 134 | The | ||
| 135 | .Fn get_session_cb | ||
| 136 | function is always called, also when session caching was disabled. | ||
| 137 | The | ||
| 138 | .Fn get_session_cb | ||
| 139 | is passed the | ||
| 140 | .Fa ssl | ||
| 141 | connection, the session id of length | ||
| 142 | .Fa length | ||
| 143 | at the memory location | ||
| 144 | .Fa data . | ||
| 145 | With the parameter | ||
| 146 | .Fa copy | ||
| 147 | the callback can require the SSL engine to increment the reference count of the | ||
| 148 | .Vt SSL_SESSION | ||
| 149 | object, | ||
| 150 | Normally the reference count is not incremented and therefore the session must | ||
| 151 | not be explicitly freed with | ||
| 152 | .Xr SSL_SESSION_free 3 . | ||
| 153 | .Sh SEE ALSO | ||
| 154 | .Xr d2i_SSL_SESSION 3 , | ||
| 155 | .Xr ssl 3 , | ||
| 156 | .Xr SSL_CTX_flush_sessions 3 , | ||
| 157 | .Xr SSL_CTX_free 3 , | ||
| 158 | .Xr SSL_CTX_set_session_cache_mode 3 , | ||
| 159 | .Xr SSL_SESSION_free 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_sessions.3 b/src/lib/libssl/doc/SSL_CTX_sessions.3 deleted file mode 100644 index 0d83711205..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_sessions.3 +++ /dev/null | |||
| @@ -1,34 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_sessions.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SESSIONS 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_sessions | ||
| 9 | .Nd access internal session cache | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft struct lhash_st * | ||
| 13 | .Fn SSL_CTX_sessions "SSL_CTX *ctx" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_CTX_sessions | ||
| 16 | returns a pointer to the lhash databases containing the internal session cache | ||
| 17 | for | ||
| 18 | .Fa ctx . | ||
| 19 | .Sh NOTES | ||
| 20 | The sessions in the internal session cache are kept in an | ||
| 21 | .Xr lhash 3 | ||
| 22 | type database. | ||
| 23 | It is possible to directly access this database, e.g., for searching. | ||
| 24 | In parallel, | ||
| 25 | the sessions form a linked list which is maintained separately from the | ||
| 26 | .Xr lhash 3 | ||
| 27 | operations, so that the database must not be modified directly but by using the | ||
| 28 | .Xr SSL_CTX_add_session 3 | ||
| 29 | family of functions. | ||
| 30 | .Sh SEE ALSO | ||
| 31 | .Xr lhash 3 , | ||
| 32 | .Xr ssl 3 , | ||
| 33 | .Xr SSL_CTX_add_session 3 , | ||
| 34 | .Xr SSL_CTX_set_session_cache_mode 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_cert_store.3 b/src/lib/libssl/doc/SSL_CTX_set_cert_store.3 deleted file mode 100644 index 8ef3c5561e..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_cert_store.3 +++ /dev/null | |||
| @@ -1,80 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_cert_store.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SET_CERT_STORE 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_cert_store , | ||
| 9 | .Nm SSL_CTX_get_cert_store | ||
| 10 | .Nd manipulate X509 certificate verification storage | ||
| 11 | .Sh SYNOPSIS | ||
| 12 | .In openssl/ssl.h | ||
| 13 | .Ft void | ||
| 14 | .Fn SSL_CTX_set_cert_store "SSL_CTX *ctx" "X509_STORE *store" | ||
| 15 | .Ft X509_STORE * | ||
| 16 | .Fn SSL_CTX_get_cert_store "const SSL_CTX *ctx" | ||
| 17 | .Sh DESCRIPTION | ||
| 18 | .Fn SSL_CTX_set_cert_store | ||
| 19 | setsthe verification storage of | ||
| 20 | .Fa ctx | ||
| 21 | to or replaces it with | ||
| 22 | .Fa store . | ||
| 23 | If another | ||
| 24 | .Vt X509_STORE | ||
| 25 | object is currently set in | ||
| 26 | .Fa ctx , | ||
| 27 | it will be | ||
| 28 | .Xr X509_STORE_free 3 Ns ed. | ||
| 29 | .Pp | ||
| 30 | .Fn SSL_CTX_get_cert_store | ||
| 31 | returns a pointer to the current certificate verification storage. | ||
| 32 | .Sh NOTES | ||
| 33 | In order to verify the certificates presented by the peer, trusted CA | ||
| 34 | certificates must be accessed. | ||
| 35 | These CA certificates are made available via lookup methods, handled inside the | ||
| 36 | .Vt X509_STORE . | ||
| 37 | From the | ||
| 38 | .Vt X509_STORE | ||
| 39 | the | ||
| 40 | .Vt X509_STORE_CTX | ||
| 41 | used when verifying certificates is created. | ||
| 42 | .Pp | ||
| 43 | Typically the trusted certificate store is handled indirectly via using | ||
| 44 | .Xr SSL_CTX_load_verify_locations 3 . | ||
| 45 | Using the | ||
| 46 | .Fn SSL_CTX_set_cert_store | ||
| 47 | and | ||
| 48 | .Fn SSL_CTX_get_cert_store | ||
| 49 | functions it is possible to manipulate the | ||
| 50 | .Vt X509_STORE | ||
| 51 | object beyond the | ||
| 52 | .Xr SSL_CTX_load_verify_locations 3 | ||
| 53 | call. | ||
| 54 | .Pp | ||
| 55 | Currently no detailed documentation on how to use the | ||
| 56 | .Vt X509_STORE | ||
| 57 | object is available. | ||
| 58 | Not all members of the | ||
| 59 | .Vt X509_STORE | ||
| 60 | are used when the verification takes place. | ||
| 61 | So will, for example, the | ||
| 62 | .Fn verify_callback | ||
| 63 | be overridden with the | ||
| 64 | .Fn verify_callback | ||
| 65 | set via the | ||
| 66 | .Xr SSL_CTX_set_verify 3 | ||
| 67 | family of functions. | ||
| 68 | This document must therefore be updated when documentation about the | ||
| 69 | .Vt X509_STORE | ||
| 70 | object and its handling becomes available. | ||
| 71 | .Sh RETURN VALUES | ||
| 72 | .Fn SSL_CTX_set_cert_store | ||
| 73 | does not return diagnostic output. | ||
| 74 | .Pp | ||
| 75 | .Fn SSL_CTX_get_cert_store | ||
| 76 | returns the current setting. | ||
| 77 | .Sh SEE ALSO | ||
| 78 | .Xr ssl 3 , | ||
| 79 | .Xr SSL_CTX_load_verify_locations 3 , | ||
| 80 | .Xr SSL_CTX_set_verify 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_cert_verify_callback.3 b/src/lib/libssl/doc/SSL_CTX_set_cert_verify_callback.3 deleted file mode 100644 index bb242d6929..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_cert_verify_callback.3 +++ /dev/null | |||
| @@ -1,112 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_cert_verify_callback.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SET_CERT_VERIFY_CALLBACK 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_cert_verify_callback | ||
| 9 | .Nd set peer certificate verification procedure | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft void | ||
| 13 | .Fo SSL_CTX_set_cert_verify_callback | ||
| 14 | .Fa "SSL_CTX *ctx" | ||
| 15 | .Fa "int (*callback)(X509_STORE_CTX *, void *)" | ||
| 16 | .Fa "void *arg" | ||
| 17 | .Fc | ||
| 18 | .Sh DESCRIPTION | ||
| 19 | .Fn SSL_CTX_set_cert_verify_callback | ||
| 20 | sets the verification callback function for | ||
| 21 | .Fa ctx . | ||
| 22 | .Vt SSL | ||
| 23 | objects that are created from | ||
| 24 | .Fa ctx | ||
| 25 | inherit the setting valid at the time when | ||
| 26 | .Xr SSL_new 3 | ||
| 27 | is called. | ||
| 28 | .Sh NOTES | ||
| 29 | Whenever a certificate is verified during a SSL/TLS handshake, | ||
| 30 | a verification function is called. | ||
| 31 | If the application does not explicitly specify a verification callback | ||
| 32 | function, the built-in verification function is used. | ||
| 33 | If a verification callback | ||
| 34 | .Fa callback | ||
| 35 | is specified via | ||
| 36 | .Fn SSL_CTX_set_cert_verify_callback , | ||
| 37 | the supplied callback function is called instead. | ||
| 38 | By setting | ||
| 39 | .Fa callback | ||
| 40 | to | ||
| 41 | .Dv NULL , | ||
| 42 | the default behaviour is restored. | ||
| 43 | .Pp | ||
| 44 | When the verification must be performed, | ||
| 45 | .Fa callback | ||
| 46 | will be called with the arguments | ||
| 47 | .Fn callback "X509_STORE_CTX *x509_store_ctx" "void *arg" . | ||
| 48 | The argument | ||
| 49 | .Fa arg | ||
| 50 | is specified by the application when setting | ||
| 51 | .Fa callback . | ||
| 52 | .Pp | ||
| 53 | .Fa callback | ||
| 54 | should return 1 to indicate verification success and 0 to indicate verification | ||
| 55 | failure. | ||
| 56 | If | ||
| 57 | .Dv SSL_VERIFY_PEER | ||
| 58 | is set and | ||
| 59 | .Fa callback | ||
| 60 | returns 0, the handshake will fail. | ||
| 61 | As the verification procedure may allow the connection to continue in case of | ||
| 62 | failure (by always returning 1) the verification result must be set in any case | ||
| 63 | using the | ||
| 64 | .Fa error | ||
| 65 | member of | ||
| 66 | .Fa x509_store_ctx | ||
| 67 | so that the calling application will be informed about the detailed result of | ||
| 68 | the verification procedure! | ||
| 69 | .Pp | ||
| 70 | Within | ||
| 71 | .Fa x509_store_ctx , | ||
| 72 | .Fa callback | ||
| 73 | has access to the | ||
| 74 | .Fa verify_callback | ||
| 75 | function set using | ||
| 76 | .Xr SSL_CTX_set_verify 3 . | ||
| 77 | .Sh WARNINGS | ||
| 78 | Do not mix the verification callback described in this function with the | ||
| 79 | .Fa verify_callback | ||
| 80 | function called during the verification process. | ||
| 81 | The latter is set using the | ||
| 82 | .Xr SSL_CTX_set_verify 3 | ||
| 83 | family of functions. | ||
| 84 | .Pp | ||
| 85 | Providing a complete verification procedure including certificate purpose | ||
| 86 | settings, etc., is a complex task. | ||
| 87 | The built-in procedure is quite powerful and in most cases it should be | ||
| 88 | sufficient to modify its behaviour using the | ||
| 89 | .Fa verify_callback | ||
| 90 | function. | ||
| 91 | .Sh RETURN VALUES | ||
| 92 | .Fn SSL_CTX_set_cert_verify_callback | ||
| 93 | does not provide diagnostic information. | ||
| 94 | .Sh SEE ALSO | ||
| 95 | .Xr ssl 3 , | ||
| 96 | .Xr SSL_CTX_load_verify_locations 3 , | ||
| 97 | .Xr SSL_CTX_set_verify 3 , | ||
| 98 | .Xr SSL_get_verify_result 3 | ||
| 99 | .Sh HISTORY | ||
| 100 | Previous to OpenSSL 0.9.7, the | ||
| 101 | .Fa arg | ||
| 102 | argument to | ||
| 103 | .Fn SSL_CTX_set_cert_verify_callback | ||
| 104 | was ignored, and | ||
| 105 | .Fa callback | ||
| 106 | was called | ||
| 107 | simply as | ||
| 108 | .Ft int | ||
| 109 | .Fn (*callback) "X509_STORE_CTX *" . | ||
| 110 | To compile software written for previous versions of OpenSSL, | ||
| 111 | a dummy argument will have to be added to | ||
| 112 | .Fa callback . | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_cipher_list.3 b/src/lib/libssl/doc/SSL_CTX_set_cipher_list.3 deleted file mode 100644 index e7ce24fb34..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_cipher_list.3 +++ /dev/null | |||
| @@ -1,82 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_cipher_list.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SET_CIPHER_LIST 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_cipher_list , | ||
| 9 | .Nm SSL_set_cipher_list | ||
| 10 | .Nd choose list of available SSL_CIPHERs | ||
| 11 | .Sh SYNOPSIS | ||
| 12 | .In openssl/ssl.h | ||
| 13 | .Ft int | ||
| 14 | .Fn SSL_CTX_set_cipher_list "SSL_CTX *ctx" "const char *str" | ||
| 15 | .Ft int | ||
| 16 | .Fn SSL_set_cipher_list "SSL *ssl" "const char *str" | ||
| 17 | .Sh DESCRIPTION | ||
| 18 | .Fn SSL_CTX_set_cipher_list | ||
| 19 | sets the list of available ciphers for | ||
| 20 | .Fa ctx | ||
| 21 | using the control string | ||
| 22 | .Fa str . | ||
| 23 | The format of the string is described | ||
| 24 | in | ||
| 25 | .Xr openssl 1 . | ||
| 26 | The list of ciphers is inherited by all | ||
| 27 | .Fa ssl | ||
| 28 | objects created from | ||
| 29 | .Fa ctx . | ||
| 30 | .Pp | ||
| 31 | .Fn SSL_set_cipher_list | ||
| 32 | sets the list of ciphers only for | ||
| 33 | .Fa ssl . | ||
| 34 | .Sh NOTES | ||
| 35 | The control string | ||
| 36 | .Fa str | ||
| 37 | should be universally usable and not depend on details of the library | ||
| 38 | configuration (ciphers compiled in). | ||
| 39 | Thus no syntax checking takes place. | ||
| 40 | Items that are not recognized, because the corresponding ciphers are not | ||
| 41 | compiled in or because they are mistyped, are simply ignored. | ||
| 42 | Failure is only flagged if no ciphers could be collected at all. | ||
| 43 | .Pp | ||
| 44 | It should be noted that inclusion of a cipher to be used into the list is a | ||
| 45 | necessary condition. | ||
| 46 | On the client side, the inclusion into the list is also sufficient. | ||
| 47 | On the server side, additional restrictions apply. | ||
| 48 | All ciphers have additional requirements. | ||
| 49 | ADH ciphers don't need a certificate, but DH-parameters must have been set. | ||
| 50 | All other ciphers need a corresponding certificate and key. | ||
| 51 | .Pp | ||
| 52 | A RSA cipher can only be chosen when a RSA certificate is available. | ||
| 53 | RSA export ciphers with a keylength of 512 bits for the RSA key require a | ||
| 54 | temporary 512 bit RSA key, as typically the supplied key has a length of 1024 | ||
| 55 | bits (see | ||
| 56 | .Xr SSL_CTX_set_tmp_rsa_callback 3 ) . | ||
| 57 | RSA ciphers using EDH need a certificate and key and additional DH-parameters | ||
| 58 | (see | ||
| 59 | .Xr SSL_CTX_set_tmp_dh_callback 3 ) . | ||
| 60 | .Pp | ||
| 61 | A DSA cipher can only be chosen when a DSA certificate is available. | ||
| 62 | DSA ciphers always use DH key exchange and therefore need DH-parameters (see | ||
| 63 | .Xr SSL_CTX_set_tmp_dh_callback 3 ) . | ||
| 64 | .Pp | ||
| 65 | When these conditions are not met for any cipher in the list (for example, a | ||
| 66 | client only supports export RSA ciphers with an asymmetric key length of 512 | ||
| 67 | bits and the server is not configured to use temporary RSA keys), the | ||
| 68 | .Dq no shared cipher | ||
| 69 | .Pq Dv SSL_R_NO_SHARED_CIPHER | ||
| 70 | error is generated and the handshake will fail. | ||
| 71 | .Sh RETURN VALUES | ||
| 72 | .Fn SSL_CTX_set_cipher_list | ||
| 73 | and | ||
| 74 | .Fn SSL_set_cipher_list | ||
| 75 | return 1 if any cipher could be selected and 0 on complete failure. | ||
| 76 | .Sh SEE ALSO | ||
| 77 | .Xr ciphers 1 , | ||
| 78 | .Xr ssl 3 , | ||
| 79 | .Xr SSL_CTX_set_tmp_dh_callback 3 , | ||
| 80 | .Xr SSL_CTX_set_tmp_rsa_callback 3 , | ||
| 81 | .Xr SSL_CTX_use_certificate 3 , | ||
| 82 | .Xr SSL_get_ciphers 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_client_CA_list.3 b/src/lib/libssl/doc/SSL_CTX_set_client_CA_list.3 deleted file mode 100644 index 688c4ac023..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_client_CA_list.3 +++ /dev/null | |||
| @@ -1,132 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_client_CA_list.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SET_CLIENT_CA_LIST 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_client_CA_list , | ||
| 9 | .Nm SSL_set_client_CA_list , | ||
| 10 | .Nm SSL_CTX_add_client_CA , | ||
| 11 | .Nm SSL_add_client_CA | ||
| 12 | .Nd set list of CAs sent to the client when requesting a client certificate | ||
| 13 | .Sh SYNOPSIS | ||
| 14 | .In openssl/ssl.h | ||
| 15 | .Ft void | ||
| 16 | .Fn SSL_CTX_set_client_CA_list "SSL_CTX *ctx" "STACK_OF(X509_NAME) *list" | ||
| 17 | .Ft void | ||
| 18 | .Fn SSL_set_client_CA_list "SSL *s" "STACK_OF(X509_NAME) *list" | ||
| 19 | .Ft int | ||
| 20 | .Fn SSL_CTX_add_client_CA "SSL_CTX *ctx" "X509 *cacert" | ||
| 21 | .Ft int | ||
| 22 | .Fn SSL_add_client_CA "SSL *ssl" "X509 *cacert" | ||
| 23 | .Sh DESCRIPTION | ||
| 24 | .Fn SSL_CTX_set_client_CA_list | ||
| 25 | sets the | ||
| 26 | .Fa list | ||
| 27 | of CAs sent to the client when requesting a client certificate for | ||
| 28 | .Fa ctx . | ||
| 29 | .Pp | ||
| 30 | .Fn SSL_set_client_CA_list | ||
| 31 | sets the | ||
| 32 | .Fa list | ||
| 33 | of CAs sent to the client when requesting a client certificate for the chosen | ||
| 34 | .Fa ssl , | ||
| 35 | overriding the setting valid for | ||
| 36 | .Fa ssl Ns 's | ||
| 37 | .Vt SSL_CTX | ||
| 38 | object. | ||
| 39 | .Pp | ||
| 40 | .Fn SSL_CTX_add_client_CA | ||
| 41 | adds the CA name extracted from | ||
| 42 | .Fa cacert | ||
| 43 | to the list of CAs sent to the client when requesting a client certificate for | ||
| 44 | .Fa ctx . | ||
| 45 | .Pp | ||
| 46 | .Fn SSL_add_client_CA | ||
| 47 | adds the CA name extracted from | ||
| 48 | .Fa cacert | ||
| 49 | to the list of CAs sent to the client when requesting a client certificate for | ||
| 50 | the chosen | ||
| 51 | .Fa ssl , | ||
| 52 | overriding the setting valid for | ||
| 53 | .Fa ssl Ns 's | ||
| 54 | .Va SSL_CTX | ||
| 55 | object. | ||
| 56 | .Sh NOTES | ||
| 57 | When a TLS/SSL server requests a client certificate (see | ||
| 58 | .Fn SSL_CTX_set_verify ) , | ||
| 59 | it sends a list of CAs for which it will accept certificates to the client. | ||
| 60 | .Pp | ||
| 61 | This list must explicitly be set using | ||
| 62 | .Fn SSL_CTX_set_client_CA_list | ||
| 63 | for | ||
| 64 | .Fa ctx | ||
| 65 | and | ||
| 66 | .Fn SSL_set_client_CA_list | ||
| 67 | for the specific | ||
| 68 | .Fa ssl . | ||
| 69 | The list specified overrides the previous setting. | ||
| 70 | The CAs listed do not become trusted | ||
| 71 | .Po | ||
| 72 | .Fa list | ||
| 73 | only contains the names, not the complete certificates | ||
| 74 | .Pc ; | ||
| 75 | use | ||
| 76 | .Xr SSL_CTX_load_verify_locations 3 | ||
| 77 | to additionally load them for verification. | ||
| 78 | .Pp | ||
| 79 | If the list of acceptable CAs is compiled in a file, the | ||
| 80 | .Xr SSL_load_client_CA_file 3 | ||
| 81 | function can be used to help importing the necessary data. | ||
| 82 | .Pp | ||
| 83 | .Fn SSL_CTX_add_client_CA | ||
| 84 | and | ||
| 85 | .Fn SSL_add_client_CA | ||
| 86 | can be used to add additional items the list of client CAs. | ||
| 87 | If no list was specified before using | ||
| 88 | .Fn SSL_CTX_set_client_CA_list | ||
| 89 | or | ||
| 90 | .Fn SSL_set_client_CA_list , | ||
| 91 | a new client CA list for | ||
| 92 | .Fa ctx | ||
| 93 | or | ||
| 94 | .Fa ssl | ||
| 95 | (as appropriate) is opened. | ||
| 96 | .Pp | ||
| 97 | These functions are only useful for TLS/SSL servers. | ||
| 98 | .Sh RETURN VALUES | ||
| 99 | .Fn SSL_CTX_set_client_CA_list | ||
| 100 | and | ||
| 101 | .Fn SSL_set_client_CA_list | ||
| 102 | do not return diagnostic information. | ||
| 103 | .Pp | ||
| 104 | .Fn SSL_CTX_add_client_CA | ||
| 105 | and | ||
| 106 | .Fn SSL_add_client_CA | ||
| 107 | have the following return values: | ||
| 108 | .Bl -tag -width Ds | ||
| 109 | .It 0 | ||
| 110 | A failure while manipulating the | ||
| 111 | .Dv STACK_OF Ns | ||
| 112 | .Pq Vt X509_NAME | ||
| 113 | object occurred or the | ||
| 114 | .Vt X509_NAME | ||
| 115 | could not be extracted from | ||
| 116 | .Fa cacert . | ||
| 117 | Check the error stack to find out the reason. | ||
| 118 | .It 1 | ||
| 119 | The operation succeeded. | ||
| 120 | .El | ||
| 121 | .Sh EXAMPLES | ||
| 122 | Scan all certificates in | ||
| 123 | .Fa CAfile | ||
| 124 | and list them as acceptable CAs: | ||
| 125 | .Bd -literal | ||
| 126 | SSL_CTX_set_client_CA_list(ctx, SSL_load_client_CA_file(CAfile)); | ||
| 127 | .Ed | ||
| 128 | .Sh SEE ALSO | ||
| 129 | .Xr ssl 3 , | ||
| 130 | .Xr SSL_CTX_load_verify_locations 3 , | ||
| 131 | .Xr SSL_get_client_CA_list 3 , | ||
| 132 | .Xr SSL_load_client_CA_file 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_client_cert_cb.3 b/src/lib/libssl/doc/SSL_CTX_set_client_cert_cb.3 deleted file mode 100644 index 7a7d9466d2..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_client_cert_cb.3 +++ /dev/null | |||
| @@ -1,143 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_client_cert_cb.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SET_CLIENT_CERT_CB 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_client_cert_cb , | ||
| 9 | .Nm SSL_CTX_get_client_cert_cb | ||
| 10 | .Nd handle client certificate callback function | ||
| 11 | .Sh SYNOPSIS | ||
| 12 | .In openssl/ssl.h | ||
| 13 | .Ft void | ||
| 14 | .Fo SSL_CTX_set_client_cert_cb | ||
| 15 | .Fa "SSL_CTX *ctx" | ||
| 16 | .Fa "int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey)" | ||
| 17 | .Fc | ||
| 18 | .Ft int | ||
| 19 | .Fo "(*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx))" | ||
| 20 | .Fa "SSL *ssl" "X509 **x509" "EVP_PKEY **pkey" | ||
| 21 | .Fc | ||
| 22 | .Ft int | ||
| 23 | .Fn "(*client_cert_cb)" "SSL *ssl" "X509 **x509" "EVP_PKEY **pkey" | ||
| 24 | .Sh DESCRIPTION | ||
| 25 | .Fn SSL_CTX_set_client_cert_cb | ||
| 26 | sets the | ||
| 27 | .Fa client_cert_cb() | ||
| 28 | callback that is called when a client certificate is requested by a server and | ||
| 29 | no certificate was yet set for the SSL object. | ||
| 30 | .Pp | ||
| 31 | When | ||
| 32 | .Fa client_cert_cb | ||
| 33 | is | ||
| 34 | .Dv NULL , | ||
| 35 | no callback function is used. | ||
| 36 | .Pp | ||
| 37 | .Fn SSL_CTX_get_client_cert_cb | ||
| 38 | returns a pointer to the currently set callback function. | ||
| 39 | .Pp | ||
| 40 | .Fn client_cert_cb | ||
| 41 | is the application-defined callback. | ||
| 42 | If it wants to set a certificate, | ||
| 43 | a certificate/private key combination must be set using the | ||
| 44 | .Fa x509 | ||
| 45 | and | ||
| 46 | .Fa pkey | ||
| 47 | arguments and 1 must be returned. | ||
| 48 | The certificate will be installed into | ||
| 49 | .Fa ssl ; | ||
| 50 | see the | ||
| 51 | .Sx NOTES | ||
| 52 | and | ||
| 53 | .Sx BUGS | ||
| 54 | sections. | ||
| 55 | If no certificate should be set, | ||
| 56 | 0 has to be returned and no certificate will be sent. | ||
| 57 | A negative return value will suspend the handshake and the handshake function | ||
| 58 | will return immediately. | ||
| 59 | .Xr SSL_get_error 3 | ||
| 60 | will return | ||
| 61 | .Dv SSL_ERROR_WANT_X509_LOOKUP | ||
| 62 | to indicate that the handshake was suspended. | ||
| 63 | The next call to the handshake function will again lead to the call of | ||
| 64 | .Fa client_cert_cb() . | ||
| 65 | It is the job of the | ||
| 66 | .Fa client_cert_cb() | ||
| 67 | to store information | ||
| 68 | about the state of the last call, if required to continue. | ||
| 69 | .Sh NOTES | ||
| 70 | During a handshake (or renegotiation) | ||
| 71 | a server may request a certificate from the client. | ||
| 72 | A client certificate must only be sent when the server did send the request. | ||
| 73 | .Pp | ||
| 74 | When a certificate has been set using the | ||
| 75 | .Xr SSL_CTX_use_certificate 3 | ||
| 76 | family of functions, | ||
| 77 | it will be sent to the server. | ||
| 78 | The TLS standard requires that only a certificate is sent if it matches the | ||
| 79 | list of acceptable CAs sent by the server. | ||
| 80 | This constraint is violated by the default behavior of the OpenSSL library. | ||
| 81 | Using the callback function it is possible to implement a proper selection | ||
| 82 | routine or to allow a user interaction to choose the certificate to be sent. | ||
| 83 | .Pp | ||
| 84 | If a callback function is defined and no certificate was yet defined for the | ||
| 85 | .Vt SSL | ||
| 86 | object, the callback function will be called. | ||
| 87 | If the callback function returns a certificate, the OpenSSL library | ||
| 88 | will try to load the private key and certificate data into the | ||
| 89 | .Vt SSL | ||
| 90 | object using the | ||
| 91 | .Fn SSL_use_certificate | ||
| 92 | and | ||
| 93 | .Fn SSL_use_private_key | ||
| 94 | functions. | ||
| 95 | Thus it will permanently install the certificate and key for this SSL object. | ||
| 96 | It will not be reset by calling | ||
| 97 | .Xr SSL_clear 3 . | ||
| 98 | If the callback returns no certificate, the OpenSSL library will not send a | ||
| 99 | certificate. | ||
| 100 | .Sh SEE ALSO | ||
| 101 | .Xr ssl 3 , | ||
| 102 | .Xr SSL_clear 3 , | ||
| 103 | .Xr SSL_CTX_add_extra_chain_cert 3 , | ||
| 104 | .Xr SSL_CTX_use_certificate 3 , | ||
| 105 | .Xr SSL_free 3 , | ||
| 106 | .Xr SSL_get_client_CA_list 3 | ||
| 107 | .Sh BUGS | ||
| 108 | The | ||
| 109 | .Fa client_cert_cb() | ||
| 110 | cannot return a complete certificate chain; | ||
| 111 | it can only return one client certificate. | ||
| 112 | If the chain only has a length of 2, | ||
| 113 | the root CA certificate may be omitted according to the TLS standard and | ||
| 114 | thus a standard conforming answer can be sent to the server. | ||
| 115 | For a longer chain, the client must send the complete chain | ||
| 116 | (with the option to leave out the root CA certificate). | ||
| 117 | This can be accomplished only by either adding the intermediate CA certificates | ||
| 118 | into the trusted certificate store for the | ||
| 119 | .Vt SSL_CTX | ||
| 120 | object (resulting in having to add CA certificates that otherwise maybe would | ||
| 121 | not be trusted), or by adding the chain certificates using the | ||
| 122 | .Xr SSL_CTX_add_extra_chain_cert 3 | ||
| 123 | function, which is only available for the | ||
| 124 | .Vt SSL_CTX | ||
| 125 | object as a whole and that therefore probably can only apply for one client | ||
| 126 | certificate, making the concept of the callback function | ||
| 127 | (to allow the choice from several certificates) questionable. | ||
| 128 | .Pp | ||
| 129 | Once the | ||
| 130 | .Vt SSL | ||
| 131 | object has been used in conjunction with the callback function, | ||
| 132 | the certificate will be set for the | ||
| 133 | .Vt SSL | ||
| 134 | object and will not be cleared even when | ||
| 135 | .Xr SSL_clear 3 | ||
| 136 | is called. | ||
| 137 | It is therefore | ||
| 138 | .Em mandatory | ||
| 139 | to destroy the | ||
| 140 | .Vt SSL | ||
| 141 | object using | ||
| 142 | .Xr SSL_free 3 | ||
| 143 | and create a new one to return to the previous state. | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_default_passwd_cb.3 b/src/lib/libssl/doc/SSL_CTX_set_default_passwd_cb.3 deleted file mode 100644 index ac4d55ae73..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_default_passwd_cb.3 +++ /dev/null | |||
| @@ -1,95 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_default_passwd_cb.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SET_DEFAULT_PASSWD_CB 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_default_passwd_cb , | ||
| 9 | .Nm SSL_CTX_set_default_passwd_cb_userdata | ||
| 10 | .Nd set passwd callback for encrypted PEM file handling | ||
| 11 | .Sh SYNOPSIS | ||
| 12 | .In openssl/ssl.h | ||
| 13 | .Ft void | ||
| 14 | .Fn SSL_CTX_set_default_passwd_cb "SSL_CTX *ctx" "pem_password_cb *cb" | ||
| 15 | .Ft void | ||
| 16 | .Fn SSL_CTX_set_default_passwd_cb_userdata "SSL_CTX *ctx" "void *u" | ||
| 17 | .Ft int | ||
| 18 | .Fn pem_passwd_cb "char *buf" "int size" "int rwflag" "void *userdata" | ||
| 19 | .Sh DESCRIPTION | ||
| 20 | .Fn SSL_CTX_set_default_passwd_cb | ||
| 21 | sets the default password callback called when loading/storing a PEM | ||
| 22 | certificate with encryption. | ||
| 23 | .Pp | ||
| 24 | .Fn SSL_CTX_set_default_passwd_cb_userdata | ||
| 25 | sets a pointer to userdata | ||
| 26 | .Fa u | ||
| 27 | which will be provided to the password callback on invocation. | ||
| 28 | .Pp | ||
| 29 | The | ||
| 30 | .Fn pem_passwd_cb , | ||
| 31 | which must be provided by the application, | ||
| 32 | hands back the password to be used during decryption. | ||
| 33 | On invocation a pointer to | ||
| 34 | .Fa userdata | ||
| 35 | is provided. | ||
| 36 | The pem_passwd_cb must write the password into the provided buffer | ||
| 37 | .Fa buf | ||
| 38 | which is of size | ||
| 39 | .Fa size . | ||
| 40 | The actual length of the password must be returned to the calling function. | ||
| 41 | .Fa rwflag | ||
| 42 | indicates whether the callback is used for reading/decryption | ||
| 43 | .Pq Fa rwflag No = 0 | ||
| 44 | or writing/encryption | ||
| 45 | .Pq Fa rwflag No = 1 . | ||
| 46 | .Sh NOTES | ||
| 47 | When loading or storing private keys, a password might be supplied to protect | ||
| 48 | the private key. | ||
| 49 | The way this password can be supplied may depend on the application. | ||
| 50 | If only one private key is handled, it can be practical to have | ||
| 51 | .Fn pem_passwd_cb | ||
| 52 | handle the password dialog interactively. | ||
| 53 | If several keys have to be handled, it can be practical to ask for the password | ||
| 54 | once, then keep it in memory and use it several times. | ||
| 55 | In the last case, the password could be stored into the | ||
| 56 | .Fa userdata | ||
| 57 | storage and the | ||
| 58 | .Fn pem_passwd_cb | ||
| 59 | only returns the password already stored. | ||
| 60 | .Pp | ||
| 61 | When asking for the password interactively, | ||
| 62 | .Fn pem_passwd_cb | ||
| 63 | can use | ||
| 64 | .Fa rwflag | ||
| 65 | to check whether an item shall be encrypted | ||
| 66 | .Pq Fa rwflag No = 1 . | ||
| 67 | In this case the password dialog may ask for the same password twice for | ||
| 68 | comparison in order to catch typos which would make decryption impossible. | ||
| 69 | .Pp | ||
| 70 | Other items in PEM formatting (certificates) can also be encrypted; it is | ||
| 71 | however atypical, as certificate information is considered public. | ||
| 72 | .Sh RETURN VALUES | ||
| 73 | .Fn SSL_CTX_set_default_passwd_cb | ||
| 74 | and | ||
| 75 | .Fn SSL_CTX_set_default_passwd_cb_userdata | ||
| 76 | do not provide diagnostic information. | ||
| 77 | .Sh EXAMPLES | ||
| 78 | The following example returns the password provided as | ||
| 79 | .Fa userdata | ||
| 80 | to the calling function. | ||
| 81 | The password is considered to be a | ||
| 82 | .Sq \e0 | ||
| 83 | terminated string. | ||
| 84 | If the password does not fit into the buffer, the password is truncated. | ||
| 85 | .Bd -literal | ||
| 86 | int pem_passwd_cb(char *buf, int size, int rwflag, void *password) | ||
| 87 | { | ||
| 88 | strncpy(buf, (char *)password, size); | ||
| 89 | buf[size - 1] = '\e0'; | ||
| 90 | return strlen(buf); | ||
| 91 | } | ||
| 92 | .Ed | ||
| 93 | .Sh SEE ALSO | ||
| 94 | .Xr ssl 3 , | ||
| 95 | .Xr SSL_CTX_use_certificate 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_generate_session_id.3 b/src/lib/libssl/doc/SSL_CTX_set_generate_session_id.3 deleted file mode 100644 index 0bea48904e..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_generate_session_id.3 +++ /dev/null | |||
| @@ -1,196 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_generate_session_id.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SET_GENERATE_SESSION_ID 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_generate_session_id , | ||
| 9 | .Nm SSL_set_generate_session_id , | ||
| 10 | .Nm SSL_has_matching_session_id | ||
| 11 | .Nd manipulate generation of SSL session IDs (server only) | ||
| 12 | .Sh SYNOPSIS | ||
| 13 | .In openssl/ssl.h | ||
| 14 | .Bd -literal | ||
| 15 | typedef int (*GEN_SESSION_CB)(const SSL *ssl, unsigned char *id, | ||
| 16 | unsigned int *id_len); | ||
| 17 | .Ed | ||
| 18 | .Ft int | ||
| 19 | .Fn SSL_CTX_set_generate_session_id "SSL_CTX *ctx" "GEN_SESSION_CB cb" | ||
| 20 | .Ft int | ||
| 21 | .Fn SSL_set_generate_session_id "SSL *ssl" "GEN_SESSION_CB" "cb);" | ||
| 22 | .Ft int | ||
| 23 | .Fo SSL_has_matching_session_id | ||
| 24 | .Fa "const SSL *ssl" "const unsigned char *id" "unsigned int id_len" | ||
| 25 | .Fc | ||
| 26 | .Sh DESCRIPTION | ||
| 27 | .Fn SSL_CTX_set_generate_session_id | ||
| 28 | sets the callback function for generating new session ids for SSL/TLS sessions | ||
| 29 | for | ||
| 30 | .Fa ctx | ||
| 31 | to be | ||
| 32 | .Fa cb . | ||
| 33 | .Pp | ||
| 34 | .Fn SSL_set_generate_session_id | ||
| 35 | sets the callback function for generating new session ids for SSL/TLS sessions | ||
| 36 | for | ||
| 37 | .Fa ssl | ||
| 38 | to be | ||
| 39 | .Fa cb . | ||
| 40 | .Pp | ||
| 41 | .Fn SSL_has_matching_session_id | ||
| 42 | checks, whether a session with id | ||
| 43 | .Fa id | ||
| 44 | (of length | ||
| 45 | .Fa id_len ) | ||
| 46 | is already contained in the internal session cache | ||
| 47 | of the parent context of | ||
| 48 | .Fa ssl . | ||
| 49 | .Sh NOTES | ||
| 50 | When a new session is established between client and server, | ||
| 51 | the server generates a session id. | ||
| 52 | The session id is an arbitrary sequence of bytes. | ||
| 53 | The length of the session id is 16 bytes for SSLv2 sessions and between 1 and | ||
| 54 | 32 bytes for SSLv3/TLSv1. | ||
| 55 | The session id is not security critical but must be unique for the server. | ||
| 56 | Additionally, the session id is transmitted in the clear when reusing the | ||
| 57 | session so it must not contain sensitive information. | ||
| 58 | .Pp | ||
| 59 | Without a callback being set, an OpenSSL server will generate a unique session | ||
| 60 | id from pseudo random numbers of the maximum possible length. | ||
| 61 | Using the callback function, the session id can be changed to contain | ||
| 62 | additional information like, e.g., a host id in order to improve load balancing | ||
| 63 | or external caching techniques. | ||
| 64 | .Pp | ||
| 65 | The callback function receives a pointer to the memory location to put | ||
| 66 | .Fa id | ||
| 67 | into and a pointer to the maximum allowed length | ||
| 68 | .Fa id_len . | ||
| 69 | The buffer at location | ||
| 70 | .Fa id | ||
| 71 | is only guaranteed to have the size | ||
| 72 | .Fa id_len . | ||
| 73 | The callback is only allowed to generate a shorter id and reduce | ||
| 74 | .Fa id_len ; | ||
| 75 | the callback | ||
| 76 | .Em must never | ||
| 77 | increase | ||
| 78 | .Fa id_len | ||
| 79 | or write to the location | ||
| 80 | .Fa id | ||
| 81 | exceeding the given limit. | ||
| 82 | .Pp | ||
| 83 | If a SSLv2 session id is generated and | ||
| 84 | .Fa id_len | ||
| 85 | is reduced, it will be restored after the callback has finished and the session | ||
| 86 | id will be padded with 0x00. | ||
| 87 | It is not recommended to change the | ||
| 88 | .Fa id_len | ||
| 89 | for SSLv2 sessions. | ||
| 90 | The callback can use the | ||
| 91 | .Xr SSL_get_version 3 | ||
| 92 | function to check whether the session is of type SSLv2. | ||
| 93 | .Pp | ||
| 94 | The location | ||
| 95 | .Fa id | ||
| 96 | is filled with 0x00 before the callback is called, | ||
| 97 | so the callback may only fill part of the possible length and leave | ||
| 98 | .Fa id_len | ||
| 99 | untouched while maintaining reproducibility. | ||
| 100 | .Pp | ||
| 101 | Since the sessions must be distinguished, session ids must be unique. | ||
| 102 | Without the callback a random number is used, | ||
| 103 | so that the probability of generating the same session id is extremely small | ||
| 104 | (2^128 possible ids for an SSLv2 session, 2^256 for SSLv3/TLSv1). | ||
| 105 | In order to ensure the uniqueness of the generated session id, | ||
| 106 | the callback must call | ||
| 107 | .Fn SSL_has_matching_session_id | ||
| 108 | and generate another id if a conflict occurs. | ||
| 109 | If an id conflict is not resolved, the handshake will fail. | ||
| 110 | If the application codes, e.g., a unique host id, a unique process number, and | ||
| 111 | a unique sequence number into the session id, uniqueness could easily be | ||
| 112 | achieved without randomness added (it should however be taken care that | ||
| 113 | no confidential information is leaked this way). | ||
| 114 | If the application cannot guarantee uniqueness, | ||
| 115 | it is recommended to use the maximum | ||
| 116 | .Fa id_len | ||
| 117 | and fill in the bytes not used to code special information with random data to | ||
| 118 | avoid collisions. | ||
| 119 | .Pp | ||
| 120 | .Fn SSL_has_matching_session_id | ||
| 121 | will only query the internal session cache, not the external one. | ||
| 122 | Since the session id is generated before the handshake is completed, | ||
| 123 | it is not immediately added to the cache. | ||
| 124 | If another thread is using the same internal session cache, | ||
| 125 | a race condition can occur in that another thread generates the same session id. | ||
| 126 | Collisions can also occur when using an external session cache, | ||
| 127 | since the external cache is not tested with | ||
| 128 | .Fn SSL_has_matching_session_id | ||
| 129 | and the same race condition applies. | ||
| 130 | .Pp | ||
| 131 | When calling | ||
| 132 | .Fn SSL_has_matching_session_id | ||
| 133 | for an SSLv2 session with reduced | ||
| 134 | .Fa id_len Ns , | ||
| 135 | the match operation will be performed using the fixed length required and with | ||
| 136 | a 0x00 padded id. | ||
| 137 | .Pp | ||
| 138 | The callback must return 0 if it cannot generate a session id for whatever | ||
| 139 | reason and return 1 on success. | ||
| 140 | .Sh RETURN VALUES | ||
| 141 | .Fn SSL_CTX_set_generate_session_id | ||
| 142 | and | ||
| 143 | .Fn SSL_set_generate_session_id | ||
| 144 | always return 1. | ||
| 145 | .Pp | ||
| 146 | .Fn SSL_has_matching_session_id | ||
| 147 | returns 1 if another session with the same id is already in the cache. | ||
| 148 | .Sh EXAMPLES | ||
| 149 | The callback function listed will generate a session id with the server id | ||
| 150 | given, and will fill the rest with pseudo random bytes: | ||
| 151 | .Bd -literal | ||
| 152 | const char session_id_prefix = "www-18"; | ||
| 153 | |||
| 154 | #define MAX_SESSION_ID_ATTEMPTS 10 | ||
| 155 | static int | ||
| 156 | generate_session_id(const SSL *ssl, unsigned char *id, | ||
| 157 | unsigned int *id_len) | ||
| 158 | { | ||
| 159 | unsigned int count = 0; | ||
| 160 | const char *version; | ||
| 161 | |||
| 162 | version = SSL_get_version(ssl); | ||
| 163 | if (!strcmp(version, "SSLv2")) { | ||
| 164 | /* we must not change id_len */ | ||
| 165 | ; | ||
| 166 | } | ||
| 167 | |||
| 168 | do { | ||
| 169 | RAND_pseudo_bytes(id, *id_len); | ||
| 170 | /* | ||
| 171 | * Prefix the session_id with the required prefix. NB: If | ||
| 172 | * our prefix is too long, clip it \(en but there will be | ||
| 173 | * worse effects anyway, e.g., the server could only | ||
| 174 | * possibly create one session ID (the prefix!) so all | ||
| 175 | * future session negotiations will fail due to conflicts. | ||
| 176 | */ | ||
| 177 | memcpy(id, session_id_prefix, | ||
| 178 | (strlen(session_id_prefix) < *id_len) ? | ||
| 179 | strlen(session_id_prefix) : *id_len); | ||
| 180 | } while (SSL_has_matching_session_id(ssl, id, *id_len) && | ||
| 181 | (++count < MAX_SESSION_ID_ATTEMPTS)); | ||
| 182 | |||
| 183 | if (count >= MAX_SESSION_ID_ATTEMPTS) | ||
| 184 | return 0; | ||
| 185 | return 1; | ||
| 186 | } | ||
| 187 | .Ed | ||
| 188 | .Sh SEE ALSO | ||
| 189 | .Xr ssl 3 , | ||
| 190 | .Xr SSL_get_version 3 | ||
| 191 | .Sh HISTORY | ||
| 192 | .Fn SSL_CTX_set_generate_session_id , | ||
| 193 | .Fn SSL_set_generate_session_id | ||
| 194 | and | ||
| 195 | .Fn SSL_has_matching_session_id | ||
| 196 | were introduced in OpenSSL 0.9.7. | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_info_callback.3 b/src/lib/libssl/doc/SSL_CTX_set_info_callback.3 deleted file mode 100644 index 24ee74dda9..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_info_callback.3 +++ /dev/null | |||
| @@ -1,167 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_info_callback.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SET_INFO_CALLBACK 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_info_callback , | ||
| 9 | .Nm SSL_CTX_get_info_callback , | ||
| 10 | .Nm SSL_set_info_callback , | ||
| 11 | .Nm SSL_get_info_callback | ||
| 12 | .Nd handle information callback for SSL connections | ||
| 13 | .Sh SYNOPSIS | ||
| 14 | .In openssl/ssl.h | ||
| 15 | .Ft void | ||
| 16 | .Fn SSL_CTX_set_info_callback "SSL_CTX *ctx" "void (*callback)()" | ||
| 17 | .Ft void | ||
| 18 | .Fn "(*SSL_CTX_get_info_callback(const SSL_CTX *ctx))" | ||
| 19 | .Ft void | ||
| 20 | .Fn SSL_set_info_callback "SSL *ssl" "void (*callback)()" | ||
| 21 | .Ft void | ||
| 22 | .Fn "(*SSL_get_info_callback(const SSL *ssl))" | ||
| 23 | .Sh DESCRIPTION | ||
| 24 | .Fn SSL_CTX_set_info_callback | ||
| 25 | sets the | ||
| 26 | .Fa callback | ||
| 27 | function that can be used to obtain state information for SSL objects created | ||
| 28 | from | ||
| 29 | .Fa ctx | ||
| 30 | during connection setup and use. | ||
| 31 | The setting for | ||
| 32 | .Fa ctx | ||
| 33 | is overridden from the setting for a specific SSL object, if specified. | ||
| 34 | When | ||
| 35 | .Fa callback | ||
| 36 | is | ||
| 37 | .Dv NULL , | ||
| 38 | no callback function is used. | ||
| 39 | .Pp | ||
| 40 | .Fn SSL_set_info_callback | ||
| 41 | sets the | ||
| 42 | .Fa callback | ||
| 43 | function that can be used to | ||
| 44 | obtain state information for | ||
| 45 | .Fa ssl | ||
| 46 | during connection setup and use. | ||
| 47 | When | ||
| 48 | .Fa callback | ||
| 49 | is | ||
| 50 | .Dv NULL , | ||
| 51 | the callback setting currently valid for | ||
| 52 | .Fa ctx | ||
| 53 | is used. | ||
| 54 | .Pp | ||
| 55 | .Fn SSL_CTX_get_info_callback | ||
| 56 | returns a pointer to the currently set information callback function for | ||
| 57 | .Fa ctx . | ||
| 58 | .Pp | ||
| 59 | .Fn SSL_get_info_callback | ||
| 60 | returns a pointer to the currently set information callback function for | ||
| 61 | .Fa ssl . | ||
| 62 | .Sh NOTES | ||
| 63 | When setting up a connection and during use, | ||
| 64 | it is possible to obtain state information from the SSL/TLS engine. | ||
| 65 | When set, an information callback function is called whenever the state changes, | ||
| 66 | an alert appears, or an error occurs. | ||
| 67 | .Pp | ||
| 68 | The callback function is called as | ||
| 69 | .Fn callback "SSL *ssl" "int where" "int ret" . | ||
| 70 | The | ||
| 71 | .Fa where | ||
| 72 | argument specifies information about where (in which context) | ||
| 73 | the callback function was called. | ||
| 74 | If | ||
| 75 | .Fa ret | ||
| 76 | is 0, an error condition occurred. | ||
| 77 | If an alert is handled, | ||
| 78 | .Dv SSL_CB_ALERT | ||
| 79 | is set and | ||
| 80 | .Fa ret | ||
| 81 | specifies the alert information. | ||
| 82 | .Pp | ||
| 83 | .Fa where | ||
| 84 | is a bitmask made up of the following bits: | ||
| 85 | .Bl -tag -width Ds | ||
| 86 | .It Dv SSL_CB_LOOP | ||
| 87 | Callback has been called to indicate state change inside a loop. | ||
| 88 | .It Dv SSL_CB_EXIT | ||
| 89 | Callback has been called to indicate error exit of a handshake function. | ||
| 90 | (May be soft error with retry option for non-blocking setups.) | ||
| 91 | .It Dv SSL_CB_READ | ||
| 92 | Callback has been called during read operation. | ||
| 93 | .It Dv SSL_CB_WRITE | ||
| 94 | Callback has been called during write operation. | ||
| 95 | .It Dv SSL_CB_ALERT | ||
| 96 | Callback has been called due to an alert being sent or received. | ||
| 97 | .It Dv SSL_CB_READ_ALERT | ||
| 98 | .It Dv SSL_CB_WRITE_ALERT | ||
| 99 | .It Dv SSL_CB_ACCEPT_LOOP | ||
| 100 | .It Dv SSL_CB_ACCEPT_EXIT | ||
| 101 | .It Dv SSL_CB_CONNECT_LOOP | ||
| 102 | .It Dv SSL_CB_CONNECT_EXIT | ||
| 103 | .It Dv SSL_CB_HANDSHAKE_START | ||
| 104 | Callback has been called because a new handshake is started. | ||
| 105 | .It Dv SSL_CB_HANDSHAKE_DONE | ||
| 106 | Callback has been called because a handshake is finished. | ||
| 107 | .El | ||
| 108 | .Pp | ||
| 109 | The current state information can be obtained using the | ||
| 110 | .Xr SSL_state_string 3 | ||
| 111 | family of functions. | ||
| 112 | .Pp | ||
| 113 | The | ||
| 114 | .Fa ret | ||
| 115 | information can be evaluated using the | ||
| 116 | .Xr SSL_alert_type_string 3 | ||
| 117 | family of functions. | ||
| 118 | .Sh RETURN VALUES | ||
| 119 | .Fn SSL_set_info_callback | ||
| 120 | does not provide diagnostic information. | ||
| 121 | .Pp | ||
| 122 | .Fn SSL_get_info_callback | ||
| 123 | returns the current setting. | ||
| 124 | .Sh EXAMPLES | ||
| 125 | The following example callback function prints state strings, | ||
| 126 | information about alerts being handled and error messages to the | ||
| 127 | .Va bio_err | ||
| 128 | .Vt BIO . | ||
| 129 | .Bd -literal | ||
| 130 | void | ||
| 131 | apps_ssl_info_callback(SSL *s, int where, int ret) | ||
| 132 | { | ||
| 133 | const char *str; | ||
| 134 | int w; | ||
| 135 | |||
| 136 | w = where & ~SSL_ST_MASK; | ||
| 137 | |||
| 138 | if (w & SSL_ST_CONNECT) | ||
| 139 | str = "SSL_connect"; | ||
| 140 | else if (w & SSL_ST_ACCEPT) | ||
| 141 | str = "SSL_accept"; | ||
| 142 | else | ||
| 143 | str = "undefined"; | ||
| 144 | |||
| 145 | if (where & SSL_CB_LOOP) { | ||
| 146 | BIO_printf(bio_err, "%s:%s\en", str, | ||
| 147 | SSL_state_string_long(s)); | ||
| 148 | } else if (where & SSL_CB_ALERT) { | ||
| 149 | str = (where & SSL_CB_READ) ? "read" : "write"; | ||
| 150 | BIO_printf(bio_err, "SSL3 alert %s:%s:%s\en", str, | ||
| 151 | SSL_alert_type_string_long(ret), | ||
| 152 | SSL_alert_desc_string_long(ret)); | ||
| 153 | } else if (where & SSL_CB_EXIT) { | ||
| 154 | if (ret == 0) | ||
| 155 | BIO_printf(bio_err, "%s:failed in %s\en", | ||
| 156 | str, SSL_state_string_long(s)); | ||
| 157 | else if (ret < 0) { | ||
| 158 | BIO_printf(bio_err, "%s:error in %s\en", | ||
| 159 | str, SSL_state_string_long(s)); | ||
| 160 | } | ||
| 161 | } | ||
| 162 | } | ||
| 163 | .Ed | ||
| 164 | .Sh SEE ALSO | ||
| 165 | .Xr ssl 3 , | ||
| 166 | .Xr SSL_alert_type_string 3 , | ||
| 167 | .Xr SSL_state_string 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_max_cert_list.3 b/src/lib/libssl/doc/SSL_CTX_set_max_cert_list.3 deleted file mode 100644 index 771b49a0b2..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_max_cert_list.3 +++ /dev/null | |||
| @@ -1,105 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_max_cert_list.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SET_MAX_CERT_LIST 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_max_cert_list , | ||
| 9 | .Nm SSL_CTX_get_max_cert_list , | ||
| 10 | .Nm SSL_set_max_cert_list , | ||
| 11 | .Nm SSL_get_max_cert_list | ||
| 12 | .Nd manipulate allowed size for the peer's certificate chain | ||
| 13 | .Sh SYNOPSIS | ||
| 14 | .In openssl/ssl.h | ||
| 15 | .Ft long | ||
| 16 | .Fn SSL_CTX_set_max_cert_list "SSL_CTX *ctx" "long size" | ||
| 17 | .Ft long | ||
| 18 | .Fn SSL_CTX_get_max_cert_list "SSL_CTX *ctx" | ||
| 19 | .Ft long | ||
| 20 | .Fn SSL_set_max_cert_list "SSL *ssl" "long size" | ||
| 21 | .Ft long | ||
| 22 | .Fn SSL_get_max_cert_list "SSL *ctx" | ||
| 23 | .Sh DESCRIPTION | ||
| 24 | .Fn SSL_CTX_set_max_cert_list | ||
| 25 | sets the maximum size allowed for the peer's certificate chain for all | ||
| 26 | .Vt SSL | ||
| 27 | objects created from | ||
| 28 | .Fa ctx | ||
| 29 | to be | ||
| 30 | .Fa size | ||
| 31 | bytes. | ||
| 32 | The | ||
| 33 | .Vt SSL | ||
| 34 | objects inherit the setting valid for | ||
| 35 | .Fa ctx | ||
| 36 | at the time | ||
| 37 | .Xr SSL_new 3 | ||
| 38 | is being called. | ||
| 39 | .Pp | ||
| 40 | .Fn SSL_CTX_get_max_cert_list | ||
| 41 | returns the currently set maximum size for | ||
| 42 | .Fa ctx . | ||
| 43 | .Pp | ||
| 44 | .Fn SSL_set_max_cert_list | ||
| 45 | sets the maximum size allowed for the peer's certificate chain for | ||
| 46 | .Fa ssl | ||
| 47 | to be | ||
| 48 | .Fa size | ||
| 49 | bytes. | ||
| 50 | This setting stays valid until a new value is set. | ||
| 51 | .Pp | ||
| 52 | .Fn SSL_get_max_cert_list | ||
| 53 | returns the currently set maximum size for | ||
| 54 | .Fa ssl . | ||
| 55 | .Sh NOTES | ||
| 56 | During the handshake process, the peer may send a certificate chain. | ||
| 57 | The TLS/SSL standard does not give any maximum size of the certificate chain. | ||
| 58 | The OpenSSL library handles incoming data by a dynamically allocated buffer. | ||
| 59 | In order to prevent this buffer from growing without bound due to data | ||
| 60 | received from a faulty or malicious peer, a maximum size for the certificate | ||
| 61 | chain is set. | ||
| 62 | .Pp | ||
| 63 | The default value for the maximum certificate chain size is 100kB (30kB | ||
| 64 | on the 16bit DOS platform). | ||
| 65 | This should be sufficient for usual certificate chains | ||
| 66 | (OpenSSL's default maximum chain length is 10, see | ||
| 67 | .Xr SSL_CTX_set_verify 3 , | ||
| 68 | and certificates without special extensions have a typical size of 1-2kB). | ||
| 69 | .Pp | ||
| 70 | For special applications it can be necessary to extend the maximum certificate | ||
| 71 | chain size allowed to be sent by the peer. | ||
| 72 | See for example the work on | ||
| 73 | .%T "Internet X.509 Public Key Infrastructure Proxy Certificate Profile" | ||
| 74 | and | ||
| 75 | .%T "TLS Delegation Protocol" | ||
| 76 | at | ||
| 77 | .Lk http://www.ietf.org/ | ||
| 78 | and | ||
| 79 | .Lk http://www.globus.org/ . | ||
| 80 | .Pp | ||
| 81 | Under normal conditions it should never be necessary to set a value smaller | ||
| 82 | than the default, as the buffer is handled dynamically and only uses the | ||
| 83 | memory actually required by the data sent by the peer. | ||
| 84 | .Pp | ||
| 85 | If the maximum certificate chain size allowed is exceeded, the handshake will | ||
| 86 | fail with a | ||
| 87 | .Dv SSL_R_EXCESSIVE_MESSAGE_SIZE | ||
| 88 | error. | ||
| 89 | .Sh RETURN VALUES | ||
| 90 | .Fn SSL_CTX_set_max_cert_list | ||
| 91 | and | ||
| 92 | .Fn SSL_set_max_cert_list | ||
| 93 | return the previously set value. | ||
| 94 | .Pp | ||
| 95 | .Fn SSL_CTX_get_max_cert_list | ||
| 96 | and | ||
| 97 | .Fn SSL_get_max_cert_list | ||
| 98 | return the currently set value. | ||
| 99 | .Sh SEE ALSO | ||
| 100 | .Xr ssl 3 , | ||
| 101 | .Xr SSL_CTX_set_verify 3 , | ||
| 102 | .Xr SSL_new 3 | ||
| 103 | .Sh HISTORY | ||
| 104 | .Fn SSL*_set/get_max_cert_list | ||
| 105 | were introduced in OpenSSL 0.9.7. | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_mode.3 b/src/lib/libssl/doc/SSL_CTX_set_mode.3 deleted file mode 100644 index 2a3fcd5531..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_mode.3 +++ /dev/null | |||
| @@ -1,126 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_mode.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SET_MODE 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_mode , | ||
| 9 | .Nm SSL_set_mode , | ||
| 10 | .Nm SSL_CTX_get_mode , | ||
| 11 | .Nm SSL_get_mode | ||
| 12 | .Nd manipulate SSL engine mode | ||
| 13 | .Sh SYNOPSIS | ||
| 14 | .In openssl/ssl.h | ||
| 15 | .Ft long | ||
| 16 | .Fn SSL_CTX_set_mode "SSL_CTX *ctx" "long mode" | ||
| 17 | .Ft long | ||
| 18 | .Fn SSL_set_mode "SSL *ssl" "long mode" | ||
| 19 | .Ft long | ||
| 20 | .Fn SSL_CTX_get_mode "SSL_CTX *ctx" | ||
| 21 | .Ft long | ||
| 22 | .Fn SSL_get_mode "SSL *ssl" | ||
| 23 | .Sh DESCRIPTION | ||
| 24 | .Fn SSL_CTX_set_mode | ||
| 25 | adds the mode set via bitmask in | ||
| 26 | .Fa mode | ||
| 27 | to | ||
| 28 | .Fa ctx . | ||
| 29 | Options already set before are not cleared. | ||
| 30 | .Pp | ||
| 31 | .Fn SSL_set_mode | ||
| 32 | adds the mode set via bitmask in | ||
| 33 | .Fa mode | ||
| 34 | to | ||
| 35 | .Fa ssl . | ||
| 36 | Options already set before are not cleared. | ||
| 37 | .Pp | ||
| 38 | .Fn SSL_CTX_get_mode | ||
| 39 | returns the mode set for | ||
| 40 | .Fa ctx . | ||
| 41 | .Pp | ||
| 42 | .Fn SSL_get_mode | ||
| 43 | returns the mode set for | ||
| 44 | .Fa ssl . | ||
| 45 | .Sh NOTES | ||
| 46 | The following mode changes are available: | ||
| 47 | .Bl -tag -width Ds | ||
| 48 | .It Dv SSL_MODE_ENABLE_PARTIAL_WRITE | ||
| 49 | Allow | ||
| 50 | .Fn SSL_write ... n | ||
| 51 | to return | ||
| 52 | .Ms r | ||
| 53 | with | ||
| 54 | .EQ | ||
| 55 | 0 < r < n | ||
| 56 | .EN | ||
| 57 | (i.e., report success when just a single record has been written). | ||
| 58 | When not set (the default), | ||
| 59 | .Xr SSL_write 3 | ||
| 60 | will only report success once the complete chunk was written. | ||
| 61 | Once | ||
| 62 | .Xr SSL_write 3 | ||
| 63 | returns with | ||
| 64 | .Ms r , | ||
| 65 | .Ms r | ||
| 66 | bytes have been successfully written and the next call to | ||
| 67 | .Xr SSL_write 3 | ||
| 68 | must only send the | ||
| 69 | .Ms n \(mi r | ||
| 70 | bytes left, imitating the behaviour of | ||
| 71 | .Xr write 2 . | ||
| 72 | .It Dv SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER | ||
| 73 | Make it possible to retry | ||
| 74 | .Xr SSL_write 3 | ||
| 75 | with changed buffer location (the buffer contents must stay the same). | ||
| 76 | This is not the default to avoid the misconception that non-blocking | ||
| 77 | .Xr SSL_write 3 | ||
| 78 | behaves like non-blocking | ||
| 79 | .Xr write 2 . | ||
| 80 | .It Dv SSL_MODE_AUTO_RETRY | ||
| 81 | Never bother the application with retries if the transport is blocking. | ||
| 82 | If a renegotiation take place during normal operation, a | ||
| 83 | .Xr SSL_read 3 | ||
| 84 | or | ||
| 85 | .Xr SSL_write 3 | ||
| 86 | would return | ||
| 87 | with \(mi1 and indicate the need to retry with | ||
| 88 | .Dv SSL_ERROR_WANT_READ . | ||
| 89 | In a non-blocking environment applications must be prepared to handle | ||
| 90 | incomplete read/write operations. | ||
| 91 | In a blocking environment, applications are not always prepared to deal with | ||
| 92 | read/write operations returning without success report. | ||
| 93 | The flag | ||
| 94 | .Dv SSL_MODE_AUTO_RETRY | ||
| 95 | will cause read/write operations to only return after the handshake and | ||
| 96 | successful completion. | ||
| 97 | .It Dv SSL_MODE_RELEASE_BUFFERS | ||
| 98 | When we no longer need a read buffer or a write buffer for a given | ||
| 99 | .Vt SSL , | ||
| 100 | then release the memory we were using to hold it. | ||
| 101 | Released memory is either appended to a list of unused RAM chunks on the | ||
| 102 | .Vt SSL_CTX , | ||
| 103 | or simply freed if the list of unused chunks would become longer than | ||
| 104 | .Va "SSL_CTX->freelist_max_len" , | ||
| 105 | which defaults to 32. | ||
| 106 | Using this flag can save around 34k per idle SSL connection. | ||
| 107 | This flag has no effect on SSL v2 connections, or on DTLS connections. | ||
| 108 | .El | ||
| 109 | .Sh RETURN VALUES | ||
| 110 | .Fn SSL_CTX_set_mode | ||
| 111 | and | ||
| 112 | .Fn SSL_set_mode | ||
| 113 | return the new mode bitmask after adding | ||
| 114 | .Fa mode . | ||
| 115 | .Pp | ||
| 116 | .Fn SSL_CTX_get_mode | ||
| 117 | and | ||
| 118 | .Fn SSL_get_mode | ||
| 119 | return the current bitmask. | ||
| 120 | .Sh SEE ALSO | ||
| 121 | .Xr ssl 3 , | ||
| 122 | .Xr SSL_read 3 , | ||
| 123 | .Xr SSL_write 3 | ||
| 124 | .Sh HISTORY | ||
| 125 | .Dv SSL_MODE_AUTO_RETRY | ||
| 126 | was added in OpenSSL 0.9.6. | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_msg_callback.3 b/src/lib/libssl/doc/SSL_CTX_set_msg_callback.3 deleted file mode 100644 index 6589306fd4..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_msg_callback.3 +++ /dev/null | |||
| @@ -1,135 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_msg_callback.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SET_MSG_CALLBACK 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_msg_callback , | ||
| 9 | .Nm SSL_CTX_set_msg_callback_arg , | ||
| 10 | .Nm SSL_set_msg_callback , | ||
| 11 | .Nm SSL_get_msg_callback_arg | ||
| 12 | .Nd install callback for observing protocol messages | ||
| 13 | .Sh SYNOPSIS | ||
| 14 | .In openssl/ssl.h | ||
| 15 | .Ft void | ||
| 16 | .Fo SSL_CTX_set_msg_callback | ||
| 17 | .Fa "SSL_CTX *ctx" | ||
| 18 | .Fa "void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)" | ||
| 19 | .Fc | ||
| 20 | .Ft void | ||
| 21 | .Fn SSL_CTX_set_msg_callback_arg "SSL_CTX *ctx" "void *arg" | ||
| 22 | .Ft void | ||
| 23 | .Fo SSL_set_msg_callback | ||
| 24 | .Fa "SSL *ssl" | ||
| 25 | .Fa "void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)" | ||
| 26 | .Fc | ||
| 27 | .Ft void | ||
| 28 | .Fn SSL_set_msg_callback_arg "SSL *ssl" "void *arg" | ||
| 29 | .Sh DESCRIPTION | ||
| 30 | .Fn SSL_CTX_set_msg_callback | ||
| 31 | or | ||
| 32 | .Fn SSL_set_msg_callback | ||
| 33 | can be used to define a message callback function | ||
| 34 | .Fa cb | ||
| 35 | for observing all SSL/TLS protocol messages (such as handshake messages) | ||
| 36 | that are received or sent. | ||
| 37 | .Fn SSL_CTX_set_msg_callback_arg | ||
| 38 | and | ||
| 39 | .Fn SSL_set_msg_callback_arg | ||
| 40 | can be used to set argument | ||
| 41 | .Fa arg | ||
| 42 | to the callback function, which is available for arbitrary application use. | ||
| 43 | .Pp | ||
| 44 | .Fn SSL_CTX_set_msg_callback | ||
| 45 | and | ||
| 46 | .Fn SSL_CTX_set_msg_callback_arg | ||
| 47 | specify default settings that will be copied to new | ||
| 48 | .Vt SSL | ||
| 49 | objects by | ||
| 50 | .Xr SSL_new 3 . | ||
| 51 | .Fn SSL_set_msg_callback | ||
| 52 | and | ||
| 53 | .Fn SSL_set_msg_callback_arg | ||
| 54 | modify the actual settings of an | ||
| 55 | .Vt SSL | ||
| 56 | object. | ||
| 57 | Using a | ||
| 58 | .Dv NULL | ||
| 59 | pointer for | ||
| 60 | .Fa cb | ||
| 61 | disables the message callback. | ||
| 62 | .Pp | ||
| 63 | When | ||
| 64 | .Fa cb | ||
| 65 | is called by the SSL/TLS library for a protocol message, | ||
| 66 | the function arguments have the following meaning: | ||
| 67 | .Bl -tag -width Ds | ||
| 68 | .It Fa write_p | ||
| 69 | This flag is 0 when a protocol message has been received and 1 when a protocol | ||
| 70 | message has been sent. | ||
| 71 | .It Fa version | ||
| 72 | The protocol version according to which the protocol message is | ||
| 73 | interpreted by the library. | ||
| 74 | Currently, this is one of | ||
| 75 | .Dv SSL2_VERSION , | ||
| 76 | .Dv SSL3_VERSION | ||
| 77 | and | ||
| 78 | .Dv TLS1_VERSION | ||
| 79 | (for SSL 2.0, SSL 3.0 and TLS 1.0, respectively). | ||
| 80 | .It Fa content_type | ||
| 81 | In the case of SSL 2.0, this is always 0. | ||
| 82 | In the case of SSL 3.0 or TLS 1.0, this is one of the | ||
| 83 | .Em ContentType | ||
| 84 | values defined in the protocol specification | ||
| 85 | .Po | ||
| 86 | .Dq change_cipher_spec(20) , | ||
| 87 | .Dq alert(21) , | ||
| 88 | .Dq handshake(22) ; | ||
| 89 | but never | ||
| 90 | .Dq application_data(23) | ||
| 91 | because the callback will only be called for protocol messages. | ||
| 92 | .Pc | ||
| 93 | .It Fa buf , Fa len | ||
| 94 | .Fa buf | ||
| 95 | points to a buffer containing the protocol message, which consists of | ||
| 96 | .Fa len | ||
| 97 | bytes. | ||
| 98 | The buffer is no longer valid after the callback function has returned. | ||
| 99 | .It Fa ssl | ||
| 100 | The | ||
| 101 | .Vt SSL | ||
| 102 | object that received or sent the message. | ||
| 103 | .It Fa arg | ||
| 104 | The user-defined argument optionally defined by | ||
| 105 | .Fn SSL_CTX_set_msg_callback_arg | ||
| 106 | or | ||
| 107 | .Fn SSL_set_msg_callback_arg . | ||
| 108 | .El | ||
| 109 | .Sh NOTES | ||
| 110 | Protocol messages are passed to the callback function after decryption | ||
| 111 | and fragment collection where applicable. | ||
| 112 | (Thus record boundaries are not visible.) | ||
| 113 | .Pp | ||
| 114 | If processing a received protocol message results in an error, | ||
| 115 | the callback function may not be called. | ||
| 116 | For example, the callback function will never see messages that are considered | ||
| 117 | too large to be processed. | ||
| 118 | .Pp | ||
| 119 | Due to automatic protocol version negotiation, | ||
| 120 | .Fa version | ||
| 121 | is not necessarily the protocol version used by the sender of the message: | ||
| 122 | If a TLS 1.0 ClientHello message is received by an SSL 3.0-only server, | ||
| 123 | .Fa version | ||
| 124 | will be | ||
| 125 | .Dv SSL3_VERSION . | ||
| 126 | .Sh SEE ALSO | ||
| 127 | .Xr ssl 3 , | ||
| 128 | .Xr SSL_new 3 | ||
| 129 | .Sh HISTORY | ||
| 130 | .Fn SSL_CTX_set_msg_callback , | ||
| 131 | .Fn SSL_CTX_set_msg_callback_arg , | ||
| 132 | .Fn SSL_set_msg_callback | ||
| 133 | and | ||
| 134 | .Fn SSL_get_msg_callback_arg | ||
| 135 | were added in OpenSSL 0.9.7. | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_options.3 b/src/lib/libssl/doc/SSL_CTX_set_options.3 deleted file mode 100644 index 852553e97f..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_options.3 +++ /dev/null | |||
| @@ -1,395 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_options.3,v 1.10 2015/07/18 19:41:54 doug Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: July 18 2015 $ | ||
| 5 | .Dt SSL_CTX_SET_OPTIONS 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_options , | ||
| 9 | .Nm SSL_set_options , | ||
| 10 | .Nm SSL_CTX_clear_options , | ||
| 11 | .Nm SSL_clear_options , | ||
| 12 | .Nm SSL_CTX_get_options , | ||
| 13 | .Nm SSL_get_options , | ||
| 14 | .Nm SSL_get_secure_renegotiation_support | ||
| 15 | .Nd manipulate SSL options | ||
| 16 | .Sh SYNOPSIS | ||
| 17 | .In openssl/ssl.h | ||
| 18 | .Ft long | ||
| 19 | .Fn SSL_CTX_set_options "SSL_CTX *ctx" "long options" | ||
| 20 | .Ft long | ||
| 21 | .Fn SSL_set_options "SSL *ssl" "long options" | ||
| 22 | .Ft long | ||
| 23 | .Fn SSL_CTX_clear_options "SSL_CTX *ctx" "long options" | ||
| 24 | .Ft long | ||
| 25 | .Fn SSL_clear_options "SSL *ssl" "long options" | ||
| 26 | .Ft long | ||
| 27 | .Fn SSL_CTX_get_options "SSL_CTX *ctx" | ||
| 28 | .Ft long | ||
| 29 | .Fn SSL_get_options "SSL *ssl" | ||
| 30 | .Ft long | ||
| 31 | .Fn SSL_get_secure_renegotiation_support "SSL *ssl" | ||
| 32 | .Sh DESCRIPTION | ||
| 33 | Note: all these functions are implemented using macros. | ||
| 34 | .Pp | ||
| 35 | .Fn SSL_CTX_set_options | ||
| 36 | adds the options set via bitmask in | ||
| 37 | .Fa options | ||
| 38 | to | ||
| 39 | .Fa ctx . | ||
| 40 | Options already set before are not cleared! | ||
| 41 | .Pp | ||
| 42 | .Fn SSL_set_options | ||
| 43 | adds the options set via bitmask in | ||
| 44 | .Fa options | ||
| 45 | to | ||
| 46 | .Fa ssl . | ||
| 47 | Options already set before are not cleared! | ||
| 48 | .Pp | ||
| 49 | .Fn SSL_CTX_clear_options | ||
| 50 | clears the options set via bitmask in | ||
| 51 | .Fa options | ||
| 52 | to | ||
| 53 | .Fa ctx . | ||
| 54 | .Pp | ||
| 55 | .Fn SSL_clear_options | ||
| 56 | clears the options set via bitmask in | ||
| 57 | .Fa options | ||
| 58 | to | ||
| 59 | .Fa ssl . | ||
| 60 | .Pp | ||
| 61 | .Fn SSL_CTX_get_options | ||
| 62 | returns the options set for | ||
| 63 | .Fa ctx . | ||
| 64 | .Pp | ||
| 65 | .Fn SSL_get_options | ||
| 66 | returns the options set for | ||
| 67 | .Fa ssl . | ||
| 68 | .Pp | ||
| 69 | .Fn SSL_get_secure_renegotiation_support | ||
| 70 | indicates whether the peer supports secure renegotiation. | ||
| 71 | .Sh NOTES | ||
| 72 | The behaviour of the SSL library can be changed by setting several options. | ||
| 73 | The options are coded as bitmasks and can be combined by a bitwise OR | ||
| 74 | operation (|). | ||
| 75 | .Pp | ||
| 76 | .Fn SSL_CTX_set_options | ||
| 77 | and | ||
| 78 | .Fn SSL_set_options | ||
| 79 | affect the (external) protocol behaviour of the SSL library. | ||
| 80 | The (internal) behaviour of the API can be changed by using the similar | ||
| 81 | .Xr SSL_CTX_set_mode 3 | ||
| 82 | and | ||
| 83 | .Xr SSL_set_mode 3 | ||
| 84 | functions. | ||
| 85 | .Pp | ||
| 86 | During a handshake, the option settings of the SSL object are used. | ||
| 87 | When a new SSL object is created from a context using | ||
| 88 | .Xr SSL_new 3 , | ||
| 89 | the current option setting is copied. | ||
| 90 | Changes to | ||
| 91 | .Fa ctx | ||
| 92 | do not affect already created | ||
| 93 | .Vt SSL | ||
| 94 | objects. | ||
| 95 | .Fn SSL_clear | ||
| 96 | does not affect the settings. | ||
| 97 | .Pp | ||
| 98 | The following | ||
| 99 | .Em bug workaround | ||
| 100 | options are available: | ||
| 101 | .Bl -tag -width Ds | ||
| 102 | .It Dv SSL_OP_MICROSOFT_SESS_ID_BUG | ||
| 103 | As of | ||
| 104 | .Ox 5.8 , | ||
| 105 | this option has no effect. | ||
| 106 | .It Dv SSL_OP_NETSCAPE_CHALLENGE_BUG | ||
| 107 | As of | ||
| 108 | .Ox 5.8 , | ||
| 109 | this option has no effect. | ||
| 110 | .It Dv SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG | ||
| 111 | As of OpenSSL 0.9.8q and 1.0.0c, this option has no effect. | ||
| 112 | .It Dv SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG | ||
| 113 | As of | ||
| 114 | .Ox 5.8 , | ||
| 115 | this option has no effect. | ||
| 116 | .It Dv SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER | ||
| 117 | As of | ||
| 118 | .Ox 5.8 , | ||
| 119 | this option has no effect. | ||
| 120 | .It Dv SSL_OP_SAFARI_ECDHE_ECDSA_BUG | ||
| 121 | As of | ||
| 122 | .Ox 5.8 , | ||
| 123 | this option has no effect. | ||
| 124 | .It Dv SSL_OP_SSLEAY_080_CLIENT_DH_BUG | ||
| 125 | As of | ||
| 126 | .Ox 5.8 , | ||
| 127 | this option has no effect. | ||
| 128 | .It Dv SSL_OP_TLS_D5_BUG | ||
| 129 | As of | ||
| 130 | .Ox 5.8 , | ||
| 131 | this option has no effect. | ||
| 132 | .It Dv SSL_OP_TLS_BLOCK_PADDING_BUG | ||
| 133 | As of | ||
| 134 | .Ox 5.8 , | ||
| 135 | this option has no effect. | ||
| 136 | .It Dv SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS | ||
| 137 | Disables a countermeasure against a SSL 3.0/TLS 1.0 protocol vulnerability | ||
| 138 | affecting CBC ciphers, which cannot be handled by some broken SSL | ||
| 139 | implementations. | ||
| 140 | This option has no effect for connections using other ciphers. | ||
| 141 | .It Dv SSL_OP_TLSEXT_PADDING | ||
| 142 | Adds a padding extension to ensure the ClientHello size is never between 256 | ||
| 143 | and 511 bytes in length. | ||
| 144 | This is needed as a workaround for some implementations. | ||
| 145 | .It Dv SSL_OP_ALL | ||
| 146 | All of the above bug workarounds. | ||
| 147 | .El | ||
| 148 | .Pp | ||
| 149 | It is usually safe to use | ||
| 150 | .Dv SSL_OP_ALL | ||
| 151 | to enable the bug workaround options if compatibility with somewhat broken | ||
| 152 | implementations is desired. | ||
| 153 | .Pp | ||
| 154 | The following | ||
| 155 | .Em modifying | ||
| 156 | options are available: | ||
| 157 | .Bl -tag -width Ds | ||
| 158 | .It Dv SSL_OP_TLS_ROLLBACK_BUG | ||
| 159 | Disable version rollback attack detection. | ||
| 160 | .Pp | ||
| 161 | During the client key exchange, the client must send the same information | ||
| 162 | about acceptable SSL/TLS protocol levels as during the first hello. | ||
| 163 | Some clients violate this rule by adapting to the server's answer. | ||
| 164 | (Example: the client sends a SSLv2 hello and accepts up to SSLv3.1=TLSv1, | ||
| 165 | the server only understands up to SSLv3. | ||
| 166 | In this case the client must still use the same SSLv3.1=TLSv1 announcement. | ||
| 167 | Some clients step down to SSLv3 with respect to the server's answer and violate | ||
| 168 | the version rollback protection.) | ||
| 169 | .It Dv SSL_OP_SINGLE_DH_USE | ||
| 170 | Always create a new key when using temporary/ephemeral DH parameters | ||
| 171 | (see | ||
| 172 | .Xr SSL_CTX_set_tmp_dh_callback 3 ) . | ||
| 173 | This option must be used to prevent small subgroup attacks, when the DH | ||
| 174 | parameters were not generated using | ||
| 175 | .Dq strong | ||
| 176 | primes (e.g., when using DSA-parameters, see | ||
| 177 | .Xr openssl 1 ) . | ||
| 178 | If | ||
| 179 | .Dq strong | ||
| 180 | primes were used, it is not strictly necessary to generate a new DH key during | ||
| 181 | each handshake but it is also recommended. | ||
| 182 | .Dv SSL_OP_SINGLE_DH_USE | ||
| 183 | should therefore be enabled whenever temporary/ephemeral DH parameters are used. | ||
| 184 | .It SSL_OP_EPHEMERAL_RSA | ||
| 185 | Always use ephemeral (temporary) RSA key when doing RSA operations (see | ||
| 186 | .Xr SSL_CTX_set_tmp_rsa_callback 3 ) . | ||
| 187 | According to the specifications, this is only done when a RSA key can only be | ||
| 188 | used for signature operations (namely under export ciphers with restricted RSA | ||
| 189 | keylength). | ||
| 190 | By setting this option, ephemeral RSA keys are always used. | ||
| 191 | This option breaks compatibility with the SSL/TLS specifications and may lead | ||
| 192 | to interoperability problems with clients and should therefore never be used. | ||
| 193 | Ciphers with EDH (ephemeral Diffie-Hellman) key exchange should be used instead. | ||
| 194 | .It Dv SSL_OP_CIPHER_SERVER_PREFERENCE | ||
| 195 | When choosing a cipher, use the server's preferences instead of the client | ||
| 196 | preferences. | ||
| 197 | When not set, the SSL server will always follow the client's preferences. | ||
| 198 | When set, the SSLv3/TLSv1 server will choose following its own preferences. | ||
| 199 | Because of the different protocol, for SSLv2 the server will send its list of | ||
| 200 | preferences to the client and the client chooses. | ||
| 201 | .It Dv SSL_OP_NETSCAPE_CA_DN_BUG | ||
| 202 | As of | ||
| 203 | .Ox 5.8 , | ||
| 204 | this option has no effect. | ||
| 205 | .It Dv SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG | ||
| 206 | As of | ||
| 207 | .Ox 5.8 , | ||
| 208 | this option has no effect. | ||
| 209 | .It Dv SSL_OP_NO_SSLv2 | ||
| 210 | As of | ||
| 211 | .Ox 5.6 , | ||
| 212 | this option has no effect as SSLv2 support has been removed. | ||
| 213 | In previous versions it disabled use of the SSLv2 protocol. | ||
| 214 | .It Dv SSL_OP_NO_SSLv3 | ||
| 215 | Do not use the SSLv3 protocol. | ||
| 216 | .It Dv SSL_OP_NO_TLSv1 | ||
| 217 | Do not use the TLSv1.0 protocol. | ||
| 218 | .It Dv SSL_OP_NO_TLSv1_1 | ||
| 219 | Do not use the TLSv1.1 protocol. | ||
| 220 | .It Dv SSL_OP_NO_TLSv1_2 | ||
| 221 | Do not use the TLSv1.2 protocol. | ||
| 222 | .It Dv SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION | ||
| 223 | When performing renegotiation as a server, always start a new session (i.e., | ||
| 224 | session resumption requests are only accepted in the initial handshake). | ||
| 225 | This option is not needed for clients. | ||
| 226 | .It Dv SSL_OP_NO_TICKET | ||
| 227 | Normally clients and servers will, where possible, transparently make use of | ||
| 228 | RFC4507bis tickets for stateless session resumption. | ||
| 229 | .Pp | ||
| 230 | If this option is set this functionality is disabled and tickets will not be | ||
| 231 | used by clients or servers. | ||
| 232 | .It Dv SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION | ||
| 233 | As of | ||
| 234 | .Ox 5.6 , | ||
| 235 | this option has no effect. | ||
| 236 | In previous versions it allowed legacy insecure renegotiation between OpenSSL | ||
| 237 | and unpatched clients or servers. | ||
| 238 | See the | ||
| 239 | .Sx SECURE RENEGOTIATION | ||
| 240 | section for more details. | ||
| 241 | .It Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
| 242 | Allow legacy insecure renegotiation between OpenSSL and unpatched servers | ||
| 243 | .Em only : | ||
| 244 | this option is currently set by default. | ||
| 245 | See the | ||
| 246 | .Sx SECURE RENEGOTIATION | ||
| 247 | section for more details. | ||
| 248 | .El | ||
| 249 | .Sh SECURE RENEGOTIATION | ||
| 250 | OpenSSL 0.9.8m and later always attempts to use secure renegotiation as | ||
| 251 | described in RFC5746. | ||
| 252 | This counters the prefix attack described in CVE-2009-3555 and elsewhere. | ||
| 253 | .Pp | ||
| 254 | The deprecated and highly broken SSLv2 protocol does not support renegotiation | ||
| 255 | at all; its use is | ||
| 256 | .Em strongly | ||
| 257 | discouraged. | ||
| 258 | .Pp | ||
| 259 | This attack has far-reaching consequences which application writers should be | ||
| 260 | aware of. | ||
| 261 | In the description below an implementation supporting secure renegotiation is | ||
| 262 | referred to as | ||
| 263 | .Dq patched . | ||
| 264 | A server not supporting secure | ||
| 265 | renegotiation is referred to as | ||
| 266 | .Dq unpatched . | ||
| 267 | .Pp | ||
| 268 | The following sections describe the operations permitted by OpenSSL's secure | ||
| 269 | renegotiation implementation. | ||
| 270 | .Ss Patched client and server | ||
| 271 | Connections and renegotiation are always permitted by OpenSSL implementations. | ||
| 272 | .Ss Unpatched client and patched OpenSSL server | ||
| 273 | The initial connection succeeds but client renegotiation is denied by the | ||
| 274 | server with a | ||
| 275 | .Em no_renegotiation | ||
| 276 | warning alert if TLS v1.0 is used or a fatal | ||
| 277 | .Em handshake_failure | ||
| 278 | alert in SSL v3.0. | ||
| 279 | .Pp | ||
| 280 | If the patched OpenSSL server attempts to renegotiate a fatal | ||
| 281 | .Em handshake_failure | ||
| 282 | alert is sent. | ||
| 283 | This is because the server code may be unaware of the unpatched nature of the | ||
| 284 | client. | ||
| 285 | .Pp | ||
| 286 | .Em N.B.: | ||
| 287 | a bug in OpenSSL clients earlier than 0.9.8m (all of which are unpatched) will | ||
| 288 | result in the connection hanging if it receives a | ||
| 289 | .Em no_renegotiation | ||
| 290 | alert. | ||
| 291 | OpenSSL versions 0.9.8m and later will regard a | ||
| 292 | .Em no_renegotiation | ||
| 293 | alert as fatal and respond with a fatal | ||
| 294 | .Em handshake_failure | ||
| 295 | alert. | ||
| 296 | This is because the OpenSSL API currently has no provision to indicate to an | ||
| 297 | application that a renegotiation attempt was refused. | ||
| 298 | .Ss Patched OpenSSL client and unpatched server | ||
| 299 | If the option | ||
| 300 | .Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
| 301 | is set then initial connections and renegotiation between patched OpenSSL | ||
| 302 | clients and unpatched servers succeeds. | ||
| 303 | If neither option is set then initial connections to unpatched servers will | ||
| 304 | fail. | ||
| 305 | .Pp | ||
| 306 | The option | ||
| 307 | .Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
| 308 | is currently set by default even though it has security implications: | ||
| 309 | otherwise it would be impossible to connect to unpatched servers (i.e., all of | ||
| 310 | them initially) and this is clearly not acceptable. | ||
| 311 | Renegotiation is permitted because this does not add any additional security | ||
| 312 | issues: during an attack clients do not see any renegotiations anyway. | ||
| 313 | .Pp | ||
| 314 | As more servers become patched the option | ||
| 315 | .Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
| 316 | will | ||
| 317 | .Em not | ||
| 318 | be set by default in a future version of OpenSSL. | ||
| 319 | .Pp | ||
| 320 | OpenSSL client applications wishing to ensure they can connect to unpatched | ||
| 321 | servers should always | ||
| 322 | .Em set | ||
| 323 | .Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
| 324 | .Pp | ||
| 325 | OpenSSL client applications that want to ensure they can | ||
| 326 | .Em not | ||
| 327 | connect to unpatched servers (and thus avoid any security issues) should always | ||
| 328 | .Em clear | ||
| 329 | .Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
| 330 | using | ||
| 331 | .Fn SSL_CTX_clear_options | ||
| 332 | or | ||
| 333 | .Fn SSL_clear_options . | ||
| 334 | .Sh RETURN VALUES | ||
| 335 | .Fn SSL_CTX_set_options | ||
| 336 | and | ||
| 337 | .Fn SSL_set_options | ||
| 338 | return the new options bitmask after adding | ||
| 339 | .Fa options . | ||
| 340 | .Pp | ||
| 341 | .Fn SSL_CTX_clear_options | ||
| 342 | and | ||
| 343 | .Fn SSL_clear_options | ||
| 344 | return the new options bitmask after clearing | ||
| 345 | .Fa options . | ||
| 346 | .Pp | ||
| 347 | .Fn SSL_CTX_get_options | ||
| 348 | and | ||
| 349 | .Fn SSL_get_options | ||
| 350 | return the current bitmask. | ||
| 351 | .Pp | ||
| 352 | .Fn SSL_get_secure_renegotiation_support | ||
| 353 | returns 1 is the peer supports secure renegotiation and 0 if it does not. | ||
| 354 | .Sh SEE ALSO | ||
| 355 | .Xr openssl 1 , | ||
| 356 | .Xr ssl 3 , | ||
| 357 | .Xr SSL_clear 3 , | ||
| 358 | .Xr SSL_CTX_set_tmp_dh_callback 3 , | ||
| 359 | .Xr SSL_CTX_set_tmp_rsa_callback 3 , | ||
| 360 | .Xr SSL_new 3 | ||
| 361 | .Sh HISTORY | ||
| 362 | .Dv SSL_OP_CIPHER_SERVER_PREFERENCE | ||
| 363 | and | ||
| 364 | .Dv SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION | ||
| 365 | have been added in | ||
| 366 | OpenSSL 0.9.7. | ||
| 367 | .Pp | ||
| 368 | .Dv SSL_OP_TLS_ROLLBACK_BUG | ||
| 369 | has been added in OpenSSL 0.9.6 and was automatically enabled with | ||
| 370 | .Dv SSL_OP_ALL . | ||
| 371 | As of 0.9.7, it is no longer included in | ||
| 372 | .Dv SSL_OP_ALL | ||
| 373 | and must be explicitly set. | ||
| 374 | .Pp | ||
| 375 | .Dv SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS | ||
| 376 | has been added in OpenSSL 0.9.6e. | ||
| 377 | Versions up to OpenSSL 0.9.6c do not include the countermeasure that can be | ||
| 378 | disabled with this option (in OpenSSL 0.9.6d, it was always enabled). | ||
| 379 | .Pp | ||
| 380 | .Fn SSL_CTX_clear_options | ||
| 381 | and | ||
| 382 | .Fn SSL_clear_options | ||
| 383 | were first added in OpenSSL 0.9.8m. | ||
| 384 | .Pp | ||
| 385 | .Dv SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION , | ||
| 386 | .Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
| 387 | and the function | ||
| 388 | .Fn SSL_get_secure_renegotiation_support | ||
| 389 | were first added in OpenSSL 0.9.8m. | ||
| 390 | .Pp | ||
| 391 | .Dv SSL_OP_NO_SSLv2 | ||
| 392 | and | ||
| 393 | .Dv SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION | ||
| 394 | were changed to have no effect in | ||
| 395 | .Ox 5.6 . | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_psk_client_callback.3 b/src/lib/libssl/doc/SSL_CTX_set_psk_client_callback.3 deleted file mode 100644 index 40504ce59a..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_psk_client_callback.3 +++ /dev/null | |||
| @@ -1,68 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_psk_client_callback.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SET_PSK_CLIENT_CALLBACK 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_psk_client_callback , | ||
| 9 | .Nm SSL_set_psk_client_callback | ||
| 10 | .Nd set PSK client callback | ||
| 11 | .Sh SYNOPSIS | ||
| 12 | .In openssl/ssl.h | ||
| 13 | .Ft void | ||
| 14 | .Fo SSL_CTX_set_psk_client_callback | ||
| 15 | .Fa "SSL_CTX *ctx" | ||
| 16 | .Fa "unsigned int (*callback)(SSL *ssl, const char *hint, char *identity, \ | ||
| 17 | unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len)" | ||
| 18 | .Fc | ||
| 19 | .Ft void | ||
| 20 | .Fo SSL_set_psk_client_callback | ||
| 21 | .Fa "SSL *ssl" | ||
| 22 | .Fa "unsigned int (*callback)(SSL *ssl, const char *hint, char *identity, \ | ||
| 23 | unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len)" | ||
| 24 | .Fc | ||
| 25 | .Sh DESCRIPTION | ||
| 26 | A client application must provide a callback function which is called | ||
| 27 | when the client is sending the ClientKeyExchange message to the server. | ||
| 28 | .Pp | ||
| 29 | The purpose of the callback function is to select the PSK identity and | ||
| 30 | the pre-shared key to use during the connection setup phase. | ||
| 31 | .Pp | ||
| 32 | The callback is set using functions | ||
| 33 | .Fn SSL_CTX_set_psk_client_callback | ||
| 34 | or | ||
| 35 | .Fn SSL_set_psk_client_callback . | ||
| 36 | The callback function is given the connection in parameter | ||
| 37 | .Fa ssl , | ||
| 38 | a | ||
| 39 | .Dv NULL Ns | ||
| 40 | -terminated PSK identity hint sent by the server in parameter | ||
| 41 | .Fa hint , | ||
| 42 | a buffer | ||
| 43 | .Fa identity | ||
| 44 | of length | ||
| 45 | .Fa max_identity_len | ||
| 46 | bytes where the resulting | ||
| 47 | .Dv NULL Ns | ||
| 48 | -terminated identity is to be stored, and a buffer | ||
| 49 | .Fa psk | ||
| 50 | of | ||
| 51 | length | ||
| 52 | .Fa max_psk_len | ||
| 53 | bytes where the resulting pre-shared key is to be stored. | ||
| 54 | .Sh NOTES | ||
| 55 | Note that parameter | ||
| 56 | .Fa hint | ||
| 57 | given to the callback may be | ||
| 58 | .Dv NULL . | ||
| 59 | .Sh RETURN VALUES | ||
| 60 | Return values from the client callback are interpreted as follows: | ||
| 61 | .Pp | ||
| 62 | On success (callback found a PSK identity and a pre-shared key to use) | ||
| 63 | the length (> 0) of | ||
| 64 | .Fa psk | ||
| 65 | in bytes is returned. | ||
| 66 | .Pp | ||
| 67 | Otherwise or on errors callback should return 0. | ||
| 68 | In this case the connection setup fails. | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_quiet_shutdown.3 b/src/lib/libssl/doc/SSL_CTX_set_quiet_shutdown.3 deleted file mode 100644 index 5cad447318..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_quiet_shutdown.3 +++ /dev/null | |||
| @@ -1,115 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_quiet_shutdown.3,v 1.3 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SET_QUIET_SHUTDOWN 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_quiet_shutdown , | ||
| 9 | .Nm SSL_CTX_get_quiet_shutdown , | ||
| 10 | .Nm SSL_set_quiet_shutdown , | ||
| 11 | .Nm SSL_get_quiet_shutdown | ||
| 12 | .Nd manipulate shutdown behaviour | ||
| 13 | .Sh SYNOPSIS | ||
| 14 | .In openssl/ssl.h | ||
| 15 | .Ft void | ||
| 16 | .Fn SSL_CTX_set_quiet_shutdown "SSL_CTX *ctx" "int mode" | ||
| 17 | .Ft int | ||
| 18 | .Fn SSL_CTX_get_quiet_shutdown "const SSL_CTX *ctx" | ||
| 19 | .Ft void | ||
| 20 | .Fn SSL_set_quiet_shutdown "SSL *ssl" "int mode" | ||
| 21 | .Ft int | ||
| 22 | .Fn SSL_get_quiet_shutdown "const SSL *ssl" | ||
| 23 | .Sh DESCRIPTION | ||
| 24 | .Fn SSL_CTX_set_quiet_shutdown | ||
| 25 | sets the | ||
| 26 | .Dq quiet shutdown | ||
| 27 | flag for | ||
| 28 | .Fa ctx | ||
| 29 | to be | ||
| 30 | .Fa mode . | ||
| 31 | .Vt SSL | ||
| 32 | objects created from | ||
| 33 | .Fa ctx | ||
| 34 | inherit the | ||
| 35 | .Fa mode | ||
| 36 | valid at the time | ||
| 37 | .Xr SSL_new 3 | ||
| 38 | is called. | ||
| 39 | .Fa mode | ||
| 40 | may be 0 or 1. | ||
| 41 | .Pp | ||
| 42 | .Fn SSL_CTX_get_quiet_shutdown | ||
| 43 | returns the | ||
| 44 | .Dq quiet shutdown | ||
| 45 | setting of | ||
| 46 | .Fa ctx . | ||
| 47 | .Pp | ||
| 48 | .Fn SSL_set_quiet_shutdown | ||
| 49 | sets the | ||
| 50 | .Dq quiet shutdown | ||
| 51 | flag for | ||
| 52 | .Fa ssl | ||
| 53 | to be | ||
| 54 | .Fa mode . | ||
| 55 | The setting stays valid until | ||
| 56 | .Fa ssl | ||
| 57 | is removed with | ||
| 58 | .Xr SSL_free 3 | ||
| 59 | or | ||
| 60 | .Fn SSL_set_quiet_shutdown | ||
| 61 | is called again. | ||
| 62 | It is not changed when | ||
| 63 | .Xr SSL_clear 3 | ||
| 64 | is called. | ||
| 65 | .Fa mode | ||
| 66 | may be 0 or 1. | ||
| 67 | .Pp | ||
| 68 | .Fn SSL_get_quiet_shutdown | ||
| 69 | returns the | ||
| 70 | .Dq quiet shutdown | ||
| 71 | setting of | ||
| 72 | .Fa ssl . | ||
| 73 | .Sh NOTES | ||
| 74 | Normally when a SSL connection is finished, the parties must send out | ||
| 75 | .Dq close notify | ||
| 76 | alert messages using | ||
| 77 | .Xr SSL_shutdown 3 | ||
| 78 | for a clean shutdown. | ||
| 79 | .Pp | ||
| 80 | When setting the | ||
| 81 | .Dq quiet shutdown | ||
| 82 | flag to 1, | ||
| 83 | .Xr SSL_shutdown 3 | ||
| 84 | will set the internal flags to | ||
| 85 | .Dv SSL_SENT_SHUTDOWN Ns | Ns Dv SSL_RECEIVED_SHUTDOWN | ||
| 86 | .Po | ||
| 87 | .Xr SSL_shutdown 3 | ||
| 88 | then behaves like | ||
| 89 | .Xr SSL_set_shutdown 3 | ||
| 90 | called with | ||
| 91 | .Dv SSL_SENT_SHUTDOWN Ns | Ns Dv SSL_RECEIVED_SHUTDOWN | ||
| 92 | .Pc . | ||
| 93 | The session is thus considered to be shut down, but no | ||
| 94 | .Dq close notify | ||
| 95 | alert is sent to the peer. | ||
| 96 | This behaviour violates the TLS standard. | ||
| 97 | .Pp | ||
| 98 | The default is normal shutdown behaviour as described by the TLS standard. | ||
| 99 | .Sh RETURN VALUES | ||
| 100 | .Fn SSL_CTX_set_quiet_shutdown | ||
| 101 | and | ||
| 102 | .Fn SSL_set_quiet_shutdown | ||
| 103 | do not return diagnostic information. | ||
| 104 | .Pp | ||
| 105 | .Fn SSL_CTX_get_quiet_shutdown | ||
| 106 | and | ||
| 107 | .Fn SSL_get_quiet_shutdown | ||
| 108 | return the current setting. | ||
| 109 | .Sh SEE ALSO | ||
| 110 | .Xr ssl 3 , | ||
| 111 | .Xr SSL_clear 3 , | ||
| 112 | .Xr SSL_free 3 , | ||
| 113 | .Xr SSL_new 3 , | ||
| 114 | .Xr SSL_set_shutdown 3 , | ||
| 115 | .Xr SSL_shutdown 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_session_cache_mode.3 b/src/lib/libssl/doc/SSL_CTX_set_session_cache_mode.3 deleted file mode 100644 index a4e147f05a..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_session_cache_mode.3 +++ /dev/null | |||
| @@ -1,143 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_session_cache_mode.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SET_SESSION_CACHE_MODE 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_session_cache_mode , | ||
| 9 | .Nm SSL_CTX_get_session_cache_mode | ||
| 10 | .Nd enable/disable session caching | ||
| 11 | .Sh SYNOPSIS | ||
| 12 | .In openssl/ssl.h | ||
| 13 | .Ft long | ||
| 14 | .Fn SSL_CTX_set_session_cache_mode "SSL_CTX ctx" "long mode" | ||
| 15 | .Ft long | ||
| 16 | .Fn SSL_CTX_get_session_cache_mode "SSL_CTX ctx" | ||
| 17 | .Sh DESCRIPTION | ||
| 18 | .Fn SSL_CTX_set_session_cache_mode | ||
| 19 | enables/disables session caching by setting the operational mode for | ||
| 20 | .Ar ctx | ||
| 21 | to | ||
| 22 | .Ar mode . | ||
| 23 | .Pp | ||
| 24 | .Fn SSL_CTX_get_session_cache_mode | ||
| 25 | returns the currently used cache mode. | ||
| 26 | .Sh NOTES | ||
| 27 | The OpenSSL library can store/retrieve SSL/TLS sessions for later reuse. | ||
| 28 | The sessions can be held in memory for each | ||
| 29 | .Fa ctx , | ||
| 30 | if more than one | ||
| 31 | .Vt SSL_CTX | ||
| 32 | object is being maintained, the sessions are unique for each | ||
| 33 | .Vt SSL_CTX | ||
| 34 | object. | ||
| 35 | .Pp | ||
| 36 | In order to reuse a session, a client must send the session's id to the server. | ||
| 37 | It can only send exactly one id. | ||
| 38 | The server then either agrees to reuse the session or it starts a full | ||
| 39 | handshake (to create a new session). | ||
| 40 | .Pp | ||
| 41 | A server will lookup up the session in its internal session storage. | ||
| 42 | If the session is not found in internal storage or lookups for the internal | ||
| 43 | storage have been deactivated | ||
| 44 | .Pq Dv SSL_SESS_CACHE_NO_INTERNAL_LOOKUP , | ||
| 45 | the server will try the external storage if available. | ||
| 46 | .Pp | ||
| 47 | Since a client may try to reuse a session intended for use in a different | ||
| 48 | context, the session id context must be set by the server (see | ||
| 49 | .Xr SSL_CTX_set_session_id_context 3 ) . | ||
| 50 | .Pp | ||
| 51 | The following session cache modes and modifiers are available: | ||
| 52 | .Bl -tag -width Ds | ||
| 53 | .It Dv SSL_SESS_CACHE_OFF | ||
| 54 | No session caching for client or server takes place. | ||
| 55 | .It Dv SSL_SESS_CACHE_CLIENT | ||
| 56 | Client sessions are added to the session cache. | ||
| 57 | As there is no reliable way for the OpenSSL library to know whether a session | ||
| 58 | should be reused or which session to choose (due to the abstract BIO layer the | ||
| 59 | SSL engine does not have details about the connection), | ||
| 60 | the application must select the session to be reused by using the | ||
| 61 | .Xr SSL_set_session 3 | ||
| 62 | function. | ||
| 63 | This option is not activated by default. | ||
| 64 | .It Dv SSL_SESS_CACHE_SERVER | ||
| 65 | Server sessions are added to the session cache. | ||
| 66 | When a client proposes a session to be reused, the server looks for the | ||
| 67 | corresponding session in (first) the internal session cache (unless | ||
| 68 | .Dv SSL_SESS_CACHE_NO_INTERNAL_LOOKUP | ||
| 69 | is set), then (second) in the external cache if available. | ||
| 70 | If the session is found, the server will try to reuse the session. | ||
| 71 | This is the default. | ||
| 72 | .It Dv SSL_SESS_CACHE_BOTH | ||
| 73 | Enable both | ||
| 74 | .Dv SSL_SESS_CACHE_CLIENT | ||
| 75 | and | ||
| 76 | .Dv SSL_SESS_CACHE_SERVER | ||
| 77 | at the same time. | ||
| 78 | .It Dv SSL_SESS_CACHE_NO_AUTO_CLEAR | ||
| 79 | Normally the session cache is checked for expired sessions every 255 | ||
| 80 | connections using the | ||
| 81 | .Xr SSL_CTX_flush_sessions 3 | ||
| 82 | function. | ||
| 83 | Since this may lead to a delay which cannot be controlled, | ||
| 84 | the automatic flushing may be disabled and | ||
| 85 | .Xr SSL_CTX_flush_sessions 3 | ||
| 86 | can be called explicitly by the application. | ||
| 87 | .It Dv SSL_SESS_CACHE_NO_INTERNAL_LOOKUP | ||
| 88 | By setting this flag, session-resume operations in an SSL/TLS server will not | ||
| 89 | automatically look up sessions in the internal cache, | ||
| 90 | even if sessions are automatically stored there. | ||
| 91 | If external session caching callbacks are in use, | ||
| 92 | this flag guarantees that all lookups are directed to the external cache. | ||
| 93 | As automatic lookup only applies for SSL/TLS servers, | ||
| 94 | the flag has no effect on clients. | ||
| 95 | .It Dv SSL_SESS_CACHE_NO_INTERNAL_STORE | ||
| 96 | Depending on the presence of | ||
| 97 | .Dv SSL_SESS_CACHE_CLIENT | ||
| 98 | and/or | ||
| 99 | .Dv SSL_SESS_CACHE_SERVER , | ||
| 100 | sessions negotiated in an SSL/TLS handshake may be cached for possible reuse. | ||
| 101 | Normally a new session is added to the internal cache as well as any external | ||
| 102 | session caching (callback) that is configured for the | ||
| 103 | .Vt SSL_CTX . | ||
| 104 | This flag will prevent sessions being stored in the internal cache | ||
| 105 | (though the application can add them manually using | ||
| 106 | .Xr SSL_CTX_add_session 3 ) . | ||
| 107 | Note: | ||
| 108 | in any SSL/TLS servers where external caching is configured, any successful | ||
| 109 | session lookups in the external cache (e.g., for session-resume requests) would | ||
| 110 | normally be copied into the local cache before processing continues \(en this | ||
| 111 | flag prevents these additions to the internal cache as well. | ||
| 112 | .It Dv SSL_SESS_CACHE_NO_INTERNAL | ||
| 113 | Enable both | ||
| 114 | .Dv SSL_SESS_CACHE_NO_INTERNAL_LOOKUP | ||
| 115 | and | ||
| 116 | .Dv SSL_SESS_CACHE_NO_INTERNAL_STORE | ||
| 117 | at the same time. | ||
| 118 | .El | ||
| 119 | .Pp | ||
| 120 | The default mode is | ||
| 121 | .Dv SSL_SESS_CACHE_SERVER . | ||
| 122 | .Sh RETURN VALUES | ||
| 123 | .Fn SSL_CTX_set_session_cache_mode | ||
| 124 | returns the previously set cache mode. | ||
| 125 | .Pp | ||
| 126 | .Fn SSL_CTX_get_session_cache_mode | ||
| 127 | returns the currently set cache mode. | ||
| 128 | .Sh SEE ALSO | ||
| 129 | .Xr ssl 3 , | ||
| 130 | .Xr SSL_CTX_add_session 3 , | ||
| 131 | .Xr SSL_CTX_flush_sessions 3 , | ||
| 132 | .Xr SSL_CTX_sess_number 3 , | ||
| 133 | .Xr SSL_CTX_sess_set_cache_size 3 , | ||
| 134 | .Xr SSL_CTX_sess_set_get_cb 3 , | ||
| 135 | .Xr SSL_CTX_set_session_id_context 3 , | ||
| 136 | .Xr SSL_CTX_set_timeout 3 , | ||
| 137 | .Xr SSL_session_reused 3 , | ||
| 138 | .Xr SSL_set_session 3 | ||
| 139 | .Sh HISTORY | ||
| 140 | .Dv SSL_SESS_CACHE_NO_INTERNAL_STORE | ||
| 141 | and | ||
| 142 | .Dv SSL_SESS_CACHE_NO_INTERNAL | ||
| 143 | were introduced in OpenSSL 0.9.6h. | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_session_id_context.3 b/src/lib/libssl/doc/SSL_CTX_set_session_id_context.3 deleted file mode 100644 index 8f85c4e938..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_session_id_context.3 +++ /dev/null | |||
| @@ -1,105 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_session_id_context.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SET_SESSION_ID_CONTEXT 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_session_id_context , | ||
| 9 | .Nm SSL_set_session_id_context | ||
| 10 | .Nd set context within which session can be reused (server side only) | ||
| 11 | .Sh SYNOPSIS | ||
| 12 | .In openssl/ssl.h | ||
| 13 | .Ft int | ||
| 14 | .Fo SSL_CTX_set_session_id_context | ||
| 15 | .Fa "SSL_CTX *ctx" | ||
| 16 | .Fa const unsigned char *sid_ctx" | ||
| 17 | .Fa "unsigned int sid_ctx_len" | ||
| 18 | .Fc | ||
| 19 | .Ft int | ||
| 20 | .Fo SSL_set_session_id_context | ||
| 21 | .Fa "SSL *ssl" | ||
| 22 | .Fa const unsigned char *sid_ctx" | ||
| 23 | .Fa "unsigned int sid_ctx_len" | ||
| 24 | .Fc | ||
| 25 | .Sh DESCRIPTION | ||
| 26 | .Fn SSL_CTX_set_session_id_context | ||
| 27 | sets the context | ||
| 28 | .Fa sid_ctx | ||
| 29 | of length | ||
| 30 | .Fa sid_ctx_len | ||
| 31 | within which a session can be reused for the | ||
| 32 | .Fa ctx | ||
| 33 | object. | ||
| 34 | .Pp | ||
| 35 | .Fn SSL_set_session_id_context | ||
| 36 | sets the context | ||
| 37 | .Fa sid_ctx | ||
| 38 | of length | ||
| 39 | .Fa sid_ctx_len | ||
| 40 | within which a session can be reused for the | ||
| 41 | .Fa ssl | ||
| 42 | object. | ||
| 43 | .Sh NOTES | ||
| 44 | Sessions are generated within a certain context. | ||
| 45 | When exporting/importing sessions with | ||
| 46 | .Xr i2d_SSL_SESSION 3 | ||
| 47 | and | ||
| 48 | .Xr d2i_SSL_SESSION 3 , | ||
| 49 | it would be possible to re-import a session generated from another context | ||
| 50 | (e.g., another application), which might lead to malfunctions. | ||
| 51 | Therefore each application must set its own session id context | ||
| 52 | .Fa sid_ctx | ||
| 53 | which is used to distinguish the contexts and is stored in exported sessions. | ||
| 54 | The | ||
| 55 | .Fa sid_ctx | ||
| 56 | can be any kind of binary data with a given length; it is therefore possible | ||
| 57 | to use, for instance, the name of the application, the hostname, the service | ||
| 58 | name... | ||
| 59 | .Pp | ||
| 60 | The session id context becomes part of the session. | ||
| 61 | The session id context is set by the SSL/TLS server. | ||
| 62 | The | ||
| 63 | .Fn SSL_CTX_set_session_id_context | ||
| 64 | and | ||
| 65 | .Fn SSL_set_session_id_context | ||
| 66 | functions are therefore only useful on the server side. | ||
| 67 | .Pp | ||
| 68 | OpenSSL clients will check the session id context returned by the server when | ||
| 69 | reusing a session. | ||
| 70 | .Pp | ||
| 71 | The maximum length of the | ||
| 72 | .Fa sid_ctx | ||
| 73 | is limited to | ||
| 74 | .Dv SSL_MAX_SSL_SESSION_ID_LENGTH . | ||
| 75 | .Sh WARNINGS | ||
| 76 | If the session id context is not set on an SSL/TLS server and client | ||
| 77 | certificates are used, stored sessions will not be reused but a fatal error | ||
| 78 | will be flagged and the handshake will fail. | ||
| 79 | .Pp | ||
| 80 | If a server returns a different session id context to an OpenSSL client | ||
| 81 | when reusing a session, an error will be flagged and the handshake will | ||
| 82 | fail. | ||
| 83 | OpenSSL servers will always return the correct session id context, | ||
| 84 | as an OpenSSL server checks the session id context itself before reusing | ||
| 85 | a session as described above. | ||
| 86 | .Sh RETURN VALUES | ||
| 87 | .Fn SSL_CTX_set_session_id_context | ||
| 88 | and | ||
| 89 | .Fn SSL_set_session_id_context | ||
| 90 | return the following values: | ||
| 91 | .Bl -tag -width Ds | ||
| 92 | .It 0 | ||
| 93 | The length | ||
| 94 | .Fa sid_ctx_len | ||
| 95 | of the session id context | ||
| 96 | .Fa sid_ctx | ||
| 97 | exceeded | ||
| 98 | the maximum allowed length of | ||
| 99 | .Dv SSL_MAX_SSL_SESSION_ID_LENGTH . | ||
| 100 | The error is logged to the error stack. | ||
| 101 | .It 1 | ||
| 102 | The operation succeeded. | ||
| 103 | .El | ||
| 104 | .Sh SEE ALSO | ||
| 105 | .Xr ssl 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_ssl_version.3 b/src/lib/libssl/doc/SSL_CTX_set_ssl_version.3 deleted file mode 100644 index f4bd74e73b..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_ssl_version.3 +++ /dev/null | |||
| @@ -1,81 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_ssl_version.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SET_SSL_VERSION 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_ssl_version , | ||
| 9 | .Nm SSL_set_ssl_method , | ||
| 10 | .Nm SSL_get_ssl_method | ||
| 11 | .Nd choose a new TLS/SSL method | ||
| 12 | .Sh SYNOPSIS | ||
| 13 | .In openssl/ssl.h | ||
| 14 | .Ft int | ||
| 15 | .Fn SSL_CTX_set_ssl_version "SSL_CTX *ctx" "const SSL_METHOD *method" | ||
| 16 | .Ft int | ||
| 17 | .Fn SSL_set_ssl_method "SSL *s" "const SSL_METHOD *method" | ||
| 18 | .Ft const SSL_METHOD * | ||
| 19 | .Fn SSL_get_ssl_method "SSL *ssl" | ||
| 20 | .Sh DESCRIPTION | ||
| 21 | .Fn SSL_CTX_set_ssl_version | ||
| 22 | sets a new default TLS/SSL | ||
| 23 | .Fa method | ||
| 24 | for | ||
| 25 | .Vt SSL | ||
| 26 | objects newly created from this | ||
| 27 | .Fa ctx . | ||
| 28 | .Vt SSL | ||
| 29 | objects already created with | ||
| 30 | .Xr SSL_new 3 | ||
| 31 | are not affected, except when | ||
| 32 | .Xr SSL_clear 3 | ||
| 33 | is called. | ||
| 34 | .Pp | ||
| 35 | .Fn SSL_set_ssl_method | ||
| 36 | sets a new TLS/SSL | ||
| 37 | .Fa method | ||
| 38 | for a particular | ||
| 39 | .Vt SSL | ||
| 40 | object | ||
| 41 | .Fa s . | ||
| 42 | It may be reset when | ||
| 43 | .Xr SSL_clear 3 | ||
| 44 | is called. | ||
| 45 | .Pp | ||
| 46 | .Fn SSL_get_ssl_method | ||
| 47 | returns a function pointer to the TLS/SSL method set in | ||
| 48 | .Fa ssl . | ||
| 49 | .Sh NOTES | ||
| 50 | The available | ||
| 51 | .Fa method | ||
| 52 | choices are described in | ||
| 53 | .Xr SSL_CTX_new 3 . | ||
| 54 | .Pp | ||
| 55 | When | ||
| 56 | .Xr SSL_clear 3 | ||
| 57 | is called and no session is connected to an | ||
| 58 | .Vt SSL | ||
| 59 | object, the method of the | ||
| 60 | .Vt SSL | ||
| 61 | object is reset to the method currently set in the corresponding | ||
| 62 | .Vt SSL_CTX | ||
| 63 | object. | ||
| 64 | .Sh RETURN VALUES | ||
| 65 | The following return values can occur for | ||
| 66 | .Fn SSL_CTX_set_ssl_version | ||
| 67 | and | ||
| 68 | .Fn SSL_set_ssl_method : | ||
| 69 | .Bl -tag -width Ds | ||
| 70 | .It 0 | ||
| 71 | The new choice failed. | ||
| 72 | Check the error stack to find out the reason. | ||
| 73 | .It 1 | ||
| 74 | The operation succeeded. | ||
| 75 | .El | ||
| 76 | .Sh SEE ALSO | ||
| 77 | .Xr ssl 3 , | ||
| 78 | .Xr SSL_clear 3 , | ||
| 79 | .Xr SSL_CTX_new 3 , | ||
| 80 | .Xr SSL_new 3 , | ||
| 81 | .Xr SSL_set_connect_state 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_timeout.3 b/src/lib/libssl/doc/SSL_CTX_set_timeout.3 deleted file mode 100644 index 6454c4616f..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_timeout.3 +++ /dev/null | |||
| @@ -1,65 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_timeout.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SET_TIMEOUT 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_timeout , | ||
| 9 | .Nm SSL_CTX_get_timeout | ||
| 10 | .Nd manipulate timeout values for session caching | ||
| 11 | .Sh SYNOPSIS | ||
| 12 | .In openssl/ssl.h | ||
| 13 | .Ft long | ||
| 14 | .Fn SSL_CTX_set_timeout "SSL_CTX *ctx" "long t" | ||
| 15 | .Ft long | ||
| 16 | .Fn SSL_CTX_get_timeout "SSL_CTX *ctx" | ||
| 17 | .Sh DESCRIPTION | ||
| 18 | .Fn SSL_CTX_set_timeout | ||
| 19 | sets the timeout for newly created sessions for | ||
| 20 | .Fa ctx | ||
| 21 | to | ||
| 22 | .Fa t . | ||
| 23 | The timeout value | ||
| 24 | .Fa t | ||
| 25 | must be given in seconds. | ||
| 26 | .Pp | ||
| 27 | .Fn SSL_CTX_get_timeout | ||
| 28 | returns the currently set timeout value for | ||
| 29 | .Fa ctx . | ||
| 30 | .Sh NOTES | ||
| 31 | Whenever a new session is created, it is assigned a maximum lifetime. | ||
| 32 | This lifetime is specified by storing the creation time of the session and the | ||
| 33 | timeout value valid at this time. | ||
| 34 | If the actual time is later than creation time plus timeout, | ||
| 35 | the session is not reused. | ||
| 36 | .Pp | ||
| 37 | Due to this realization, all sessions behave according to the timeout value | ||
| 38 | valid at the time of the session negotiation. | ||
| 39 | Changes of the timeout value do not affect already established sessions. | ||
| 40 | .Pp | ||
| 41 | The expiration time of a single session can be modified using the | ||
| 42 | .Xr SSL_SESSION_get_time 3 | ||
| 43 | family of functions. | ||
| 44 | .Pp | ||
| 45 | Expired sessions are removed from the internal session cache, whenever | ||
| 46 | .Xr SSL_CTX_flush_sessions 3 | ||
| 47 | is called, either directly by the application or automatically (see | ||
| 48 | .Xr SSL_CTX_set_session_cache_mode 3 ) . | ||
| 49 | .Pp | ||
| 50 | The default value for session timeout is decided on a per-protocol basis; see | ||
| 51 | .Xr SSL_get_default_timeout 3 . | ||
| 52 | All currently supported protocols have the same default timeout value of 300 | ||
| 53 | seconds. | ||
| 54 | .Sh RETURN VALUES | ||
| 55 | .Fn SSL_CTX_set_timeout | ||
| 56 | returns the previously set timeout value. | ||
| 57 | .Pp | ||
| 58 | .Fn SSL_CTX_get_timeout | ||
| 59 | returns the currently set timeout value. | ||
| 60 | .Sh SEE ALSO | ||
| 61 | .Xr ssl 3 , | ||
| 62 | .Xr SSL_CTX_flush_sessions 3 , | ||
| 63 | .Xr SSL_CTX_set_session_cache_mode 3 , | ||
| 64 | .Xr SSL_get_default_timeout 3 , | ||
| 65 | .Xr SSL_SESSION_get_time 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_tmp_dh_callback.3 b/src/lib/libssl/doc/SSL_CTX_set_tmp_dh_callback.3 deleted file mode 100644 index 17eed868ee..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_tmp_dh_callback.3 +++ /dev/null | |||
| @@ -1,235 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_tmp_dh_callback.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SET_TMP_DH_CALLBACK 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_tmp_dh_callback , | ||
| 9 | .Nm SSL_CTX_set_tmp_dh , | ||
| 10 | .Nm SSL_set_tmp_dh_callback , | ||
| 11 | .Nm SSL_set_tmp_dh | ||
| 12 | .Nd handle DH keys for ephemeral key exchange | ||
| 13 | .Sh SYNOPSIS | ||
| 14 | .In openssl/ssl.h | ||
| 15 | .Ft void | ||
| 16 | .Fo SSL_CTX_set_tmp_dh_callback | ||
| 17 | .Fa "SSL_CTX *ctx" | ||
| 18 | .Fa "DH *(*tmp_dh_callback)(SSL *ssl, int is_export, int keylength)" | ||
| 19 | .Fc | ||
| 20 | .Ft long | ||
| 21 | .Fn SSL_CTX_set_tmp_dh "SSL_CTX *ctx" "DH *dh" | ||
| 22 | .Ft void | ||
| 23 | .Fo SSL_set_tmp_dh_callback | ||
| 24 | .Fa "SSL *ssl" | ||
| 25 | .Fa "DH *(*tmp_dh_callback)(SSL *ssl, int is_export, int keylength" | ||
| 26 | .Fc | ||
| 27 | .Ft long | ||
| 28 | .Fn SSL_set_tmp_dh "SSL *ssl" "DH *dh" | ||
| 29 | .Sh DESCRIPTION | ||
| 30 | .Fn SSL_CTX_set_tmp_dh_callback | ||
| 31 | sets the callback function for | ||
| 32 | .Fa ctx | ||
| 33 | to be used when a DH parameters are required to | ||
| 34 | .Fa tmp_dh_callback . | ||
| 35 | The callback is inherited by all | ||
| 36 | .Vt ssl | ||
| 37 | objects created from | ||
| 38 | .Fa ctx . | ||
| 39 | .Pp | ||
| 40 | .Fn SSL_CTX_set_tmp_dh | ||
| 41 | sets DH parameters to be used to be | ||
| 42 | .Sy dh Ns . | ||
| 43 | The key is inherited by all | ||
| 44 | .Fa ssl | ||
| 45 | objects created from | ||
| 46 | .Fa ctx . | ||
| 47 | .Pp | ||
| 48 | .Fn SSL_set_tmp_dh_callback | ||
| 49 | sets the callback only for | ||
| 50 | .Fa ssl . | ||
| 51 | .Pp | ||
| 52 | .Fn SSL_set_tmp_dh | ||
| 53 | sets the parameters only for | ||
| 54 | .Fa ssl . | ||
| 55 | .Pp | ||
| 56 | These functions apply to SSL/TLS servers only. | ||
| 57 | .Sh NOTES | ||
| 58 | When using a cipher with RSA authentication, | ||
| 59 | an ephemeral DH key exchange can take place. | ||
| 60 | Ciphers with DSA keys always use ephemeral DH keys as well. | ||
| 61 | In these cases, the session data are negotiated using the ephemeral/temporary | ||
| 62 | DH key and the key supplied and certified by the certificate chain is only used | ||
| 63 | for signing. | ||
| 64 | Anonymous ciphers (without a permanent server key) also use ephemeral DH keys. | ||
| 65 | .Pp | ||
| 66 | Using ephemeral DH key exchange yields forward secrecy, | ||
| 67 | as the connection can only be decrypted when the DH key is known. | ||
| 68 | By generating a temporary DH key inside the server application that is lost | ||
| 69 | when the application is left, it becomes impossible for an attacker to decrypt | ||
| 70 | past sessions, even if he gets hold of the normal (certified) key, | ||
| 71 | as this key was only used for signing. | ||
| 72 | .Pp | ||
| 73 | In order to perform a DH key exchange the server must use a DH group | ||
| 74 | (DH parameters) and generate a DH key. | ||
| 75 | The server will always generate a new DH key during the negotiation, | ||
| 76 | when the DH parameters are supplied via callback and/or when the | ||
| 77 | .Dv SSL_OP_SINGLE_DH_USE | ||
| 78 | option of | ||
| 79 | .Xr SSL_CTX_set_options 3 | ||
| 80 | is set. | ||
| 81 | It will immediately create a DH key, when DH parameters are supplied via | ||
| 82 | .Fn SSL_CTX_set_tmp_dh | ||
| 83 | and | ||
| 84 | .Dv SSL_OP_SINGLE_DH_USE | ||
| 85 | is not set. | ||
| 86 | In this case, it may happen that a key is generated on initialization without | ||
| 87 | later being needed, while on the other hand the computer time during the | ||
| 88 | negotiation is being saved. | ||
| 89 | .Pp | ||
| 90 | If | ||
| 91 | .Dq strong | ||
| 92 | primes were used to generate the DH parameters, it is not strictly necessary to | ||
| 93 | generate a new key for each handshake but it does improve forward secrecy. | ||
| 94 | If it is not assured that | ||
| 95 | .Dq strong | ||
| 96 | primes were used (see especially the section about DSA parameters below), | ||
| 97 | .Dv SSL_OP_SINGLE_DH_USE | ||
| 98 | must be used in order to prevent small subgroup attacks. | ||
| 99 | Always using | ||
| 100 | .Dv SSL_OP_SINGLE_DH_USE | ||
| 101 | has an impact on the computer time needed during negotiation, | ||
| 102 | but it is not very large, | ||
| 103 | so application authors/users should consider always enabling this option. | ||
| 104 | .Pp | ||
| 105 | As generating DH parameters is extremely time consuming, an application should | ||
| 106 | not generate the parameters on the fly but supply the parameters. | ||
| 107 | DH parameters can be reused, | ||
| 108 | as the actual key is newly generated during the negotiation. | ||
| 109 | The risk in reusing DH parameters is that an attacker may specialize on a very | ||
| 110 | often used DH group. | ||
| 111 | Applications should therefore generate their own DH parameters during the | ||
| 112 | installation process using the openssl | ||
| 113 | .Xr openssl 1 | ||
| 114 | application. | ||
| 115 | In order to reduce the computer time needed for this generation, | ||
| 116 | it is possible to use DSA parameters instead (see | ||
| 117 | .Xr openssl 1 ) , | ||
| 118 | but in this case | ||
| 119 | .Dv SSL_OP_SINGLE_DH_USE | ||
| 120 | is mandatory. | ||
| 121 | .Pp | ||
| 122 | Application authors may compile in DH parameters. | ||
| 123 | Files | ||
| 124 | .Pa dh512.pem , | ||
| 125 | .Pa dh1024.pem , | ||
| 126 | .Pa dh2048.pem , | ||
| 127 | and | ||
| 128 | .Pa dh4096.pem | ||
| 129 | in the | ||
| 130 | .Pa apps | ||
| 131 | directory of the current version of the OpenSSL distribution contain the | ||
| 132 | .Sq SKIP | ||
| 133 | DH parameters, | ||
| 134 | which use safe primes and were generated verifiably pseudo-randomly. | ||
| 135 | These files can be converted into C code using the | ||
| 136 | .Fl C | ||
| 137 | option of the | ||
| 138 | .Xr openssl 1 | ||
| 139 | application. | ||
| 140 | Authors may also generate their own set of parameters using | ||
| 141 | .Xr openssl 1 , | ||
| 142 | but a user may not be sure how the parameters were generated. | ||
| 143 | The generation of DH parameters during installation is therefore recommended. | ||
| 144 | .Pp | ||
| 145 | An application may either directly specify the DH parameters or can supply the | ||
| 146 | DH parameters via a callback function. | ||
| 147 | The callback approach has the advantage that the callback may supply DH | ||
| 148 | parameters for different key lengths. | ||
| 149 | .Pp | ||
| 150 | The | ||
| 151 | .Fa tmp_dh_callback | ||
| 152 | is called with the | ||
| 153 | .Fa keylength | ||
| 154 | needed and the | ||
| 155 | .Fa is_export | ||
| 156 | information. | ||
| 157 | The | ||
| 158 | .Fa is_export | ||
| 159 | flag is set when the ephemeral DH key exchange is performed with an export | ||
| 160 | cipher. | ||
| 161 | .Sh RETURN VALUES | ||
| 162 | .Fn SSL_CTX_set_tmp_dh_callback | ||
| 163 | and | ||
| 164 | .Fn SSL_set_tmp_dh_callback | ||
| 165 | do not return diagnostic output. | ||
| 166 | .Pp | ||
| 167 | .Fn SSL_CTX_set_tmp_dh | ||
| 168 | and | ||
| 169 | .Fn SSL_set_tmp_dh | ||
| 170 | do return 1 on success and 0 on failure. | ||
| 171 | Check the error queue to find out the reason of failure. | ||
| 172 | .Sh EXAMPLES | ||
| 173 | Handle DH parameters for key lengths of 512 and 1024 bits. | ||
| 174 | (Error handling partly left out.) | ||
| 175 | .Bd -literal | ||
| 176 | \&... | ||
| 177 | /* Set up ephemeral DH stuff */ | ||
| 178 | DH *dh_512 = NULL; | ||
| 179 | DH *dh_1024 = NULL; | ||
| 180 | FILE *paramfile; | ||
| 181 | |||
| 182 | \&... | ||
| 183 | |||
| 184 | /* "openssl dhparam -out dh_param_512.pem -2 512" */ | ||
| 185 | paramfile = fopen("dh_param_512.pem", "r"); | ||
| 186 | if (paramfile) { | ||
| 187 | dh_512 = PEM_read_DHparams(paramfile, NULL, NULL, NULL); | ||
| 188 | fclose(paramfile); | ||
| 189 | } | ||
| 190 | /* "openssl dhparam -out dh_param_1024.pem -2 1024" */ | ||
| 191 | paramfile = fopen("dh_param_1024.pem", "r"); | ||
| 192 | if (paramfile) { | ||
| 193 | dh_1024 = PEM_read_DHparams(paramfile, NULL, NULL, NULL); | ||
| 194 | fclose(paramfile); | ||
| 195 | } | ||
| 196 | |||
| 197 | \&... | ||
| 198 | |||
| 199 | /* "openssl dhparam -C -2 512" etc... */ | ||
| 200 | DH *get_dh512() { ... } | ||
| 201 | DH *get_dh1024() { ... } | ||
| 202 | |||
| 203 | DH * | ||
| 204 | tmp_dh_callback(SSL *s, int is_export, int keylength) | ||
| 205 | { | ||
| 206 | DH *dh_tmp=NULL; | ||
| 207 | |||
| 208 | switch (keylength) { | ||
| 209 | case 512: | ||
| 210 | if (!dh_512) | ||
| 211 | dh_512 = get_dh512(); | ||
| 212 | dh_tmp = dh_512; | ||
| 213 | break; | ||
| 214 | case 1024: | ||
| 215 | if (!dh_1024) | ||
| 216 | dh_1024 = get_dh1024(); | ||
| 217 | dh_tmp = dh_1024; | ||
| 218 | break; | ||
| 219 | default: | ||
| 220 | /* | ||
| 221 | * Generating a key on the fly is very costly, | ||
| 222 | * so use what is there | ||
| 223 | */ | ||
| 224 | setup_dh_parameters_like_above(); | ||
| 225 | } | ||
| 226 | |||
| 227 | return(dh_tmp); | ||
| 228 | } | ||
| 229 | .Ed | ||
| 230 | .Sh SEE ALSO | ||
| 231 | .Xr openssl 1 , | ||
| 232 | .Xr ssl 3 , | ||
| 233 | .Xr SSL_CTX_set_cipher_list 3 , | ||
| 234 | .Xr SSL_CTX_set_options 3 , | ||
| 235 | .Xr SSL_CTX_set_tmp_rsa_callback 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_tmp_rsa_callback.3 b/src/lib/libssl/doc/SSL_CTX_set_tmp_rsa_callback.3 deleted file mode 100644 index 253274d122..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_tmp_rsa_callback.3 +++ /dev/null | |||
| @@ -1,231 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_tmp_rsa_callback.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SET_TMP_RSA_CALLBACK.POD 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_tmp_rsa_callback , | ||
| 9 | .Nm SSL_CTX_set_tmp_rsa , | ||
| 10 | .Nm SSL_CTX_need_tmp_rsa , | ||
| 11 | .Nm SSL_set_tmp_rsa_callback , | ||
| 12 | .Nm SSL_set_tmp_rsa , | ||
| 13 | .Nm SSL_need_tmp_rsa | ||
| 14 | .Nd handle RSA keys for ephemeral key exchange | ||
| 15 | .Sh SYNOPSIS | ||
| 16 | .In openssl/ssl.h | ||
| 17 | .Ft void | ||
| 18 | .Fo SSL_CTX_set_tmp_rsa_callback | ||
| 19 | .Fa "SSL_CTX *ctx" | ||
| 20 | .Fa "RSA *(*tmp_rsa_callback)(SSL *ssl, int is_export, int keylength)" | ||
| 21 | .Fc | ||
| 22 | .Ft long | ||
| 23 | .Fn SSL_CTX_set_tmp_rsa "SSL_CTX *ctx" "RSA *rsa" | ||
| 24 | .Ft long | ||
| 25 | .Fn SSL_CTX_need_tmp_rsa "SSL_CTX *ctx" | ||
| 26 | .Ft void | ||
| 27 | .Fo SSL_set_tmp_rsa_callback | ||
| 28 | .Fa "SSL_CTX *ctx" | ||
| 29 | .Fa "RSA *(*tmp_rsa_callback)(SSL *ssl, int is_export, int keylength)" | ||
| 30 | .Fc | ||
| 31 | .Ft long | ||
| 32 | .Fn SSL_set_tmp_rsa "SSL *ssl" "RSA *rsa" | ||
| 33 | .Ft long | ||
| 34 | .Fn SSL_need_tmp_rsa "SSL *ssl" | ||
| 35 | .Ft RSA * | ||
| 36 | .Fn "(*tmp_rsa_callback)" "SSL *ssl" "int is_export" "int keylength" | ||
| 37 | .Sh DESCRIPTION | ||
| 38 | .Fn SSL_CTX_set_tmp_rsa_callback | ||
| 39 | sets the callback function for | ||
| 40 | .Fa ctx | ||
| 41 | to be used when a temporary/ephemeral RSA key is required to | ||
| 42 | .Fa tmp_rsa_callback . | ||
| 43 | The callback is inherited by all | ||
| 44 | .Vt SSL | ||
| 45 | objects newly created from | ||
| 46 | .Fa ctx | ||
| 47 | with | ||
| 48 | .Xr SSL_new 3 . | ||
| 49 | Already created SSL objects are not affected. | ||
| 50 | .Pp | ||
| 51 | .Fn SSL_CTX_set_tmp_rsa | ||
| 52 | sets the temporary/ephemeral RSA key to be used to be | ||
| 53 | .Fa rsa . | ||
| 54 | The key is inherited by all | ||
| 55 | .Vt SSL | ||
| 56 | objects newly created from | ||
| 57 | .Fa ctx | ||
| 58 | with | ||
| 59 | .Xr SSL_new 3 . | ||
| 60 | Already created SSL objects are not affected. | ||
| 61 | .Pp | ||
| 62 | .Fn SSL_CTX_need_tmp_rsa | ||
| 63 | returns 1, | ||
| 64 | if a temporary/ephemeral RSA key is needed for RSA-based strength-limited | ||
| 65 | .Sq exportable | ||
| 66 | ciphersuites because a RSA key with a keysize larger than 512 bits is installed. | ||
| 67 | .Pp | ||
| 68 | .Fn SSL_set_tmp_rsa_callback | ||
| 69 | sets the callback only for | ||
| 70 | .Fa ssl . | ||
| 71 | .Pp | ||
| 72 | .Fn SSL_set_tmp_rsa | ||
| 73 | sets the key only for | ||
| 74 | .Fa ssl . | ||
| 75 | .Pp | ||
| 76 | .Fn SSL_need_tmp_rsa | ||
| 77 | returns 1, | ||
| 78 | if a temporary/ephemeral RSA key is needed for RSA-based strength-limited | ||
| 79 | .Sq exportable | ||
| 80 | ciphersuites because a RSA key with a keysize larger than 512 bits is installed. | ||
| 81 | .Pp | ||
| 82 | These functions apply to SSL/TLS servers only. | ||
| 83 | .Sh NOTES | ||
| 84 | When using a cipher with RSA authentication, | ||
| 85 | an ephemeral RSA key exchange can take place. | ||
| 86 | In this case the session data are negotiated using the ephemeral/temporary RSA | ||
| 87 | key and the RSA key supplied and certified by the certificate chain is only | ||
| 88 | used for signing. | ||
| 89 | .Pp | ||
| 90 | Under previous export restrictions, ciphers with RSA keys shorter (512 bits) | ||
| 91 | than the usual key length of 1024 bits were created. | ||
| 92 | To use these ciphers with RSA keys of usual length, an ephemeral key exchange | ||
| 93 | must be performed, as the normal (certified) key cannot be directly used. | ||
| 94 | .Pp | ||
| 95 | Using ephemeral RSA key exchange yields forward secrecy, | ||
| 96 | as the connection can only be decrypted when the RSA key is known. | ||
| 97 | By generating a temporary RSA key inside the server application that is lost | ||
| 98 | when the application is left, it becomes impossible for an attacker to decrypt | ||
| 99 | past sessions, even if he gets hold of the normal (certified) RSA key, | ||
| 100 | as this key was used for signing only. | ||
| 101 | The downside is that creating a RSA key is computationally expensive. | ||
| 102 | .Pp | ||
| 103 | Additionally, the use of ephemeral RSA key exchange is only allowed in the TLS | ||
| 104 | standard when the RSA key can be used for signing only, that is, | ||
| 105 | for export ciphers. | ||
| 106 | Using ephemeral RSA key exchange for other purposes violates the standard and | ||
| 107 | can break interoperability with clients. | ||
| 108 | It is therefore strongly recommended to not use ephemeral RSA key exchange and | ||
| 109 | use EDH (Ephemeral Diffie-Hellman) key exchange instead in order to achieve | ||
| 110 | forward secrecy (see | ||
| 111 | .Xr SSL_CTX_set_tmp_dh_callback 3 ) . | ||
| 112 | .Pp | ||
| 113 | On OpenSSL servers ephemeral RSA key exchange is therefore disabled by default | ||
| 114 | and must be explicitly enabled using the | ||
| 115 | .Dv SSL_OP_EPHEMERAL_RSA | ||
| 116 | option of | ||
| 117 | .Xr SSL_CTX_set_options 3 , | ||
| 118 | violating the TLS/SSL | ||
| 119 | standard. | ||
| 120 | When ephemeral RSA key exchange is required for export ciphers, | ||
| 121 | it will automatically be used without this option! | ||
| 122 | .Pp | ||
| 123 | An application may either directly specify the key or can supply the key via | ||
| 124 | a callback function. | ||
| 125 | The callback approach has the advantage that the callback may generate the key | ||
| 126 | only in case it is actually needed. | ||
| 127 | However, as the generation of a RSA key is costly, | ||
| 128 | it will lead to a significant delay in the handshake procedure. | ||
| 129 | Another advantage of the callback function is that it can supply keys of | ||
| 130 | different size (e.g., for | ||
| 131 | .Dv SSL_OP_EPHEMERAL_RSA | ||
| 132 | usage) while the explicit setting of the key is only useful for key size of | ||
| 133 | 512 bits to satisfy the export restricted ciphers and does give away key length | ||
| 134 | if a longer key would be allowed. | ||
| 135 | .Pp | ||
| 136 | The | ||
| 137 | .Fa tmp_rsa_callback | ||
| 138 | is called with the | ||
| 139 | .Fa keylength | ||
| 140 | needed and the | ||
| 141 | .Fa is_export | ||
| 142 | information. | ||
| 143 | The | ||
| 144 | .Fa is_export | ||
| 145 | flag is set when the ephemeral RSA key exchange is performed with an export | ||
| 146 | cipher. | ||
| 147 | .Sh RETURN VALUES | ||
| 148 | .Fn SSL_CTX_set_tmp_rsa_callback | ||
| 149 | and | ||
| 150 | .Fn SSL_set_tmp_rsa_callback | ||
| 151 | do not return diagnostic output. | ||
| 152 | .Pp | ||
| 153 | .Fn SSL_CTX_set_tmp_rsa | ||
| 154 | and | ||
| 155 | .Fn SSL_set_tmp_rsa | ||
| 156 | return 1 on success and 0 on failure. | ||
| 157 | Check the error queue to find out the reason of failure. | ||
| 158 | .Pp | ||
| 159 | .Fn SSL_CTX_need_tmp_rsa | ||
| 160 | and | ||
| 161 | .Fn SSL_need_tmp_rsa | ||
| 162 | return 1 if a temporary RSA key is needed and 0 otherwise. | ||
| 163 | .Sh EXAMPLES | ||
| 164 | Generate temporary RSA keys to prepare ephemeral RSA key exchange. | ||
| 165 | As the generation of a RSA key costs a lot of computer time, | ||
| 166 | they are saved for later reuse. | ||
| 167 | For demonstration purposes, two keys for 512 bits and 1024 bits | ||
| 168 | respectively are generated. | ||
| 169 | .Bd -literal | ||
| 170 | \&... | ||
| 171 | |||
| 172 | /* Set up ephemeral RSA stuff */ | ||
| 173 | RSA *rsa_512 = NULL; | ||
| 174 | RSA *rsa_1024 = NULL; | ||
| 175 | |||
| 176 | rsa_512 = RSA_generate_key(512, RSA_F4, NULL, NULL); | ||
| 177 | if (rsa_512 == NULL) | ||
| 178 | evaluate_error_queue(); | ||
| 179 | |||
| 180 | rsa_1024 = RSA_generate_key(1024, RSA_F4, NULL, NULL); | ||
| 181 | if (rsa_1024 == NULL) | ||
| 182 | evaluate_error_queue(); | ||
| 183 | |||
| 184 | \&... | ||
| 185 | |||
| 186 | RSA * | ||
| 187 | tmp_rsa_callback(SSL *s, int is_export, int keylength) | ||
| 188 | { | ||
| 189 | RSA *rsa_tmp = NULL; | ||
| 190 | |||
| 191 | switch (keylength) { | ||
| 192 | case 512: | ||
| 193 | if (rsa_512) | ||
| 194 | rsa_tmp = rsa_512; | ||
| 195 | else { | ||
| 196 | /* | ||
| 197 | * generate on the fly, | ||
| 198 | * should not happen in this example | ||
| 199 | */ | ||
| 200 | rsa_tmp = RSA_generate_key(keylength, RSA_F4, NULL, | ||
| 201 | NULL); | ||
| 202 | rsa_512 = rsa_tmp; /* Remember for later reuse */ | ||
| 203 | } | ||
| 204 | break; | ||
| 205 | case 1024: | ||
| 206 | if (rsa_1024) | ||
| 207 | rsa_tmp = rsa_1024; | ||
| 208 | else | ||
| 209 | should_not_happen_in_this_example(); | ||
| 210 | break; | ||
| 211 | default: | ||
| 212 | /* | ||
| 213 | * Generating a key on the fly is very costly, | ||
| 214 | * so use what is there | ||
| 215 | */ | ||
| 216 | if (rsa_1024) | ||
| 217 | rsa_tmp = rsa_1024; | ||
| 218 | else | ||
| 219 | /* Use at least a shorter key */ | ||
| 220 | rsa_tmp = rsa_512; | ||
| 221 | } | ||
| 222 | return rsa_tmp; | ||
| 223 | } | ||
| 224 | .Ed | ||
| 225 | .Sh SEE ALSO | ||
| 226 | .Xr openssl 1 , | ||
| 227 | .Xr ssl 3 , | ||
| 228 | .Xr SSL_CTX_set_cipher_list 3 , | ||
| 229 | .Xr SSL_CTX_set_options 3 , | ||
| 230 | .Xr SSL_CTX_set_tmp_dh_callback 3 , | ||
| 231 | .Xr SSL_new 3 | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_set_verify.3 b/src/lib/libssl/doc/SSL_CTX_set_verify.3 deleted file mode 100644 index 9292f2086b..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_set_verify.3 +++ /dev/null | |||
| @@ -1,415 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_set_verify.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_SET_VERIFY 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_set_verify , | ||
| 9 | .Nm SSL_set_verify , | ||
| 10 | .Nm SSL_CTX_set_verify_depth , | ||
| 11 | .Nm SSL_set_verify_depth | ||
| 12 | .Nd set peer certificate verification parameters | ||
| 13 | .Sh SYNOPSIS | ||
| 14 | .In openssl/ssl.h | ||
| 15 | .Ft void | ||
| 16 | .Fo SSL_CTX_set_verify | ||
| 17 | .Fa "SSL_CTX *ctx" | ||
| 18 | .Fa "int mode" | ||
| 19 | .Fa "int (*verify_callback)(int, X509_STORE_CTX *)" | ||
| 20 | .Fc | ||
| 21 | .Ft void | ||
| 22 | .Fo SSL_set_verify | ||
| 23 | .Fa "SSL *s" | ||
| 24 | .Fa "int mode" | ||
| 25 | .Fa "int (*verify_callback)(int, X509_STORE_CTX *)" | ||
| 26 | .Fc | ||
| 27 | .Ft void | ||
| 28 | .Fn SSL_CTX_set_verify_depth "SSL_CTX *ctx" "int depth" | ||
| 29 | .Ft void | ||
| 30 | .Fn SSL_set_verify_depth "SSL *s" "int depth" | ||
| 31 | .Ft int | ||
| 32 | .Fn verify_callback "int preverify_ok" "X509_STORE_CTX *x509_ctx" | ||
| 33 | .Sh DESCRIPTION | ||
| 34 | .Fn SSL_CTX_set_verify | ||
| 35 | sets the verification flags for | ||
| 36 | .Fa ctx | ||
| 37 | to be | ||
| 38 | .Fa mode | ||
| 39 | and | ||
| 40 | specifies the | ||
| 41 | .Fa verify_callback | ||
| 42 | function to be used. | ||
| 43 | If no callback function shall be specified, the | ||
| 44 | .Dv NULL | ||
| 45 | pointer can be used for | ||
| 46 | .Fa verify_callback . | ||
| 47 | .Pp | ||
| 48 | .Fn SSL_set_verify | ||
| 49 | sets the verification flags for | ||
| 50 | .Fa ssl | ||
| 51 | to be | ||
| 52 | .Fa mode | ||
| 53 | and specifies the | ||
| 54 | .Fa verify_callback | ||
| 55 | function to be used. | ||
| 56 | If no callback function shall be specified, the | ||
| 57 | .Dv NULL | ||
| 58 | pointer can be used for | ||
| 59 | .Fa verify_callback . | ||
| 60 | In this case last | ||
| 61 | .Fa verify_callback | ||
| 62 | set specifically for this | ||
| 63 | .Fa ssl | ||
| 64 | remains. | ||
| 65 | If no special callback was set before, the default callback for the underlying | ||
| 66 | .Fa ctx | ||
| 67 | is used, that was valid at the time | ||
| 68 | .Fa ssl | ||
| 69 | was created with | ||
| 70 | .Xr SSL_new 3 . | ||
| 71 | .Pp | ||
| 72 | .Fn SSL_CTX_set_verify_depth | ||
| 73 | sets the maximum | ||
| 74 | .Fa depth | ||
| 75 | for the certificate chain verification that shall be allowed for | ||
| 76 | .Fa ctx . | ||
| 77 | (See the | ||
| 78 | .Sx BUGS | ||
| 79 | section.) | ||
| 80 | .Pp | ||
| 81 | .Fn SSL_set_verify_depth | ||
| 82 | sets the maximum | ||
| 83 | .Fa depth | ||
| 84 | for the certificate chain verification that shall be allowed for | ||
| 85 | .Fa ssl . | ||
| 86 | (See the | ||
| 87 | .Sx BUGS | ||
| 88 | section.) | ||
| 89 | .Sh NOTES | ||
| 90 | The verification of certificates can be controlled by a set of bitwise ORed | ||
| 91 | .Fa mode | ||
| 92 | flags: | ||
| 93 | .Bl -tag -width Ds | ||
| 94 | .It Dv SSL_VERIFY_NONE | ||
| 95 | .Em Server mode: | ||
| 96 | the server will not send a client certificate request to the client, | ||
| 97 | so the client will not send a certificate. | ||
| 98 | .Pp | ||
| 99 | .Em Client mode: | ||
| 100 | if not using an anonymous cipher (by default disabled), | ||
| 101 | the server will send a certificate which will be checked. | ||
| 102 | The result of the certificate verification process can be checked after the | ||
| 103 | TLS/SSL handshake using the | ||
| 104 | .Xr SSL_get_verify_result 3 | ||
| 105 | function. | ||
| 106 | The handshake will be continued regardless of the verification result. | ||
| 107 | .It Dv SSL_VERIFY_PEER | ||
| 108 | .Em Server mode: | ||
| 109 | the server sends a client certificate request to the client. | ||
| 110 | The certificate returned (if any) is checked. | ||
| 111 | If the verification process fails, | ||
| 112 | the TLS/SSL handshake is immediately terminated with an alert message | ||
| 113 | containing the reason for the verification failure. | ||
| 114 | The behaviour can be controlled by the additional | ||
| 115 | .Dv SSL_VERIFY_FAIL_IF_NO_PEER_CERT | ||
| 116 | and | ||
| 117 | .Dv SSL_VERIFY_CLIENT_ONCE | ||
| 118 | flags. | ||
| 119 | .Pp | ||
| 120 | .Em Client mode: | ||
| 121 | the server certificate is verified. | ||
| 122 | If the verification process fails, | ||
| 123 | the TLS/SSL handshake is immediately terminated with an alert message | ||
| 124 | containing the reason for the verification failure. | ||
| 125 | If no server certificate is sent, because an anonymous cipher is used, | ||
| 126 | .Dv SSL_VERIFY_PEER | ||
| 127 | is ignored. | ||
| 128 | .It Dv SSL_VERIFY_FAIL_IF_NO_PEER_CERT | ||
| 129 | .Em Server mode: | ||
| 130 | if the client did not return a certificate, the TLS/SSL | ||
| 131 | handshake is immediately terminated with a | ||
| 132 | .Dq handshake failure | ||
| 133 | alert. | ||
| 134 | This flag must be used together with | ||
| 135 | .Dv SSL_VERIFY_PEER. | ||
| 136 | .Pp | ||
| 137 | .Em Client mode: | ||
| 138 | ignored | ||
| 139 | .It Dv SSL_VERIFY_CLIENT_ONCE | ||
| 140 | .Em Server mode: | ||
| 141 | only request a client certificate on the initial TLS/SSL handshake. | ||
| 142 | Do not ask for a client certificate again in case of a renegotiation. | ||
| 143 | This flag must be used together with | ||
| 144 | .Dv SSL_VERIFY_PEER . | ||
| 145 | .Pp | ||
| 146 | .Em Client mode: | ||
| 147 | ignored | ||
| 148 | .El | ||
| 149 | .Pp | ||
| 150 | Exactly one of the | ||
| 151 | .Fa mode | ||
| 152 | flags | ||
| 153 | .Dv SSL_VERIFY_NONE | ||
| 154 | and | ||
| 155 | .Dv SSL_VERIFY_PEER | ||
| 156 | must be set at any time. | ||
| 157 | .Pp | ||
| 158 | The actual verification procedure is performed either using the built-in | ||
| 159 | verification procedure or using another application provided verification | ||
| 160 | function set with | ||
| 161 | .Xr SSL_CTX_set_cert_verify_callback 3 . | ||
| 162 | The following descriptions apply in the case of the built-in procedure. | ||
| 163 | An application provided procedure also has access to the verify depth | ||
| 164 | information and the | ||
| 165 | .Fa verify_callback Ns () | ||
| 166 | function, but the way this information is used may be different. | ||
| 167 | .Pp | ||
| 168 | .Fn SSL_CTX_set_verify_depth | ||
| 169 | and | ||
| 170 | .Fn SSL_set_verify_depth | ||
| 171 | set the limit up to which depth certificates in a chain are used during the | ||
| 172 | verification procedure. | ||
| 173 | If the certificate chain is longer than allowed, | ||
| 174 | the certificates above the limit are ignored. | ||
| 175 | Error messages are generated as if these certificates would not be present, | ||
| 176 | most likely a | ||
| 177 | .Dv X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY | ||
| 178 | will be issued. | ||
| 179 | The depth count is | ||
| 180 | .Dq level 0: peer certificate , | ||
| 181 | .Dq level 1: CA certificate , | ||
| 182 | .Dq level 2: higher level CA certificate , | ||
| 183 | and so on. | ||
| 184 | Setting the maximum depth to 2 allows the levels 0, 1, and 2. | ||
| 185 | The default depth limit is 100, | ||
| 186 | allowing for the peer certificate and an additional 100 CA certificates. | ||
| 187 | .Pp | ||
| 188 | The | ||
| 189 | .Fa verify_callback | ||
| 190 | function is used to control the behaviour when the | ||
| 191 | .Dv SSL_VERIFY_PEER | ||
| 192 | flag is set. | ||
| 193 | It must be supplied by the application and receives two arguments: | ||
| 194 | .Fa preverify_ok | ||
| 195 | indicates whether the verification of the certificate in question was passed | ||
| 196 | (preverify_ok=1) or not (preverify_ok=0). | ||
| 197 | .Fa x509_ctx | ||
| 198 | is a pointer to the complete context used | ||
| 199 | for the certificate chain verification. | ||
| 200 | .Pp | ||
| 201 | The certificate chain is checked starting with the deepest nesting level | ||
| 202 | (the root CA certificate) and worked upward to the peer's certificate. | ||
| 203 | At each level signatures and issuer attributes are checked. | ||
| 204 | Whenever a verification error is found, the error number is stored in | ||
| 205 | .Fa x509_ctx | ||
| 206 | and | ||
| 207 | .Fa verify_callback | ||
| 208 | is called with | ||
| 209 | .Fa preverify_ok | ||
| 210 | equal to 0. | ||
| 211 | By applying | ||
| 212 | .Fn X509_CTX_store_* | ||
| 213 | functions | ||
| 214 | .Fa verify_callback | ||
| 215 | can locate the certificate in question and perform additional steps (see | ||
| 216 | .Sx EXAMPLES ) . | ||
| 217 | If no error is found for a certificate, | ||
| 218 | .Fa verify_callback | ||
| 219 | is called with | ||
| 220 | .Fa preverify_ok | ||
| 221 | equal to 1 before advancing to the next level. | ||
| 222 | .Pp | ||
| 223 | The return value of | ||
| 224 | .Fa verify_callback | ||
| 225 | controls the strategy of the further verification process. | ||
| 226 | If | ||
| 227 | .Fa verify_callback | ||
| 228 | returns 0, the verification process is immediately stopped with | ||
| 229 | .Dq verification failed | ||
| 230 | state. | ||
| 231 | If | ||
| 232 | .Dv SSL_VERIFY_PEER | ||
| 233 | is set, a verification failure alert is sent to the peer and the TLS/SSL | ||
| 234 | handshake is terminated. | ||
| 235 | If | ||
| 236 | .Fa verify_callback | ||
| 237 | returns 1, the verification process is continued. | ||
| 238 | If | ||
| 239 | .Fa verify_callback | ||
| 240 | always returns 1, | ||
| 241 | the TLS/SSL handshake will not be terminated with respect to verification | ||
| 242 | failures and the connection will be established. | ||
| 243 | The calling process can however retrieve the error code of the last | ||
| 244 | verification error using | ||
| 245 | .Xr SSL_get_verify_result 3 | ||
| 246 | or by maintaining its own error storage managed by | ||
| 247 | .Fa verify_callback . | ||
| 248 | .Pp | ||
| 249 | If no | ||
| 250 | .Fa verify_callback | ||
| 251 | is specified, the default callback will be used. | ||
| 252 | Its return value is identical to | ||
| 253 | .Fa preverify_ok , | ||
| 254 | so that any verification | ||
| 255 | failure will lead to a termination of the TLS/SSL handshake with an | ||
| 256 | alert message, if | ||
| 257 | .Dv SSL_VERIFY_PEER | ||
| 258 | is set. | ||
| 259 | .Sh RETURN VALUES | ||
| 260 | The | ||
| 261 | .Fn SSL*_set_verify* | ||
| 262 | functions do not provide diagnostic information. | ||
| 263 | .Sh EXAMPLES | ||
| 264 | The following code sequence realizes an example | ||
| 265 | .Fa verify_callback | ||
| 266 | function that will always continue the TLS/SSL handshake regardless of | ||
| 267 | verification failure, if wished. | ||
| 268 | The callback realizes a verification depth limit with more informational output. | ||
| 269 | .Pp | ||
| 270 | All verification errors are printed; | ||
| 271 | information about the certificate chain is printed on request. | ||
| 272 | The example is realized for a server that does allow but not require client | ||
| 273 | certificates. | ||
| 274 | .Pp | ||
| 275 | The example makes use of the ex_data technique to store application data | ||
| 276 | into/retrieve application data from the | ||
| 277 | .Vt SSL | ||
| 278 | structure (see | ||
| 279 | .Xr SSL_get_ex_new_index 3 , | ||
| 280 | .Xr SSL_get_ex_data_X509_STORE_CTX_idx 3 ) . | ||
| 281 | .Bd -literal | ||
| 282 | \&... | ||
| 283 | |||
| 284 | typedef struct { | ||
| 285 | int verbose_mode; | ||
| 286 | int verify_depth; | ||
| 287 | int always_continue; | ||
| 288 | } mydata_t; | ||
| 289 | int mydata_index; | ||
| 290 | \&... | ||
| 291 | static int | ||
| 292 | verify_callback(int preverify_ok, X509_STORE_CTX *ctx) | ||
| 293 | { | ||
| 294 | char buf[256]; | ||
| 295 | X509 *err_cert; | ||
| 296 | int err, depth; | ||
| 297 | SSL *ssl; | ||
| 298 | mydata_t *mydata; | ||
| 299 | |||
| 300 | err_cert = X509_STORE_CTX_get_current_cert(ctx); | ||
| 301 | err = X509_STORE_CTX_get_error(ctx); | ||
| 302 | depth = X509_STORE_CTX_get_error_depth(ctx); | ||
| 303 | |||
| 304 | /* | ||
| 305 | * Retrieve the pointer to the SSL of the connection currently | ||
| 306 | * treated * and the application specific data stored into the | ||
| 307 | * SSL object. | ||
| 308 | */ | ||
| 309 | ssl = X509_STORE_CTX_get_ex_data(ctx, | ||
| 310 | SSL_get_ex_data_X509_STORE_CTX_idx()); | ||
| 311 | mydata = SSL_get_ex_data(ssl, mydata_index); | ||
| 312 | |||
| 313 | X509_NAME_oneline(X509_get_subject_name(err_cert), buf, 256); | ||
| 314 | |||
| 315 | /* | ||
| 316 | * Catch a too long certificate chain. The depth limit set using | ||
| 317 | * SSL_CTX_set_verify_depth() is by purpose set to "limit+1" so | ||
| 318 | * that whenever the "depth>verify_depth" condition is met, we | ||
| 319 | * have violated the limit and want to log this error condition. | ||
| 320 | * We must do it here, because the CHAIN_TOO_LONG error would not | ||
| 321 | * be found explicitly; only errors introduced by cutting off the | ||
| 322 | * additional certificates would be logged. | ||
| 323 | */ | ||
| 324 | if (depth > mydata->verify_depth) { | ||
| 325 | preverify_ok = 0; | ||
| 326 | err = X509_V_ERR_CERT_CHAIN_TOO_LONG; | ||
| 327 | X509_STORE_CTX_set_error(ctx, err); | ||
| 328 | } | ||
| 329 | if (!preverify_ok) { | ||
| 330 | printf("verify error:num=%d:%s:depth=%d:%s\en", err, | ||
| 331 | X509_verify_cert_error_string(err), depth, buf); | ||
| 332 | } else if (mydata->verbose_mode) { | ||
| 333 | printf("depth=%d:%s\en", depth, buf); | ||
| 334 | } | ||
| 335 | |||
| 336 | /* | ||
| 337 | * At this point, err contains the last verification error. | ||
| 338 | * We can use it for something special | ||
| 339 | */ | ||
| 340 | if (!preverify_ok && (err == | ||
| 341 | X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT)) { | ||
| 342 | X509_NAME_oneline(X509_get_issuer_name(ctx->current_cert), | ||
| 343 | buf, 256); | ||
| 344 | printf("issuer= %s\en", buf); | ||
| 345 | } | ||
| 346 | |||
| 347 | if (mydata->always_continue) | ||
| 348 | return 1; | ||
| 349 | else | ||
| 350 | return preverify_ok; | ||
| 351 | } | ||
| 352 | \&... | ||
| 353 | |||
| 354 | mydata_t mydata; | ||
| 355 | |||
| 356 | \&... | ||
| 357 | |||
| 358 | mydata_index = SSL_get_ex_new_index(0, "mydata index", NULL, NULL, NULL); | ||
| 359 | |||
| 360 | \&... | ||
| 361 | |||
| 362 | SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER|SSL_VERIFY_CLIENT_ONCE, | ||
| 363 | verify_callback); | ||
| 364 | |||
| 365 | /* | ||
| 366 | * Let the verify_callback catch the verify_depth error so that we get | ||
| 367 | * an appropriate error in the logfile. | ||
| 368 | */ | ||
| 369 | SSL_CTX_set_verify_depth(verify_depth + 1); | ||
| 370 | |||
| 371 | /* | ||
| 372 | * Set up the SSL specific data into "mydata" and store it into the SSL | ||
| 373 | * structure. | ||
| 374 | */ | ||
| 375 | mydata.verify_depth = verify_depth; ... | ||
| 376 | SSL_set_ex_data(ssl, mydata_index, &mydata); | ||
| 377 | |||
| 378 | \&... | ||
| 379 | |||
| 380 | SSL_accept(ssl); /* check of success left out for clarity */ | ||
| 381 | if (peer = SSL_get_peer_certificate(ssl)) { | ||
| 382 | if (SSL_get_verify_result(ssl) == X509_V_OK) { | ||
| 383 | /* The client sent a certificate which verified OK */ | ||
| 384 | } | ||
| 385 | } | ||
| 386 | .Ed | ||
| 387 | .Sh SEE ALSO | ||
| 388 | .Xr ssl 3 , | ||
| 389 | .Xr SSL_CTX_get_verify_mode 3 , | ||
| 390 | .Xr SSL_CTX_load_verify_locations 3 , | ||
| 391 | .Xr SSL_CTX_set_cert_verify_callback 3 , | ||
| 392 | .Xr SSL_get_ex_data_X509_STORE_CTX_idx 3 , | ||
| 393 | .Xr SSL_get_ex_new_index 3 , | ||
| 394 | .Xr SSL_get_peer_certificate 3 , | ||
| 395 | .Xr SSL_get_verify_result 3 , | ||
| 396 | .Xr SSL_new 3 | ||
| 397 | .Sh BUGS | ||
| 398 | In client mode, it is not checked whether the | ||
| 399 | .Dv SSL_VERIFY_PEER | ||
| 400 | flag is set, but whether | ||
| 401 | .Dv SSL_VERIFY_NONE | ||
| 402 | is not set. | ||
| 403 | This can lead to unexpected behaviour, if the | ||
| 404 | .Dv SSL_VERIFY_PEER | ||
| 405 | and | ||
| 406 | .Dv SSL_VERIFY_NONE | ||
| 407 | are not used as required (exactly one must be set at any time). | ||
| 408 | .Pp | ||
| 409 | The certificate verification depth set with | ||
| 410 | .Fn SSL[_CTX]_verify_depth | ||
| 411 | stops the verification at a certain depth. | ||
| 412 | The error message produced will be that of an incomplete certificate chain and | ||
| 413 | not | ||
| 414 | .Dv X509_V_ERR_CERT_CHAIN_TOO_LONG | ||
| 415 | as may be expected. | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_use_certificate.3 b/src/lib/libssl/doc/SSL_CTX_use_certificate.3 deleted file mode 100644 index 6282c3b0d7..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_use_certificate.3 +++ /dev/null | |||
| @@ -1,336 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_use_certificate.3,v 1.3 2015/02/06 01:37:11 reyk Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: February 6 2015 $ | ||
| 5 | .Dt SSL_CTX_USE_CERTIFICATE 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_use_certificate , | ||
| 9 | .Nm SSL_CTX_use_certificate_ASN1 , | ||
| 10 | .Nm SSL_CTX_use_certificate_file , | ||
| 11 | .Nm SSL_use_certificate , | ||
| 12 | .Nm SSL_use_certificate_ASN1 , | ||
| 13 | .Nm SSL_use_certificate_file , | ||
| 14 | .Nm SSL_CTX_use_certificate_chain_file , | ||
| 15 | .Nm SSL_CTX_use_certificate_chain_mem , | ||
| 16 | .Nm SSL_CTX_use_PrivateKey , | ||
| 17 | .Nm SSL_CTX_use_PrivateKey_ASN1 , | ||
| 18 | .Nm SSL_CTX_use_PrivateKey_file , | ||
| 19 | .Nm SSL_CTX_use_RSAPrivateKey , | ||
| 20 | .Nm SSL_CTX_use_RSAPrivateKey_ASN1 , | ||
| 21 | .Nm SSL_CTX_use_RSAPrivateKey_file , | ||
| 22 | .Nm SSL_use_PrivateKey_file , | ||
| 23 | .Nm SSL_use_PrivateKey_ASN1 , | ||
| 24 | .Nm SSL_use_PrivateKey , | ||
| 25 | .Nm SSL_use_RSAPrivateKey , | ||
| 26 | .Nm SSL_use_RSAPrivateKey_ASN1 , | ||
| 27 | .Nm SSL_use_RSAPrivateKey_file , | ||
| 28 | .Nm SSL_CTX_check_private_key , | ||
| 29 | .Nm SSL_check_private_key | ||
| 30 | .Nd load certificate and key data | ||
| 31 | .Sh SYNOPSIS | ||
| 32 | .In openssl/ssl.h | ||
| 33 | .Ft int | ||
| 34 | .Fn SSL_CTX_use_certificate "SSL_CTX *ctx" "X509 *x" | ||
| 35 | .Ft int | ||
| 36 | .Fn SSL_CTX_use_certificate_ASN1 "SSL_CTX *ctx" "int len" "unsigned char *d" | ||
| 37 | .Ft int | ||
| 38 | .Fn SSL_CTX_use_certificate_file "SSL_CTX *ctx" "const char *file" "int type" | ||
| 39 | .Ft int | ||
| 40 | .Fn SSL_use_certificate "SSL *ssl" "X509 *x" | ||
| 41 | .Ft int | ||
| 42 | .Fn SSL_use_certificate_ASN1 "SSL *ssl" "unsigned char *d" "int len" | ||
| 43 | .Ft int | ||
| 44 | .Fn SSL_use_certificate_file "SSL *ssl" "const char *file" "int type" | ||
| 45 | .Ft int | ||
| 46 | .Fn SSL_CTX_use_certificate_chain_file "SSL_CTX *ctx" "const char *file" | ||
| 47 | .Ft int | ||
| 48 | .Fn SSL_CTX_use_certificate_chain_mem "SSL_CTX *ctx" "void *buf" "int len" | ||
| 49 | .Ft int | ||
| 50 | .Fn SSL_CTX_use_PrivateKey "SSL_CTX *ctx" "EVP_PKEY *pkey" | ||
| 51 | .Ft int | ||
| 52 | .Fo SSL_CTX_use_PrivateKey_ASN1 | ||
| 53 | .Fa "int pk" "SSL_CTX *ctx" "unsigned char *d" "long len" | ||
| 54 | .Fc | ||
| 55 | .Ft int | ||
| 56 | .Fn SSL_CTX_use_PrivateKey_file "SSL_CTX *ctx" "const char *file" "int type" | ||
| 57 | .Ft int | ||
| 58 | .Fn SSL_CTX_use_RSAPrivateKey "SSL_CTX *ctx" "RSA *rsa" | ||
| 59 | .Ft int | ||
| 60 | .Fn SSL_CTX_use_RSAPrivateKey_ASN1 "SSL_CTX *ctx" "unsigned char *d" "long len" | ||
| 61 | .Ft int | ||
| 62 | .Fn SSL_CTX_use_RSAPrivateKey_file "SSL_CTX *ctx" "const char *file" "int type" | ||
| 63 | .Ft int | ||
| 64 | .Fn SSL_use_PrivateKey "SSL *ssl" "EVP_PKEY *pkey" | ||
| 65 | .Ft int | ||
| 66 | .Fn SSL_use_PrivateKey_ASN1 "int pk" "SSL *ssl" "unsigned char *d" "long len" | ||
| 67 | .Ft int | ||
| 68 | .Fn SSL_use_PrivateKey_file "SSL *ssl" "const char *file" "int type" | ||
| 69 | .Ft int | ||
| 70 | .Fn SSL_use_RSAPrivateKey "SSL *ssl" "RSA *rsa" | ||
| 71 | .Ft int | ||
| 72 | .Fn SSL_use_RSAPrivateKey_ASN1 "SSL *ssl" "unsigned char *d" "long len" | ||
| 73 | .Ft int | ||
| 74 | .Fn SSL_use_RSAPrivateKey_file "SSL *ssl" "const char *file" "int type" | ||
| 75 | .Ft int | ||
| 76 | .Fn SSL_CTX_check_private_key "const SSL_CTX *ctx" | ||
| 77 | .Ft int | ||
| 78 | .Fn SSL_check_private_key "const SSL *ssl" | ||
| 79 | .Sh DESCRIPTION | ||
| 80 | These functions load the certificates and private keys into the | ||
| 81 | .Vt SSL_CTX | ||
| 82 | or | ||
| 83 | .Vt SSL | ||
| 84 | object, respectively. | ||
| 85 | .Pp | ||
| 86 | The | ||
| 87 | .Fn SSL_CTX_* | ||
| 88 | class of functions loads the certificates and keys into the | ||
| 89 | .Vt SSL_CTX | ||
| 90 | object | ||
| 91 | .Fa ctx . | ||
| 92 | The information is passed to | ||
| 93 | .Vt SSL | ||
| 94 | objects | ||
| 95 | .Fa ssl | ||
| 96 | created from | ||
| 97 | .Fa ctx | ||
| 98 | with | ||
| 99 | .Xr SSL_new 3 | ||
| 100 | by copying, so that changes applied to | ||
| 101 | .Fa ctx | ||
| 102 | do not propagate to already existing | ||
| 103 | .Vt SSL | ||
| 104 | objects. | ||
| 105 | .Pp | ||
| 106 | The | ||
| 107 | .Fn SSL_* | ||
| 108 | class of functions only loads certificates and keys into a specific | ||
| 109 | .Vt SSL | ||
| 110 | object. | ||
| 111 | The specific information is kept when | ||
| 112 | .Xr SSL_clear 3 | ||
| 113 | is called for this | ||
| 114 | .Vt SSL | ||
| 115 | object. | ||
| 116 | .Pp | ||
| 117 | .Fn SSL_CTX_use_certificate | ||
| 118 | loads the certificate | ||
| 119 | .Fa x | ||
| 120 | into | ||
| 121 | .Fa ctx ; | ||
| 122 | .Fn SSL_use_certificate | ||
| 123 | loads | ||
| 124 | .Fa x | ||
| 125 | into | ||
| 126 | .Fa ssl . | ||
| 127 | The rest of the certificates needed to form the complete certificate chain can | ||
| 128 | be specified using the | ||
| 129 | .Xr SSL_CTX_add_extra_chain_cert 3 | ||
| 130 | function. | ||
| 131 | .Pp | ||
| 132 | .Fn SSL_CTX_use_certificate_ASN1 | ||
| 133 | loads the ASN1 encoded certificate from the memory location | ||
| 134 | .Fa d | ||
| 135 | (with length | ||
| 136 | .Fa len ) | ||
| 137 | into | ||
| 138 | .Fa ctx ; | ||
| 139 | .Fn SSL_use_certificate_ASN1 | ||
| 140 | loads the ASN1 encoded certificate into | ||
| 141 | .Fa ssl . | ||
| 142 | .Pp | ||
| 143 | .Fn SSL_CTX_use_certificate_file | ||
| 144 | loads the first certificate stored in | ||
| 145 | .Fa file | ||
| 146 | into | ||
| 147 | .Fa ctx . | ||
| 148 | The formatting | ||
| 149 | .Fa type | ||
| 150 | of the certificate must be specified from the known types | ||
| 151 | .Dv SSL_FILETYPE_PEM | ||
| 152 | and | ||
| 153 | .Dv SSL_FILETYPE_ASN1 . | ||
| 154 | .Fn SSL_use_certificate_file | ||
| 155 | loads the certificate from | ||
| 156 | .Fa file | ||
| 157 | into | ||
| 158 | .Fa ssl . | ||
| 159 | See the | ||
| 160 | .Sx NOTES | ||
| 161 | section on why | ||
| 162 | .Fn SSL_CTX_use_certificate_chain_file | ||
| 163 | should be preferred. | ||
| 164 | .Pp | ||
| 165 | The | ||
| 166 | .Fn SSL_CTX_use_certificate_chain* | ||
| 167 | functions load a certificate chain into | ||
| 168 | .Fa ctx . | ||
| 169 | The certificates must be in PEM format and must be sorted starting with the | ||
| 170 | subject's certificate (actual client or server certificate), | ||
| 171 | followed by intermediate CA certificates if applicable, | ||
| 172 | and ending at the highest level (root) CA. | ||
| 173 | There is no corresponding function working on a single | ||
| 174 | .Vt SSL | ||
| 175 | object. | ||
| 176 | .Pp | ||
| 177 | .Fn SSL_CTX_use_PrivateKey | ||
| 178 | adds | ||
| 179 | .Fa pkey | ||
| 180 | as private key to | ||
| 181 | .Fa ctx . | ||
| 182 | .Fn SSL_CTX_use_RSAPrivateKey | ||
| 183 | adds the private key | ||
| 184 | .Fa rsa | ||
| 185 | of type RSA to | ||
| 186 | .Fa ctx . | ||
| 187 | .Fn SSL_use_PrivateKey | ||
| 188 | adds | ||
| 189 | .Fa pkey | ||
| 190 | as private key to | ||
| 191 | .Fa ssl ; | ||
| 192 | .Fn SSL_use_RSAPrivateKey | ||
| 193 | adds | ||
| 194 | .Fa rsa | ||
| 195 | as private key of type RSA to | ||
| 196 | .Fa ssl . | ||
| 197 | If a certificate has already been set and the private does not belong to the | ||
| 198 | certificate, an error is returned. | ||
| 199 | To change a certificate private key pair, | ||
| 200 | the new certificate needs to be set with | ||
| 201 | .Fn SSL_use_certificate | ||
| 202 | or | ||
| 203 | .Fn SSL_CTX_use_certificate | ||
| 204 | before setting the private key with | ||
| 205 | .Fn SSL_CTX_use_PrivateKey | ||
| 206 | or | ||
| 207 | .Fn SSL_use_PrivateKey . | ||
| 208 | .Pp | ||
| 209 | .Fn SSL_CTX_use_PrivateKey_ASN1 | ||
| 210 | adds the private key of type | ||
| 211 | .Fa pk | ||
| 212 | stored at memory location | ||
| 213 | .Fa d | ||
| 214 | (length | ||
| 215 | .Fa len ) | ||
| 216 | to | ||
| 217 | .Fa ctx . | ||
| 218 | .Fn SSL_CTX_use_RSAPrivateKey_ASN1 | ||
| 219 | adds the private key of type RSA stored at memory location | ||
| 220 | .Fa d | ||
| 221 | (length | ||
| 222 | .Fa len ) | ||
| 223 | to | ||
| 224 | .Fa ctx . | ||
| 225 | .Fn SSL_use_PrivateKey_ASN1 | ||
| 226 | and | ||
| 227 | .Fn SSL_use_RSAPrivateKey_ASN1 | ||
| 228 | add the private key to | ||
| 229 | .Fa ssl . | ||
| 230 | .Pp | ||
| 231 | .Fn SSL_CTX_use_PrivateKey_file | ||
| 232 | adds the first private key found in | ||
| 233 | .Fa file | ||
| 234 | to | ||
| 235 | .Fa ctx . | ||
| 236 | The formatting | ||
| 237 | .Fa type | ||
| 238 | of the certificate must be specified from the known types | ||
| 239 | .Dv SSL_FILETYPE_PEM | ||
| 240 | and | ||
| 241 | .Dv SSL_FILETYPE_ASN1 . | ||
| 242 | .Fn SSL_CTX_use_RSAPrivateKey_file | ||
| 243 | adds the first private RSA key found in | ||
| 244 | .Fa file | ||
| 245 | to | ||
| 246 | .Fa ctx . | ||
| 247 | .Fn SSL_use_PrivateKey_file | ||
| 248 | adds the first private key found in | ||
| 249 | .Fa file | ||
| 250 | to | ||
| 251 | .Fa ssl ; | ||
| 252 | .Fn SSL_use_RSAPrivateKey_file | ||
| 253 | adds the first private RSA key found to | ||
| 254 | .Fa ssl . | ||
| 255 | .Pp | ||
| 256 | .Fn SSL_CTX_check_private_key | ||
| 257 | checks the consistency of a private key with the corresponding certificate | ||
| 258 | loaded into | ||
| 259 | .Fa ctx . | ||
| 260 | If more than one key/certificate pair (RSA/DSA) is installed, | ||
| 261 | the last item installed will be checked. | ||
| 262 | If, e.g., the last item was a RSA certificate or key, | ||
| 263 | the RSA key/certificate pair will be checked. | ||
| 264 | .Fn SSL_check_private_key | ||
| 265 | performs the same check for | ||
| 266 | .Fa ssl . | ||
| 267 | If no key/certificate was explicitly added for this | ||
| 268 | .Fa ssl , | ||
| 269 | the last item added into | ||
| 270 | .Fa ctx | ||
| 271 | will be checked. | ||
| 272 | .Sh NOTES | ||
| 273 | The internal certificate store of OpenSSL can hold two private key/certificate | ||
| 274 | pairs at a time: | ||
| 275 | one key/certificate of type RSA and one key/certificate of type DSA. | ||
| 276 | The certificate used depends on the cipher select, see also | ||
| 277 | .Xr SSL_CTX_set_cipher_list 3 . | ||
| 278 | .Pp | ||
| 279 | When reading certificates and private keys from file, files of type | ||
| 280 | .Dv SSL_FILETYPE_ASN1 | ||
| 281 | (also known as | ||
| 282 | .Em DER , | ||
| 283 | binary encoding) can only contain one certificate or private key; consequently, | ||
| 284 | .Fn SSL_CTX_use_certificate_chain_file | ||
| 285 | is only applicable to PEM formatting. | ||
| 286 | Files of type | ||
| 287 | .Dv SSL_FILETYPE_PEM | ||
| 288 | can contain more than one item. | ||
| 289 | .Pp | ||
| 290 | .Fn SSL_CTX_use_certificate_chain_file | ||
| 291 | adds the first certificate found in the file to the certificate store. | ||
| 292 | The other certificates are added to the store of chain certificates using | ||
| 293 | .Xr SSL_CTX_add_extra_chain_cert 3 . | ||
| 294 | There exists only one extra chain store, so that the same chain is appended | ||
| 295 | to both types of certificates, RSA and DSA! | ||
| 296 | If it is not intended to use both type of certificate at the same time, | ||
| 297 | it is recommended to use the | ||
| 298 | .Fn SSL_CTX_use_certificate_chain_file | ||
| 299 | instead of the | ||
| 300 | .Fn SSL_CTX_use_certificate_file | ||
| 301 | function in order to allow the use of complete certificate chains even when no | ||
| 302 | trusted CA storage is used or when the CA issuing the certificate shall not be | ||
| 303 | added to the trusted CA storage. | ||
| 304 | .Pp | ||
| 305 | If additional certificates are needed to complete the chain during the TLS | ||
| 306 | negotiation, CA certificates are additionally looked up in the locations of | ||
| 307 | trusted CA certificates (see | ||
| 308 | .Xr SSL_CTX_load_verify_locations 3 ) . | ||
| 309 | .Pp | ||
| 310 | The private keys loaded from file can be encrypted. | ||
| 311 | In order to successfully load encrypted keys, | ||
| 312 | a function returning the passphrase must have been supplied (see | ||
| 313 | .Xr SSL_CTX_set_default_passwd_cb 3 ) . | ||
| 314 | (Certificate files might be encrypted as well from the technical point of view, | ||
| 315 | it however does not make sense as the data in the certificate is considered | ||
| 316 | public anyway.) | ||
| 317 | .Sh RETURN VALUES | ||
| 318 | On success, the functions return 1. | ||
| 319 | Otherwise check out the error stack to find out the reason. | ||
| 320 | .Sh SEE ALSO | ||
| 321 | .Xr ssl 3 , | ||
| 322 | .Xr SSL_clear 3 , | ||
| 323 | .Xr SSL_CTX_add_extra_chain_cert 3 , | ||
| 324 | .Xr SSL_CTX_load_verify_locations 3 , | ||
| 325 | .Xr SSL_CTX_set_cipher_list 3 , | ||
| 326 | .Xr SSL_CTX_set_client_cert_cb 3 , | ||
| 327 | .Xr SSL_CTX_set_default_passwd_cb 3 , | ||
| 328 | .Xr SSL_new 3 | ||
| 329 | .Sh HISTORY | ||
| 330 | Support for DER encoded private keys | ||
| 331 | .Pq Dv SSL_FILETYPE_ASN1 | ||
| 332 | in | ||
| 333 | .Fn SSL_CTX_use_PrivateKey_file | ||
| 334 | and | ||
| 335 | .Fn SSL_use_PrivateKey_file | ||
| 336 | was added in 0.9.8. | ||
diff --git a/src/lib/libssl/doc/SSL_CTX_use_psk_identity_hint.3 b/src/lib/libssl/doc/SSL_CTX_use_psk_identity_hint.3 deleted file mode 100644 index 00c92b51ab..0000000000 --- a/src/lib/libssl/doc/SSL_CTX_use_psk_identity_hint.3 +++ /dev/null | |||
| @@ -1,110 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_CTX_use_psk_identity_hint.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CTX_USE_PSK_IDENTITY_HINT 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_CTX_use_psk_identity_hint , | ||
| 9 | .Nm SSL_use_psk_identity_hint , | ||
| 10 | .Nm SSL_CTX_set_psk_server_callback , | ||
| 11 | .Nm SSL_set_psk_server_callback | ||
| 12 | .Nd set PSK identity hint to use | ||
| 13 | .Sh SYNOPSIS | ||
| 14 | .In openssl/ssl.h | ||
| 15 | .Ft int | ||
| 16 | .Fn SSL_CTX_use_psk_identity_hint "SSL_CTX *ctx" "const char *hint" | ||
| 17 | .Ft int | ||
| 18 | .Fn SSL_use_psk_identity_hint "SSL *ssl" "const char *hint" | ||
| 19 | .Ft void | ||
| 20 | .Fo SSL_CTX_set_psk_server_callback | ||
| 21 | .Fa "SSL_CTX *ctx" | ||
| 22 | .Fa "unsigned int (*callback)(SSL *ssl, const char *identity, unsigned char *psk, int max_psk_len)" | ||
| 23 | .Fc | ||
| 24 | .Ft void | ||
| 25 | .Fo SSL_set_psk_server_callback | ||
| 26 | .Fa "SSL *ssl" | ||
| 27 | .Fa "unsigned int (*callback)(SSL *ssl, const char *identity, unsigned char *psk, int max_psk_len)" | ||
| 28 | .Fc | ||
| 29 | .Sh DESCRIPTION | ||
| 30 | .Fn SSL_CTX_use_psk_identity_hint | ||
| 31 | sets the given | ||
| 32 | .Dv NULL Ns | ||
| 33 | -terminated PSK identity hint | ||
| 34 | .Fa hint | ||
| 35 | to SSL context object | ||
| 36 | .Fa ctx . | ||
| 37 | .Fn SSL_use_psk_identity_hint | ||
| 38 | sets the given | ||
| 39 | .Dv NULL Ns | ||
| 40 | -terminated | ||
| 41 | PSK identity hint | ||
| 42 | .Fa hint | ||
| 43 | to SSL connection object | ||
| 44 | .Fa ssl . | ||
| 45 | If | ||
| 46 | .Fa hint | ||
| 47 | is | ||
| 48 | .Dv NULL | ||
| 49 | the current hint from | ||
| 50 | .Fa ctx | ||
| 51 | or | ||
| 52 | .Fa ssl | ||
| 53 | is deleted. | ||
| 54 | .Pp | ||
| 55 | In the case where PSK identity hint is | ||
| 56 | .Dv NULL , | ||
| 57 | the server does not send the | ||
| 58 | .Em ServerKeyExchange | ||
| 59 | message to the client. | ||
| 60 | .Pp | ||
| 61 | A server application must provide a callback function which is called when the | ||
| 62 | server receives the | ||
| 63 | .Em ClientKeyExchange | ||
| 64 | message from the client. | ||
| 65 | The purpose of the callback function is to validate the received PSK identity | ||
| 66 | and to fetch the pre-shared key used during the connection setup phase. | ||
| 67 | The callback is set using functions | ||
| 68 | .Fn SSL_CTX_set_psk_server_callback | ||
| 69 | or | ||
| 70 | .Fn SSL_set_psk_server_callback . | ||
| 71 | The callback function is given the connection in parameter | ||
| 72 | .Fa ssl , | ||
| 73 | .Dv NULL Ns | ||
| 74 | -terminated PSK identity sent by the client in parameter | ||
| 75 | .Fa identity , | ||
| 76 | and a buffer | ||
| 77 | .Fa psk | ||
| 78 | of length | ||
| 79 | .Fa max_psk_len | ||
| 80 | bytes where the pre-shared key is to be stored. | ||
| 81 | .Sh RETURN VALUES | ||
| 82 | .Fn SSL_CTX_use_psk_identity_hint | ||
| 83 | and | ||
| 84 | .Fn SSL_use_psk_identity_hint | ||
| 85 | return 1 on success, 0 otherwise. | ||
| 86 | .Pp | ||
| 87 | Return values from the server callback are interpreted as follows: | ||
| 88 | .Bl -tag -width Ds | ||
| 89 | .It >0 | ||
| 90 | PSK identity was found and the server callback has provided the PSK | ||
| 91 | successfully in parameter | ||
| 92 | .Fa psk . | ||
| 93 | Return value is the length of | ||
| 94 | .Fa psk | ||
| 95 | in bytes. | ||
| 96 | It is an error to return a value greater than | ||
| 97 | .Fa max_psk_len . | ||
| 98 | .Pp | ||
| 99 | If the PSK identity was not found but the callback instructs the protocol to | ||
| 100 | continue anyway, the callback must provide some random data to | ||
| 101 | .Fa psk | ||
| 102 | and return the length of the random data, so the connection will fail with | ||
| 103 | .Dq decryption_error | ||
| 104 | before it will be finished completely. | ||
| 105 | .It 0 | ||
| 106 | PSK identity was not found. | ||
| 107 | An | ||
| 108 | .Dq unknown_psk_identity | ||
| 109 | alert message will be sent and the connection setup fails. | ||
| 110 | .El | ||
diff --git a/src/lib/libssl/doc/SSL_SESSION_free.3 b/src/lib/libssl/doc/SSL_SESSION_free.3 deleted file mode 100644 index ffd5ae2b29..0000000000 --- a/src/lib/libssl/doc/SSL_SESSION_free.3 +++ /dev/null | |||
| @@ -1,79 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_SESSION_free.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_SESSION_FREE 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_SESSION_free | ||
| 9 | .Nd free an allocated SSL_SESSION structure | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft void | ||
| 13 | .Fn SSL_SESSION_free "SSL_SESSION *session" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_SESSION_free | ||
| 16 | decrements the reference count of | ||
| 17 | .Fa session | ||
| 18 | and removes the | ||
| 19 | .Vt SSL_SESSION | ||
| 20 | structure pointed to by | ||
| 21 | .Fa session | ||
| 22 | and frees up the allocated memory, if the reference count has reached 0. | ||
| 23 | .Sh NOTES | ||
| 24 | .Vt SSL_SESSION | ||
| 25 | objects are allocated when a TLS/SSL handshake operation is successfully | ||
| 26 | completed. | ||
| 27 | Depending on the settings, see | ||
| 28 | .Xr SSL_CTX_set_session_cache_mode 3 , | ||
| 29 | the | ||
| 30 | .Vt SSL_SESSION | ||
| 31 | objects are internally referenced by the | ||
| 32 | .Vt SSL_CTX | ||
| 33 | and linked into its session cache. | ||
| 34 | .Vt SSL | ||
| 35 | objects may be using the | ||
| 36 | .Vt SSL_SESSION | ||
| 37 | object; as a session may be reused, several | ||
| 38 | .Vt SSL | ||
| 39 | objects may be using one | ||
| 40 | .Vt SSL_SESSION | ||
| 41 | object at the same time. | ||
| 42 | It is therefore crucial to keep the reference count (usage information) correct | ||
| 43 | and not delete a | ||
| 44 | .Vt SSL_SESSION | ||
| 45 | object that is still used, as this may lead to program failures due to dangling | ||
| 46 | pointers. | ||
| 47 | These failures may also appear delayed, e.g., when an | ||
| 48 | .Vt SSL_SESSION | ||
| 49 | object is completely freed as the reference count incorrectly becomes 0, but it | ||
| 50 | is still referenced in the internal session cache and the cache list is | ||
| 51 | processed during a | ||
| 52 | .Xr SSL_CTX_flush_sessions 3 | ||
| 53 | operation. | ||
| 54 | .Pp | ||
| 55 | .Fn SSL_SESSION_free | ||
| 56 | must only be called for | ||
| 57 | .Vt SSL_SESSION | ||
| 58 | objects, for which the reference count was explicitly incremented (e.g., by | ||
| 59 | calling | ||
| 60 | .Xr SSL_get1_session 3 ; | ||
| 61 | see | ||
| 62 | .Xr SSL_get_session 3 ) | ||
| 63 | or when the | ||
| 64 | .Vt SSL_SESSION | ||
| 65 | object was generated outside a TLS handshake operation, e.g., by using | ||
| 66 | .Xr d2i_SSL_SESSION 3 . | ||
| 67 | It must not be called on other | ||
| 68 | .Vt SSL_SESSION | ||
| 69 | objects, as this would cause incorrect reference counts and therefore program | ||
| 70 | failures. | ||
| 71 | .Sh RETURN VALUES | ||
| 72 | .Fn SSL_SESSION_free | ||
| 73 | does not provide diagnostic information. | ||
| 74 | .Sh SEE ALSO | ||
| 75 | .Xr d2i_SSL_SESSION 3 , | ||
| 76 | .Xr ssl 3 , | ||
| 77 | .Xr SSL_CTX_flush_sessions 3 , | ||
| 78 | .Xr SSL_CTX_set_session_cache_mode 3 , | ||
| 79 | .Xr SSL_get_session 3 | ||
diff --git a/src/lib/libssl/doc/SSL_SESSION_get_ex_new_index.3 b/src/lib/libssl/doc/SSL_SESSION_get_ex_new_index.3 deleted file mode 100644 index a31f519506..0000000000 --- a/src/lib/libssl/doc/SSL_SESSION_get_ex_new_index.3 +++ /dev/null | |||
| @@ -1,80 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_SESSION_get_ex_new_index.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_SESSION_GET_EX_NEW_INDEX 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_SESSION_get_ex_new_index , | ||
| 9 | .Nm SSL_SESSION_set_ex_data , | ||
| 10 | .Nm SSL_SESSION_get_ex_data | ||
| 11 | .Nd internal application specific data functions | ||
| 12 | .Sh SYNOPSIS | ||
| 13 | .In openssl/ssl.h | ||
| 14 | .Ft int | ||
| 15 | .Fo SSL_SESSION_get_ex_new_index | ||
| 16 | .Fa "long argl" | ||
| 17 | .Fa "void *argp" | ||
| 18 | .Fa "CRYPTO_EX_new *new_func" | ||
| 19 | .Fa "CRYPTO_EX_dup *dup_func" | ||
| 20 | .Fa "CRYPTO_EX_free *free_func" | ||
| 21 | .Fc | ||
| 22 | .Ft int | ||
| 23 | .Fn SSL_SESSION_set_ex_data "SSL_SESSION *session" "int idx" "void *arg" | ||
| 24 | .Ft void * | ||
| 25 | .Fn SSL_SESSION_get_ex_data "const SSL_SESSION *session" "int idx" | ||
| 26 | .Bd -literal | ||
| 27 | typedef int new_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad, | ||
| 28 | int idx, long argl, void *argp); | ||
| 29 | typedef void free_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad, | ||
| 30 | int idx, long argl, void *argp); | ||
| 31 | typedef int dup_func(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d, | ||
| 32 | int idx, long argl, void *argp); | ||
| 33 | .Ed | ||
| 34 | .Sh DESCRIPTION | ||
| 35 | Several OpenSSL structures can have application specific data attached to them. | ||
| 36 | These functions are used internally by OpenSSL to manipulate | ||
| 37 | application-specific data attached to a specific structure. | ||
| 38 | .Pp | ||
| 39 | .Fn SSL_SESSION_get_ex_new_index | ||
| 40 | is used to register a new index for application-specific data. | ||
| 41 | .Pp | ||
| 42 | .Fn SSL_SESSION_set_ex_data | ||
| 43 | is used to store application data at | ||
| 44 | .Fa arg | ||
| 45 | for | ||
| 46 | .Fa idx | ||
| 47 | into the | ||
| 48 | .Fa session | ||
| 49 | object. | ||
| 50 | .Pp | ||
| 51 | .Fn SSL_SESSION_get_ex_data | ||
| 52 | is used to retrieve the information for | ||
| 53 | .Fa idx | ||
| 54 | from | ||
| 55 | .Fa session . | ||
| 56 | .Pp | ||
| 57 | A detailed description for the | ||
| 58 | .Fn *_get_ex_new_index | ||
| 59 | functionality | ||
| 60 | can be found in | ||
| 61 | .Xr RSA_get_ex_new_index 3 . | ||
| 62 | The | ||
| 63 | .Fn *_get_ex_data | ||
| 64 | and | ||
| 65 | .Fn *_set_ex_data | ||
| 66 | functionality is described in | ||
| 67 | .Xr CRYPTO_set_ex_data 3 . | ||
| 68 | .Sh WARNINGS | ||
| 69 | The application data is only maintained for sessions held in memory. | ||
| 70 | The application data is not included when dumping the session with | ||
| 71 | .Xr i2d_SSL_SESSION 3 | ||
| 72 | (and all functions indirectly calling the dump functions like | ||
| 73 | .Xr PEM_write_SSL_SESSION 3 | ||
| 74 | and | ||
| 75 | .Xr PEM_write_bio_SSL_SESSION 3 ) | ||
| 76 | and can therefore not be restored. | ||
| 77 | .Sh SEE ALSO | ||
| 78 | .Xr CRYPTO_set_ex_data 3 , | ||
| 79 | .Xr RSA_get_ex_new_index 3 , | ||
| 80 | .Xr ssl 3 | ||
diff --git a/src/lib/libssl/doc/SSL_SESSION_get_time.3 b/src/lib/libssl/doc/SSL_SESSION_get_time.3 deleted file mode 100644 index 5eb7e5a162..0000000000 --- a/src/lib/libssl/doc/SSL_SESSION_get_time.3 +++ /dev/null | |||
| @@ -1,94 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_SESSION_get_time.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_SESSION_GET_TIME 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_SESSION_get_time , | ||
| 9 | .Nm SSL_SESSION_set_time , | ||
| 10 | .Nm SSL_SESSION_get_timeout , | ||
| 11 | .Nm SSL_SESSION_set_timeout | ||
| 12 | .Nd retrieve and manipulate session time and timeout settings | ||
| 13 | .Sh SYNOPSIS | ||
| 14 | .In openssl/ssl.h | ||
| 15 | .Ft long | ||
| 16 | .Fn SSL_SESSION_get_time "const SSL_SESSION *s" | ||
| 17 | .Ft long | ||
| 18 | .Fn SSL_SESSION_set_time "SSL_SESSION *s" "long tm" | ||
| 19 | .Ft long | ||
| 20 | .Fn SSL_SESSION_get_timeout "const SSL_SESSION *s" | ||
| 21 | .Ft long | ||
| 22 | .Fn SSL_SESSION_set_timeout "SSL_SESSION *s" "long tm" | ||
| 23 | .Ft long | ||
| 24 | .Fn SSL_get_time "const SSL_SESSION *s" | ||
| 25 | .Ft long | ||
| 26 | .Fn SSL_set_time "SSL_SESSION *s" "long tm" | ||
| 27 | .Ft long | ||
| 28 | .Fn SSL_get_timeout "const SSL_SESSION *s" | ||
| 29 | .Ft long | ||
| 30 | .Fn SSL_set_timeout "SSL_SESSION *s" "long tm" | ||
| 31 | .Sh DESCRIPTION | ||
| 32 | .Fn SSL_SESSION_get_time | ||
| 33 | returns the time at which the session | ||
| 34 | .Fa s | ||
| 35 | was established. | ||
| 36 | The time is given in seconds since the Epoch and therefore compatible to the | ||
| 37 | time delivered by the | ||
| 38 | .Xr time 3 | ||
| 39 | call. | ||
| 40 | .Pp | ||
| 41 | .Fn SSL_SESSION_set_time | ||
| 42 | replaces the creation time of the session | ||
| 43 | .Fa s | ||
| 44 | with | ||
| 45 | the chosen value | ||
| 46 | .Fa tm . | ||
| 47 | .Pp | ||
| 48 | .Fn SSL_SESSION_get_timeout | ||
| 49 | returns the timeout value set for session | ||
| 50 | .Fa s | ||
| 51 | in seconds. | ||
| 52 | .Pp | ||
| 53 | .Fn SSL_SESSION_set_timeout | ||
| 54 | sets the timeout value for session | ||
| 55 | .Fa s | ||
| 56 | in seconds to | ||
| 57 | .Fa tm . | ||
| 58 | .Pp | ||
| 59 | The | ||
| 60 | .Fn SSL_get_time , | ||
| 61 | .Fn SSL_set_time , | ||
| 62 | .Fn SSL_get_timeout , | ||
| 63 | and | ||
| 64 | .Fn SSL_set_timeout | ||
| 65 | functions are synonyms for the | ||
| 66 | .Fn SSL_SESSION_* | ||
| 67 | counterparts. | ||
| 68 | .Sh NOTES | ||
| 69 | Sessions are expired by examining the creation time and the timeout value. | ||
| 70 | Both are set at creation time of the session to the actual time and the default | ||
| 71 | timeout value at creation, respectively, as set by | ||
| 72 | .Xr SSL_CTX_set_timeout 3 . | ||
| 73 | Using these functions it is possible to extend or shorten the lifetime of the | ||
| 74 | session. | ||
| 75 | .Sh RETURN VALUES | ||
| 76 | .Fn SSL_SESSION_get_time | ||
| 77 | and | ||
| 78 | .Fn SSL_SESSION_get_timeout | ||
| 79 | return the currently valid values. | ||
| 80 | .Pp | ||
| 81 | .Fn SSL_SESSION_set_time | ||
| 82 | and | ||
| 83 | .Fn SSL_SESSION_set_timeout | ||
| 84 | return 1 on success. | ||
| 85 | .Pp | ||
| 86 | If any of the function is passed the | ||
| 87 | .Dv NULL | ||
| 88 | pointer for the session | ||
| 89 | .Fa s , | ||
| 90 | 0 is returned. | ||
| 91 | .Sh SEE ALSO | ||
| 92 | .Xr ssl 3 , | ||
| 93 | .Xr SSL_CTX_set_timeout 3 , | ||
| 94 | .Xr SSL_get_default_timeout 3 | ||
diff --git a/src/lib/libssl/doc/SSL_accept.3 b/src/lib/libssl/doc/SSL_accept.3 deleted file mode 100644 index 8c7409d04f..0000000000 --- a/src/lib/libssl/doc/SSL_accept.3 +++ /dev/null | |||
| @@ -1,103 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_accept.3,v 1.3 2015/06/18 22:51:05 doug Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: June 18 2015 $ | ||
| 5 | .Dt SSL_ACCEPT 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_accept | ||
| 9 | .Nd wait for a TLS/SSL client to initiate a TLS/SSL handshake | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft int | ||
| 13 | .Fn SSL_accept "SSL *ssl" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_accept | ||
| 16 | waits for a TLS/SSL client to initiate the TLS/SSL handshake. | ||
| 17 | The communication channel must already have been set and assigned to the | ||
| 18 | .Fa ssl | ||
| 19 | object by setting an underlying | ||
| 20 | .Vt BIO . | ||
| 21 | .Sh NOTES | ||
| 22 | The behaviour of | ||
| 23 | .Fn SSL_accept | ||
| 24 | depends on the underlying | ||
| 25 | .Vt BIO . | ||
| 26 | .Pp | ||
| 27 | If the underlying | ||
| 28 | .Vt BIO | ||
| 29 | is | ||
| 30 | .Em blocking , | ||
| 31 | .Fn SSL_accept | ||
| 32 | will only return once the handshake has been finished or an error occurred. | ||
| 33 | .Pp | ||
| 34 | If the underlying | ||
| 35 | .Vt BIO | ||
| 36 | is | ||
| 37 | .Em non-blocking , | ||
| 38 | .Fn SSL_accept | ||
| 39 | will also return when the underlying | ||
| 40 | .Vt BIO | ||
| 41 | could not satisfy the needs of | ||
| 42 | .Fn SSL_accept | ||
| 43 | to continue the handshake, indicating the problem by the return value \(mi1. | ||
| 44 | In this case a call to | ||
| 45 | .Xr SSL_get_error 3 | ||
| 46 | with the | ||
| 47 | return value of | ||
| 48 | .Fn SSL_accept | ||
| 49 | will yield | ||
| 50 | .Dv SSL_ERROR_WANT_READ | ||
| 51 | or | ||
| 52 | .Dv SSL_ERROR_WANT_WRITE . | ||
| 53 | The calling process then must repeat the call after taking appropriate action | ||
| 54 | to satisfy the needs of | ||
| 55 | .Fn SSL_accept . | ||
| 56 | The action depends on the underlying | ||
| 57 | .Dv BIO . | ||
| 58 | When using a non-blocking socket, nothing is to be done, but | ||
| 59 | .Xr select 2 | ||
| 60 | can be used to check for the required condition. | ||
| 61 | When using a buffering | ||
| 62 | .Vt BIO , | ||
| 63 | like a | ||
| 64 | .Vt BIO | ||
| 65 | pair, data must be written into or retrieved out of the | ||
| 66 | .Vt BIO | ||
| 67 | before being able to continue. | ||
| 68 | .Sh RETURN VALUES | ||
| 69 | The following return values can occur: | ||
| 70 | .Bl -tag -width Ds | ||
| 71 | .It 0 | ||
| 72 | The TLS/SSL handshake was not successful but was shut down controlled and by | ||
| 73 | the specifications of the TLS/SSL protocol. | ||
| 74 | Call | ||
| 75 | .Xr SSL_get_error 3 | ||
| 76 | with the return value | ||
| 77 | .Fa ret | ||
| 78 | to find out the reason. | ||
| 79 | .It 1 | ||
| 80 | The TLS/SSL handshake was successfully completed, | ||
| 81 | and a TLS/SSL connection has been established. | ||
| 82 | .It <0 | ||
| 83 | The TLS/SSL handshake was not successful because a fatal error occurred either | ||
| 84 | at the protocol level or a connection failure occurred. | ||
| 85 | The shutdown was not clean. | ||
| 86 | It can also occur of action is need to continue the operation for non-blocking | ||
| 87 | .Vt BIO Ns | ||
| 88 | s. | ||
| 89 | Call | ||
| 90 | .Xr SSL_get_error 3 | ||
| 91 | with the return value | ||
| 92 | .Fa ret | ||
| 93 | to find out the reason. | ||
| 94 | .El | ||
| 95 | .Sh SEE ALSO | ||
| 96 | .Xr bio 3 , | ||
| 97 | .Xr ssl 3 , | ||
| 98 | .Xr SSL_connect 3 , | ||
| 99 | .Xr SSL_CTX_new 3 , | ||
| 100 | .Xr SSL_do_handshake 3 , | ||
| 101 | .Xr SSL_get_error 3 , | ||
| 102 | .Xr SSL_set_connect_state 3 , | ||
| 103 | .Xr SSL_shutdown 3 | ||
diff --git a/src/lib/libssl/doc/SSL_alert_type_string.3 b/src/lib/libssl/doc/SSL_alert_type_string.3 deleted file mode 100644 index 93b67fbd1d..0000000000 --- a/src/lib/libssl/doc/SSL_alert_type_string.3 +++ /dev/null | |||
| @@ -1,193 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_alert_type_string.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_ALERT_TYPE_STRING.POD 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_alert_type_string , | ||
| 9 | .Nm SSL_alert_type_string_long , | ||
| 10 | .Nm SSL_alert_desc_string , | ||
| 11 | .Nm SSL_alert_desc_string_long | ||
| 12 | .Nd get textual description of alert information | ||
| 13 | .Sh SYNOPSIS | ||
| 14 | .In openssl/ssl.h | ||
| 15 | .Ft const char * Ns | ||
| 16 | .Fn SSL_alert_type_string "int value" | ||
| 17 | .Ft const char * Ns | ||
| 18 | .Fn SSL_alert_type_string_long "int value" | ||
| 19 | .Ft const char * Ns | ||
| 20 | .Fn SSL_alert_desc_string "int value" | ||
| 21 | .Ft const char * Ns | ||
| 22 | .Fn SSL_alert_desc_string_long "int value" | ||
| 23 | .Sh DESCRIPTION | ||
| 24 | .Fn SSL_alert_type_string | ||
| 25 | returns a one letter string indicating the type of the alert specified by | ||
| 26 | .Fa value . | ||
| 27 | .Pp | ||
| 28 | .Fn SSL_alert_type_string_long | ||
| 29 | returns a string indicating the type of the alert specified by | ||
| 30 | .Fa value . | ||
| 31 | .Pp | ||
| 32 | .Fn SSL_alert_desc_string | ||
| 33 | returns a two letter string as a short form describing the reason of the alert | ||
| 34 | specified by | ||
| 35 | .Fa value . | ||
| 36 | .Pp | ||
| 37 | .Fn SSL_alert_desc_string_long | ||
| 38 | returns a string describing the reason of the alert specified by | ||
| 39 | .Fa value . | ||
| 40 | .Sh NOTES | ||
| 41 | When one side of an SSL/TLS communication wants to inform the peer about | ||
| 42 | a special situation, it sends an alert. | ||
| 43 | The alert is sent as a special message and does not influence the normal data | ||
| 44 | stream (unless its contents results in the communication being canceled). | ||
| 45 | .Pp | ||
| 46 | A warning alert is sent, when a non-fatal error condition occurs. | ||
| 47 | The | ||
| 48 | .Dq close notify | ||
| 49 | alert is sent as a warning alert. | ||
| 50 | Other examples for non-fatal errors are certificate errors | ||
| 51 | .Po | ||
| 52 | .Dq certificate expired , | ||
| 53 | .Dq unsupported certificate | ||
| 54 | .Pc , | ||
| 55 | for which a warning alert may be sent. | ||
| 56 | (The sending party may, however, decide to send a fatal error.) | ||
| 57 | The receiving side may cancel the connection on reception of a warning alert at | ||
| 58 | its discretion. | ||
| 59 | .Pp | ||
| 60 | Several alert messages must be sent as fatal alert messages as specified | ||
| 61 | by the TLS RFC. | ||
| 62 | A fatal alert always leads to a connection abort. | ||
| 63 | .Sh RETURN VALUES | ||
| 64 | The following strings can occur for | ||
| 65 | .Fn SSL_alert_type_string | ||
| 66 | or | ||
| 67 | .Fn SSL_alert_type_string_long : | ||
| 68 | .Bl -tag -width Ds | ||
| 69 | .It \(dqW\(dq/\(dqwarning\(dq | ||
| 70 | .It \(dqF\(dq/\(dqfatal\(dq | ||
| 71 | .It \(dqU\(dq/\(dqunknown\(dq | ||
| 72 | This indicates that no support is available for this alert type. | ||
| 73 | Probably | ||
| 74 | .Fa value | ||
| 75 | does not contain a correct alert message. | ||
| 76 | .El | ||
| 77 | .Pp | ||
| 78 | The following strings can occur for | ||
| 79 | .Fn SSL_alert_desc_string | ||
| 80 | or | ||
| 81 | .Fn SSL_alert_desc_string_long : | ||
| 82 | .Bl -tag -width Ds | ||
| 83 | .It \(dqCN\(dq/\(dqclose notify\(dq | ||
| 84 | The connection shall be closed. | ||
| 85 | This is a warning alert. | ||
| 86 | .It \(dqUM\(dq/\(dqunexpected message\(dq | ||
| 87 | An inappropriate message was received. | ||
| 88 | This alert is always fatal and should never be observed in communication | ||
| 89 | between proper implementations. | ||
| 90 | .It \(dqBM\(dq/\(dqbad record mac\(dq | ||
| 91 | This alert is returned if a record is received with an incorrect MAC. | ||
| 92 | This message is always fatal. | ||
| 93 | .It \(dqDF\(dq/\(dqdecompression failure\(dq | ||
| 94 | The decompression function received improper input | ||
| 95 | (e.g., data that would expand to excessive length). | ||
| 96 | This message is always fatal. | ||
| 97 | .It \(dqHF\(dq/\(dqhandshake failure\(dq | ||
| 98 | Reception of a handshake_failure alert message indicates that the sender was | ||
| 99 | unable to negotiate an acceptable set of security parameters given the options | ||
| 100 | available. | ||
| 101 | This is a fatal error. | ||
| 102 | .It \(dqNC\(dq/\(dqno certificate\(dq | ||
| 103 | A client, that was asked to send a certificate, does not send a certificate | ||
| 104 | (SSLv3 only). | ||
| 105 | .It \(dqBC\(dq/\(dqbad certificate\(dq | ||
| 106 | A certificate was corrupt, contained signatures that did not verify correctly, | ||
| 107 | etc. | ||
| 108 | .It \(dqUC\(dq/\(dqunsupported certificate\(dq | ||
| 109 | A certificate was of an unsupported type. | ||
| 110 | .It \(dqCR\(dq/\(dqcertificate revoked\(dq | ||
| 111 | A certificate was revoked by its signer. | ||
| 112 | .It \(dqCE\(dq/\(dqcertificate expired\(dq | ||
| 113 | A certificate has expired or is not currently valid. | ||
| 114 | .It \(dqCU\(dq/\(dqcertificate unknown\(dq | ||
| 115 | Some other (unspecified) issue arose in processing the certificate, | ||
| 116 | rendering it unacceptable. | ||
| 117 | .It \(dqIP\(dq/\(dqillegal parameter\(dq | ||
| 118 | A field in the handshake was out of range or inconsistent with other fields. | ||
| 119 | This is always fatal. | ||
| 120 | .It \(dqDC\(dq/\(dqdecryption failed\(dq | ||
| 121 | A TLSCiphertext decrypted in an invalid way: either it wasn't an even multiple | ||
| 122 | of the block length or its padding values, when checked, weren't correct. | ||
| 123 | This message is always fatal. | ||
| 124 | .It \(dqRO\(dq/\(dqrecord overflow\(dq | ||
| 125 | A TLSCiphertext record was received which had a length more than | ||
| 126 | 2^14+2048 bytes, or a record decrypted to a TLSCompressed record with more than | ||
| 127 | 2^14+1024 bytes. | ||
| 128 | This message is always fatal. | ||
| 129 | .It \(dqCA\(dq/\(dqunknown CA\(dq | ||
| 130 | A valid certificate chain or partial chain was received, | ||
| 131 | but the certificate was not accepted because the CA certificate could not be | ||
| 132 | located or couldn't be matched with a known, trusted CA. | ||
| 133 | This message is always fatal. | ||
| 134 | .It \(dqAD\(dq/\(dqaccess denied\(dq | ||
| 135 | A valid certificate was received, but when access control was applied, | ||
| 136 | the sender decided not to proceed with negotiation. | ||
| 137 | This message is always fatal. | ||
| 138 | .It \(dqDE\(dq/\(dqdecode error\(dq | ||
| 139 | A message could not be decoded because some field was out of the specified | ||
| 140 | range or the length of the message was incorrect. | ||
| 141 | This message is always fatal. | ||
| 142 | .It \(dqCY\(dq/\(dqdecrypt error\(dq | ||
| 143 | A handshake cryptographic operation failed, including being unable to correctly | ||
| 144 | verify a signature, decrypt a key exchange, or validate a finished message. | ||
| 145 | .It \(dqER\(dq/\(dqexport restriction\(dq | ||
| 146 | A negotiation not in compliance with export restrictions was detected; | ||
| 147 | for example, attempting to transfer a 1024 bit ephemeral RSA key for the | ||
| 148 | RSA_EXPORT handshake method. | ||
| 149 | This message is always fatal. | ||
| 150 | .It \(dqPV\(dq/\(dqprotocol version\(dq | ||
| 151 | The protocol version the client has attempted to negotiate is recognized, | ||
| 152 | but not supported. | ||
| 153 | (For example, old protocol versions might be avoided for security reasons.) | ||
| 154 | This message is always fatal. | ||
| 155 | .It \(dqIS\(dq/\(dqinsufficient security\(dq | ||
| 156 | Returned instead of handshake_failure when a negotiation has failed | ||
| 157 | specifically because the server requires ciphers more secure than those | ||
| 158 | supported by the client. | ||
| 159 | This message is always fatal. | ||
| 160 | .It \(dqIE\(dq/\(dqinternal error\(dq | ||
| 161 | An internal error unrelated to the peer or the correctness of the protocol | ||
| 162 | makes it impossible to continue (such as a memory allocation failure). | ||
| 163 | This message is always fatal. | ||
| 164 | .It \(dqUS\(dq/\(dquser canceled\(dq | ||
| 165 | This handshake is being canceled for some reason unrelated to a protocol | ||
| 166 | failure. | ||
| 167 | If the user cancels an operation after the handshake is complete, | ||
| 168 | just closing the connection by sending a close_notify is more appropriate. | ||
| 169 | This alert should be followed by a close_notify. | ||
| 170 | This message is generally a warning. | ||
| 171 | .It \(dqNR\(dq/\(dqno renegotiation\(dq | ||
| 172 | Sent by the client in response to a hello request or by the server in response | ||
| 173 | to a client hello after initial handshaking. | ||
| 174 | Either of these would normally lead to renegotiation; when that is not | ||
| 175 | appropriate, the recipient should respond with this alert; at that point, | ||
| 176 | the original requester can decide whether to proceed with the connection. | ||
| 177 | One case where this would be appropriate would be where a server has spawned a | ||
| 178 | process to satisfy a request; the process might receive security parameters | ||
| 179 | (key length, authentication, etc.) at startup and it might be difficult to | ||
| 180 | communicate changes to these parameters after that point. | ||
| 181 | This message is always a warning. | ||
| 182 | .It \(dqUP\(dq/\(dqunknown PSK identity\(dq | ||
| 183 | Sent by the server to indicate that it does not recognize a PSK identity or an | ||
| 184 | SRP identity. | ||
| 185 | .It \(dqUK\(dq/\(dqunknown\(dq | ||
| 186 | This indicates that no description is available for this alert type. | ||
| 187 | Probably | ||
| 188 | .Fa value | ||
| 189 | does not contain a correct alert message. | ||
| 190 | .El | ||
| 191 | .Sh SEE ALSO | ||
| 192 | .Xr ssl 3 , | ||
| 193 | .Xr SSL_CTX_set_info_callback 3 | ||
diff --git a/src/lib/libssl/doc/SSL_clear.3 b/src/lib/libssl/doc/SSL_clear.3 deleted file mode 100644 index 8d49a840ca..0000000000 --- a/src/lib/libssl/doc/SSL_clear.3 +++ /dev/null | |||
| @@ -1,92 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_clear.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_CLEAR 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_clear | ||
| 9 | .Nd reset SSL object to allow another connection | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft int | ||
| 13 | .Fn SSL_clear "SSL *ssl" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | Reset | ||
| 16 | .Fa ssl | ||
| 17 | to allow another connection. | ||
| 18 | All settings (method, ciphers, BIOs) are kept. | ||
| 19 | .Sh NOTES | ||
| 20 | .Fn SSL_clear | ||
| 21 | is used to prepare an | ||
| 22 | .Vt SSL | ||
| 23 | object for a new connection. | ||
| 24 | While all settings are kept, | ||
| 25 | a side effect is the handling of the current SSL session. | ||
| 26 | If a session is still | ||
| 27 | .Em open , | ||
| 28 | it is considered bad and will be removed from the session cache, | ||
| 29 | as required by RFC2246. | ||
| 30 | A session is considered open if | ||
| 31 | .Xr SSL_shutdown 3 | ||
| 32 | was not called for the connection or at least | ||
| 33 | .Xr SSL_set_shutdown 3 | ||
| 34 | was used to | ||
| 35 | set the | ||
| 36 | .Dv SSL_SENT_SHUTDOWN | ||
| 37 | state. | ||
| 38 | .Pp | ||
| 39 | If a session was closed cleanly, | ||
| 40 | the session object will be kept and all settings corresponding. | ||
| 41 | This explicitly means that for example the special method used during the | ||
| 42 | session will be kept for the next handshake. | ||
| 43 | So if the session was a TLSv1 session, a | ||
| 44 | .Vt SSL | ||
| 45 | client object will use a TLSv1 client method for the next handshake and a | ||
| 46 | .Vt SSL | ||
| 47 | server object will use a TLSv1 server method, even if | ||
| 48 | .Fn SSLv23_*_method Ns s | ||
| 49 | were chosen on startup. | ||
| 50 | This might lead to connection failures (see | ||
| 51 | .Xr SSL_new 3 ) | ||
| 52 | for a description of the method's properties. | ||
| 53 | .Sh WARNINGS | ||
| 54 | .Fn SSL_clear | ||
| 55 | resets the | ||
| 56 | .Vt SSL | ||
| 57 | object to allow for another connection. | ||
| 58 | The reset operation however keeps several settings of the last sessions | ||
| 59 | (some of these settings were made automatically during the last handshake). | ||
| 60 | It only makes sense for a new connection with the exact same peer that shares | ||
| 61 | these settings, | ||
| 62 | and may fail if that peer changes its settings between connections. | ||
| 63 | Use the sequence | ||
| 64 | .Xr SSL_get_session 3 ; | ||
| 65 | .Xr SSL_new 3 ; | ||
| 66 | .Xr SSL_set_session 3 ; | ||
| 67 | .Xr SSL_free 3 | ||
| 68 | instead to avoid such failures (or simply | ||
| 69 | .Xr SSL_free 3 ; | ||
| 70 | .Xr SSL_new 3 | ||
| 71 | if session reuse is not desired). | ||
| 72 | .Sh RETURN VALUES | ||
| 73 | The following return values can occur: | ||
| 74 | .Bl -tag -width Ds | ||
| 75 | .It 0 | ||
| 76 | The | ||
| 77 | .Fn SSL_clear | ||
| 78 | operation could not be performed. | ||
| 79 | Check the error stack to find out the reason. | ||
| 80 | .It 1 | ||
| 81 | The | ||
| 82 | .Fn SSL_clear | ||
| 83 | operation was successful. | ||
| 84 | .El | ||
| 85 | .Sh SEE ALSO | ||
| 86 | .Xr ssl 3 , | ||
| 87 | .Xr SSL_CTX_set_client_cert_cb 3 , | ||
| 88 | .Xr SSL_CTX_set_options 3 , | ||
| 89 | .Xr SSL_free 3 , | ||
| 90 | .Xr SSL_new 3 , | ||
| 91 | .Xr SSL_set_shutdown 3 , | ||
| 92 | .Xr SSL_shutdown 3 | ||
diff --git a/src/lib/libssl/doc/SSL_connect.3 b/src/lib/libssl/doc/SSL_connect.3 deleted file mode 100644 index 105e0ed923..0000000000 --- a/src/lib/libssl/doc/SSL_connect.3 +++ /dev/null | |||
| @@ -1,102 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_connect.3,v 1.3 2015/07/24 15:25:08 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: July 24 2015 $ | ||
| 5 | .Dt SSL_CONNECT 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_connect | ||
| 9 | .Nd initiate the TLS/SSL handshake with a TLS/SSL server | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft int | ||
| 13 | .Fn SSL_connect "SSL *ssl" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_connect | ||
| 16 | initiates the TLS/SSL handshake with a server. | ||
| 17 | The communication channel must already have been set and assigned to the | ||
| 18 | .Fa ssl | ||
| 19 | by setting an underlying | ||
| 20 | .Vt BIO . | ||
| 21 | .Sh NOTES | ||
| 22 | The behaviour of | ||
| 23 | .Fn SSL_connect | ||
| 24 | depends on the underlying | ||
| 25 | .Vt BIO . | ||
| 26 | .Pp | ||
| 27 | If the underlying | ||
| 28 | .Vt BIO | ||
| 29 | is | ||
| 30 | .Em blocking , | ||
| 31 | .Fn SSL_connect | ||
| 32 | will only return once the handshake has been finished or an error occurred. | ||
| 33 | .Pp | ||
| 34 | If the underlying | ||
| 35 | .Vt BIO | ||
| 36 | is | ||
| 37 | .Em non-blocking , | ||
| 38 | .Fn SSL_connect | ||
| 39 | will also return when the underlying | ||
| 40 | .Vt BIO | ||
| 41 | could not satisfy the needs of | ||
| 42 | .Fn SSL_connect | ||
| 43 | to continue the handshake, indicating the problem with the return value \(mi1. | ||
| 44 | In this case a call to | ||
| 45 | .Xr SSL_get_error 3 | ||
| 46 | with the return value of | ||
| 47 | .Fn SSL_connect | ||
| 48 | will yield | ||
| 49 | .Dv SSL_ERROR_WANT_READ | ||
| 50 | or | ||
| 51 | .Dv SSL_ERROR_WANT_WRITE . | ||
| 52 | The calling process then must repeat the call after taking appropriate action | ||
| 53 | to satisfy the needs of | ||
| 54 | .Fn SSL_connect . | ||
| 55 | The action depends on the underlying | ||
| 56 | .Vt BIO . | ||
| 57 | When using a non-blocking socket, nothing is to be done, but | ||
| 58 | .Xr select 2 | ||
| 59 | can be used to check for the required condition. | ||
| 60 | When using a buffering | ||
| 61 | .Vt BIO , | ||
| 62 | like a | ||
| 63 | .Vt BIO | ||
| 64 | pair, data must be written into or retrieved out of the | ||
| 65 | .Vt BIO | ||
| 66 | before being able to continue. | ||
| 67 | .Sh RETURN VALUES | ||
| 68 | The following return values can occur: | ||
| 69 | .Bl -tag -width Ds | ||
| 70 | .It 0 | ||
| 71 | The TLS/SSL handshake was not successful but was shut down controlled and | ||
| 72 | by the specifications of the TLS/SSL protocol. | ||
| 73 | Call | ||
| 74 | .Xr SSL_get_error 3 | ||
| 75 | with the return value | ||
| 76 | .Fa ret | ||
| 77 | to find out the reason. | ||
| 78 | .It 1 | ||
| 79 | The TLS/SSL handshake was successfully completed, | ||
| 80 | and a TLS/SSL connection has been established. | ||
| 81 | .It <0 | ||
| 82 | The TLS/SSL handshake was not successful, because either a fatal error occurred | ||
| 83 | at the protocol level or a connection failure occurred. | ||
| 84 | The shutdown was not clean. | ||
| 85 | It can also occur if action is needed to continue the operation for | ||
| 86 | non-blocking | ||
| 87 | .Vt BIO Ns s. | ||
| 88 | Call | ||
| 89 | .Xr SSL_get_error 3 | ||
| 90 | with the return value | ||
| 91 | .Fa ret | ||
| 92 | to find out the reason. | ||
| 93 | .El | ||
| 94 | .Sh SEE ALSO | ||
| 95 | .Xr bio 3 , | ||
| 96 | .Xr ssl 3 , | ||
| 97 | .Xr SSL_accept 3 , | ||
| 98 | .Xr SSL_CTX_new 3 , | ||
| 99 | .Xr SSL_do_handshake 3 , | ||
| 100 | .Xr SSL_get_error 3 , | ||
| 101 | .Xr SSL_set_connect_state 3 , | ||
| 102 | .Xr SSL_shutdown 3 | ||
diff --git a/src/lib/libssl/doc/SSL_do_handshake.3 b/src/lib/libssl/doc/SSL_do_handshake.3 deleted file mode 100644 index 78a37b08c9..0000000000 --- a/src/lib/libssl/doc/SSL_do_handshake.3 +++ /dev/null | |||
| @@ -1,101 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_do_handshake.3,v 1.3 2015/06/18 22:51:05 doug Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: June 18 2015 $ | ||
| 5 | .Dt SSL_DO_HANDSHAKE 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_do_handshake | ||
| 9 | .Nd perform a TLS/SSL handshake | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft int | ||
| 13 | .Fn SSL_do_handshake "SSL *ssl" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_do_handshake | ||
| 16 | will wait for a SSL/TLS handshake to take place. | ||
| 17 | If the connection is in client mode, the handshake will be started. | ||
| 18 | The handshake routines may have to be explicitly set in advance using either | ||
| 19 | .Xr SSL_set_connect_state 3 | ||
| 20 | or | ||
| 21 | .Xr SSL_set_accept_state 3 . | ||
| 22 | .Sh NOTES | ||
| 23 | The behaviour of | ||
| 24 | .Fn SSL_do_handshake | ||
| 25 | depends on the underlying | ||
| 26 | .Vt BIO . | ||
| 27 | .Pp | ||
| 28 | If the underlying | ||
| 29 | .Vt BIO | ||
| 30 | is | ||
| 31 | .Em blocking , | ||
| 32 | .Fn SSL_do_handshake | ||
| 33 | will only return once the handshake has been finished or an error occurred. | ||
| 34 | .Pp | ||
| 35 | If the underlying | ||
| 36 | .Vt BIO | ||
| 37 | is | ||
| 38 | .Em non-blocking , | ||
| 39 | .Fn SSL_do_handshake | ||
| 40 | will also return when the underlying | ||
| 41 | .Vt BIO | ||
| 42 | could not satisfy the needs of | ||
| 43 | .Fn SSL_do_handshake | ||
| 44 | to continue the handshake. | ||
| 45 | In this case a call to | ||
| 46 | .Xr SSL_get_error 3 | ||
| 47 | with the return value of | ||
| 48 | .Fn SSL_do_handshake | ||
| 49 | will yield | ||
| 50 | .Dv SSL_ERROR_WANT_READ | ||
| 51 | or | ||
| 52 | .Dv SSL_ERROR_WANT_WRITE . | ||
| 53 | The calling process then must repeat the call after taking appropriate action | ||
| 54 | to satisfy the needs of | ||
| 55 | .Fn SSL_do_handshake . | ||
| 56 | The action depends on the underlying | ||
| 57 | .Vt BIO . | ||
| 58 | When using a non-blocking socket, nothing is to be done, but | ||
| 59 | .Xr select 2 | ||
| 60 | can be used to check for the required condition. | ||
| 61 | When using a buffering | ||
| 62 | .Vt BIO , | ||
| 63 | like a | ||
| 64 | .Vt BIO | ||
| 65 | pair, data must be written into or retrieved out of the | ||
| 66 | .Vt BIO | ||
| 67 | before being able to continue. | ||
| 68 | .Sh RETURN VALUES | ||
| 69 | The following return values can occur: | ||
| 70 | .Bl -tag -width Ds | ||
| 71 | .It 0 | ||
| 72 | The TLS/SSL handshake was not successful but was shut down controlled and | ||
| 73 | by the specifications of the TLS/SSL protocol. | ||
| 74 | Call | ||
| 75 | .Xr SSL_get_error 3 | ||
| 76 | with the return value | ||
| 77 | .Fa ret | ||
| 78 | to find out the reason. | ||
| 79 | .It 1 | ||
| 80 | The TLS/SSL handshake was successfully completed, | ||
| 81 | and a TLS/SSL connection has been established. | ||
| 82 | .It <0 | ||
| 83 | The TLS/SSL handshake was not successful because either a fatal error occurred | ||
| 84 | at the protocol level or a connection failure occurred. | ||
| 85 | The shutdown was not clean. | ||
| 86 | It can also occur if action is needed to continue the operation for | ||
| 87 | non-blocking | ||
| 88 | .Vt BIO Ns s. | ||
| 89 | Call | ||
| 90 | .Xr SSL_get_error 3 | ||
| 91 | with the return value | ||
| 92 | .Fa ret | ||
| 93 | to find out the reason. | ||
| 94 | .El | ||
| 95 | .Sh SEE ALSO | ||
| 96 | .Xr bio 3 , | ||
| 97 | .Xr ssl 3 , | ||
| 98 | .Xr SSL_accept 3 , | ||
| 99 | .Xr SSL_connect 3 , | ||
| 100 | .Xr SSL_get_error 3 , | ||
| 101 | .Xr SSL_set_connect_state 3 | ||
diff --git a/src/lib/libssl/doc/SSL_free.3 b/src/lib/libssl/doc/SSL_free.3 deleted file mode 100644 index c0078d817a..0000000000 --- a/src/lib/libssl/doc/SSL_free.3 +++ /dev/null | |||
| @@ -1,62 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_free.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_FREE 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_free | ||
| 9 | .Nd free an allocated SSL structure | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft void | ||
| 13 | .Fn SSL_free "SSL *ssl" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_free | ||
| 16 | decrements the reference count of | ||
| 17 | .Fa ssl , | ||
| 18 | and removes the | ||
| 19 | .Vt SSL | ||
| 20 | structure pointed to by | ||
| 21 | .Fa ssl | ||
| 22 | and frees up the allocated memory if the reference count has reached 0. | ||
| 23 | .Sh NOTES | ||
| 24 | .Fn SSL_free | ||
| 25 | also calls the | ||
| 26 | .Xr free 3 Ns | ||
| 27 | ing procedures for indirectly affected items, if applicable: the buffering | ||
| 28 | .Vt BIO , | ||
| 29 | the read and write | ||
| 30 | .Vt BIOs , | ||
| 31 | cipher lists specially created for this | ||
| 32 | .Fa ssl , | ||
| 33 | the | ||
| 34 | .Sy SSL_SESSION . | ||
| 35 | Do not explicitly free these indirectly freed up items before or after calling | ||
| 36 | .Fn SSL_free , | ||
| 37 | as trying to free things twice may lead to program failure. | ||
| 38 | .Pp | ||
| 39 | The | ||
| 40 | .Fa ssl | ||
| 41 | session has reference counts from two users: the | ||
| 42 | .Vt SSL | ||
| 43 | object, for which the reference count is removed by | ||
| 44 | .Fn SSL_free | ||
| 45 | and the internal session cache. | ||
| 46 | If the session is considered bad, because | ||
| 47 | .Xr SSL_shutdown 3 | ||
| 48 | was not called for the connection and | ||
| 49 | .Xr SSL_set_shutdown 3 | ||
| 50 | was not used to set the | ||
| 51 | .Vt SSL_SENT_SHUTDOWN | ||
| 52 | state, the session will also be removed from the session cache as required by | ||
| 53 | RFC2246. | ||
| 54 | .Sh RETURN VALUES | ||
| 55 | .Fn SSL_free | ||
| 56 | does not provide diagnostic information. | ||
| 57 | .Sh SEE ALSO | ||
| 58 | .Xr ssl 3 , | ||
| 59 | .Xr SSL_clear 3 , | ||
| 60 | .Xr SSL_new 3 , | ||
| 61 | .Xr SSL_set_shutdown 3 , | ||
| 62 | .Xr SSL_shutdown 3 | ||
diff --git a/src/lib/libssl/doc/SSL_get_SSL_CTX.3 b/src/lib/libssl/doc/SSL_get_SSL_CTX.3 deleted file mode 100644 index 7ba5b0cb81..0000000000 --- a/src/lib/libssl/doc/SSL_get_SSL_CTX.3 +++ /dev/null | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_get_SSL_CTX.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_GET_SSL_CTX 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_get_SSL_CTX | ||
| 9 | .Nd get the SSL_CTX from which an SSL is created | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft SSL_CTX * | ||
| 13 | .Fn SSL_get_SSL_CTX "const SSL *ssl" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_get_SSL_CTX | ||
| 16 | returns a pointer to the | ||
| 17 | .Vt SSL_CTX | ||
| 18 | object from which | ||
| 19 | .Fa ssl | ||
| 20 | was created with | ||
| 21 | .Xr SSL_new 3 . | ||
| 22 | .Sh RETURN VALUES | ||
| 23 | The pointer to the | ||
| 24 | .Vt SSL_CTX | ||
| 25 | object is returned. | ||
| 26 | .Sh SEE ALSO | ||
| 27 | .Xr ssl 3 , | ||
| 28 | .Xr SSL_new 3 | ||
diff --git a/src/lib/libssl/doc/SSL_get_ciphers.3 b/src/lib/libssl/doc/SSL_get_ciphers.3 deleted file mode 100644 index 89abc172b4..0000000000 --- a/src/lib/libssl/doc/SSL_get_ciphers.3 +++ /dev/null | |||
| @@ -1,68 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_get_ciphers.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_GET_CIPHERS 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_get_ciphers , | ||
| 9 | .Nm SSL_get_cipher_list | ||
| 10 | .Nd get list of available SSL_CIPHERs | ||
| 11 | .Sh SYNOPSIS | ||
| 12 | .In openssl/ssl.h | ||
| 13 | .Ft STACK_OF(SSL_CIPHER) * | ||
| 14 | .Fn SSL_get_ciphers "const SSL *ssl" | ||
| 15 | .Ft const char * | ||
| 16 | .Fn SSL_get_cipher_list "const SSL *ssl" "int priority" | ||
| 17 | .Sh DESCRIPTION | ||
| 18 | .Fn SSL_get_ciphers | ||
| 19 | returns the stack of available | ||
| 20 | .Vt SSL_CIPHER Ns s | ||
| 21 | for | ||
| 22 | .Fa ssl , | ||
| 23 | sorted by preference. | ||
| 24 | If | ||
| 25 | .Fa ssl | ||
| 26 | is | ||
| 27 | .Dv NULL | ||
| 28 | or no ciphers are available, | ||
| 29 | .Dv NULL | ||
| 30 | is returned. | ||
| 31 | .Pp | ||
| 32 | .Fn SSL_get_cipher_list | ||
| 33 | returns a pointer to the name of the | ||
| 34 | .Vt SSL_CIPHER | ||
| 35 | listed for | ||
| 36 | .Fa ssl | ||
| 37 | with | ||
| 38 | .Fa priority . | ||
| 39 | If | ||
| 40 | .Fa ssl | ||
| 41 | is | ||
| 42 | .Dv NULL , | ||
| 43 | no ciphers are available, or there are fewer ciphers than | ||
| 44 | .Fa priority | ||
| 45 | available, | ||
| 46 | .Dv NULL | ||
| 47 | is returned. | ||
| 48 | .Sh NOTES | ||
| 49 | The details of the ciphers obtained by | ||
| 50 | .Fn SSL_get_ciphers | ||
| 51 | can be obtained using the | ||
| 52 | .Xr SSL_CIPHER_get_name 3 | ||
| 53 | family of functions. | ||
| 54 | .Pp | ||
| 55 | Call | ||
| 56 | .Fn SSL_get_cipher_list | ||
| 57 | with | ||
| 58 | .Fa priority | ||
| 59 | starting from 0 to obtain the sorted list of available ciphers, until | ||
| 60 | .Dv NULL | ||
| 61 | is returned. | ||
| 62 | .Sh RETURN VALUES | ||
| 63 | See | ||
| 64 | .Sx DESCRIPTION . | ||
| 65 | .Sh SEE ALSO | ||
| 66 | .Xr ssl 3 , | ||
| 67 | .Xr SSL_CIPHER_get_name 3 , | ||
| 68 | .Xr SSL_CTX_set_cipher_list 3 | ||
diff --git a/src/lib/libssl/doc/SSL_get_client_CA_list.3 b/src/lib/libssl/doc/SSL_get_client_CA_list.3 deleted file mode 100644 index 7aa5a90c9a..0000000000 --- a/src/lib/libssl/doc/SSL_get_client_CA_list.3 +++ /dev/null | |||
| @@ -1,61 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_get_client_CA_list.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_GET_CLIENT_CA_LIST 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_get_client_CA_list , | ||
| 9 | .Nm SSL_CTX_get_client_CA_list | ||
| 10 | .Nd get list of client CAs | ||
| 11 | .Sh SYNOPSIS | ||
| 12 | .In openssl/ssl.h | ||
| 13 | .Ft STACK_OF(X509_NAME) * | ||
| 14 | .Fn SSL_get_client_CA_list "const SSL *s" | ||
| 15 | .Ft STACK_OF(X509_NAME) * | ||
| 16 | .Fn SSL_CTX_get_client_CA_list "const SSL_CTX *ctx" | ||
| 17 | .Sh DESCRIPTION | ||
| 18 | .Fn SSL_CTX_get_client_CA_list | ||
| 19 | returns the list of client CAs explicitly set for | ||
| 20 | .Fa ctx | ||
| 21 | using | ||
| 22 | .Xr SSL_CTX_set_client_CA_list 3 . | ||
| 23 | .Pp | ||
| 24 | .Fn SSL_get_client_CA_list | ||
| 25 | returns the list of client CAs explicitly set for | ||
| 26 | .Fa ssl | ||
| 27 | using | ||
| 28 | .Fn SSL_set_client_CA_list | ||
| 29 | or | ||
| 30 | .Fa ssl Ns 's | ||
| 31 | .Vt SSL_CTX | ||
| 32 | object with | ||
| 33 | .Xr SSL_CTX_set_client_CA_list 3 , | ||
| 34 | when in server mode. | ||
| 35 | In client mode, | ||
| 36 | .Fn SSL_get_client_CA_list | ||
| 37 | returns the list of client CAs sent from the server, if any. | ||
| 38 | .Sh RETURN VALUES | ||
| 39 | .Fn SSL_CTX_set_client_CA_list | ||
| 40 | and | ||
| 41 | .Fn SSL_set_client_CA_list | ||
| 42 | do not return diagnostic information. | ||
| 43 | .Pp | ||
| 44 | .Fn SSL_CTX_add_client_CA | ||
| 45 | and | ||
| 46 | .Fn SSL_add_client_CA | ||
| 47 | have the following return values: | ||
| 48 | .Bl -tag -width Ds | ||
| 49 | .It Dv STACK_OF Ns Po Vt X509_NAMES Pc | ||
| 50 | List of CA names explicitly set (for | ||
| 51 | .Fa ctx | ||
| 52 | or in server mode) or sent by the server (client mode). | ||
| 53 | .It Dv NULL | ||
| 54 | No client CA list was explicitly set (for | ||
| 55 | .Fa ctx | ||
| 56 | or in server mode) or the server did not send a list of CAs (client mode). | ||
| 57 | .El | ||
| 58 | .Sh SEE ALSO | ||
| 59 | .Xr ssl 3 , | ||
| 60 | .Xr SSL_CTX_set_client_CA_list 3 , | ||
| 61 | .Xr SSL_CTX_set_client_cert_cb 3 | ||
diff --git a/src/lib/libssl/doc/SSL_get_current_cipher.3 b/src/lib/libssl/doc/SSL_get_current_cipher.3 deleted file mode 100644 index d7140571b0..0000000000 --- a/src/lib/libssl/doc/SSL_get_current_cipher.3 +++ /dev/null | |||
| @@ -1,52 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_get_current_cipher.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_GET_CURRENT_CIPHER 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_get_current_cipher , | ||
| 9 | .Nm SSL_get_cipher , | ||
| 10 | .Nm SSL_get_cipher_name , | ||
| 11 | .Nm SSL_get_cipher_bits , | ||
| 12 | .Nm SSL_get_cipher_version | ||
| 13 | .Nd get SSL_CIPHER of a connection | ||
| 14 | .Sh SYNOPSIS | ||
| 15 | .In openssl/ssl.h | ||
| 16 | .Ft SSL_CIPHER * | ||
| 17 | .Fn SSL_get_current_cipher "const SSL *ssl" | ||
| 18 | .Fd #define SSL_get_cipher(s) SSL_CIPHER_get_name(SSL_get_current_cipher(s)) | ||
| 19 | .Fd #define SSL_get_cipher_name(s) \ | ||
| 20 | SSL_CIPHER_get_name(SSL_get_current_cipher(s)) | ||
| 21 | .Fd #define SSL_get_cipher_bits(s,np) \ | ||
| 22 | SSL_CIPHER_get_bits(SSL_get_current_cipher(s),np) | ||
| 23 | .Fd #define SSL_get_cipher_version(s) \ | ||
| 24 | SSL_CIPHER_get_version(SSL_get_current_cipher(s)) | ||
| 25 | .Sh DESCRIPTION | ||
| 26 | .Fn SSL_get_current_cipher | ||
| 27 | returns a pointer to an | ||
| 28 | .Vt SSL_CIPHER | ||
| 29 | object containing the description of the actually used cipher of a connection | ||
| 30 | established with the | ||
| 31 | .Fa ssl | ||
| 32 | object. | ||
| 33 | .Pp | ||
| 34 | .Fn SSL_get_cipher | ||
| 35 | and | ||
| 36 | .Fn SSL_get_cipher_name | ||
| 37 | are identical macros to obtain the name of the currently used cipher. | ||
| 38 | .Fn SSL_get_cipher_bits | ||
| 39 | is a macro to obtain the number of secret/algorithm bits used and | ||
| 40 | .Fn SSL_get_cipher_version | ||
| 41 | returns the protocol name. | ||
| 42 | See | ||
| 43 | .Xr SSL_CIPHER_get_name 3 | ||
| 44 | for more details. | ||
| 45 | .Sh RETURN VALUES | ||
| 46 | .Fn SSL_get_current_cipher | ||
| 47 | returns the cipher actually used or | ||
| 48 | .Dv NULL , | ||
| 49 | when no session has been established. | ||
| 50 | .Sh SEE ALSO | ||
| 51 | .Xr ssl 3 , | ||
| 52 | .Xr SSL_CIPHER_get_name 3 | ||
diff --git a/src/lib/libssl/doc/SSL_get_default_timeout.3 b/src/lib/libssl/doc/SSL_get_default_timeout.3 deleted file mode 100644 index 1a58e87f27..0000000000 --- a/src/lib/libssl/doc/SSL_get_default_timeout.3 +++ /dev/null | |||
| @@ -1,36 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_get_default_timeout.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_GET_DEFAULT_TIMEOUT 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_get_default_timeout | ||
| 9 | .Nd get default session timeout value | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft long | ||
| 13 | .Fn SSL_get_default_timeout "const SSL *ssl" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_get_default_timeout | ||
| 16 | returns the default timeout value assigned to | ||
| 17 | .Vt SSL_SESSION | ||
| 18 | objects negotiated for the protocol valid for | ||
| 19 | .Fa ssl . | ||
| 20 | .Sh NOTES | ||
| 21 | Whenever a new session is negotiated, it is assigned a timeout value, | ||
| 22 | after which it will not be accepted for session reuse. | ||
| 23 | If the timeout value was not explicitly set using | ||
| 24 | .Xr SSL_CTX_set_timeout 3 , | ||
| 25 | the hardcoded default timeout for the protocol will be used. | ||
| 26 | .Pp | ||
| 27 | .Fn SSL_get_default_timeout | ||
| 28 | return this hardcoded value, which is 300 seconds for all currently supported | ||
| 29 | protocols (SSLv2, SSLv3, and TLSv1). | ||
| 30 | .Sh RETURN VALUES | ||
| 31 | See description. | ||
| 32 | .Sh SEE ALSO | ||
| 33 | .Xr ssl 3 , | ||
| 34 | .Xr SSL_CTX_flush_sessions 3 , | ||
| 35 | .Xr SSL_CTX_set_session_cache_mode 3 , | ||
| 36 | .Xr SSL_SESSION_get_time 3 | ||
diff --git a/src/lib/libssl/doc/SSL_get_error.3 b/src/lib/libssl/doc/SSL_get_error.3 deleted file mode 100644 index f6e5045b01..0000000000 --- a/src/lib/libssl/doc/SSL_get_error.3 +++ /dev/null | |||
| @@ -1,169 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_get_error.3,v 1.3 2015/07/24 15:25:08 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: July 24 2015 $ | ||
| 5 | .Dt SSL_GET_ERROR 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_get_error | ||
| 9 | .Nd obtain result code for TLS/SSL I/O operation | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft int | ||
| 13 | .Fn SSL_get_error "const SSL *ssl" "int ret" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_get_error | ||
| 16 | returns a result code (suitable for the C | ||
| 17 | .Dq switch | ||
| 18 | statement) for a preceding call to | ||
| 19 | .Xr SSL_connect 3 , | ||
| 20 | .Xr SSL_accept 3 , | ||
| 21 | .Xr SSL_do_handshake 3 , | ||
| 22 | .Xr SSL_read 3 , | ||
| 23 | .Xr SSL_peek 3 , | ||
| 24 | or | ||
| 25 | .Xr SSL_write 3 | ||
| 26 | on | ||
| 27 | .Fa ssl . | ||
| 28 | The value returned by that TLS/SSL I/O function must be passed to | ||
| 29 | .Fn SSL_get_error | ||
| 30 | in parameter | ||
| 31 | .Fa ret . | ||
| 32 | .Pp | ||
| 33 | In addition to | ||
| 34 | .Fa ssl | ||
| 35 | and | ||
| 36 | .Fa ret , | ||
| 37 | .Fn SSL_get_error | ||
| 38 | inspects the current thread's OpenSSL error queue. | ||
| 39 | Thus, | ||
| 40 | .Fn SSL_get_error | ||
| 41 | must be used in the same thread that performed the TLS/SSL I/O operation, | ||
| 42 | and no other OpenSSL function calls should appear in between. | ||
| 43 | The current thread's error queue must be empty before the TLS/SSL I/O operation | ||
| 44 | is attempted, or | ||
| 45 | .Fn SSL_get_error | ||
| 46 | will not work reliably. | ||
| 47 | .Sh RETURN VALUES | ||
| 48 | The following return values can currently occur: | ||
| 49 | .Bl -tag -width Ds | ||
| 50 | .It Dv SSL_ERROR_NONE | ||
| 51 | The TLS/SSL I/O operation completed. | ||
| 52 | This result code is returned if and only if | ||
| 53 | .Fa ret | ||
| 54 | < 0. | ||
| 55 | .It Dv SSL_ERROR_ZERO_RETURN | ||
| 56 | The TLS/SSL connection has been closed. | ||
| 57 | If the protocol version is SSL 3.0 or TLS 1.0, this result code is returned | ||
| 58 | only if a closure alert has occurred in the protocol, i.e., if the connection | ||
| 59 | has been closed cleanly. | ||
| 60 | Note that in this case | ||
| 61 | .Dv SSL_ERROR_ZERO_RETURN | ||
| 62 | does not necessarily indicate that the underlying transport has been closed. | ||
| 63 | .It Dv SSL_ERROR_WANT_READ , Dv SSL_ERROR_WANT_WRITE | ||
| 64 | The operation did not complete; | ||
| 65 | the same TLS/SSL I/O function should be called again later. | ||
| 66 | If, by then, the underlying | ||
| 67 | .Vt BIO | ||
| 68 | has data available for reading (if the result code is | ||
| 69 | .Dv SSL_ERROR_WANT_READ ) | ||
| 70 | or allows writing data | ||
| 71 | .Pq Dv SSL_ERROR_WANT_WRITE , | ||
| 72 | then some TLS/SSL protocol progress will take place, | ||
| 73 | i.e., at least part of a TLS/SSL record will be read or written. | ||
| 74 | Note that the retry may again lead to a | ||
| 75 | .Dv SSL_ERROR_WANT_READ | ||
| 76 | or | ||
| 77 | .Dv SSL_ERROR_WANT_WRITE | ||
| 78 | condition. | ||
| 79 | There is no fixed upper limit for the number of iterations that may be | ||
| 80 | necessary until progress becomes visible at application protocol level. | ||
| 81 | .Pp | ||
| 82 | For socket | ||
| 83 | .Fa BIO Ns | ||
| 84 | s (e.g., when | ||
| 85 | .Fn SSL_set_fd | ||
| 86 | was used), | ||
| 87 | .Xr select 2 | ||
| 88 | or | ||
| 89 | .Xr poll 2 | ||
| 90 | on the underlying socket can be used to find out when the TLS/SSL I/O function | ||
| 91 | should be retried. | ||
| 92 | .Pp | ||
| 93 | Caveat: Any TLS/SSL I/O function can lead to either of | ||
| 94 | .Dv SSL_ERROR_WANT_READ | ||
| 95 | and | ||
| 96 | .Dv SSL_ERROR_WANT_WRITE . | ||
| 97 | In particular, | ||
| 98 | .Xr SSL_read 3 | ||
| 99 | or | ||
| 100 | .Xr SSL_peek 3 | ||
| 101 | may want to write data and | ||
| 102 | .Xr SSL_write 3 | ||
| 103 | may want | ||
| 104 | to read data. | ||
| 105 | This is mainly because TLS/SSL handshakes may occur at any time during the | ||
| 106 | protocol (initiated by either the client or the server); | ||
| 107 | .Xr SSL_read 3 , | ||
| 108 | .Xr SSL_peek 3 , | ||
| 109 | and | ||
| 110 | .Xr SSL_write 3 | ||
| 111 | will handle any pending handshakes. | ||
| 112 | .It Dv SSL_ERROR_WANT_CONNECT , Dv SSL_ERROR_WANT_ACCEPT | ||
| 113 | The operation did not complete; the same TLS/SSL I/O function should be | ||
| 114 | called again later. | ||
| 115 | The underlying BIO was not connected yet to the peer and the call would block | ||
| 116 | in | ||
| 117 | .Xr connect 2 Ns / Ns | ||
| 118 | .Xr accept 2 . | ||
| 119 | The SSL function should be | ||
| 120 | called again when the connection is established. | ||
| 121 | These messages can only appear with a | ||
| 122 | .Xr BIO_s_connect 3 | ||
| 123 | or | ||
| 124 | .Xr BIO_s_accept 3 | ||
| 125 | .Vt BIO , | ||
| 126 | respectively. | ||
| 127 | In order to find out when the connection has been successfully established, | ||
| 128 | on many platforms | ||
| 129 | .Xr select 2 | ||
| 130 | or | ||
| 131 | .Xr poll 2 | ||
| 132 | for writing on the socket file descriptor can be used. | ||
| 133 | .It Dv SSL_ERROR_WANT_X509_LOOKUP | ||
| 134 | The operation did not complete because an application callback set by | ||
| 135 | .Xr SSL_CTX_set_client_cert_cb 3 | ||
| 136 | has asked to be called again. | ||
| 137 | The TLS/SSL I/O function should be called again later. | ||
| 138 | Details depend on the application. | ||
| 139 | .It Dv SSL_ERROR_SYSCALL | ||
| 140 | Some I/O error occurred. | ||
| 141 | The OpenSSL error queue may contain more information on the error. | ||
| 142 | If the error queue is empty (i.e., | ||
| 143 | .Fn ERR_get_error | ||
| 144 | returns 0), | ||
| 145 | .Fa ret | ||
| 146 | can be used to find out more about the error: | ||
| 147 | If | ||
| 148 | .Fa ret | ||
| 149 | == 0, an | ||
| 150 | .Dv EOF | ||
| 151 | was observed that violates the protocol. | ||
| 152 | If | ||
| 153 | .Fa ret | ||
| 154 | == \(mi1, the underlying | ||
| 155 | .Vt BIO | ||
| 156 | reported an | ||
| 157 | I/O error (for socket I/O on Unix systems, consult | ||
| 158 | .Dv errno | ||
| 159 | for details). | ||
| 160 | .It Dv SSL_ERROR_SSL | ||
| 161 | A failure in the SSL library occurred, usually a protocol error. | ||
| 162 | The OpenSSL error queue contains more information on the error. | ||
| 163 | .El | ||
| 164 | .Sh SEE ALSO | ||
| 165 | .Xr err 3 , | ||
| 166 | .Xr ssl 3 | ||
| 167 | .Sh HISTORY | ||
| 168 | .Fn SSL_get_error | ||
| 169 | was added in SSLeay 0.8. | ||
diff --git a/src/lib/libssl/doc/SSL_get_ex_data_X509_STORE_CTX_idx.3 b/src/lib/libssl/doc/SSL_get_ex_data_X509_STORE_CTX_idx.3 deleted file mode 100644 index ac8a27c952..0000000000 --- a/src/lib/libssl/doc/SSL_get_ex_data_X509_STORE_CTX_idx.3 +++ /dev/null | |||
| @@ -1,65 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_get_ex_data_X509_STORE_CTX_idx.3,v 1.3 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_GET_EX_DATA_X509_STORE_CTX_IDX 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_get_ex_data_X509_STORE_CTX_idx | ||
| 9 | .Nd get ex_data index to access SSL structure from X509_STORE_CTX | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft int | ||
| 13 | .Fn SSL_get_ex_data_X509_STORE_CTX_idx void | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_get_ex_data_X509_STORE_CTX_idx | ||
| 16 | returns the index number under which the pointer to the | ||
| 17 | .Vt SSL | ||
| 18 | object is stored into the | ||
| 19 | .Vt X509_STORE_CTX | ||
| 20 | object. | ||
| 21 | .Sh NOTES | ||
| 22 | Whenever a | ||
| 23 | .Vt X509_STORE_CTX | ||
| 24 | object is created for the verification of the peer's certificate during a | ||
| 25 | handshake, a pointer to the | ||
| 26 | .Vt SSL | ||
| 27 | object is stored into the | ||
| 28 | .Vt X509_STORE_CTX | ||
| 29 | object to identify the connection affected. | ||
| 30 | To retrieve this pointer the | ||
| 31 | .Xr X509_STORE_CTX_get_ex_data 3 | ||
| 32 | function can be used with the correct index. | ||
| 33 | This index is globally the same for all | ||
| 34 | .Vt X509_STORE_CTX | ||
| 35 | objects and can be retrieved using | ||
| 36 | .Fn SSL_get_ex_data_X509_STORE_CTX_idx . | ||
| 37 | The index value is set when | ||
| 38 | .Fn SSL_get_ex_data_X509_STORE_CTX_idx | ||
| 39 | is first called either by the application program directly or indirectly during | ||
| 40 | other SSL setup functions or during the handshake. | ||
| 41 | .Pp | ||
| 42 | The value depends on other index values defined for | ||
| 43 | .Vt X509_STORE_CTX | ||
| 44 | objects before the SSL index is created. | ||
| 45 | .Sh RETURN VALUES | ||
| 46 | .Bl -tag -width Ds | ||
| 47 | .It \(>=0 | ||
| 48 | The index value to access the pointer. | ||
| 49 | .It <0 | ||
| 50 | An error occurred, check the error stack for a detailed error message. | ||
| 51 | .El | ||
| 52 | .Sh EXAMPLES | ||
| 53 | The index returned from | ||
| 54 | .Fn SSL_get_ex_data_X509_STORE_CTX_idx | ||
| 55 | provides access to | ||
| 56 | .Vt SSL | ||
| 57 | object for the connection during the | ||
| 58 | .Fn verify_callback | ||
| 59 | when checking the peer's certificate. | ||
| 60 | Please check the example in | ||
| 61 | .Xr SSL_CTX_set_verify 3 . | ||
| 62 | .Sh SEE ALSO | ||
| 63 | .Xr CRYPTO_set_ex_data 3 , | ||
| 64 | .Xr ssl 3 , | ||
| 65 | .Xr SSL_CTX_set_verify 3 | ||
diff --git a/src/lib/libssl/doc/SSL_get_ex_new_index.3 b/src/lib/libssl/doc/SSL_get_ex_new_index.3 deleted file mode 100644 index d4613a6210..0000000000 --- a/src/lib/libssl/doc/SSL_get_ex_new_index.3 +++ /dev/null | |||
| @@ -1,76 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_get_ex_new_index.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_GET_EX_NEW_INDEX 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_get_ex_new_index , | ||
| 9 | .Nm SSL_set_ex_data , | ||
| 10 | .Nm SSL_get_ex_data | ||
| 11 | .Nd internal application specific data functions | ||
| 12 | .Sh SYNOPSIS | ||
| 13 | .In openssl/ssl.h | ||
| 14 | .Ft int | ||
| 15 | .Fo SSL_get_ex_new_index | ||
| 16 | .Fa "long argl" | ||
| 17 | .Fa "void *argp" | ||
| 18 | .Fa "CRYPTO_EX_new *new_func" | ||
| 19 | .Fa "CRYPTO_EX_dup *dup_func" | ||
| 20 | .Fa "CRYPTO_EX_free *free_func" | ||
| 21 | .Fc | ||
| 22 | .Ft int | ||
| 23 | .Fn SSL_set_ex_data "SSL *ssl" "int idx" "void *arg" | ||
| 24 | .Ft void * | ||
| 25 | .Fn SSL_get_ex_data "const SSL *ssl" "int idx" | ||
| 26 | .Bd -literal | ||
| 27 | typedef int new_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad, | ||
| 28 | int idx, long argl, void *argp); | ||
| 29 | typedef void free_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad, | ||
| 30 | int idx, long argl, void *argp); | ||
| 31 | typedef int dup_func(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d, | ||
| 32 | int idx, long argl, void *argp); | ||
| 33 | .Ed | ||
| 34 | .Sh DESCRIPTION | ||
| 35 | Several OpenSSL structures can have application specific data attached to them. | ||
| 36 | These functions are used internally by OpenSSL to manipulate application | ||
| 37 | specific data attached to a specific structure. | ||
| 38 | .Pp | ||
| 39 | .Fn SSL_get_ex_new_index | ||
| 40 | is used to register a new index for application specific data. | ||
| 41 | .Pp | ||
| 42 | .Fn SSL_set_ex_data | ||
| 43 | is used to store application data at | ||
| 44 | .Fa arg | ||
| 45 | for | ||
| 46 | .Fa idx | ||
| 47 | into the | ||
| 48 | .Fa ssl | ||
| 49 | object. | ||
| 50 | .Pp | ||
| 51 | .Fn SSL_get_ex_data | ||
| 52 | is used to retrieve the information for | ||
| 53 | .Fa idx | ||
| 54 | from | ||
| 55 | .Fa ssl . | ||
| 56 | .Pp | ||
| 57 | A detailed description for the | ||
| 58 | .Fn *_get_ex_new_index | ||
| 59 | functionality can be found in | ||
| 60 | .Xr RSA_get_ex_new_index 3 . | ||
| 61 | The | ||
| 62 | .Fn *_get_ex_data | ||
| 63 | and | ||
| 64 | .Fn *_set_ex_data | ||
| 65 | functionality is described in | ||
| 66 | .Xr CRYPTO_set_ex_data 3 . | ||
| 67 | .Sh EXAMPLES | ||
| 68 | An example of how to use the functionality is included in the example | ||
| 69 | .Fn verify_callback | ||
| 70 | in | ||
| 71 | .Xr SSL_CTX_set_verify 3 . | ||
| 72 | .Sh SEE ALSO | ||
| 73 | .Xr CRYPTO_set_ex_data 3 , | ||
| 74 | .Xr RSA_get_ex_new_index 3 , | ||
| 75 | .Xr ssl 3 , | ||
| 76 | .Xr SSL_CTX_set_verify 3 | ||
diff --git a/src/lib/libssl/doc/SSL_get_fd.3 b/src/lib/libssl/doc/SSL_get_fd.3 deleted file mode 100644 index b66b5f1044..0000000000 --- a/src/lib/libssl/doc/SSL_get_fd.3 +++ /dev/null | |||
| @@ -1,46 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_get_fd.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_GET_FD 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_get_fd , | ||
| 9 | .Nm SSL_get_rfd , | ||
| 10 | .Nm SSL_get_wfd | ||
| 11 | .Nd get file descriptor linked to an SSL object | ||
| 12 | .Sh SYNOPSIS | ||
| 13 | .In openssl/ssl.h | ||
| 14 | .Ft int | ||
| 15 | .Fn SSL_get_fd "const SSL *ssl" | ||
| 16 | .Ft int | ||
| 17 | .Fn SSL_get_rfd "const SSL *ssl" | ||
| 18 | .Ft int | ||
| 19 | .Fn SSL_get_wfd "const SSL *ssl" | ||
| 20 | .Sh DESCRIPTION | ||
| 21 | .Fn SSL_get_fd | ||
| 22 | returns the file descriptor which is linked to | ||
| 23 | .Fa ssl . | ||
| 24 | .Fn SSL_get_rfd | ||
| 25 | and | ||
| 26 | .Fn SSL_get_wfd | ||
| 27 | return the file descriptors for the read or the write channel, | ||
| 28 | which can be different. | ||
| 29 | If the read and the write channel are different, | ||
| 30 | .Fn SSL_get_fd | ||
| 31 | will return the file descriptor of the read channel. | ||
| 32 | .Sh RETURN VALUES | ||
| 33 | The following return values can occur: | ||
| 34 | .Bl -tag -width Ds | ||
| 35 | .It \(mi1 | ||
| 36 | The operation failed, because the underlying | ||
| 37 | .Vt BIO | ||
| 38 | is not of the correct type (suitable for file descriptors). | ||
| 39 | .It \(>=0 | ||
| 40 | The file descriptor linked to | ||
| 41 | .Fa ssl . | ||
| 42 | .El | ||
| 43 | .Sh SEE ALSO | ||
| 44 | .Xr bio 3 , | ||
| 45 | .Xr ssl 3 , | ||
| 46 | .Xr SSL_set_fd 3 | ||
diff --git a/src/lib/libssl/doc/SSL_get_peer_cert_chain.3 b/src/lib/libssl/doc/SSL_get_peer_cert_chain.3 deleted file mode 100644 index e4faece5d0..0000000000 --- a/src/lib/libssl/doc/SSL_get_peer_cert_chain.3 +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_get_peer_cert_chain.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_GET_PEER_CERT_CHAIN 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_get_peer_cert_chain | ||
| 9 | .Nd get the X509 certificate chain of the peer | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft STACK_OF(X509) * | ||
| 13 | .Fn SSL_get_peer_cert_chain "const SSL *ssl" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_get_peer_cert_chain | ||
| 16 | returns a pointer to | ||
| 17 | .Dv STACK_OF Ns Po Vt X509 Pc | ||
| 18 | certificates forming the certificate chain of the peer. | ||
| 19 | If called on the client side, the stack also contains the peer's certificate; | ||
| 20 | if called on the server side, the peer's certificate must be obtained | ||
| 21 | separately using | ||
| 22 | .Xr SSL_get_peer_certificate 3 . | ||
| 23 | If the peer did not present a certificate, | ||
| 24 | .Dv NULL | ||
| 25 | is returned. | ||
| 26 | .Sh NOTES | ||
| 27 | The peer certificate chain is not necessarily available after reusing a | ||
| 28 | session, in which case a | ||
| 29 | .Dv NULL | ||
| 30 | pointer is returned. | ||
| 31 | .Pp | ||
| 32 | The reference count of the | ||
| 33 | .Dv STACK_OF Ns Po Vt X509 Pc | ||
| 34 | object is not incremented. | ||
| 35 | If the corresponding session is freed, the pointer must not be used any longer. | ||
| 36 | .Sh RETURN VALUES | ||
| 37 | The following return values can occur: | ||
| 38 | .Bl -tag -width Ds | ||
| 39 | .It Dv NULL | ||
| 40 | No certificate was presented by the peer or no connection was established or | ||
| 41 | the certificate chain is no longer available when a session is reused. | ||
| 42 | .It Pointer to a Dv STACK_OF Ns Po X509 Pc | ||
| 43 | The return value points to the certificate chain presented by the peer. | ||
| 44 | .El | ||
| 45 | .Sh SEE ALSO | ||
| 46 | .Xr ssl 3 , | ||
| 47 | .Xr SSL_get_peer_certificate 3 | ||
diff --git a/src/lib/libssl/doc/SSL_get_peer_certificate.3 b/src/lib/libssl/doc/SSL_get_peer_certificate.3 deleted file mode 100644 index bb32572356..0000000000 --- a/src/lib/libssl/doc/SSL_get_peer_certificate.3 +++ /dev/null | |||
| @@ -1,53 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_get_peer_certificate.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_GET_PEER_CERTIFICATE 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_get_peer_certificate | ||
| 9 | .Nd get the X509 certificate of the peer | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft X509 * | ||
| 13 | .Fn SSL_get_peer_certificate "const SSL *ssl" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_get_peer_certificate | ||
| 16 | returns a pointer to the X509 certificate the peer presented. | ||
| 17 | If the peer did not present a certificate, | ||
| 18 | .Dv NULL | ||
| 19 | is returned. | ||
| 20 | .Sh NOTES | ||
| 21 | Due to the protocol definition, a TLS/SSL server will always send a | ||
| 22 | certificate, if present. | ||
| 23 | A client will only send a certificate when explicitly requested to do so by the | ||
| 24 | server (see | ||
| 25 | .Xr SSL_CTX_set_verify 3 ) . | ||
| 26 | If an anonymous cipher is used, no certificates are sent. | ||
| 27 | .Pp | ||
| 28 | That a certificate is returned does not indicate information about the | ||
| 29 | verification state. | ||
| 30 | Use | ||
| 31 | .Xr SSL_get_verify_result 3 | ||
| 32 | to check the verification state. | ||
| 33 | .Pp | ||
| 34 | The reference count of the | ||
| 35 | .Vt X509 | ||
| 36 | object is incremented by one, so that it will not be destroyed when the session | ||
| 37 | containing the peer certificate is freed. | ||
| 38 | The | ||
| 39 | .Vt X509 | ||
| 40 | object must be explicitly freed using | ||
| 41 | .Xr X509_free 3 . | ||
| 42 | .Sh RETURN VALUES | ||
| 43 | The following return values can occur: | ||
| 44 | .Bl -tag -width Ds | ||
| 45 | .It Dv NULL | ||
| 46 | No certificate was presented by the peer or no connection was established. | ||
| 47 | .It Pointer to an X509 certificate | ||
| 48 | The return value points to the certificate presented by the peer. | ||
| 49 | .El | ||
| 50 | .Sh SEE ALSO | ||
| 51 | .Xr ssl 3 , | ||
| 52 | .Xr SSL_CTX_set_verify 3 , | ||
| 53 | .Xr SSL_get_verify_result 3 | ||
diff --git a/src/lib/libssl/doc/SSL_get_psk_identity.3 b/src/lib/libssl/doc/SSL_get_psk_identity.3 deleted file mode 100644 index 408555c0ee..0000000000 --- a/src/lib/libssl/doc/SSL_get_psk_identity.3 +++ /dev/null | |||
| @@ -1,44 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_get_psk_identity.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_GET_PSK_IDENTITY 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_get_psk_identity , | ||
| 9 | .Nm SSL_get_psk_identity_hint | ||
| 10 | .Nd get PSK client identity and hint | ||
| 11 | .Sh SYNOPSIS | ||
| 12 | .In openssl/ssl.h | ||
| 13 | .Ft const char * | ||
| 14 | .Fn SSL_get_psk_identity_hint "const SSL *ssl" | ||
| 15 | .Ft const char * | ||
| 16 | .Fn SSL_get_psk_identity "const SSL *ssl" | ||
| 17 | .Sh DESCRIPTION | ||
| 18 | .Fn SSL_get_psk_identity_hint | ||
| 19 | is used to retrieve the PSK identity hint used during the connection setup | ||
| 20 | related to | ||
| 21 | .Vt SSL | ||
| 22 | object | ||
| 23 | .Fa ssl . | ||
| 24 | Similarly, | ||
| 25 | .Fn SSL_get_psk_identity | ||
| 26 | is used to retrieve the PSK identity used during the connection setup. | ||
| 27 | .Sh RETURN VALUES | ||
| 28 | If | ||
| 29 | .Pf non- Dv NULL , | ||
| 30 | .Fn SSL_get_psk_identity_hint | ||
| 31 | returns the PSK identity hint and | ||
| 32 | .Fn SSL_get_psk_identity | ||
| 33 | returns the PSK identity. | ||
| 34 | Both are | ||
| 35 | .Dv NULL Ns -terminated. | ||
| 36 | .Fn SSL_get_psk_identity_hint | ||
| 37 | may return | ||
| 38 | .Dv NULL | ||
| 39 | if no PSK identity hint was used during the connection setup. | ||
| 40 | .Pp | ||
| 41 | Note that the return value is valid only during the lifetime of the | ||
| 42 | .Vt SSL | ||
| 43 | object | ||
| 44 | .Fa ssl . | ||
diff --git a/src/lib/libssl/doc/SSL_get_rbio.3 b/src/lib/libssl/doc/SSL_get_rbio.3 deleted file mode 100644 index 4455692eac..0000000000 --- a/src/lib/libssl/doc/SSL_get_rbio.3 +++ /dev/null | |||
| @@ -1,45 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_get_rbio.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_GET_RBIO 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_get_rbio , | ||
| 9 | .Nm SSL_get_wbio | ||
| 10 | .Nd get BIO linked to an SSL object | ||
| 11 | .Sh SYNOPSIS | ||
| 12 | .In openssl/ssl.h | ||
| 13 | .Ft BIO * | ||
| 14 | .Fn SSL_get_rbio "SSL *ssl" | ||
| 15 | .Ft BIO * | ||
| 16 | .Fn SSL_get_wbio "SSL *ssl" | ||
| 17 | .Sh DESCRIPTION | ||
| 18 | .Fn SSL_get_rbio | ||
| 19 | and | ||
| 20 | .Fn SSL_get_wbio | ||
| 21 | return pointers to the | ||
| 22 | .Vt BIO Ns s | ||
| 23 | for the read or the write channel, which can be different. | ||
| 24 | The reference count of the | ||
| 25 | .Vt BIO | ||
| 26 | is not incremented. | ||
| 27 | .Sh RETURN VALUES | ||
| 28 | The following return values can occur: | ||
| 29 | .Bl -tag -width Ds | ||
| 30 | .It Dv NULL | ||
| 31 | No | ||
| 32 | .Vt BIO | ||
| 33 | was connected to the | ||
| 34 | .Vt SSL | ||
| 35 | object. | ||
| 36 | .It Any other pointer | ||
| 37 | The | ||
| 38 | .Vt BIO | ||
| 39 | linked to | ||
| 40 | .Fa ssl . | ||
| 41 | .El | ||
| 42 | .Sh SEE ALSO | ||
| 43 | .Xr bio 3 , | ||
| 44 | .Xr ssl 3 , | ||
| 45 | .Xr SSL_set_bio 3 | ||
diff --git a/src/lib/libssl/doc/SSL_get_session.3 b/src/lib/libssl/doc/SSL_get_session.3 deleted file mode 100644 index 435fe20956..0000000000 --- a/src/lib/libssl/doc/SSL_get_session.3 +++ /dev/null | |||
| @@ -1,97 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_get_session.3,v 1.3 2014/12/04 18:27:10 schwarze Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 4 2014 $ | ||
| 5 | .Dt SSL_GET_SESSION 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_get_session , | ||
| 9 | .Nm SSL_get0_session , | ||
| 10 | .Nm SSL_get1_session | ||
| 11 | .Nd retrieve TLS/SSL session data | ||
| 12 | .Sh SYNOPSIS | ||
| 13 | .In openssl/ssl.h | ||
| 14 | .Ft SSL_SESSION * | ||
| 15 | .Fn SSL_get_session "const SSL *ssl" | ||
| 16 | .Ft SSL_SESSION * | ||
| 17 | .Fn SSL_get0_session "const SSL *ssl" | ||
| 18 | .Ft SSL_SESSION * | ||
| 19 | .Fn SSL_get1_session "SSL *ssl" | ||
| 20 | .Sh DESCRIPTION | ||
| 21 | .Fn SSL_get_session | ||
| 22 | returns a pointer to the | ||
| 23 | .Vt SSL_SESSION | ||
| 24 | actually used in | ||
| 25 | .Fa ssl . | ||
| 26 | The reference count of the | ||
| 27 | .Vt SSL_SESSION | ||
| 28 | is not incremented, so that the pointer can become invalid by other operations. | ||
| 29 | .Pp | ||
| 30 | .Fn SSL_get0_session | ||
| 31 | is the same as | ||
| 32 | .Fn SSL_get_session . | ||
| 33 | .Pp | ||
| 34 | .Fn SSL_get1_session | ||
| 35 | is the same as | ||
| 36 | .Fn SSL_get_session , | ||
| 37 | but the reference count of the | ||
| 38 | .Vt SSL_SESSION | ||
| 39 | is incremented by one. | ||
| 40 | .Sh NOTES | ||
| 41 | The | ||
| 42 | Fa ssl | ||
| 43 | session contains all information required to re-establish the connection | ||
| 44 | without a new handshake. | ||
| 45 | .Pp | ||
| 46 | .Fn SSL_get0_session | ||
| 47 | returns a pointer to the actual session. | ||
| 48 | As the reference counter is not incremented, | ||
| 49 | the pointer is only valid while the connection is in use. | ||
| 50 | If | ||
| 51 | .Xr SSL_clear 3 | ||
| 52 | or | ||
| 53 | .Xr SSL_free 3 | ||
| 54 | is called, the session may be removed completely (if considered bad), | ||
| 55 | and the pointer obtained will become invalid. | ||
| 56 | Even if the session is valid, | ||
| 57 | it can be removed at any time due to timeout during | ||
| 58 | .Xr SSL_CTX_flush_sessions 3 . | ||
| 59 | .Pp | ||
| 60 | If the data is to be kept, | ||
| 61 | .Fn SSL_get1_session | ||
| 62 | will increment the reference count, so that the session will not be implicitly | ||
| 63 | removed by other operations but stays in memory. | ||
| 64 | In order to remove the session | ||
| 65 | .Xr SSL_SESSION_free 3 | ||
| 66 | must be explicitly called once to decrement the reference count again. | ||
| 67 | .Pp | ||
| 68 | .Vt SSL_SESSION | ||
| 69 | objects keep internal link information about the session cache list when being | ||
| 70 | inserted into one | ||
| 71 | .Vt SSL_CTX | ||
| 72 | object's session cache. | ||
| 73 | One | ||
| 74 | .Vt SSL_SESSION | ||
| 75 | object, regardless of its reference count, must therefore only be used with one | ||
| 76 | .Vt SSL_CTX | ||
| 77 | object (and the | ||
| 78 | .Vt SSL | ||
| 79 | objects created from this | ||
| 80 | .Vt SSL_CTX | ||
| 81 | object). | ||
| 82 | .Sh RETURN VALUES | ||
| 83 | The following return values can occur: | ||
| 84 | .Bl -tag -width Ds | ||
| 85 | .It Dv NULL | ||
| 86 | There is no session available in | ||
| 87 | .Fa ssl . | ||
| 88 | .It Pointer to an Vt SSL | ||
| 89 | The return value points to the data of an | ||
| 90 | .Vt SSL | ||
| 91 | session. | ||
| 92 | .El | ||
| 93 | .Sh SEE ALSO | ||
| 94 | .Xr ssl 3 , | ||
| 95 | .Xr SSL_clear 3 , | ||
| 96 | .Xr SSL_free 3 , | ||
| 97 | .Xr SSL_SESSION_free 3 | ||
diff --git a/src/lib/libssl/doc/SSL_get_verify_result.3 b/src/lib/libssl/doc/SSL_get_verify_result.3 deleted file mode 100644 index e89e3dea61..0000000000 --- a/src/lib/libssl/doc/SSL_get_verify_result.3 +++ /dev/null | |||
| @@ -1,49 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_get_verify_result.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_GET_VERIFY_RESULT 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_get_verify_result | ||
| 9 | .Nd get result of peer certificate verification | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft long | ||
| 13 | .Fn SSL_get_verify_result "const SSL *ssl" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_get_verify_result | ||
| 16 | returns the result of the verification of the X509 certificate presented by the | ||
| 17 | peer, if any. | ||
| 18 | .Sh NOTES | ||
| 19 | .Fn SSL_get_verify_result | ||
| 20 | can only return one error code while the verification of a certificate can fail | ||
| 21 | because of many reasons at the same time. | ||
| 22 | Only the last verification error that occurred during the processing is | ||
| 23 | available from | ||
| 24 | .Fn SSL_get_verify_result . | ||
| 25 | .Pp | ||
| 26 | The verification result is part of the established session and is restored when | ||
| 27 | a session is reused. | ||
| 28 | .Sh RETURN VALUES | ||
| 29 | The following return values can currently occur: | ||
| 30 | .Bl -tag -width Ds | ||
| 31 | .It Dv X509_V_OK | ||
| 32 | The verification succeeded or no peer certificate was presented. | ||
| 33 | .It Any other value | ||
| 34 | Documented in | ||
| 35 | .Xr openssl 1 . | ||
| 36 | .El | ||
| 37 | .Sh SEE ALSO | ||
| 38 | .Xr openssl 1 , | ||
| 39 | .Xr ssl 3 , | ||
| 40 | .Xr SSL_get_peer_certificate 3 , | ||
| 41 | .Xr SSL_set_verify_result 3 | ||
| 42 | .Sh BUGS | ||
| 43 | If no peer certificate was presented, the returned result code is | ||
| 44 | .Dv X509_V_OK . | ||
| 45 | This is because no verification error occurred; | ||
| 46 | however, it does not indicate success. | ||
| 47 | .Fn SSL_get_verify_result | ||
| 48 | is only useful in connection with | ||
| 49 | .Xr SSL_get_peer_certificate 3 . | ||
diff --git a/src/lib/libssl/doc/SSL_get_version.3 b/src/lib/libssl/doc/SSL_get_version.3 deleted file mode 100644 index ecfd005f12..0000000000 --- a/src/lib/libssl/doc/SSL_get_version.3 +++ /dev/null | |||
| @@ -1,35 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_get_version.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_GET_VERSION 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_get_version | ||
| 9 | .Nd get the protocol version of a connection | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft const char * | ||
| 13 | .Fn SSL_get_version "const SSL *ssl" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_get_version | ||
| 16 | returns the name of the protocol used for the connection | ||
| 17 | .Fa ssl . | ||
| 18 | .Sh RETURN VALUES | ||
| 19 | The following strings can be returned: | ||
| 20 | .Bl -tag -width Ds | ||
| 21 | .It Qq SSLv2 | ||
| 22 | The connection uses the SSLv2 protocol. | ||
| 23 | .It Qq SSLv3 | ||
| 24 | The connection uses the SSLv3 protocol. | ||
| 25 | .It Qq TLSv1 | ||
| 26 | The connection uses the TLSv1.0 protocol. | ||
| 27 | .It Qq TLSv1.1 | ||
| 28 | The connection uses the TLSv1.1 protocol. | ||
| 29 | .It Qq TLSv1.2 | ||
| 30 | The connection uses the TLSv1.2 protocol. | ||
| 31 | .It Qq unknown | ||
| 32 | This indicates that no version has been set (no connection established). | ||
| 33 | .El | ||
| 34 | .Sh SEE ALSO | ||
| 35 | .Xr ssl 3 | ||
diff --git a/src/lib/libssl/doc/SSL_library_init.3 b/src/lib/libssl/doc/SSL_library_init.3 deleted file mode 100644 index 0c84c5d9c9..0000000000 --- a/src/lib/libssl/doc/SSL_library_init.3 +++ /dev/null | |||
| @@ -1,54 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_library_init.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_LIBRARY_INIT 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_library_init , | ||
| 9 | .Nm OpenSSL_add_ssl_algorithms , | ||
| 10 | .Nm SSLeay_add_ssl_algorithms | ||
| 11 | .Nd initialize SSL library by registering algorithms | ||
| 12 | .Sh SYNOPSIS | ||
| 13 | .In openssl/ssl.h | ||
| 14 | .Ft int | ||
| 15 | .Fn SSL_library_init void | ||
| 16 | .Fd #define OpenSSL_add_ssl_algorithms() SSL_library_init() | ||
| 17 | .Fd #define SSLeay_add_ssl_algorithms() SSL_library_init() | ||
| 18 | .Sh DESCRIPTION | ||
| 19 | .Fn SSL_library_init | ||
| 20 | registers the available SSL/TLS ciphers and digests. | ||
| 21 | .Pp | ||
| 22 | .Fn OpenSSL_add_ssl_algorithms | ||
| 23 | and | ||
| 24 | .Fn SSLeay_add_ssl_algorithms | ||
| 25 | are synonyms for | ||
| 26 | .Fn SSL_library_init . | ||
| 27 | .Sh NOTES | ||
| 28 | .Fn SSL_library_init | ||
| 29 | must be called before any other action takes place. | ||
| 30 | .Fn SSL_library_init | ||
| 31 | is not reentrant. | ||
| 32 | .Sh WARNING | ||
| 33 | .Fn SSL_library_init | ||
| 34 | adds ciphers and digests used directly and indirectly by SSL/TLS. | ||
| 35 | .Sh RETURN VALUES | ||
| 36 | .Fn SSL_library_init | ||
| 37 | always returns 1, so it is safe to discard the return value. | ||
| 38 | .Sh EXAMPLES | ||
| 39 | A typical TLS/SSL application will start with the library initialization, and | ||
| 40 | provide readable error messages. | ||
| 41 | .Bd -literal | ||
| 42 | SSL_load_error_strings(); /* readable error messages */ | ||
| 43 | SSL_library_init(); /* initialize library */ | ||
| 44 | .Ed | ||
| 45 | .Sh NOTES | ||
| 46 | OpenSSL 0.9.8o and 1.0.0a and later added SHA2 algorithms to | ||
| 47 | .Fn SSL_library_init . | ||
| 48 | Applications which need to use SHA2 in earlier versions of OpenSSL should call | ||
| 49 | .Fn OpenSSL_add_all_algorithms | ||
| 50 | as well. | ||
| 51 | .Sh SEE ALSO | ||
| 52 | .Xr RAND_add 3 , | ||
| 53 | .Xr ssl 3 , | ||
| 54 | .Xr SSL_load_error_strings 3 | ||
diff --git a/src/lib/libssl/doc/SSL_load_client_CA_file.3 b/src/lib/libssl/doc/SSL_load_client_CA_file.3 deleted file mode 100644 index d1f085583f..0000000000 --- a/src/lib/libssl/doc/SSL_load_client_CA_file.3 +++ /dev/null | |||
| @@ -1,53 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_load_client_CA_file.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_LOAD_CLIENT_CA_FILE 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_load_client_CA_file | ||
| 9 | .Nd load certificate names from file | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft STACK_OF(X509_NAME) * | ||
| 13 | .Fn SSL_load_client_CA_file "const char *file" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_load_client_CA_file | ||
| 16 | reads certificates from | ||
| 17 | .Fa file | ||
| 18 | and returns a | ||
| 19 | .Dv STACK_OF Ns | ||
| 20 | .Pq Vt X509_NAME | ||
| 21 | with the subject names found. | ||
| 22 | .Sh NOTES | ||
| 23 | .Fn SSL_load_client_CA_file | ||
| 24 | reads a file of PEM formatted certificates and extracts the | ||
| 25 | .Vt X509_NAME Ns s | ||
| 26 | of the certificates found. | ||
| 27 | While the name suggests the specific usage as support function for | ||
| 28 | .Xr SSL_CTX_set_client_CA_list 3 , | ||
| 29 | it is not limited to CA certificates. | ||
| 30 | .Sh RETURN VALUES | ||
| 31 | The following return values can occur: | ||
| 32 | .Bl -tag -width Ds | ||
| 33 | .It Dv NULL | ||
| 34 | The operation failed, check out the error stack for the reason. | ||
| 35 | .It Pointer to Dv STACK_OF Ns Po Vt X509_NAME Pc | ||
| 36 | Pointer to the subject names of the successfully read certificates. | ||
| 37 | .El | ||
| 38 | .Sh EXAMPLES | ||
| 39 | Load names of CAs from file and use it as a client CA list: | ||
| 40 | .Bd -literal | ||
| 41 | SSL_CTX *ctx; | ||
| 42 | STACK_OF(X509_NAME) *cert_names; | ||
| 43 | \&... | ||
| 44 | cert_names = SSL_load_client_CA_file("/path/to/CAfile.pem"); | ||
| 45 | if (cert_names != NULL) | ||
| 46 | SSL_CTX_set_client_CA_list(ctx, cert_names); | ||
| 47 | else | ||
| 48 | error_handling(); | ||
| 49 | \&... | ||
| 50 | .Ed | ||
| 51 | .Sh SEE ALSO | ||
| 52 | .Xr ssl 3 , | ||
| 53 | .Xr SSL_CTX_set_client_CA_list 3 | ||
diff --git a/src/lib/libssl/doc/SSL_new.3 b/src/lib/libssl/doc/SSL_new.3 deleted file mode 100644 index 884b51270b..0000000000 --- a/src/lib/libssl/doc/SSL_new.3 +++ /dev/null | |||
| @@ -1,41 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_new.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_NEW 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_new | ||
| 9 | .Nd create a new SSL structure for a connection | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft SSL * | ||
| 13 | .Fn SSL_new "SSL_CTX *ctx" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_new | ||
| 16 | creates a new | ||
| 17 | .Vt SSL | ||
| 18 | structure which is needed to hold the data for a TLS/SSL connection. | ||
| 19 | The new structure inherits the settings of the underlying context | ||
| 20 | .Fa ctx : | ||
| 21 | connection method (SSLv2/v3/TLSv1), options, verification settings, | ||
| 22 | timeout settings. | ||
| 23 | .Sh RETURN VALUES | ||
| 24 | The following return values can occur: | ||
| 25 | .Bl -tag -width Ds | ||
| 26 | .It Dv NULL | ||
| 27 | The creation of a new | ||
| 28 | .Vt SSL | ||
| 29 | structure failed. | ||
| 30 | Check the error stack to find out the reason. | ||
| 31 | .It Pointer to an Vt SSL No structure | ||
| 32 | The return value points to an allocated | ||
| 33 | .Vt SSL | ||
| 34 | structure. | ||
| 35 | .El | ||
| 36 | .Sh SEE ALSO | ||
| 37 | .Xr ssl 3 , | ||
| 38 | .Xr SSL_clear 3 , | ||
| 39 | .Xr SSL_CTX_set_options 3 , | ||
| 40 | .Xr SSL_free 3 , | ||
| 41 | .Xr SSL_get_SSL_CTX 3 | ||
diff --git a/src/lib/libssl/doc/SSL_pending.3 b/src/lib/libssl/doc/SSL_pending.3 deleted file mode 100644 index 25ef4ea0ba..0000000000 --- a/src/lib/libssl/doc/SSL_pending.3 +++ /dev/null | |||
| @@ -1,44 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_pending.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_PENDING 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_pending | ||
| 9 | .Nd obtain number of readable bytes buffered in an SSL object | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft int | ||
| 13 | .Fn SSL_pending "const SSL *ssl" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_pending | ||
| 16 | returns the number of bytes which are available inside | ||
| 17 | .Fa ssl | ||
| 18 | for immediate read. | ||
| 19 | .Sh NOTES | ||
| 20 | Data are received in blocks from the peer. | ||
| 21 | Therefore data can be buffered inside | ||
| 22 | .Fa ssl | ||
| 23 | and are ready for immediate retrieval with | ||
| 24 | .Xr SSL_read 3 . | ||
| 25 | .Sh RETURN VALUES | ||
| 26 | The number of bytes pending is returned. | ||
| 27 | .Sh SEE ALSO | ||
| 28 | .Xr ssl 3 , | ||
| 29 | .Xr SSL_read 3 | ||
| 30 | .Sh BUGS | ||
| 31 | .Fn SSL_pending | ||
| 32 | takes into account only bytes from the TLS/SSL record that is currently being | ||
| 33 | processed (if any). | ||
| 34 | If the | ||
| 35 | .Vt SSL | ||
| 36 | object's | ||
| 37 | .Em read_ahead | ||
| 38 | flag is set, additional protocol bytes may have been read containing more | ||
| 39 | TLS/SSL records; these are ignored by | ||
| 40 | .Fn SSL_pending . | ||
| 41 | .Pp | ||
| 42 | Up to OpenSSL 0.9.6, | ||
| 43 | .Fn SSL_pending | ||
| 44 | does not check if the record type of pending data is application data. | ||
diff --git a/src/lib/libssl/doc/SSL_read.3 b/src/lib/libssl/doc/SSL_read.3 deleted file mode 100644 index d6e5960958..0000000000 --- a/src/lib/libssl/doc/SSL_read.3 +++ /dev/null | |||
| @@ -1,193 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_read.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_READ 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_read | ||
| 9 | .Nd read bytes from a TLS/SSL connection | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft int | ||
| 13 | .Fn SSL_read "SSL *ssl" "void *buf" "int num" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_read | ||
| 16 | tries to read | ||
| 17 | .Fa num | ||
| 18 | bytes from the specified | ||
| 19 | .Fa ssl | ||
| 20 | into the buffer | ||
| 21 | .Fa buf . | ||
| 22 | .Sh NOTES | ||
| 23 | If necessary, | ||
| 24 | .Fn SSL_read | ||
| 25 | will negotiate a TLS/SSL session, if not already explicitly performed by | ||
| 26 | .Xr SSL_connect 3 | ||
| 27 | or | ||
| 28 | .Xr SSL_accept 3 . | ||
| 29 | If the peer requests a re-negotiation, | ||
| 30 | it will be performed transparently during the | ||
| 31 | .Fn SSL_read | ||
| 32 | operation. | ||
| 33 | The behaviour of | ||
| 34 | .Fn SSL_read | ||
| 35 | depends on the underlying | ||
| 36 | .Vt BIO . | ||
| 37 | .Pp | ||
| 38 | For the transparent negotiation to succeed, the | ||
| 39 | .Fa ssl | ||
| 40 | must have been initialized to client or server mode. | ||
| 41 | This is being done by calling | ||
| 42 | .Xr SSL_set_connect_state 3 | ||
| 43 | or | ||
| 44 | .Xr SSL_set_accept_state 3 | ||
| 45 | before the first call to | ||
| 46 | .Fn SSL_read | ||
| 47 | or | ||
| 48 | .Xr SSL_write 3 . | ||
| 49 | .Pp | ||
| 50 | .Fn SSL_read | ||
| 51 | works based on the SSL/TLS records. | ||
| 52 | The data are received in records (with a maximum record size of 16kB for | ||
| 53 | SSLv3/TLSv1). | ||
| 54 | Only after a record has been completely received can it be processed | ||
| 55 | (decrypted and checked for integrity). | ||
| 56 | Therefore data not retrieved at the last call of | ||
| 57 | .Fn SSL_read | ||
| 58 | can still be buffered inside the SSL layer and will be retrieved on the next | ||
| 59 | call to | ||
| 60 | .Fn SSL_read . | ||
| 61 | If | ||
| 62 | .Fa num | ||
| 63 | is higher than the number of bytes buffered, | ||
| 64 | .Fn SSL_read | ||
| 65 | will return with the bytes buffered. | ||
| 66 | If no more bytes are in the buffer, | ||
| 67 | .Fn SSL_read | ||
| 68 | will trigger the processing of the next record. | ||
| 69 | Only when the record has been received and processed completely will | ||
| 70 | .Fn SSL_read | ||
| 71 | return reporting success. | ||
| 72 | At most the contents of the record will be returned. | ||
| 73 | As the size of an SSL/TLS record may exceed the maximum packet size of the | ||
| 74 | underlying transport (e.g., TCP), it may be necessary to read several packets | ||
| 75 | from the transport layer before the record is complete and | ||
| 76 | .Fn SSL_read | ||
| 77 | can succeed. | ||
| 78 | .Pp | ||
| 79 | If the underlying | ||
| 80 | .Vt BIO | ||
| 81 | is | ||
| 82 | .Em blocking , | ||
| 83 | .Fn SSL_read | ||
| 84 | will only return once the read operation has been finished or an error | ||
| 85 | has occurred, except when a renegotiation take place, in which case a | ||
| 86 | .Dv SSL_ERROR_WANT_READ | ||
| 87 | may occur. | ||
| 88 | This behavior can be controlled with the | ||
| 89 | .Dv SSL_MODE_AUTO_RETRY | ||
| 90 | flag of the | ||
| 91 | .Xr SSL_CTX_set_mode 3 | ||
| 92 | call. | ||
| 93 | .Pp | ||
| 94 | If the underlying | ||
| 95 | .Vt BIO | ||
| 96 | is | ||
| 97 | .Em non-blocking , | ||
| 98 | .Fn SSL_read | ||
| 99 | will also return when the underlying | ||
| 100 | .Vt BIO | ||
| 101 | could not satisfy the needs of | ||
| 102 | .Fn SSL_read | ||
| 103 | to continue the operation. | ||
| 104 | In this case a call to | ||
| 105 | .Xr SSL_get_error 3 | ||
| 106 | with the return value of | ||
| 107 | .Fn SSL_read | ||
| 108 | will yield | ||
| 109 | .Dv SSL_ERROR_WANT_READ | ||
| 110 | or | ||
| 111 | .Dv SSL_ERROR_WANT_WRITE . | ||
| 112 | As at any time a re-negotiation is possible, a call to | ||
| 113 | .Fn SSL_read | ||
| 114 | can also cause write operations! | ||
| 115 | The calling process then must repeat the call after taking appropriate action | ||
| 116 | to satisfy the needs of | ||
| 117 | .Fn SSL_read . | ||
| 118 | The action depends on the underlying | ||
| 119 | .Vt BIO . | ||
| 120 | When using a non-blocking socket, nothing is to be done, but | ||
| 121 | .Xr select 2 | ||
| 122 | can be used to check for the required condition. | ||
| 123 | When using a buffering | ||
| 124 | .Vt BIO , | ||
| 125 | like a | ||
| 126 | .Vt BIO | ||
| 127 | pair, data must be written into or retrieved out of the | ||
| 128 | .Vt BIO | ||
| 129 | before being able to continue. | ||
| 130 | .Pp | ||
| 131 | .Xr SSL_pending 3 | ||
| 132 | can be used to find out whether there are buffered bytes available for | ||
| 133 | immediate retrieval. | ||
| 134 | In this case | ||
| 135 | .Fn SSL_read | ||
| 136 | can be called without blocking or actually receiving new data from the | ||
| 137 | underlying socket. | ||
| 138 | .Sh WARNING | ||
| 139 | When an | ||
| 140 | .Fn SSL_read | ||
| 141 | operation has to be repeated because of | ||
| 142 | .Dv SSL_ERROR_WANT_READ | ||
| 143 | or | ||
| 144 | .Dv SSL_ERROR_WANT_WRITE , | ||
| 145 | it must be repeated with the same arguments. | ||
| 146 | .Sh RETURN VALUES | ||
| 147 | The following return values can occur: | ||
| 148 | .Bl -tag -width Ds | ||
| 149 | .It >0 | ||
| 150 | The read operation was successful; the return value is the number of bytes | ||
| 151 | actually read from the TLS/SSL connection. | ||
| 152 | .It 0 | ||
| 153 | The read operation was not successful. | ||
| 154 | The reason may either be a clean shutdown due to a | ||
| 155 | .Dq close notify | ||
| 156 | alert sent by the peer (in which case the | ||
| 157 | .Dv SSL_RECEIVED_SHUTDOWN | ||
| 158 | flag in the ssl shutdown state is set (see | ||
| 159 | .Xr SSL_shutdown 3 | ||
| 160 | and | ||
| 161 | .Xr SSL_set_shutdown 3 ) . | ||
| 162 | It is also possible that the peer simply shut down the underlying transport and | ||
| 163 | the shutdown is incomplete. | ||
| 164 | Call | ||
| 165 | .Fn SSL_get_error | ||
| 166 | with the return value to find out whether an error occurred or the connection | ||
| 167 | was shut down cleanly | ||
| 168 | .Pq Dv SSL_ERROR_ZERO_RETURN . | ||
| 169 | .Pp | ||
| 170 | SSLv2 (deprecated) does not support a shutdown alert protocol, so it can only | ||
| 171 | be detected whether the underlying connection was closed. | ||
| 172 | It cannot be checked whether the closure was initiated by the peer or by | ||
| 173 | something else. | ||
| 174 | .It <0 | ||
| 175 | The read operation was not successful, because either an error occurred or | ||
| 176 | action must be taken by the calling process. | ||
| 177 | Call | ||
| 178 | .Fn SSL_get_error | ||
| 179 | with the return value to find out the reason. | ||
| 180 | .El | ||
| 181 | .Sh SEE ALSO | ||
| 182 | .Xr bio 3 , | ||
| 183 | .Xr ssl 3 , | ||
| 184 | .Xr SSL_accept 3 , | ||
| 185 | .Xr SSL_connect 3 , | ||
| 186 | .Xr SSL_CTX_new 3 , | ||
| 187 | .Xr SSL_CTX_set_mode 3 , | ||
| 188 | .Xr SSL_get_error 3 , | ||
| 189 | .Xr SSL_pending 3 , | ||
| 190 | .Xr SSL_set_connect_state 3 , | ||
| 191 | .Xr SSL_set_shutdown 3 , | ||
| 192 | .Xr SSL_shutdown 3 , | ||
| 193 | .Xr SSL_write 3 | ||
diff --git a/src/lib/libssl/doc/SSL_rstate_string.3 b/src/lib/libssl/doc/SSL_rstate_string.3 deleted file mode 100644 index 81d83e52a1..0000000000 --- a/src/lib/libssl/doc/SSL_rstate_string.3 +++ /dev/null | |||
| @@ -1,55 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_rstate_string.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_RSTATE_STRING 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_rstate_string , | ||
| 9 | .Nm SSL_rstate_string_long | ||
| 10 | .Nd get textual description of state of an SSL object during read operation | ||
| 11 | .Sh SYNOPSIS | ||
| 12 | .In openssl/ssl.h | ||
| 13 | .Ft const char * | ||
| 14 | .Fn SSL_rstate_string "SSL *ssl" | ||
| 15 | .Ft const char * | ||
| 16 | .Fn SSL_rstate_string_long "SSL *ssl" | ||
| 17 | .Sh DESCRIPTION | ||
| 18 | .Fn SSL_rstate_string | ||
| 19 | returns a 2-letter string indicating the current read state of the | ||
| 20 | .Vt SSL | ||
| 21 | object | ||
| 22 | .Fa ssl . | ||
| 23 | .Pp | ||
| 24 | .Fn SSL_rstate_string_long | ||
| 25 | returns a string indicating the current read state of the | ||
| 26 | .Vt SSL | ||
| 27 | object | ||
| 28 | .Fa ssl . | ||
| 29 | .Sh NOTES | ||
| 30 | When performing a read operation, the SSL/TLS engine must parse the record, | ||
| 31 | consisting of header and body. | ||
| 32 | When working in a blocking environment, | ||
| 33 | .Fn SSL_rstate_string[_long] | ||
| 34 | should always return | ||
| 35 | .Qo RD Qc Ns / Ns Qo read done Qc . | ||
| 36 | .Pp | ||
| 37 | This function should only seldom be needed in applications. | ||
| 38 | .Sh RETURN VALUES | ||
| 39 | .Fn SSL_rstate_string | ||
| 40 | and | ||
| 41 | .Fn SSL_rstate_string_long | ||
| 42 | can return the following values: | ||
| 43 | .Bl -tag -width Ds | ||
| 44 | .It Qo RH Qc Ns / Ns Qo read header Qc | ||
| 45 | The header of the record is being evaluated. | ||
| 46 | .It Qo RB Qc Ns / Ns Qo read body Qc | ||
| 47 | The body of the record is being evaluated. | ||
| 48 | .It Qo RD Qc Ns / Ns Qo read done Qc | ||
| 49 | The record has been completely processed. | ||
| 50 | .It Qo unknown Qc Ns / Ns Qo unknown Qc | ||
| 51 | The read state is unknown. | ||
| 52 | This should never happen. | ||
| 53 | .El | ||
| 54 | .Sh SEE ALSO | ||
| 55 | .Xr ssl 3 | ||
diff --git a/src/lib/libssl/doc/SSL_session_reused.3 b/src/lib/libssl/doc/SSL_session_reused.3 deleted file mode 100644 index 6ea45f749b..0000000000 --- a/src/lib/libssl/doc/SSL_session_reused.3 +++ /dev/null | |||
| @@ -1,32 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_session_reused.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_SESSION_REUSED 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_session_reused | ||
| 9 | .Nd query whether a reused session was negotiated during handshake | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft int | ||
| 13 | .Fn SSL_session_reused "SSL *ssl" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | Query whether a reused session was negotiated during the handshake. | ||
| 16 | .Sh NOTES | ||
| 17 | During the negotiation, a client can propose to reuse a session. | ||
| 18 | The server then looks up the session in its cache. | ||
| 19 | If both client and server agree on the session, | ||
| 20 | it will be reused and a flag is set that can be queried by the application. | ||
| 21 | .Sh RETURN VALUES | ||
| 22 | The following return values can occur: | ||
| 23 | .Bl -tag -width Ds | ||
| 24 | .It 0 | ||
| 25 | A new session was negotiated. | ||
| 26 | .It 1 | ||
| 27 | A session was reused. | ||
| 28 | .El | ||
| 29 | .Sh SEE ALSO | ||
| 30 | .Xr ssl 3 , | ||
| 31 | .Xr SSL_CTX_set_session_cache_mode 3 , | ||
| 32 | .Xr SSL_set_session 3 | ||
diff --git a/src/lib/libssl/doc/SSL_set_bio.3 b/src/lib/libssl/doc/SSL_set_bio.3 deleted file mode 100644 index 7e2611e000..0000000000 --- a/src/lib/libssl/doc/SSL_set_bio.3 +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_set_bio.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_SET_BIO 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_set_bio | ||
| 9 | .Nd connect the SSL object with a BIO | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft void | ||
| 13 | .Fn SSL_set_bio "SSL *ssl" "BIO *rbio" "BIO *wbio" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_set_bio | ||
| 16 | connects the | ||
| 17 | .Vt BIO Ns | ||
| 18 | s | ||
| 19 | .Fa rbio | ||
| 20 | and | ||
| 21 | .Fa wbio | ||
| 22 | for the read and write operations of the TLS/SSL (encrypted) side of | ||
| 23 | .Fa ssl . | ||
| 24 | .Pp | ||
| 25 | The SSL engine inherits the behaviour of | ||
| 26 | .Fa rbio | ||
| 27 | and | ||
| 28 | .Fa wbio , | ||
| 29 | respectively. | ||
| 30 | If a | ||
| 31 | .Vt BIO | ||
| 32 | is non-blocking, the | ||
| 33 | .Fa ssl | ||
| 34 | will also have non-blocking behaviour. | ||
| 35 | .Pp | ||
| 36 | If there was already a | ||
| 37 | .Vt BIO | ||
| 38 | connected to | ||
| 39 | .Fa ssl , | ||
| 40 | .Xr BIO_free 3 | ||
| 41 | will be called (for both the reading and writing side, if different). | ||
| 42 | .Sh RETURN VALUES | ||
| 43 | .Fn SSL_set_bio | ||
| 44 | cannot fail. | ||
| 45 | .Sh SEE ALSO | ||
| 46 | .Xr bio 3 , | ||
| 47 | .Xr ssl 3 , | ||
| 48 | .Xr SSL_accept 3 , | ||
| 49 | .Xr SSL_connect 3 , | ||
| 50 | .Xr SSL_get_rbio 3 , | ||
| 51 | .Xr SSL_shutdown 3 | ||
diff --git a/src/lib/libssl/doc/SSL_set_connect_state.3 b/src/lib/libssl/doc/SSL_set_connect_state.3 deleted file mode 100644 index e3f946f8ee..0000000000 --- a/src/lib/libssl/doc/SSL_set_connect_state.3 +++ /dev/null | |||
| @@ -1,71 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_set_connect_state.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_SET_CONNECT_STATE 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_set_connect_state , | ||
| 9 | .Nm SSL_get_accept_state | ||
| 10 | .Nd prepare SSL object to work in client or server mode | ||
| 11 | .Sh SYNOPSIS | ||
| 12 | .In openssl/ssl.h | ||
| 13 | .Ft void | ||
| 14 | .Fn SSL_set_connect_state "SSL *ssl" | ||
| 15 | .Ft void | ||
| 16 | .Fn SSL_set_accept_state "SSL *ssl" | ||
| 17 | .Sh DESCRIPTION | ||
| 18 | .Fn SSL_set_connect_state | ||
| 19 | sets | ||
| 20 | .Fa ssl | ||
| 21 | to work in client mode. | ||
| 22 | .Pp | ||
| 23 | .Fn SSL_set_accept_state | ||
| 24 | sets | ||
| 25 | .Fa ssl | ||
| 26 | to work in server mode. | ||
| 27 | .Sh NOTES | ||
| 28 | When the | ||
| 29 | .Vt SSL_CTX | ||
| 30 | object was created with | ||
| 31 | .Xr SSL_CTX_new 3 , | ||
| 32 | it was either assigned a dedicated client method, a dedicated server method, or | ||
| 33 | a generic method, that can be used for both client and server connections. | ||
| 34 | (The method might have been changed with | ||
| 35 | .Xr SSL_CTX_set_ssl_version 3 | ||
| 36 | or | ||
| 37 | .Xr SSL_set_ssl_method 3 . ) | ||
| 38 | .Pp | ||
| 39 | When beginning a new handshake, the SSL engine must know whether it must call | ||
| 40 | the connect (client) or accept (server) routines. | ||
| 41 | Even though it may be clear from the method chosen whether client or server | ||
| 42 | mode was requested, the handshake routines must be explicitly set. | ||
| 43 | .Pp | ||
| 44 | When using the | ||
| 45 | .Xr SSL_connect 3 | ||
| 46 | or | ||
| 47 | .Xr SSL_accept 3 | ||
| 48 | routines, the correct handshake routines are automatically set. | ||
| 49 | When performing a transparent negotiation using | ||
| 50 | .Xr SSL_write 3 | ||
| 51 | or | ||
| 52 | .Xr SSL_read 3 , | ||
| 53 | the handshake routines must be explicitly set in advance using either | ||
| 54 | .Fn SSL_set_connect_state | ||
| 55 | or | ||
| 56 | .Fn SSL_set_accept_state . | ||
| 57 | .Sh RETURN VALUES | ||
| 58 | .Fn SSL_set_connect_state | ||
| 59 | and | ||
| 60 | .Fn SSL_set_accept_state | ||
| 61 | do not return diagnostic information. | ||
| 62 | .Sh SEE ALSO | ||
| 63 | .Xr ssl 3 , | ||
| 64 | .Xr SSL_accept 3 , | ||
| 65 | .Xr SSL_connect 3 , | ||
| 66 | .Xr SSL_CTX_new 3 , | ||
| 67 | .Xr SSL_CTX_set_ssl_version 3 , | ||
| 68 | .Xr SSL_do_handshake 3 , | ||
| 69 | .Xr SSL_new 3 , | ||
| 70 | .Xr SSL_read 3 , | ||
| 71 | .Xr SSL_write 3 | ||
diff --git a/src/lib/libssl/doc/SSL_set_fd.3 b/src/lib/libssl/doc/SSL_set_fd.3 deleted file mode 100644 index 94e0c7614a..0000000000 --- a/src/lib/libssl/doc/SSL_set_fd.3 +++ /dev/null | |||
| @@ -1,73 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_set_fd.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_SET_FD 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_set_fd , | ||
| 9 | .Nm SSL_set_rfd , | ||
| 10 | .Nm SSL_set_wfd | ||
| 11 | .Nd connect the SSL object with a file descriptor | ||
| 12 | .Sh SYNOPSIS | ||
| 13 | .In openssl/ssl.h | ||
| 14 | .Ft int | ||
| 15 | .Fn SSL_set_fd "SSL *ssl" "int fd" | ||
| 16 | .Ft int | ||
| 17 | .Fn SSL_set_rfd "SSL *ssl" "int fd" | ||
| 18 | .Ft int | ||
| 19 | .Fn SSL_set_wfd "SSL *ssl" "int fd" | ||
| 20 | .Sh DESCRIPTION | ||
| 21 | .Fn SSL_set_fd | ||
| 22 | sets the file descriptor | ||
| 23 | .Fa fd | ||
| 24 | as the input/output facility for the TLS/SSL (encrypted) side of | ||
| 25 | .Fa ssl . | ||
| 26 | .Fa fd | ||
| 27 | will typically be the socket file descriptor of a network connection. | ||
| 28 | .Pp | ||
| 29 | When performing the operation, a socket | ||
| 30 | .Vt BIO | ||
| 31 | is automatically created to interface between the | ||
| 32 | .Fa ssl | ||
| 33 | and | ||
| 34 | .Fa fd . | ||
| 35 | The | ||
| 36 | .Vt BIO | ||
| 37 | and hence the SSL engine inherit the behaviour of | ||
| 38 | .Fa fd . | ||
| 39 | If | ||
| 40 | .Fa fd | ||
| 41 | is non-blocking, the | ||
| 42 | .Fa ssl | ||
| 43 | will also have non-blocking behaviour. | ||
| 44 | .Pp | ||
| 45 | If there was already a | ||
| 46 | .Vt BIO | ||
| 47 | connected to | ||
| 48 | .Fa ssl , | ||
| 49 | .Xr BIO_free 3 | ||
| 50 | will be called (for both the reading and writing side, if different). | ||
| 51 | .Pp | ||
| 52 | .Fn SSL_set_rfd | ||
| 53 | and | ||
| 54 | .Fn SSL_set_wfd | ||
| 55 | perform the respective action, but only for the read channel or the write | ||
| 56 | channel, which can be set independently. | ||
| 57 | .Sh RETURN VALUES | ||
| 58 | The following return values can occur: | ||
| 59 | .Bl -tag -width Ds | ||
| 60 | .It 0 | ||
| 61 | The operation failed. | ||
| 62 | Check the error stack to find out why. | ||
| 63 | .It 1 | ||
| 64 | The operation succeeded. | ||
| 65 | .El | ||
| 66 | .Sh SEE ALSO | ||
| 67 | .Xr bio 3 , | ||
| 68 | .Xr ssl 3 , | ||
| 69 | .Xr SSL_accept 3 , | ||
| 70 | .Xr SSL_connect 3 , | ||
| 71 | .Xr SSL_get_fd 3 , | ||
| 72 | .Xr SSL_set_bio 3 , | ||
| 73 | .Xr SSL_shutdown 3 | ||
diff --git a/src/lib/libssl/doc/SSL_set_session.3 b/src/lib/libssl/doc/SSL_set_session.3 deleted file mode 100644 index 1f2fc66cba..0000000000 --- a/src/lib/libssl/doc/SSL_set_session.3 +++ /dev/null | |||
| @@ -1,68 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_set_session.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_SET_SESSION 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_set_session | ||
| 9 | .Nd set a TLS/SSL session to be used during TLS/SSL connect | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft int | ||
| 13 | .Fn SSL_set_session "SSL *ssl" "SSL_SESSION *session" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_set_session | ||
| 16 | sets | ||
| 17 | .Fa session | ||
| 18 | to be used when the TLS/SSL connection is to be established. | ||
| 19 | .Fn SSL_set_session | ||
| 20 | is only useful for TLS/SSL clients. | ||
| 21 | When the session is set, the reference count of | ||
| 22 | .Fa session | ||
| 23 | is incremented | ||
| 24 | by 1. | ||
| 25 | If the session is not reused, the reference count is decremented again during | ||
| 26 | .Fn SSL_connect . | ||
| 27 | Whether the session was reused can be queried with the | ||
| 28 | .Xr SSL_session_reused 3 | ||
| 29 | call. | ||
| 30 | .Pp | ||
| 31 | If there is already a session set inside | ||
| 32 | .Fa ssl | ||
| 33 | (because it was set with | ||
| 34 | .Fn SSL_set_session | ||
| 35 | before or because the same | ||
| 36 | .Fa ssl | ||
| 37 | was already used for a connection), | ||
| 38 | .Xr SSL_SESSION_free 3 | ||
| 39 | will be called for that session. | ||
| 40 | .Sh NOTES | ||
| 41 | .Vt SSL_SESSION | ||
| 42 | objects keep internal link information about the session cache list when being | ||
| 43 | inserted into one | ||
| 44 | .Vt SSL_CTX | ||
| 45 | object's session cache. | ||
| 46 | One | ||
| 47 | .Vt SSL_SESSION | ||
| 48 | object, regardless of its reference count, must therefore only be used with one | ||
| 49 | .Vt SSL_CTX | ||
| 50 | object (and the | ||
| 51 | .Vt SSL | ||
| 52 | objects created from this | ||
| 53 | .Vt SSL_CTX | ||
| 54 | object). | ||
| 55 | .Sh RETURN VALUES | ||
| 56 | The following return values can occur: | ||
| 57 | .Bl -tag -width Ds | ||
| 58 | .It 0 | ||
| 59 | The operation failed; check the error stack to find out the reason. | ||
| 60 | .It 1 | ||
| 61 | The operation succeeded. | ||
| 62 | .El | ||
| 63 | .Sh SEE ALSO | ||
| 64 | .Xr ssl 3 , | ||
| 65 | .Xr SSL_CTX_set_session_cache_mode 3 , | ||
| 66 | .Xr SSL_get_session 3 , | ||
| 67 | .Xr SSL_SESSION_free 3 , | ||
| 68 | .Xr SSL_session_reused 3 | ||
diff --git a/src/lib/libssl/doc/SSL_set_shutdown.3 b/src/lib/libssl/doc/SSL_set_shutdown.3 deleted file mode 100644 index 546b52dad5..0000000000 --- a/src/lib/libssl/doc/SSL_set_shutdown.3 +++ /dev/null | |||
| @@ -1,88 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_set_shutdown.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_SET_SHUTDOWN 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_set_shutdown , | ||
| 9 | .Nm SSL_get_shutdown | ||
| 10 | .Nd manipulate shutdown state of an SSL connection | ||
| 11 | .Sh SYNOPSIS | ||
| 12 | .In openssl/ssl.h | ||
| 13 | .Ft void | ||
| 14 | .Fn SSL_set_shutdown "SSL *ssl" "int mode" | ||
| 15 | .Ft int | ||
| 16 | .Fn SSL_get_shutdown "const SSL *ssl" | ||
| 17 | .Sh DESCRIPTION | ||
| 18 | .Fn SSL_set_shutdown | ||
| 19 | sets the shutdown state of | ||
| 20 | .Fa ssl | ||
| 21 | to | ||
| 22 | .Fa mode . | ||
| 23 | .Pp | ||
| 24 | .Fn SSL_get_shutdown | ||
| 25 | returns the shutdown mode of | ||
| 26 | .Fa ssl . | ||
| 27 | .Sh NOTES | ||
| 28 | The shutdown state of an ssl connection is a bitmask of: | ||
| 29 | .Bl -tag -width Ds | ||
| 30 | .It 0 | ||
| 31 | No shutdown setting, yet. | ||
| 32 | .It Dv SSL_SENT_SHUTDOWN | ||
| 33 | A | ||
| 34 | .Dq close notify | ||
| 35 | shutdown alert was sent to the peer; the connection is being considered closed | ||
| 36 | and the session is closed and correct. | ||
| 37 | .It Dv SSL_RECEIVED_SHUTDOWN | ||
| 38 | A shutdown alert was received form the peer, either a normal | ||
| 39 | .Dq close notify | ||
| 40 | or a fatal error. | ||
| 41 | .El | ||
| 42 | .Pp | ||
| 43 | .Dv SSL_SENT_SHUTDOWN | ||
| 44 | and | ||
| 45 | .Dv SSL_RECEIVED_SHUTDOWN | ||
| 46 | can be set at the same time. | ||
| 47 | .Pp | ||
| 48 | The shutdown state of the connection is used to determine the state of the | ||
| 49 | .Fa ssl | ||
| 50 | session. | ||
| 51 | If the session is still open when | ||
| 52 | .Xr SSL_clear 3 | ||
| 53 | or | ||
| 54 | .Xr SSL_free 3 | ||
| 55 | is called, it is considered bad and removed according to RFC2246. | ||
| 56 | The actual condition for a correctly closed session is | ||
| 57 | .Dv SSL_SENT_SHUTDOWN | ||
| 58 | (according to the TLS RFC, it is acceptable to only send the | ||
| 59 | .Dq close notify | ||
| 60 | alert but to not wait for the peer's answer when the underlying connection is | ||
| 61 | closed). | ||
| 62 | .Fn SSL_set_shutdown | ||
| 63 | can be used to set this state without sending a close alert to the peer (see | ||
| 64 | .Xr SSL_shutdown 3 ) . | ||
| 65 | .Pp | ||
| 66 | If a | ||
| 67 | .Dq close notify | ||
| 68 | was received, | ||
| 69 | .Dv SSL_RECEIVED_SHUTDOWN | ||
| 70 | will be set, but to set | ||
| 71 | .Dv SSL_SENT_SHUTDOWN | ||
| 72 | the application must still call | ||
| 73 | .Xr SSL_shutdown 3 | ||
| 74 | or | ||
| 75 | .Fn SSL_set_shutdown | ||
| 76 | itself. | ||
| 77 | .Sh RETURN VALUES | ||
| 78 | .Fn SSL_set_shutdown | ||
| 79 | does not return diagnostic information. | ||
| 80 | .Pp | ||
| 81 | .Fn SSL_get_shutdown | ||
| 82 | returns the current setting. | ||
| 83 | .Sh SEE ALSO | ||
| 84 | .Xr ssl 3 , | ||
| 85 | .Xr SSL_clear 3 , | ||
| 86 | .Xr SSL_CTX_set_quiet_shutdown 3 , | ||
| 87 | .Xr SSL_free 3 , | ||
| 88 | .Xr SSL_shutdown 3 | ||
diff --git a/src/lib/libssl/doc/SSL_set_verify_result.3 b/src/lib/libssl/doc/SSL_set_verify_result.3 deleted file mode 100644 index 9d5474d07a..0000000000 --- a/src/lib/libssl/doc/SSL_set_verify_result.3 +++ /dev/null | |||
| @@ -1,42 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_set_verify_result.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_SET_VERIFY_RESULT 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_set_verify_result | ||
| 9 | .Nd override result of peer certificate verification | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft void | ||
| 13 | .Fn SSL_set_verify_result "SSL *ssl" "long verify_result" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_set_verify_result | ||
| 16 | sets | ||
| 17 | .Fa verify_result | ||
| 18 | of the object | ||
| 19 | .Fa ssl | ||
| 20 | to be the result of the verification of the X509 certificate presented by the | ||
| 21 | peer, if any. | ||
| 22 | .Sh NOTES | ||
| 23 | .Fn SSL_set_verify_result | ||
| 24 | overrides the verification result. | ||
| 25 | It only changes the verification result of the | ||
| 26 | .Fa ssl | ||
| 27 | object. | ||
| 28 | It does not become part of the established session, so if the session is to be | ||
| 29 | reused later, the original value will reappear. | ||
| 30 | .Pp | ||
| 31 | The valid codes for | ||
| 32 | .Fa verify_result | ||
| 33 | are documented in | ||
| 34 | .Xr openssl 1 . | ||
| 35 | .Sh RETURN VALUES | ||
| 36 | .Fn SSL_set_verify_result | ||
| 37 | does not provide a return value. | ||
| 38 | .Sh SEE ALSO | ||
| 39 | .Xr openssl 1 , | ||
| 40 | .Xr ssl 3 , | ||
| 41 | .Xr SSL_get_peer_certificate 3 , | ||
| 42 | .Xr SSL_get_verify_result 3 | ||
diff --git a/src/lib/libssl/doc/SSL_shutdown.3 b/src/lib/libssl/doc/SSL_shutdown.3 deleted file mode 100644 index 187e656fe3..0000000000 --- a/src/lib/libssl/doc/SSL_shutdown.3 +++ /dev/null | |||
| @@ -1,204 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_shutdown.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_SHUTDOWN 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_shutdown | ||
| 9 | .Nd shut down a TLS/SSL connection | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft int | ||
| 13 | .Fn SSL_shutdown "SSL *ssl" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_shutdown | ||
| 16 | shuts down an active TLS/SSL connection. | ||
| 17 | It sends the | ||
| 18 | .Dq close notify | ||
| 19 | shutdown alert to the peer. | ||
| 20 | .Sh NOTES | ||
| 21 | .Fn SSL_shutdown | ||
| 22 | tries to send the | ||
| 23 | .Dq close notify | ||
| 24 | shutdown alert to the peer. | ||
| 25 | Whether the operation succeeds or not, the | ||
| 26 | .Dv SSL_SENT_SHUTDOWN | ||
| 27 | flag is set and a currently open session is considered closed and good and will | ||
| 28 | be kept in the session cache for further reuse. | ||
| 29 | .Pp | ||
| 30 | The shutdown procedure consists of 2 steps: the sending of the | ||
| 31 | .Dq close notify | ||
| 32 | shutdown alert and the reception of the peer's | ||
| 33 | .Dq close notify | ||
| 34 | shutdown alert. | ||
| 35 | According to the TLS standard, it is acceptable for an application to only send | ||
| 36 | its shutdown alert and then close the underlying connection without waiting for | ||
| 37 | the peer's response (this way resources can be saved, as the process can | ||
| 38 | already terminate or serve another connection). | ||
| 39 | When the underlying connection shall be used for more communications, | ||
| 40 | the complete shutdown procedure (bidirectional | ||
| 41 | .Dq close notify | ||
| 42 | alerts) must be performed, so that the peers stay synchronized. | ||
| 43 | .Pp | ||
| 44 | .Fn SSL_shutdown | ||
| 45 | supports both uni- and bidirectional shutdown by its 2 step behavior. | ||
| 46 | .Pp | ||
| 47 | When the application is the first party to send the | ||
| 48 | .Dq close notify | ||
| 49 | alert, | ||
| 50 | .Fn SSL_shutdown | ||
| 51 | will only send the alert and then set the | ||
| 52 | .Dv SSL_SENT_SHUTDOWN | ||
| 53 | flag (so that the session is considered good and will be kept in cache). | ||
| 54 | .Fn SSL_shutdown | ||
| 55 | will then return 0. | ||
| 56 | If a unidirectional shutdown is enough | ||
| 57 | (the underlying connection shall be closed anyway), this first call to | ||
| 58 | .Fn SSL_shutdown | ||
| 59 | is sufficient. | ||
| 60 | In order to complete the bidirectional shutdown handshake, | ||
| 61 | .Fn SSL_shutdown | ||
| 62 | must be called again. | ||
| 63 | The second call will make | ||
| 64 | .Fn SSL_shutdown | ||
| 65 | wait for the peer's | ||
| 66 | .Dq close notify | ||
| 67 | shutdown alert. | ||
| 68 | On success, the second call to | ||
| 69 | .Fn SSL_shutdown | ||
| 70 | will return 1. | ||
| 71 | .Pp | ||
| 72 | If the peer already sent the | ||
| 73 | .Dq close notify | ||
| 74 | alert and it was already processed implicitly inside another function | ||
| 75 | .Pq Xr SSL_read 3 , | ||
| 76 | the | ||
| 77 | .Dv SSL_RECEIVED_SHUTDOWN | ||
| 78 | flag is set. | ||
| 79 | .Fn SSL_shutdown | ||
| 80 | will send the | ||
| 81 | .Dq close notify | ||
| 82 | alert, set the | ||
| 83 | .Dv SSL_SENT_SHUTDOWN | ||
| 84 | flag and will immediately return with 1. | ||
| 85 | Whether | ||
| 86 | .Dv SSL_RECEIVED_SHUTDOWN | ||
| 87 | is already set can be checked using the | ||
| 88 | .Fn SSL_get_shutdown | ||
| 89 | (see also the | ||
| 90 | .Xr SSL_set_shutdown 3 | ||
| 91 | call). | ||
| 92 | .Pp | ||
| 93 | It is therefore recommended to check the return value of | ||
| 94 | .Fn SSL_shutdown | ||
| 95 | and call | ||
| 96 | .Fn SSL_shutdown | ||
| 97 | again, if the bidirectional shutdown is not yet complete (return value of the | ||
| 98 | first call is 0). | ||
| 99 | As the shutdown is not specially handled in the SSLv2 protocol, | ||
| 100 | .Fn SSL_shutdown | ||
| 101 | will succeed on the first call. | ||
| 102 | .Pp | ||
| 103 | The behaviour of | ||
| 104 | .Fn SSL_shutdown | ||
| 105 | additionally depends on the underlying | ||
| 106 | .Vt BIO . | ||
| 107 | .Pp | ||
| 108 | If the underlying | ||
| 109 | .Vt BIO | ||
| 110 | is | ||
| 111 | .Em blocking , | ||
| 112 | .Fn SSL_shutdown | ||
| 113 | will only return once the | ||
| 114 | handshake step has been finished or an error occurred. | ||
| 115 | .Pp | ||
| 116 | If the underlying | ||
| 117 | .Vt BIO | ||
| 118 | is | ||
| 119 | .Em non-blocking , | ||
| 120 | .Fn SSL_shutdown | ||
| 121 | will also return when the underlying | ||
| 122 | .Vt BIO | ||
| 123 | could not satisfy the needs of | ||
| 124 | .Fn SSL_shutdown | ||
| 125 | to continue the handshake. | ||
| 126 | In this case a call to | ||
| 127 | .Xr SSL_get_error 3 | ||
| 128 | with the | ||
| 129 | return value of | ||
| 130 | .Fn SSL_shutdown | ||
| 131 | will yield | ||
| 132 | .Dv SSL_ERROR_WANT_READ | ||
| 133 | or | ||
| 134 | .Dv SSL_ERROR_WANT_WRITE . | ||
| 135 | The calling process then must repeat the call after taking appropriate action | ||
| 136 | to satisfy the needs of | ||
| 137 | .Fn SSL_shutdown . | ||
| 138 | The action depends on the underlying | ||
| 139 | .Vt BIO . | ||
| 140 | When using a non-blocking socket, nothing is to be done, but | ||
| 141 | .Xr select 2 | ||
| 142 | can be used to check for the required condition. | ||
| 143 | When using a buffering | ||
| 144 | .Vt BIO , | ||
| 145 | like a | ||
| 146 | .Vt BIO | ||
| 147 | pair, data must be written into or retrieved out of the | ||
| 148 | .Vt BIO | ||
| 149 | before being able to continue. | ||
| 150 | .Pp | ||
| 151 | .Fn SSL_shutdown | ||
| 152 | can be modified to only set the connection to | ||
| 153 | .Dq shutdown | ||
| 154 | state but not actually send the | ||
| 155 | .Dq close notify | ||
| 156 | alert messages; see | ||
| 157 | .Xr SSL_CTX_set_quiet_shutdown 3 . | ||
| 158 | When | ||
| 159 | .Dq quiet shutdown | ||
| 160 | is enabled, | ||
| 161 | .Fn SSL_shutdown | ||
| 162 | will always succeed and return 1. | ||
| 163 | .Sh RETURN VALUES | ||
| 164 | The following return values can occur: | ||
| 165 | .Bl -tag -width Ds | ||
| 166 | .It 0 | ||
| 167 | The shutdown is not yet finished. | ||
| 168 | Call | ||
| 169 | .Fn SSL_shutdown | ||
| 170 | for a second time, if a bidirectional shutdown shall be performed. | ||
| 171 | The output of | ||
| 172 | .Xr SSL_get_error 3 | ||
| 173 | may be misleading, as an erroneous | ||
| 174 | .Dv SSL_ERROR_SYSCALL | ||
| 175 | may be flagged even though no error occurred. | ||
| 176 | .It 1 | ||
| 177 | The shutdown was successfully completed. | ||
| 178 | The | ||
| 179 | .Dq close notify | ||
| 180 | alert was sent and the peer's | ||
| 181 | .Dq close notify | ||
| 182 | alert was received. | ||
| 183 | .It \(mi1 | ||
| 184 | The shutdown was not successful because a fatal error occurred either | ||
| 185 | at the protocol level or a connection failure occurred. | ||
| 186 | It can also occur if action is need to continue the operation for non-blocking | ||
| 187 | .Vt BIO Ns | ||
| 188 | s. | ||
| 189 | Call | ||
| 190 | .Xr SSL_get_error 3 | ||
| 191 | with the return value | ||
| 192 | .Fa ret | ||
| 193 | to find out the reason. | ||
| 194 | .El | ||
| 195 | .Sh SEE ALSO | ||
| 196 | .Xr bio 3 , | ||
| 197 | .Xr ssl 3 , | ||
| 198 | .Xr SSL_accept 3 , | ||
| 199 | .Xr SSL_clear 3 , | ||
| 200 | .Xr SSL_connect 3 , | ||
| 201 | .Xr SSL_CTX_set_quiet_shutdown 3 , | ||
| 202 | .Xr SSL_free 3 , | ||
| 203 | .Xr SSL_get_error 3 , | ||
| 204 | .Xr SSL_set_shutdown 3 | ||
diff --git a/src/lib/libssl/doc/SSL_state_string.3 b/src/lib/libssl/doc/SSL_state_string.3 deleted file mode 100644 index e9a042a3ce..0000000000 --- a/src/lib/libssl/doc/SSL_state_string.3 +++ /dev/null | |||
| @@ -1,57 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_state_string.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_STATE_STRING 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_state_string , | ||
| 9 | .Nm SSL_state_string_long | ||
| 10 | .Nd get textual description of state of an SSL object | ||
| 11 | .Sh SYNOPSIS | ||
| 12 | .In openssl/ssl.h | ||
| 13 | .Ft const char * | ||
| 14 | .Fn SSL_state_string "const SSL *ssl" | ||
| 15 | .Ft const char * | ||
| 16 | .Fn SSL_state_string_long "const SSL *ssl" | ||
| 17 | .Sh DESCRIPTION | ||
| 18 | .Fn SSL_state_string | ||
| 19 | returns a 6 letter string indicating the current state of the | ||
| 20 | .Vt SSL | ||
| 21 | object | ||
| 22 | .Fa ssl . | ||
| 23 | .Pp | ||
| 24 | .Fn SSL_state_string_long | ||
| 25 | returns a string indicating the current state of the | ||
| 26 | .Vt SSL | ||
| 27 | object | ||
| 28 | .Fa ssl . | ||
| 29 | .Sh NOTES | ||
| 30 | During its use, an | ||
| 31 | .Vt SSL | ||
| 32 | object passes several states. | ||
| 33 | The state is internally maintained. | ||
| 34 | Querying the state information is not very informative before or when a | ||
| 35 | connection has been established. | ||
| 36 | It however can be of significant interest during the handshake. | ||
| 37 | .Pp | ||
| 38 | When using non-blocking sockets, | ||
| 39 | the function call performing the handshake may return with | ||
| 40 | .Dv SSL_ERROR_WANT_READ | ||
| 41 | or | ||
| 42 | .Dv SSL_ERROR_WANT_WRITE | ||
| 43 | condition, so that | ||
| 44 | .Fn SSL_state_string[_long] | ||
| 45 | may be called. | ||
| 46 | .Pp | ||
| 47 | For both blocking or non-blocking sockets, | ||
| 48 | the details state information can be used within the | ||
| 49 | .Fn info_callback | ||
| 50 | function set with the | ||
| 51 | .Xr SSL_set_info_callback 3 | ||
| 52 | call. | ||
| 53 | .Sh RETURN VALUES | ||
| 54 | Detailed description of possible states to be included later. | ||
| 55 | .Sh SEE ALSO | ||
| 56 | .Xr ssl 3 , | ||
| 57 | .Xr SSL_CTX_set_info_callback 3 | ||
diff --git a/src/lib/libssl/doc/SSL_want.3 b/src/lib/libssl/doc/SSL_want.3 deleted file mode 100644 index e9513c8793..0000000000 --- a/src/lib/libssl/doc/SSL_want.3 +++ /dev/null | |||
| @@ -1,103 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_want.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_WANT 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_want , | ||
| 9 | .Nm SSL_want_nothing , | ||
| 10 | .Nm SSL_want_read , | ||
| 11 | .Nm SSL_want_write , | ||
| 12 | .Nm SSL_want_x509_lookup | ||
| 13 | .Nd obtain state information TLS/SSL I/O operation | ||
| 14 | .Sh SYNOPSIS | ||
| 15 | .In openssl/ssl.h | ||
| 16 | .Ft int | ||
| 17 | .Fn SSL_want "const SSL *ssl" | ||
| 18 | .Ft int | ||
| 19 | .Fn SSL_want_nothing "const SSL *ssl" | ||
| 20 | .Ft int | ||
| 21 | .Fn SSL_want_read "const SSL *ssl" | ||
| 22 | .Ft int | ||
| 23 | .Fn SSL_want_write "const SSL *ssl" | ||
| 24 | .Ft int | ||
| 25 | .Fn SSL_want_x509_lookup "const SSL *ssl" | ||
| 26 | .Sh DESCRIPTION | ||
| 27 | .Fn SSL_want | ||
| 28 | returns state information for the | ||
| 29 | .Vt SSL | ||
| 30 | object | ||
| 31 | .Fa ssl . | ||
| 32 | .Pp | ||
| 33 | The other | ||
| 34 | .Fn SSL_want_* | ||
| 35 | calls are shortcuts for the possible states returned by | ||
| 36 | .Fn SSL_want . | ||
| 37 | .Sh NOTES | ||
| 38 | .Fn SSL_want | ||
| 39 | examines the internal state information of the | ||
| 40 | .Vt SSL | ||
| 41 | object. | ||
| 42 | Its return values are similar to those of | ||
| 43 | .Xr SSL_get_error 3 . | ||
| 44 | Unlike | ||
| 45 | .Xr SSL_get_error 3 , | ||
| 46 | which also evaluates the error queue, | ||
| 47 | the results are obtained by examining an internal state flag only. | ||
| 48 | The information must therefore only be used for normal operation under | ||
| 49 | non-blocking I/O. | ||
| 50 | Error conditions are not handled and must be treated using | ||
| 51 | .Xr SSL_get_error 3 . | ||
| 52 | .Pp | ||
| 53 | The result returned by | ||
| 54 | .Fn SSL_want | ||
| 55 | should always be consistent with the result of | ||
| 56 | .Xr SSL_get_error 3 . | ||
| 57 | .Sh RETURN VALUES | ||
| 58 | The following return values can currently occur for | ||
| 59 | .Fn SSL_want : | ||
| 60 | .Bl -tag -width Ds | ||
| 61 | .It .Dv SSL_NOTHING | ||
| 62 | There is no data to be written or to be read. | ||
| 63 | .It .Dv SSL_WRITING | ||
| 64 | There are data in the SSL buffer that must be written to the underlying | ||
| 65 | .Vt BIO | ||
| 66 | layer in order to complete the actual | ||
| 67 | .Fn SSL_* | ||
| 68 | operation. | ||
| 69 | A call to | ||
| 70 | .Xr SSL_get_error 3 | ||
| 71 | should return | ||
| 72 | .Dv SSL_ERROR_WANT_WRITE . | ||
| 73 | .It Dv SSL_READING | ||
| 74 | More data must be read from the underlying | ||
| 75 | .Vt BIO | ||
| 76 | layer in order to | ||
| 77 | complete the actual | ||
| 78 | .Fn SSL_* | ||
| 79 | operation. | ||
| 80 | A call to | ||
| 81 | .Xr SSL_get_error 3 | ||
| 82 | should return | ||
| 83 | .Dv SSL_ERROR_WANT_READ. | ||
| 84 | .It Dv SSL_X509_LOOKUP | ||
| 85 | The operation did not complete because an application callback set by | ||
| 86 | .Xr SSL_CTX_set_client_cert_cb 3 | ||
| 87 | has asked to be called again. | ||
| 88 | A call to | ||
| 89 | .Xr SSL_get_error 3 | ||
| 90 | should return | ||
| 91 | .Dv SSL_ERROR_WANT_X509_LOOKUP . | ||
| 92 | .El | ||
| 93 | .Pp | ||
| 94 | .Fn SSL_want_nothing , | ||
| 95 | .Fn SSL_want_read , | ||
| 96 | .Fn SSL_want_write , | ||
| 97 | and | ||
| 98 | .Fn SSL_want_x509_lookup | ||
| 99 | return 1 when the corresponding condition is true or 0 otherwise. | ||
| 100 | .Sh SEE ALSO | ||
| 101 | .Xr err 3 , | ||
| 102 | .Xr ssl 3 , | ||
| 103 | .Xr SSL_get_error 3 | ||
diff --git a/src/lib/libssl/doc/SSL_write.3 b/src/lib/libssl/doc/SSL_write.3 deleted file mode 100644 index f020b8b59c..0000000000 --- a/src/lib/libssl/doc/SSL_write.3 +++ /dev/null | |||
| @@ -1,175 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_write.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL_WRITE 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_write | ||
| 9 | .Nd write bytes to a TLS/SSL connection | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft int | ||
| 13 | .Fn SSL_write "SSL *ssl" "const void *buf" "int num" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_write | ||
| 16 | writes | ||
| 17 | .Fa num | ||
| 18 | bytes from the buffer | ||
| 19 | .Fa buf | ||
| 20 | into the specified | ||
| 21 | .Fa ssl | ||
| 22 | connection. | ||
| 23 | .Sh NOTES | ||
| 24 | If necessary, | ||
| 25 | .Fn SSL_write | ||
| 26 | will negotiate a TLS/SSL session, if not already explicitly performed by | ||
| 27 | .Xr SSL_connect 3 | ||
| 28 | or | ||
| 29 | .Xr SSL_accept 3 . | ||
| 30 | If the peer requests a re-negotiation, | ||
| 31 | it will be performed transparently during the | ||
| 32 | .Fn SSL_write | ||
| 33 | operation. | ||
| 34 | The behaviour of | ||
| 35 | .Fn SSL_write | ||
| 36 | depends on the underlying | ||
| 37 | .Vt BIO . | ||
| 38 | .Pp | ||
| 39 | For the transparent negotiation to succeed, the | ||
| 40 | .Fa ssl | ||
| 41 | must have been initialized to client or server mode. | ||
| 42 | This is being done by calling | ||
| 43 | .Xr SSL_set_connect_state 3 | ||
| 44 | or | ||
| 45 | .Xr SSL_set_accept_state 3 | ||
| 46 | before the first call to an | ||
| 47 | .Xr SSL_read 3 | ||
| 48 | or | ||
| 49 | .Fn SSL_write | ||
| 50 | function. | ||
| 51 | .Pp | ||
| 52 | If the underlying | ||
| 53 | .Vt BIO | ||
| 54 | is | ||
| 55 | .Em blocking , | ||
| 56 | .Fn SSL_write | ||
| 57 | will only return once the write operation has been finished or an error | ||
| 58 | occurred, except when a renegotiation take place, in which case a | ||
| 59 | .Dv SSL_ERROR_WANT_READ | ||
| 60 | may occur. | ||
| 61 | This behaviour can be controlled with the | ||
| 62 | .Dv SSL_MODE_AUTO_RETRY | ||
| 63 | flag of the | ||
| 64 | .Xr SSL_CTX_set_mode 3 | ||
| 65 | call. | ||
| 66 | .Pp | ||
| 67 | If the underlying | ||
| 68 | .Vt BIO | ||
| 69 | is | ||
| 70 | .Em non-blocking , | ||
| 71 | .Fn SSL_write | ||
| 72 | will also return when the underlying | ||
| 73 | .Vt BIO | ||
| 74 | could not satisfy the needs of | ||
| 75 | .Fn SSL_write | ||
| 76 | to continue the operation. | ||
| 77 | In this case a call to | ||
| 78 | .Xr SSL_get_error 3 | ||
| 79 | with the return value of | ||
| 80 | .Fn SSL_write | ||
| 81 | will yield | ||
| 82 | .Dv SSL_ERROR_WANT_READ | ||
| 83 | or | ||
| 84 | .Dv SSL_ERROR_WANT_WRITE . | ||
| 85 | As at any time a re-negotiation is possible, a call to | ||
| 86 | .Fn SSL_write | ||
| 87 | can also cause read operations! | ||
| 88 | The calling process then must repeat the call after taking appropriate action | ||
| 89 | to satisfy the needs of | ||
| 90 | .Fn SSL_write . | ||
| 91 | The action depends on the underlying | ||
| 92 | .Vt BIO . | ||
| 93 | When using a non-blocking socket, nothing is to be done, but | ||
| 94 | .Xr select 2 | ||
| 95 | can be used to check for the required condition. | ||
| 96 | When using a buffering | ||
| 97 | .Vt BIO , | ||
| 98 | like a | ||
| 99 | .Vt BIO | ||
| 100 | pair, data must be written into or retrieved out of the BIO before being able | ||
| 101 | to continue. | ||
| 102 | .Pp | ||
| 103 | .Fn SSL_write | ||
| 104 | will only return with success, when the complete contents of | ||
| 105 | .Fa buf | ||
| 106 | of length | ||
| 107 | .Fa num | ||
| 108 | have been written. | ||
| 109 | This default behaviour can be changed with the | ||
| 110 | .Dv SSL_MODE_ENABLE_PARTIAL_WRITE | ||
| 111 | option of | ||
| 112 | .Xr SSL_CTX_set_mode 3 . | ||
| 113 | When this flag is set, | ||
| 114 | .Fn SSL_write | ||
| 115 | will also return with success when a partial write has been successfully | ||
| 116 | completed. | ||
| 117 | In this case the | ||
| 118 | .Fn SSL_write | ||
| 119 | operation is considered completed. | ||
| 120 | The bytes are sent and a new | ||
| 121 | .Fn SSL_write | ||
| 122 | operation with a new buffer (with the already sent bytes removed) must be | ||
| 123 | started. | ||
| 124 | A partial write is performed with the size of a message block, which is 16kB | ||
| 125 | for SSLv3/TLSv1. | ||
| 126 | .Sh WARNING | ||
| 127 | When an | ||
| 128 | .Fn SSL_write | ||
| 129 | operation has to be repeated because of | ||
| 130 | .Dv SSL_ERROR_WANT_READ | ||
| 131 | or | ||
| 132 | .Dv SSL_ERROR_WANT_WRITE , | ||
| 133 | it must be repeated with the same arguments. | ||
| 134 | .Pp | ||
| 135 | When calling | ||
| 136 | .Fn SSL_write | ||
| 137 | with | ||
| 138 | .Fa num Ns | ||
| 139 | =0 bytes to be sent the behaviour is undefined. | ||
| 140 | .Sh RETURN VALUES | ||
| 141 | The following return values can occur: | ||
| 142 | .Bl -tag -width Ds | ||
| 143 | .It >0 | ||
| 144 | The write operation was successful. | ||
| 145 | The return value is the number of bytes actually written to the TLS/SSL | ||
| 146 | connection. | ||
| 147 | .It 0 | ||
| 148 | The write operation was not successful. | ||
| 149 | Probably the underlying connection was closed. | ||
| 150 | Call | ||
| 151 | .Xr SSL_get_error 3 | ||
| 152 | with the return value to find out whether an error occurred or the connection | ||
| 153 | was shut down cleanly | ||
| 154 | .Pq Dv SSL_ERROR_ZERO_RETURN . | ||
| 155 | .Pp | ||
| 156 | SSLv2 (deprecated) does not support a shutdown alert protocol, so it can only | ||
| 157 | be detected whether the underlying connection was closed. | ||
| 158 | It cannot be checked why the closure happened. | ||
| 159 | .It <0 | ||
| 160 | The write operation was not successful, because either an error occurred or | ||
| 161 | action must be taken by the calling process. | ||
| 162 | Call | ||
| 163 | .Xr SSL_get_error 3 | ||
| 164 | with the return value to find out the reason. | ||
| 165 | .El | ||
| 166 | .Sh SEE ALSO | ||
| 167 | .Xr bio 3 , | ||
| 168 | .Xr ssl 3 , | ||
| 169 | .Xr SSL_accept 3 , | ||
| 170 | .Xr SSL_connect 3 , | ||
| 171 | .Xr SSL_CTX_new 3 , | ||
| 172 | .Xr SSL_CTX_set_mode 3 , | ||
| 173 | .Xr SSL_get_error 3 , | ||
| 174 | .Xr SSL_read 3 , | ||
| 175 | .Xr SSL_set_connect_state 3 | ||
diff --git a/src/lib/libssl/doc/d2i_SSL_SESSION.3 b/src/lib/libssl/doc/d2i_SSL_SESSION.3 deleted file mode 100644 index ef8a36de79..0000000000 --- a/src/lib/libssl/doc/d2i_SSL_SESSION.3 +++ /dev/null | |||
| @@ -1,129 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: d2i_SSL_SESSION.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt D2I_SSL_SESSION 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm d2i_SSL_SESSION , | ||
| 9 | .Nm i2d_SSL_SESSION | ||
| 10 | .Nd convert SSL_SESSION object from/to ASN1 representation | ||
| 11 | .Sh SYNOPSIS | ||
| 12 | .In openssl/ssl.h | ||
| 13 | .Ft SSL_SESSION * | ||
| 14 | .Fn d2i_SSL_SESSION "SSL_SESSION **a" "const unsigned char **pp" "long length" | ||
| 15 | .Ft int | ||
| 16 | .Fn i2d_SSL_SESSION "SSL_SESSION *in" "unsigned char **pp" | ||
| 17 | .Sh DESCRIPTION | ||
| 18 | .Fn d2i_SSL_SESSION | ||
| 19 | transforms the external ASN1 representation of an SSL/TLS session, | ||
| 20 | stored as binary data at location | ||
| 21 | .Fa pp | ||
| 22 | with length | ||
| 23 | .Fa length , | ||
| 24 | into | ||
| 25 | an | ||
| 26 | .Vt SSL_SESSION | ||
| 27 | object. | ||
| 28 | .Pp | ||
| 29 | .Fn i2d_SSL_SESSION | ||
| 30 | transforms the | ||
| 31 | .Vt SSL_SESSION | ||
| 32 | object | ||
| 33 | .Fa in | ||
| 34 | into the ASN1 representation and stores it into the memory location pointed to | ||
| 35 | by | ||
| 36 | .Fa pp . | ||
| 37 | The length of the resulting ASN1 representation is returned. | ||
| 38 | If | ||
| 39 | .Fa pp | ||
| 40 | is the | ||
| 41 | .Dv NULL | ||
| 42 | pointer, only the length is calculated and returned. | ||
| 43 | .Sh NOTES | ||
| 44 | The | ||
| 45 | .Vt SSL_SESSION | ||
| 46 | object is built from several | ||
| 47 | .Xr malloc 3 Ns | ||
| 48 | -ed parts; it can therefore not be moved, copied or stored directly. | ||
| 49 | In order to store session data on disk or into a database, | ||
| 50 | it must be transformed into a binary ASN1 representation. | ||
| 51 | .Pp | ||
| 52 | When using | ||
| 53 | .Fn d2i_SSL_SESSION , | ||
| 54 | the | ||
| 55 | .Vt SSL_SESSION | ||
| 56 | object is automatically allocated. | ||
| 57 | The reference count is 1, so that the session must be explicitly removed using | ||
| 58 | .Xr SSL_SESSION_free 3 , | ||
| 59 | unless the | ||
| 60 | .Vt SSL_SESSION | ||
| 61 | object is completely taken over, when being called inside the | ||
| 62 | .Xr get_session_cb 3 | ||
| 63 | (see | ||
| 64 | .Xr SSL_CTX_sess_set_get_cb 3 ) . | ||
| 65 | .Pp | ||
| 66 | .Vt SSL_SESSION | ||
| 67 | objects keep internal link information about the session cache list when being | ||
| 68 | inserted into one | ||
| 69 | .Vt SSL_CTX | ||
| 70 | object's session cache. | ||
| 71 | One | ||
| 72 | .Vt SSL_SESSION | ||
| 73 | object, regardless of its reference count, must therefore only be used with one | ||
| 74 | .Vt SSL_CTX | ||
| 75 | object (and the | ||
| 76 | .Vt SSL | ||
| 77 | objects created from this | ||
| 78 | .Vt SSL_CTX | ||
| 79 | object). | ||
| 80 | .Pp | ||
| 81 | When using | ||
| 82 | .Fn i2d_SSL_SESSION , | ||
| 83 | the memory location pointed to by | ||
| 84 | .Fa pp | ||
| 85 | must be large enough to hold the binary representation of the session. | ||
| 86 | There is no known limit on the size of the created ASN1 representation, | ||
| 87 | so the necessary amount of space should be obtained by first calling | ||
| 88 | .Fn i2d_SSL_SESSION | ||
| 89 | with | ||
| 90 | .Fa pp Ns | ||
| 91 | = Ns | ||
| 92 | .Dv NULL , | ||
| 93 | and obtain the size needed, then allocate the memory and call | ||
| 94 | .Fn i2d_SSL_SESSION | ||
| 95 | again. | ||
| 96 | Note that this will advance the value contained in | ||
| 97 | .Fa *pp | ||
| 98 | so it is necessary to save a copy of the original allocation. | ||
| 99 | For example: | ||
| 100 | .Bd -literal | ||
| 101 | int i, j; | ||
| 102 | |||
| 103 | char *p, *temp; | ||
| 104 | |||
| 105 | i = i2d_SSL_SESSION(sess, NULL); | ||
| 106 | p = temp = malloc(i); | ||
| 107 | if (temp != NULL) { | ||
| 108 | j = i2d_SSL_SESSION(sess, &temp); | ||
| 109 | assert(i == j); | ||
| 110 | assert(p + i == temp); | ||
| 111 | } | ||
| 112 | .Ed | ||
| 113 | .Sh RETURN VALUES | ||
| 114 | .Fn d2i_SSL_SESSION | ||
| 115 | returns a pointer to the newly allocated | ||
| 116 | .Vt SSL_SESSION | ||
| 117 | object. | ||
| 118 | In case of failure a | ||
| 119 | .Dv NULL | ||
| 120 | pointer is returned and the error message can be retrieved from the error | ||
| 121 | stack. | ||
| 122 | .Pp | ||
| 123 | .Fn i2d_SSL_SESSION | ||
| 124 | returns the size of the ASN1 representation in bytes. | ||
| 125 | When the session is not valid, 0 is returned and no operation is performed. | ||
| 126 | .Sh SEE ALSO | ||
| 127 | .Xr ssl 3 , | ||
| 128 | .Xr SSL_CTX_sess_set_get_cb 3 , | ||
| 129 | .Xr SSL_SESSION_free 3 | ||
diff --git a/src/lib/libssl/doc/openssl.cnf b/src/lib/libssl/doc/openssl.cnf deleted file mode 100644 index ed4bde52e8..0000000000 --- a/src/lib/libssl/doc/openssl.cnf +++ /dev/null | |||
| @@ -1,348 +0,0 @@ | |||
| 1 | # | ||
| 2 | # OpenSSL example configuration file. | ||
| 3 | # This is mostly being used for generation of certificate requests. | ||
| 4 | # | ||
| 5 | |||
| 6 | # This definition stops the following lines choking if HOME isn't | ||
| 7 | # defined. | ||
| 8 | HOME = . | ||
| 9 | |||
| 10 | # Extra OBJECT IDENTIFIER info: | ||
| 11 | #oid_file = $ENV::HOME/.oid | ||
| 12 | oid_section = new_oids | ||
| 13 | |||
| 14 | # To use this configuration file with the "-extfile" option of the | ||
| 15 | # "openssl x509" utility, name here the section containing the | ||
| 16 | # X.509v3 extensions to use: | ||
| 17 | # extensions = | ||
| 18 | # (Alternatively, use a configuration file that has only | ||
| 19 | # X.509v3 extensions in its main [= default] section.) | ||
| 20 | |||
| 21 | [ new_oids ] | ||
| 22 | |||
| 23 | # We can add new OIDs in here for use by 'ca', 'req' and 'ts'. | ||
| 24 | # Add a simple OID like this: | ||
| 25 | # testoid1=1.2.3.4 | ||
| 26 | # Or use config file substitution like this: | ||
| 27 | # testoid2=${testoid1}.5.6 | ||
| 28 | |||
| 29 | # Policies used by the TSA examples. | ||
| 30 | tsa_policy1 = 1.2.3.4.1 | ||
| 31 | tsa_policy2 = 1.2.3.4.5.6 | ||
| 32 | tsa_policy3 = 1.2.3.4.5.7 | ||
| 33 | |||
| 34 | #################################################################### | ||
| 35 | [ ca ] | ||
| 36 | default_ca = CA_default # The default ca section | ||
| 37 | |||
| 38 | #################################################################### | ||
| 39 | [ CA_default ] | ||
| 40 | |||
| 41 | dir = ./demoCA # Where everything is kept | ||
| 42 | certs = $dir/certs # Where the issued certs are kept | ||
| 43 | crl_dir = $dir/crl # Where the issued crl are kept | ||
| 44 | database = $dir/index.txt # database index file. | ||
| 45 | #unique_subject = no # Set to 'no' to allow creation of | ||
| 46 | # several ctificates with same subject. | ||
| 47 | new_certs_dir = $dir/newcerts # default place for new certs. | ||
| 48 | |||
| 49 | certificate = $dir/cacert.pem # The CA certificate | ||
| 50 | serial = $dir/serial # The current serial number | ||
| 51 | crlnumber = $dir/crlnumber # the current crl number | ||
| 52 | # must be commented out to leave a V1 CRL | ||
| 53 | crl = $dir/crl.pem # The current CRL | ||
| 54 | private_key = $dir/private/cakey.pem# The private key | ||
| 55 | |||
| 56 | x509_extensions = usr_cert # The extentions to add to the cert | ||
| 57 | |||
| 58 | # Comment out the following two lines for the "traditional" | ||
| 59 | # (and highly broken) format. | ||
| 60 | name_opt = ca_default # Subject Name options | ||
| 61 | cert_opt = ca_default # Certificate field options | ||
| 62 | |||
| 63 | # Extension copying option: use with caution. | ||
| 64 | # copy_extensions = copy | ||
| 65 | |||
| 66 | # Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs | ||
| 67 | # so this is commented out by default to leave a V1 CRL. | ||
| 68 | # crlnumber must also be commented out to leave a V1 CRL. | ||
| 69 | # crl_extensions = crl_ext | ||
| 70 | |||
| 71 | default_days = 365 # how long to certify for | ||
| 72 | default_crl_days= 30 # how long before next CRL | ||
| 73 | default_md = default # use public key default MD | ||
| 74 | preserve = no # keep passed DN ordering | ||
| 75 | |||
| 76 | # A few difference way of specifying how similar the request should look | ||
| 77 | # For type CA, the listed attributes must be the same, and the optional | ||
| 78 | # and supplied fields are just that :-) | ||
| 79 | policy = policy_match | ||
| 80 | |||
| 81 | # For the CA policy | ||
| 82 | [ policy_match ] | ||
| 83 | countryName = match | ||
| 84 | stateOrProvinceName = match | ||
| 85 | organizationName = match | ||
| 86 | organizationalUnitName = optional | ||
| 87 | commonName = supplied | ||
| 88 | emailAddress = optional | ||
| 89 | |||
| 90 | # For the 'anything' policy | ||
| 91 | # At this point in time, you must list all acceptable 'object' | ||
| 92 | # types. | ||
| 93 | [ policy_anything ] | ||
| 94 | countryName = optional | ||
| 95 | stateOrProvinceName = optional | ||
| 96 | localityName = optional | ||
| 97 | organizationName = optional | ||
| 98 | organizationalUnitName = optional | ||
| 99 | commonName = supplied | ||
| 100 | emailAddress = optional | ||
| 101 | |||
| 102 | #################################################################### | ||
| 103 | [ req ] | ||
| 104 | default_bits = 1024 | ||
| 105 | default_keyfile = privkey.pem | ||
| 106 | distinguished_name = req_distinguished_name | ||
| 107 | attributes = req_attributes | ||
| 108 | x509_extensions = v3_ca # The extentions to add to the self signed cert | ||
| 109 | |||
| 110 | # Passwords for private keys if not present they will be prompted for | ||
| 111 | # input_password = secret | ||
| 112 | # output_password = secret | ||
| 113 | |||
| 114 | # This sets a mask for permitted string types. There are several options. | ||
| 115 | # default: PrintableString, T61String, BMPString. | ||
| 116 | # pkix : PrintableString, BMPString (PKIX recommendation before 2004) | ||
| 117 | # utf8only: only UTF8Strings (PKIX recommendation after 2004). | ||
| 118 | # nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). | ||
| 119 | # MASK:XXXX a literal mask value. | ||
| 120 | # WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings. | ||
| 121 | string_mask = utf8only | ||
| 122 | |||
| 123 | # req_extensions = v3_req # The extensions to add to a certificate request | ||
| 124 | |||
| 125 | [ req_distinguished_name ] | ||
| 126 | countryName = Country Name (2 letter code) | ||
| 127 | countryName_default = AU | ||
| 128 | countryName_min = 2 | ||
| 129 | countryName_max = 2 | ||
| 130 | |||
| 131 | stateOrProvinceName = State or Province Name (full name) | ||
| 132 | stateOrProvinceName_default = Some-State | ||
| 133 | |||
| 134 | localityName = Locality Name (eg, city) | ||
| 135 | |||
| 136 | 0.organizationName = Organization Name (eg, company) | ||
| 137 | 0.organizationName_default = Internet Widgits Pty Ltd | ||
| 138 | |||
| 139 | # we can do this but it is not needed normally :-) | ||
| 140 | #1.organizationName = Second Organization Name (eg, company) | ||
| 141 | #1.organizationName_default = World Wide Web Pty Ltd | ||
| 142 | |||
| 143 | organizationalUnitName = Organizational Unit Name (eg, section) | ||
| 144 | #organizationalUnitName_default = | ||
| 145 | |||
| 146 | commonName = Common Name (e.g. server FQDN or YOUR name) | ||
| 147 | commonName_max = 64 | ||
| 148 | |||
| 149 | emailAddress = Email Address | ||
| 150 | emailAddress_max = 64 | ||
| 151 | |||
| 152 | # SET-ex3 = SET extension number 3 | ||
| 153 | |||
| 154 | [ req_attributes ] | ||
| 155 | challengePassword = A challenge password | ||
| 156 | challengePassword_min = 4 | ||
| 157 | challengePassword_max = 20 | ||
| 158 | |||
| 159 | unstructuredName = An optional company name | ||
| 160 | |||
| 161 | [ usr_cert ] | ||
| 162 | |||
| 163 | # These extensions are added when 'ca' signs a request. | ||
| 164 | |||
| 165 | # This goes against PKIX guidelines but some CAs do it and some software | ||
| 166 | # requires this to avoid interpreting an end user certificate as a CA. | ||
| 167 | |||
| 168 | basicConstraints=CA:FALSE | ||
| 169 | |||
| 170 | # Here are some examples of the usage of nsCertType. If it is omitted | ||
| 171 | # the certificate can be used for anything *except* object signing. | ||
| 172 | |||
| 173 | # This is OK for an SSL server. | ||
| 174 | # nsCertType = server | ||
| 175 | |||
| 176 | # For an object signing certificate this would be used. | ||
| 177 | # nsCertType = objsign | ||
| 178 | |||
| 179 | # For normal client use this is typical | ||
| 180 | # nsCertType = client, email | ||
| 181 | |||
| 182 | # and for everything including object signing: | ||
| 183 | # nsCertType = client, email, objsign | ||
| 184 | |||
| 185 | # This is typical in keyUsage for a client certificate. | ||
| 186 | # keyUsage = nonRepudiation, digitalSignature, keyEncipherment | ||
| 187 | |||
| 188 | # This will be displayed in Netscape's comment listbox. | ||
| 189 | nsComment = "OpenSSL Generated Certificate" | ||
| 190 | |||
| 191 | # PKIX recommendations harmless if included in all certificates. | ||
| 192 | subjectKeyIdentifier=hash | ||
| 193 | authorityKeyIdentifier=keyid,issuer | ||
| 194 | |||
| 195 | # This stuff is for subjectAltName and issuerAltname. | ||
| 196 | # Import the email address. | ||
| 197 | # subjectAltName=email:copy | ||
| 198 | # An alternative to produce certificates that aren't | ||
| 199 | # deprecated according to PKIX. | ||
| 200 | # subjectAltName=email:move | ||
| 201 | |||
| 202 | # Copy subject details | ||
| 203 | # issuerAltName=issuer:copy | ||
| 204 | |||
| 205 | #nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem | ||
| 206 | #nsBaseUrl | ||
| 207 | #nsRevocationUrl | ||
| 208 | #nsRenewalUrl | ||
| 209 | #nsCaPolicyUrl | ||
| 210 | #nsSslServerName | ||
| 211 | |||
| 212 | # This is required for TSA certificates. | ||
| 213 | # extendedKeyUsage = critical,timeStamping | ||
| 214 | |||
| 215 | [ v3_req ] | ||
| 216 | |||
| 217 | # Extensions to add to a certificate request | ||
| 218 | |||
| 219 | basicConstraints = CA:FALSE | ||
| 220 | keyUsage = nonRepudiation, digitalSignature, keyEncipherment | ||
| 221 | |||
| 222 | [ v3_ca ] | ||
| 223 | |||
| 224 | |||
| 225 | # Extensions for a typical CA | ||
| 226 | |||
| 227 | |||
| 228 | # PKIX recommendation. | ||
| 229 | |||
| 230 | subjectKeyIdentifier=hash | ||
| 231 | |||
| 232 | authorityKeyIdentifier=keyid:always,issuer | ||
| 233 | |||
| 234 | # This is what PKIX recommends but some broken software chokes on critical | ||
| 235 | # extensions. | ||
| 236 | #basicConstraints = critical,CA:true | ||
| 237 | # So we do this instead. | ||
| 238 | basicConstraints = CA:true | ||
| 239 | |||
| 240 | # Key usage: this is typical for a CA certificate. However since it will | ||
| 241 | # prevent it being used as an test self-signed certificate it is best | ||
| 242 | # left out by default. | ||
| 243 | # keyUsage = cRLSign, keyCertSign | ||
| 244 | |||
| 245 | # Some might want this also | ||
| 246 | # nsCertType = sslCA, emailCA | ||
| 247 | |||
| 248 | # Include email address in subject alt name: another PKIX recommendation | ||
| 249 | # subjectAltName=email:copy | ||
| 250 | # Copy issuer details | ||
| 251 | # issuerAltName=issuer:copy | ||
| 252 | |||
| 253 | # DER hex encoding of an extension: beware experts only! | ||
| 254 | # obj=DER:02:03 | ||
| 255 | # Where 'obj' is a standard or added object | ||
| 256 | # You can even override a supported extension: | ||
| 257 | # basicConstraints= critical, DER:30:03:01:01:FF | ||
| 258 | |||
| 259 | [ crl_ext ] | ||
| 260 | |||
| 261 | # CRL extensions. | ||
| 262 | # Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. | ||
| 263 | |||
| 264 | # issuerAltName=issuer:copy | ||
| 265 | authorityKeyIdentifier=keyid:always | ||
| 266 | |||
| 267 | [ proxy_cert_ext ] | ||
| 268 | # These extensions should be added when creating a proxy certificate | ||
| 269 | |||
| 270 | # This goes against PKIX guidelines but some CAs do it and some software | ||
| 271 | # requires this to avoid interpreting an end user certificate as a CA. | ||
| 272 | |||
| 273 | basicConstraints=CA:FALSE | ||
| 274 | |||
| 275 | # Here are some examples of the usage of nsCertType. If it is omitted | ||
| 276 | # the certificate can be used for anything *except* object signing. | ||
| 277 | |||
| 278 | # This is OK for an SSL server. | ||
| 279 | # nsCertType = server | ||
| 280 | |||
| 281 | # For an object signing certificate this would be used. | ||
| 282 | # nsCertType = objsign | ||
| 283 | |||
| 284 | # For normal client use this is typical | ||
| 285 | # nsCertType = client, email | ||
| 286 | |||
| 287 | # and for everything including object signing: | ||
| 288 | # nsCertType = client, email, objsign | ||
| 289 | |||
| 290 | # This is typical in keyUsage for a client certificate. | ||
| 291 | # keyUsage = nonRepudiation, digitalSignature, keyEncipherment | ||
| 292 | |||
| 293 | # This will be displayed in Netscape's comment listbox. | ||
| 294 | nsComment = "OpenSSL Generated Certificate" | ||
| 295 | |||
| 296 | # PKIX recommendations harmless if included in all certificates. | ||
| 297 | subjectKeyIdentifier=hash | ||
| 298 | authorityKeyIdentifier=keyid,issuer | ||
| 299 | |||
| 300 | # This stuff is for subjectAltName and issuerAltname. | ||
| 301 | # Import the email address. | ||
| 302 | # subjectAltName=email:copy | ||
| 303 | # An alternative to produce certificates that aren't | ||
| 304 | # deprecated according to PKIX. | ||
| 305 | # subjectAltName=email:move | ||
| 306 | |||
| 307 | # Copy subject details | ||
| 308 | # issuerAltName=issuer:copy | ||
| 309 | |||
| 310 | #nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem | ||
| 311 | #nsBaseUrl | ||
| 312 | #nsRevocationUrl | ||
| 313 | #nsRenewalUrl | ||
| 314 | #nsCaPolicyUrl | ||
| 315 | #nsSslServerName | ||
| 316 | |||
| 317 | # This really needs to be in place for it to be a proxy certificate. | ||
| 318 | proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo | ||
| 319 | |||
| 320 | #################################################################### | ||
| 321 | [ tsa ] | ||
| 322 | |||
| 323 | default_tsa = tsa_config1 # the default TSA section | ||
| 324 | |||
| 325 | [ tsa_config1 ] | ||
| 326 | |||
| 327 | # These are used by the TSA reply generation only. | ||
| 328 | dir = ./demoCA # TSA root directory | ||
| 329 | serial = $dir/tsaserial # The current serial number (mandatory) | ||
| 330 | crypto_device = builtin # OpenSSL engine to use for signing | ||
| 331 | signer_cert = $dir/tsacert.pem # The TSA signing certificate | ||
| 332 | # (optional) | ||
| 333 | certs = $dir/cacert.pem # Certificate chain to include in reply | ||
| 334 | # (optional) | ||
| 335 | signer_key = $dir/private/tsakey.pem # The TSA private key (optional) | ||
| 336 | |||
| 337 | default_policy = tsa_policy1 # Policy if request did not specify it | ||
| 338 | # (optional) | ||
| 339 | other_policies = tsa_policy2, tsa_policy3 # acceptable policies (optional) | ||
| 340 | digests = md5, sha1 # Acceptable message digests (mandatory) | ||
| 341 | accuracy = secs:1, millisecs:500, microsecs:100 # (optional) | ||
| 342 | clock_precision_digits = 0 # number of digits after dot. (optional) | ||
| 343 | ordering = yes # Is ordering defined for timestamps? | ||
| 344 | # (optional, default: no) | ||
| 345 | tsa_name = yes # Must the TSA name be included in the reply? | ||
| 346 | # (optional, default: no) | ||
| 347 | ess_cert_id_chain = no # Must the ESS cert id chain be included? | ||
| 348 | # (optional, default: no) | ||
diff --git a/src/lib/libssl/doc/openssl.txt b/src/lib/libssl/doc/openssl.txt deleted file mode 100644 index f8817b0a71..0000000000 --- a/src/lib/libssl/doc/openssl.txt +++ /dev/null | |||
| @@ -1,1254 +0,0 @@ | |||
| 1 | |||
| 2 | This is some preliminary documentation for OpenSSL. | ||
| 3 | |||
| 4 | Contents: | ||
| 5 | |||
| 6 | OpenSSL X509V3 extension configuration | ||
| 7 | X509V3 Extension code: programmers guide | ||
| 8 | PKCS#12 Library | ||
| 9 | |||
| 10 | |||
| 11 | ============================================================================== | ||
| 12 | OpenSSL X509V3 extension configuration | ||
| 13 | ============================================================================== | ||
| 14 | |||
| 15 | OpenSSL X509V3 extension configuration: preliminary documentation. | ||
| 16 | |||
| 17 | INTRODUCTION. | ||
| 18 | |||
| 19 | For OpenSSL 0.9.2 the extension code has be considerably enhanced. It is now | ||
| 20 | possible to add and print out common X509 V3 certificate and CRL extensions. | ||
| 21 | |||
| 22 | BEGINNERS NOTE | ||
| 23 | |||
| 24 | For most simple applications you don't need to know too much about extensions: | ||
| 25 | the default openssl.cnf values will usually do sensible things. | ||
| 26 | |||
| 27 | If you want to know more you can initially quickly look through the sections | ||
| 28 | describing how the standard OpenSSL utilities display and add extensions and | ||
| 29 | then the list of supported extensions. | ||
| 30 | |||
| 31 | For more technical information about the meaning of extensions see: | ||
| 32 | |||
| 33 | http://www.imc.org/ietf-pkix/ | ||
| 34 | http://home.netscape.com/eng/security/certs.html | ||
| 35 | |||
| 36 | PRINTING EXTENSIONS. | ||
| 37 | |||
| 38 | Extension values are automatically printed out for supported extensions. | ||
| 39 | |||
| 40 | openssl x509 -in cert.pem -text | ||
| 41 | openssl crl -in crl.pem -text | ||
| 42 | |||
| 43 | will give information in the extension printout, for example: | ||
| 44 | |||
| 45 | X509v3 extensions: | ||
| 46 | X509v3 Basic Constraints: | ||
| 47 | CA:TRUE | ||
| 48 | X509v3 Subject Key Identifier: | ||
| 49 | 73:FE:F7:59:A7:E1:26:84:44:D6:44:36:EE:79:1A:95:7C:B1:4B:15 | ||
| 50 | X509v3 Authority Key Identifier: | ||
| 51 | keyid:73:FE:F7:59:A7:E1:26:84:44:D6:44:36:EE:79:1A:95:7C:B1:4B:15, DirName:/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/Email=email@1.address/Email=email@2.address, serial:00 | ||
| 52 | X509v3 Key Usage: | ||
| 53 | Certificate Sign, CRL Sign | ||
| 54 | X509v3 Subject Alternative Name: | ||
| 55 | email:email@1.address, email:email@2.address | ||
| 56 | |||
| 57 | CONFIGURATION FILES. | ||
| 58 | |||
| 59 | The OpenSSL utilities 'ca' and 'req' can now have extension sections listing | ||
| 60 | which certificate extensions to include. In each case a line: | ||
| 61 | |||
| 62 | x509_extensions = extension_section | ||
| 63 | |||
| 64 | indicates which section contains the extensions. In the case of 'req' the | ||
| 65 | extension section is used when the -x509 option is present to create a | ||
| 66 | self signed root certificate. | ||
| 67 | |||
| 68 | The 'x509' utility also supports extensions when it signs a certificate. | ||
| 69 | The -extfile option is used to set the configuration file containing the | ||
| 70 | extensions. In this case a line with: | ||
| 71 | |||
| 72 | extensions = extension_section | ||
| 73 | |||
| 74 | in the nameless (default) section is used. If no such line is included then | ||
| 75 | it uses the default section. | ||
| 76 | |||
| 77 | You can also add extensions to CRLs: a line | ||
| 78 | |||
| 79 | crl_extensions = crl_extension_section | ||
| 80 | |||
| 81 | will include extensions when the -gencrl option is used with the 'ca' utility. | ||
| 82 | You can add any extension to a CRL but of the supported extensions only | ||
| 83 | issuerAltName and authorityKeyIdentifier make any real sense. Note: these are | ||
| 84 | CRL extensions NOT CRL *entry* extensions which cannot currently be generated. | ||
| 85 | CRL entry extensions can be displayed. | ||
| 86 | |||
| 87 | NB. At this time Netscape Communicator rejects V2 CRLs: to get an old V1 CRL | ||
| 88 | you should not include a crl_extensions line in the configuration file. | ||
| 89 | |||
| 90 | As with all configuration files you can use the inbuilt environment expansion | ||
| 91 | to allow the values to be passed in the environment. Therefore if you have | ||
| 92 | several extension sections used for different purposes you can have a line: | ||
| 93 | |||
| 94 | x509_extensions = $ENV::ENV_EXT | ||
| 95 | |||
| 96 | and set the ENV_EXT environment variable before calling the relevant utility. | ||
| 97 | |||
| 98 | EXTENSION SYNTAX. | ||
| 99 | |||
| 100 | Extensions have the basic form: | ||
| 101 | |||
| 102 | extension_name=[critical,] extension_options | ||
| 103 | |||
| 104 | the use of the critical option makes the extension critical. Extreme caution | ||
| 105 | should be made when using the critical flag. If an extension is marked | ||
| 106 | as critical then any client that does not understand the extension should | ||
| 107 | reject it as invalid. Some broken software will reject certificates which | ||
| 108 | have *any* critical extensions (these violates PKIX but we have to live | ||
| 109 | with it). | ||
| 110 | |||
| 111 | There are three main types of extension: string extensions, multi-valued | ||
| 112 | extensions, and raw extensions. | ||
| 113 | |||
| 114 | String extensions simply have a string which contains either the value itself | ||
| 115 | or how it is obtained. | ||
| 116 | |||
| 117 | For example: | ||
| 118 | |||
| 119 | nsComment="This is a Comment" | ||
| 120 | |||
| 121 | Multi-valued extensions have a short form and a long form. The short form | ||
| 122 | is a list of names and values: | ||
| 123 | |||
| 124 | basicConstraints=critical,CA:true,pathlen:1 | ||
| 125 | |||
| 126 | The long form allows the values to be placed in a separate section: | ||
| 127 | |||
| 128 | basicConstraints=critical,@bs_section | ||
| 129 | |||
| 130 | [bs_section] | ||
| 131 | |||
| 132 | CA=true | ||
| 133 | pathlen=1 | ||
| 134 | |||
| 135 | Both forms are equivalent. However it should be noted that in some cases the | ||
| 136 | same name can appear multiple times, for example, | ||
| 137 | |||
| 138 | subjectAltName=email:steve@here,email:steve@there | ||
| 139 | |||
| 140 | in this case an equivalent long form is: | ||
| 141 | |||
| 142 | subjectAltName=@alt_section | ||
| 143 | |||
| 144 | [alt_section] | ||
| 145 | |||
| 146 | email.1=steve@here | ||
| 147 | email.2=steve@there | ||
| 148 | |||
| 149 | This is because the configuration file code cannot handle the same name | ||
| 150 | occurring twice in the same section. | ||
| 151 | |||
| 152 | The syntax of raw extensions is governed by the extension code: it can | ||
| 153 | for example contain data in multiple sections. The correct syntax to | ||
| 154 | use is defined by the extension code itself: check out the certificate | ||
| 155 | policies extension for an example. | ||
| 156 | |||
| 157 | There are two ways to encode arbitrary extensions. | ||
| 158 | |||
| 159 | The first way is to use the word ASN1 followed by the extension content | ||
| 160 | using the same syntax as ASN1_generate_nconf(). For example: | ||
| 161 | |||
| 162 | 1.2.3.4=critical,ASN1:UTF8String:Some random data | ||
| 163 | |||
| 164 | 1.2.3.4=ASN1:SEQUENCE:seq_sect | ||
| 165 | |||
| 166 | [seq_sect] | ||
| 167 | |||
| 168 | field1 = UTF8:field1 | ||
| 169 | field2 = UTF8:field2 | ||
| 170 | |||
| 171 | It is also possible to use the word DER to include arbitrary data in any | ||
| 172 | extension. | ||
| 173 | |||
| 174 | 1.2.3.4=critical,DER:01:02:03:04 | ||
| 175 | 1.2.3.4=DER:01020304 | ||
| 176 | |||
| 177 | The value following DER is a hex dump of the DER encoding of the extension | ||
| 178 | Any extension can be placed in this form to override the default behaviour. | ||
| 179 | For example: | ||
| 180 | |||
| 181 | basicConstraints=critical,DER:00:01:02:03 | ||
| 182 | |||
| 183 | WARNING: DER should be used with caution. It is possible to create totally | ||
| 184 | invalid extensions unless care is taken. | ||
| 185 | |||
| 186 | CURRENTLY SUPPORTED EXTENSIONS. | ||
| 187 | |||
| 188 | If you aren't sure about extensions then they can be largely ignored: its only | ||
| 189 | when you want to do things like restrict certificate usage when you need to | ||
| 190 | worry about them. | ||
| 191 | |||
| 192 | The only extension that a beginner might want to look at is Basic Constraints. | ||
| 193 | If in addition you want to try Netscape object signing the you should also | ||
| 194 | look at Netscape Certificate Type. | ||
| 195 | |||
| 196 | Literal String extensions. | ||
| 197 | |||
| 198 | In each case the 'value' of the extension is placed directly in the | ||
| 199 | extension. Currently supported extensions in this category are: nsBaseUrl, | ||
| 200 | nsRevocationUrl, nsCaRevocationUrl, nsRenewalUrl, nsCaPolicyUrl, | ||
| 201 | nsSslServerName and nsComment. | ||
| 202 | |||
| 203 | For example: | ||
| 204 | |||
| 205 | nsComment="This is a test comment" | ||
| 206 | |||
| 207 | Bit Strings. | ||
| 208 | |||
| 209 | Bit string extensions just consist of a list of supported bits, currently | ||
| 210 | two extensions are in this category: PKIX keyUsage and the Netscape specific | ||
| 211 | nsCertType. | ||
| 212 | |||
| 213 | nsCertType (netscape certificate type) takes the flags: client, server, email, | ||
| 214 | objsign, reserved, sslCA, emailCA, objCA. | ||
| 215 | |||
| 216 | keyUsage (PKIX key usage) takes the flags: digitalSignature, nonRepudiation, | ||
| 217 | keyEncipherment, dataEncipherment, keyAgreement, keyCertSign, cRLSign, | ||
| 218 | encipherOnly, decipherOnly. | ||
| 219 | |||
| 220 | For example: | ||
| 221 | |||
| 222 | nsCertType=server | ||
| 223 | |||
| 224 | keyUsage=digitalSignature, nonRepudiation | ||
| 225 | |||
| 226 | Hints on Netscape Certificate Type. | ||
| 227 | |||
| 228 | Other than Basic Constraints this is the only extension a beginner might | ||
| 229 | want to use, if you want to try Netscape object signing, otherwise it can | ||
| 230 | be ignored. | ||
| 231 | |||
| 232 | If you want a certificate that can be used just for object signing then: | ||
| 233 | |||
| 234 | nsCertType=objsign | ||
| 235 | |||
| 236 | will do the job. If you want to use it as a normal end user and server | ||
| 237 | certificate as well then | ||
| 238 | |||
| 239 | nsCertType=objsign,email,server | ||
| 240 | |||
| 241 | is more appropriate. You cannot use a self signed certificate for object | ||
| 242 | signing (well Netscape signtool can but it cheats!) so you need to create | ||
| 243 | a CA certificate and sign an end user certificate with it. | ||
| 244 | |||
| 245 | Side note: If you want to conform to the Netscape specifications then you | ||
| 246 | should really also set: | ||
| 247 | |||
| 248 | nsCertType=objCA | ||
| 249 | |||
| 250 | in the *CA* certificate for just an object signing CA and | ||
| 251 | |||
| 252 | nsCertType=objCA,emailCA,sslCA | ||
| 253 | |||
| 254 | for everything. Current Netscape software doesn't enforce this so it can | ||
| 255 | be omitted. | ||
| 256 | |||
| 257 | Basic Constraints. | ||
| 258 | |||
| 259 | This is generally the only extension you need to worry about for simple | ||
| 260 | applications. If you want your certificate to be usable as a CA certificate | ||
| 261 | (in addition to an end user certificate) then you set this to: | ||
| 262 | |||
| 263 | basicConstraints=CA:TRUE | ||
| 264 | |||
| 265 | if you want to be certain the certificate cannot be used as a CA then do: | ||
| 266 | |||
| 267 | basicConstraints=CA:FALSE | ||
| 268 | |||
| 269 | The rest of this section describes more advanced usage. | ||
| 270 | |||
| 271 | Basic constraints is a multi-valued extension that supports a CA and an | ||
| 272 | optional pathlen option. The CA option takes the values true and false and | ||
| 273 | pathlen takes an integer. Note if the CA option is false the pathlen option | ||
| 274 | should be omitted. | ||
| 275 | |||
| 276 | The pathlen parameter indicates the maximum number of CAs that can appear | ||
| 277 | below this one in a chain. So if you have a CA with a pathlen of zero it can | ||
| 278 | only be used to sign end user certificates and not further CAs. This all | ||
| 279 | assumes that the software correctly interprets this extension of course. | ||
| 280 | |||
| 281 | Examples: | ||
| 282 | |||
| 283 | basicConstraints=CA:TRUE | ||
| 284 | basicConstraints=critical,CA:TRUE, pathlen:0 | ||
| 285 | |||
| 286 | NOTE: for a CA to be considered valid it must have the CA option set to | ||
| 287 | TRUE. An end user certificate MUST NOT have the CA value set to true. | ||
| 288 | According to PKIX recommendations it should exclude the extension entirely, | ||
| 289 | however some software may require CA set to FALSE for end entity certificates. | ||
| 290 | |||
| 291 | Extended Key Usage. | ||
| 292 | |||
| 293 | This extensions consists of a list of usages. | ||
| 294 | |||
| 295 | These can either be object short names of the dotted numerical form of OIDs. | ||
| 296 | While any OID can be used only certain values make sense. In particular the | ||
| 297 | following PKIX, NS and MS values are meaningful: | ||
| 298 | |||
| 299 | Value Meaning | ||
| 300 | ----- ------- | ||
| 301 | serverAuth SSL/TLS Web Server Authentication. | ||
| 302 | clientAuth SSL/TLS Web Client Authentication. | ||
| 303 | codeSigning Code signing. | ||
| 304 | emailProtection E-mail Protection (S/MIME). | ||
| 305 | timeStamping Trusted Timestamping | ||
| 306 | msCodeInd Microsoft Individual Code Signing (authenticode) | ||
| 307 | msCodeCom Microsoft Commercial Code Signing (authenticode) | ||
| 308 | msCTLSign Microsoft Trust List Signing | ||
| 309 | msSGC Microsoft Server Gated Crypto | ||
| 310 | msEFS Microsoft Encrypted File System | ||
| 311 | nsSGC Netscape Server Gated Crypto | ||
| 312 | |||
| 313 | For example, under IE5 a CA can be used for any purpose: by including a list | ||
| 314 | of the above usages the CA can be restricted to only authorised uses. | ||
| 315 | |||
| 316 | Note: software packages may place additional interpretations on certificate | ||
| 317 | use, in particular some usages may only work for selected CAs. Don't for example | ||
| 318 | expect just including msSGC or nsSGC will automatically mean that a certificate | ||
| 319 | can be used for SGC ("step up" encryption) otherwise anyone could use it. | ||
| 320 | |||
| 321 | Examples: | ||
| 322 | |||
| 323 | extendedKeyUsage=critical,codeSigning,1.2.3.4 | ||
| 324 | extendedKeyUsage=nsSGC,msSGC | ||
| 325 | |||
| 326 | Subject Key Identifier. | ||
| 327 | |||
| 328 | This is really a string extension and can take two possible values. Either | ||
| 329 | a hex string giving details of the extension value to include or the word | ||
| 330 | 'hash' which then automatically follow PKIX guidelines in selecting and | ||
| 331 | appropriate key identifier. The use of the hex string is strongly discouraged. | ||
| 332 | |||
| 333 | Example: subjectKeyIdentifier=hash | ||
| 334 | |||
| 335 | Authority Key Identifier. | ||
| 336 | |||
| 337 | The authority key identifier extension permits two options. keyid and issuer: | ||
| 338 | both can take the optional value "always". | ||
| 339 | |||
| 340 | If the keyid option is present an attempt is made to copy the subject key | ||
| 341 | identifier from the parent certificate. If the value "always" is present | ||
| 342 | then an error is returned if the option fails. | ||
| 343 | |||
| 344 | The issuer option copies the issuer and serial number from the issuer | ||
| 345 | certificate. Normally this will only be done if the keyid option fails or | ||
| 346 | is not included: the "always" flag will always include the value. | ||
| 347 | |||
| 348 | Subject Alternative Name. | ||
| 349 | |||
| 350 | The subject alternative name extension allows various literal values to be | ||
| 351 | included in the configuration file. These include "email" (an email address) | ||
| 352 | "URI" a uniform resource indicator, "DNS" (a DNS domain name), RID (a | ||
| 353 | registered ID: OBJECT IDENTIFIER), IP (and IP address) and otherName. | ||
| 354 | |||
| 355 | Also the email option include a special 'copy' value. This will automatically | ||
| 356 | include and email addresses contained in the certificate subject name in | ||
| 357 | the extension. | ||
| 358 | |||
| 359 | otherName can include arbitrary data associated with an OID: the value | ||
| 360 | should be the OID followed by a semicolon and the content in standard | ||
| 361 | ASN1_generate_nconf() format. | ||
| 362 | |||
| 363 | Examples: | ||
| 364 | |||
| 365 | subjectAltName=email:copy,email:my@other.address,URI:http://my.url.here/ | ||
| 366 | subjectAltName=email:my@other.address,RID:1.2.3.4 | ||
| 367 | subjectAltName=otherName:1.2.3.4;UTF8:some other identifier | ||
| 368 | |||
| 369 | Issuer Alternative Name. | ||
| 370 | |||
| 371 | The issuer alternative name option supports all the literal options of | ||
| 372 | subject alternative name. It does *not* support the email:copy option because | ||
| 373 | that would not make sense. It does support an additional issuer:copy option | ||
| 374 | that will copy all the subject alternative name values from the issuer | ||
| 375 | certificate (if possible). | ||
| 376 | |||
| 377 | Example: | ||
| 378 | |||
| 379 | issuserAltName = issuer:copy | ||
| 380 | |||
| 381 | Authority Info Access. | ||
| 382 | |||
| 383 | The authority information access extension gives details about how to access | ||
| 384 | certain information relating to the CA. Its syntax is accessOID;location | ||
| 385 | where 'location' has the same syntax as subject alternative name (except | ||
| 386 | that email:copy is not supported). accessOID can be any valid OID but only | ||
| 387 | certain values are meaningful for example OCSP and caIssuers. OCSP gives the | ||
| 388 | location of an OCSP responder: this is used by Netscape PSM and other software. | ||
| 389 | |||
| 390 | Example: | ||
| 391 | |||
| 392 | authorityInfoAccess = OCSP;URI:http://ocsp.my.host/ | ||
| 393 | authorityInfoAccess = caIssuers;URI:http://my.ca/ca.html | ||
| 394 | |||
| 395 | CRL distribution points. | ||
| 396 | |||
| 397 | This is a multi-valued extension that supports all the literal options of | ||
| 398 | subject alternative name. Of the few software packages that currently interpret | ||
| 399 | this extension most only interpret the URI option. | ||
| 400 | |||
| 401 | Currently each option will set a new DistributionPoint with the fullName | ||
| 402 | field set to the given value. | ||
| 403 | |||
| 404 | Other fields like cRLissuer and reasons cannot currently be set or displayed: | ||
| 405 | at this time no examples were available that used these fields. | ||
| 406 | |||
| 407 | If you see this extension with <UNSUPPORTED> when you attempt to print it out | ||
| 408 | or it doesn't appear to display correctly then let me know, including the | ||
| 409 | certificate (mail me at steve@openssl.org) . | ||
| 410 | |||
| 411 | Examples: | ||
| 412 | |||
| 413 | crlDistributionPoints=URI:http://www.myhost.com/myca.crl | ||
| 414 | crlDistributionPoints=URI:http://www.my.com/my.crl,URI:http://www.oth.com/my.crl | ||
| 415 | |||
| 416 | Certificate Policies. | ||
| 417 | |||
| 418 | This is a RAW extension. It attempts to display the contents of this extension: | ||
| 419 | unfortunately this extension is often improperly encoded. | ||
| 420 | |||
| 421 | The certificate policies extension will rarely be used in practice: few | ||
| 422 | software packages interpret it correctly or at all. IE5 does partially | ||
| 423 | support this extension: but it needs the 'ia5org' option because it will | ||
| 424 | only correctly support a broken encoding. Of the options below only the | ||
| 425 | policy OID, explicitText and CPS options are displayed with IE5. | ||
| 426 | |||
| 427 | All the fields of this extension can be set by using the appropriate syntax. | ||
| 428 | |||
| 429 | If you follow the PKIX recommendations of not including any qualifiers and just | ||
| 430 | using only one OID then you just include the value of that OID. Multiple OIDs | ||
| 431 | can be set separated by commas, for example: | ||
| 432 | |||
| 433 | certificatePolicies= 1.2.4.5, 1.1.3.4 | ||
| 434 | |||
| 435 | If you wish to include qualifiers then the policy OID and qualifiers need to | ||
| 436 | be specified in a separate section: this is done by using the @section syntax | ||
| 437 | instead of a literal OID value. | ||
| 438 | |||
| 439 | The section referred to must include the policy OID using the name | ||
| 440 | policyIdentifier, cPSuri qualifiers can be included using the syntax: | ||
| 441 | |||
| 442 | CPS.nnn=value | ||
| 443 | |||
| 444 | userNotice qualifiers can be set using the syntax: | ||
| 445 | |||
| 446 | userNotice.nnn=@notice | ||
| 447 | |||
| 448 | The value of the userNotice qualifier is specified in the relevant section. | ||
| 449 | This section can include explicitText, organization and noticeNumbers | ||
| 450 | options. explicitText and organization are text strings, noticeNumbers is a | ||
| 451 | comma separated list of numbers. The organization and noticeNumbers options | ||
| 452 | (if included) must BOTH be present. If you use the userNotice option with IE5 | ||
| 453 | then you need the 'ia5org' option at the top level to modify the encoding: | ||
| 454 | otherwise it will not be interpreted properly. | ||
| 455 | |||
| 456 | Example: | ||
| 457 | |||
| 458 | certificatePolicies=ia5org,1.2.3.4,1.5.6.7.8,@polsect | ||
| 459 | |||
| 460 | [polsect] | ||
| 461 | |||
| 462 | policyIdentifier = 1.3.5.8 | ||
| 463 | CPS.1="http://my.host.name/" | ||
| 464 | CPS.2="http://my.your.name/" | ||
| 465 | userNotice.1=@notice | ||
| 466 | |||
| 467 | [notice] | ||
| 468 | |||
| 469 | explicitText="Explicit Text Here" | ||
| 470 | organization="Organisation Name" | ||
| 471 | noticeNumbers=1,2,3,4 | ||
| 472 | |||
| 473 | TECHNICAL NOTE: the ia5org option changes the type of the 'organization' field, | ||
| 474 | according to PKIX it should be of type DisplayText but Verisign uses an | ||
| 475 | IA5STRING and IE5 needs this too. | ||
| 476 | |||
| 477 | Display only extensions. | ||
| 478 | |||
| 479 | Some extensions are only partially supported and currently are only displayed | ||
| 480 | but cannot be set. These include private key usage period, CRL number, and | ||
| 481 | CRL reason. | ||
| 482 | |||
| 483 | ============================================================================== | ||
| 484 | X509V3 Extension code: programmers guide | ||
| 485 | ============================================================================== | ||
| 486 | |||
| 487 | The purpose of the extension code is twofold. It allows an extension to be | ||
| 488 | created from a string or structure describing its contents and it prints out an | ||
| 489 | extension in a human or machine readable form. | ||
| 490 | |||
| 491 | 1. Initialisation and cleanup. | ||
| 492 | |||
| 493 | No special initialisation is needed before calling the extension functions. | ||
| 494 | You used to have to call X509V3_add_standard_extensions(); but this is no longer | ||
| 495 | required and this function no longer does anything. | ||
| 496 | |||
| 497 | void X509V3_EXT_cleanup(void); | ||
| 498 | |||
| 499 | This function should be called to cleanup the extension code if any custom | ||
| 500 | extensions have been added. If no custom extensions have been added then this | ||
| 501 | call does nothing. After this call all custom extension code is freed up but | ||
| 502 | you can still use the standard extensions. | ||
| 503 | |||
| 504 | 2. Printing and parsing extensions. | ||
| 505 | |||
| 506 | The simplest way to print out extensions is via the standard X509 printing | ||
| 507 | routines: if you use the standard X509_print() function, the supported | ||
| 508 | extensions will be printed out automatically. | ||
| 509 | |||
| 510 | The following functions allow finer control over extension display: | ||
| 511 | |||
| 512 | int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, int flag, int indent); | ||
| 513 | int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent); | ||
| 514 | |||
| 515 | These two functions print out an individual extension to a BIO or FILE pointer. | ||
| 516 | Currently the flag argument is unused and should be set to 0. The 'indent' | ||
| 517 | argument is the number of spaces to indent each line. | ||
| 518 | |||
| 519 | void *X509V3_EXT_d2i(X509_EXTENSION *ext); | ||
| 520 | |||
| 521 | This function parses an extension and returns its internal structure. The | ||
| 522 | precise structure you get back depends on the extension being parsed. If the | ||
| 523 | extension if basicConstraints you will get back a pointer to a | ||
| 524 | BASIC_CONSTRAINTS structure. Check out the source in crypto/x509v3 for more | ||
| 525 | details about the structures returned. The returned structure should be freed | ||
| 526 | after use using the relevant free function, BASIC_CONSTRAINTS_free() for | ||
| 527 | example. | ||
| 528 | |||
| 529 | void * X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx); | ||
| 530 | void * X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx); | ||
| 531 | void * X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx); | ||
| 532 | void * X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx); | ||
| 533 | |||
| 534 | These functions combine the operations of searching for extensions and | ||
| 535 | parsing them. They search a certificate, a CRL a CRL entry or a stack | ||
| 536 | of extensions respectively for extension whose NID is 'nid' and return | ||
| 537 | the parsed result of NULL if an error occurred. For example: | ||
| 538 | |||
| 539 | BASIC_CONSTRAINTS *bs; | ||
| 540 | bs = X509_get_ext_d2i(cert, NID_basic_constraints, NULL, NULL); | ||
| 541 | |||
| 542 | This will search for the basicConstraints extension and either return | ||
| 543 | it value or NULL. NULL can mean either the extension was not found, it | ||
| 544 | occurred more than once or it could not be parsed. | ||
| 545 | |||
| 546 | If 'idx' is NULL then an extension is only parsed if it occurs precisely | ||
| 547 | once. This is standard behaviour because extensions normally cannot occur | ||
| 548 | more than once. If however more than one extension of the same type can | ||
| 549 | occur it can be used to parse successive extensions for example: | ||
| 550 | |||
| 551 | int i; | ||
| 552 | void *ext; | ||
| 553 | |||
| 554 | i = -1; | ||
| 555 | for(;;) { | ||
| 556 | ext = X509_get_ext_d2i(x, nid, crit, &idx); | ||
| 557 | if(ext == NULL) break; | ||
| 558 | /* Do something with ext */ | ||
| 559 | } | ||
| 560 | |||
| 561 | If 'crit' is not NULL and the extension was found then the int it points to | ||
| 562 | is set to 1 for critical extensions and 0 for non critical. Therefore if the | ||
| 563 | function returns NULL but 'crit' is set to 0 or 1 then the extension was | ||
| 564 | found but it could not be parsed. | ||
| 565 | |||
| 566 | The int pointed to by crit will be set to -1 if the extension was not found | ||
| 567 | and -2 if the extension occurred more than once (this will only happen if | ||
| 568 | idx is NULL). In both cases the function will return NULL. | ||
| 569 | |||
| 570 | 3. Generating extensions. | ||
| 571 | |||
| 572 | An extension will typically be generated from a configuration file, or some | ||
| 573 | other kind of configuration database. | ||
| 574 | |||
| 575 | int X509V3_EXT_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, | ||
| 576 | X509 *cert); | ||
| 577 | int X509V3_EXT_CRL_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, | ||
| 578 | X509_CRL *crl); | ||
| 579 | |||
| 580 | These functions add all the extensions in the given section to the given | ||
| 581 | certificate or CRL. They will normally be called just before the certificate | ||
| 582 | or CRL is due to be signed. Both return 0 on error on non zero for success. | ||
| 583 | |||
| 584 | In each case 'conf' is the LHASH pointer of the configuration file to use | ||
| 585 | and 'section' is the section containing the extension details. | ||
| 586 | |||
| 587 | See the 'context functions' section for a description of the ctx parameter. | ||
| 588 | |||
| 589 | |||
| 590 | X509_EXTENSION *X509V3_EXT_conf(LHASH *conf, X509V3_CTX *ctx, char *name, | ||
| 591 | char *value); | ||
| 592 | |||
| 593 | This function returns an extension based on a name and value pair, if the | ||
| 594 | pair will not need to access other sections in a config file (or there is no | ||
| 595 | config file) then the 'conf' parameter can be set to NULL. | ||
| 596 | |||
| 597 | X509_EXTENSION *X509V3_EXT_conf_nid(char *conf, X509V3_CTX *ctx, int nid, | ||
| 598 | char *value); | ||
| 599 | |||
| 600 | This function creates an extension in the same way as X509V3_EXT_conf() but | ||
| 601 | takes the NID of the extension rather than its name. | ||
| 602 | |||
| 603 | For example to produce basicConstraints with the CA flag and a path length of | ||
| 604 | 10: | ||
| 605 | |||
| 606 | x = X509V3_EXT_conf_nid(NULL, NULL, NID_basic_constraints,"CA:TRUE,pathlen:10"); | ||
| 607 | |||
| 608 | |||
| 609 | X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc); | ||
| 610 | |||
| 611 | This function sets up an extension from its internal structure. The ext_nid | ||
| 612 | parameter is the NID of the extension and 'crit' is the critical flag. | ||
| 613 | |||
| 614 | 4. Context functions. | ||
| 615 | |||
| 616 | The following functions set and manipulate an extension context structure. | ||
| 617 | The purpose of the extension context is to allow the extension code to | ||
| 618 | access various structures relating to the "environment" of the certificate: | ||
| 619 | for example the issuers certificate or the certificate request. | ||
| 620 | |||
| 621 | void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subject, | ||
| 622 | X509_REQ *req, X509_CRL *crl, int flags); | ||
| 623 | |||
| 624 | This function sets up an X509V3_CTX structure with details of the certificate | ||
| 625 | environment: specifically the issuers certificate, the subject certificate, | ||
| 626 | the certificate request and the CRL: if these are not relevant or not | ||
| 627 | available then they can be set to NULL. The 'flags' parameter should be set | ||
| 628 | to zero. | ||
| 629 | |||
| 630 | X509V3_set_ctx_test(ctx) | ||
| 631 | |||
| 632 | This macro is used to set the 'ctx' structure to a 'test' value: this is to | ||
| 633 | allow the syntax of an extension (or configuration file) to be tested. | ||
| 634 | |||
| 635 | X509V3_set_ctx_nodb(ctx) | ||
| 636 | |||
| 637 | This macro is used when no configuration database is present. | ||
| 638 | |||
| 639 | void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH *lhash); | ||
| 640 | |||
| 641 | This function is used to set the configuration database when it is an LHASH | ||
| 642 | structure: typically a configuration file. | ||
| 643 | |||
| 644 | The following functions are used to access a configuration database: they | ||
| 645 | should only be used in RAW extensions. | ||
| 646 | |||
| 647 | char * X509V3_get_string(X509V3_CTX *ctx, char *name, char *section); | ||
| 648 | |||
| 649 | This function returns the value of the parameter "name" in "section", or NULL | ||
| 650 | if there has been an error. | ||
| 651 | |||
| 652 | void X509V3_string_free(X509V3_CTX *ctx, char *str); | ||
| 653 | |||
| 654 | This function frees up the string returned by the above function. | ||
| 655 | |||
| 656 | STACK_OF(CONF_VALUE) * X509V3_get_section(X509V3_CTX *ctx, char *section); | ||
| 657 | |||
| 658 | This function returns a whole section as a STACK_OF(CONF_VALUE) . | ||
| 659 | |||
| 660 | void X509V3_section_free( X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *section); | ||
| 661 | |||
| 662 | This function frees up the STACK returned by the above function. | ||
| 663 | |||
| 664 | Note: it is possible to use the extension code with a custom configuration | ||
| 665 | database. To do this the "db_meth" element of the X509V3_CTX structure should | ||
| 666 | be set to an X509V3_CTX_METHOD structure. This structure contains the following | ||
| 667 | function pointers: | ||
| 668 | |||
| 669 | char * (*get_string)(void *db, char *section, char *value); | ||
| 670 | STACK_OF(CONF_VALUE) * (*get_section)(void *db, char *section); | ||
| 671 | void (*free_string)(void *db, char * string); | ||
| 672 | void (*free_section)(void *db, STACK_OF(CONF_VALUE) *section); | ||
| 673 | |||
| 674 | these will be called and passed the 'db' element in the X509V3_CTX structure | ||
| 675 | to access the database. If a given function is not implemented or not required | ||
| 676 | it can be set to NULL. | ||
| 677 | |||
| 678 | 5. String helper functions. | ||
| 679 | |||
| 680 | There are several "i2s" and "s2i" functions that convert structures to and | ||
| 681 | from ASCII strings. In all the "i2s" cases the returned string should be | ||
| 682 | freed using Free() after use. Since some of these are part of other extension | ||
| 683 | code they may take a 'method' parameter. Unless otherwise stated it can be | ||
| 684 | safely set to NULL. | ||
| 685 | |||
| 686 | char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *oct); | ||
| 687 | |||
| 688 | This returns a hex string from an ASN1_OCTET_STRING. | ||
| 689 | |||
| 690 | char * i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint); | ||
| 691 | char * i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint); | ||
| 692 | |||
| 693 | These return a string decimal representations of an ASN1_INTEGER and an | ||
| 694 | ASN1_ENUMERATED type, respectively. | ||
| 695 | |||
| 696 | ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, | ||
| 697 | X509V3_CTX *ctx, char *str); | ||
| 698 | |||
| 699 | This converts an ASCII hex string to an ASN1_OCTET_STRING. | ||
| 700 | |||
| 701 | ASN1_INTEGER * s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, char *value); | ||
| 702 | |||
| 703 | This converts a decimal ASCII string into an ASN1_INTEGER. | ||
| 704 | |||
| 705 | 6. Multi valued extension helper functions. | ||
| 706 | |||
| 707 | The following functions can be used to manipulate STACKs of CONF_VALUE | ||
| 708 | structures, as used by multi valued extensions. | ||
| 709 | |||
| 710 | int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool); | ||
| 711 | |||
| 712 | This function expects a boolean value in 'value' and sets 'asn1_bool' to | ||
| 713 | it. That is it sets it to 0 for FALSE or 0xff for TRUE. The following | ||
| 714 | strings are acceptable: "TRUE", "true", "Y", "y", "YES", "yes", "FALSE" | ||
| 715 | "false", "N", "n", "NO" or "no". | ||
| 716 | |||
| 717 | int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint); | ||
| 718 | |||
| 719 | This accepts a decimal integer of arbitrary length and sets an ASN1_INTEGER. | ||
| 720 | |||
| 721 | int X509V3_add_value(const char *name, const char *value, | ||
| 722 | STACK_OF(CONF_VALUE) **extlist); | ||
| 723 | |||
| 724 | This simply adds a string name and value pair. | ||
| 725 | |||
| 726 | int X509V3_add_value_uchar(const char *name, const unsigned char *value, | ||
| 727 | STACK_OF(CONF_VALUE) **extlist); | ||
| 728 | |||
| 729 | The same as above but for an unsigned character value. | ||
| 730 | |||
| 731 | int X509V3_add_value_bool(const char *name, int asn1_bool, | ||
| 732 | STACK_OF(CONF_VALUE) **extlist); | ||
| 733 | |||
| 734 | This adds either "TRUE" or "FALSE" depending on the value of 'asn1_bool' | ||
| 735 | |||
| 736 | int X509V3_add_value_bool_nf(char *name, int asn1_bool, | ||
| 737 | STACK_OF(CONF_VALUE) **extlist); | ||
| 738 | |||
| 739 | This is the same as above except it adds nothing if asn1_bool is FALSE. | ||
| 740 | |||
| 741 | int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint, | ||
| 742 | STACK_OF(CONF_VALUE) **extlist); | ||
| 743 | |||
| 744 | This function adds the value of the ASN1_INTEGER in decimal form. | ||
| 745 | |||
| 746 | 7. Other helper functions. | ||
| 747 | |||
| 748 | <to be added> | ||
| 749 | |||
| 750 | ADDING CUSTOM EXTENSIONS. | ||
| 751 | |||
| 752 | Currently there are three types of supported extensions. | ||
| 753 | |||
| 754 | String extensions are simple strings where the value is placed directly in the | ||
| 755 | extensions, and the string returned is printed out. | ||
| 756 | |||
| 757 | Multi value extensions are passed a STACK_OF(CONF_VALUE) name and value pairs | ||
| 758 | or return a STACK_OF(CONF_VALUE). | ||
| 759 | |||
| 760 | Raw extensions are just passed a BIO or a value and it is the extensions | ||
| 761 | responsibility to handle all the necessary printing. | ||
| 762 | |||
| 763 | There are two ways to add an extension. One is simply as an alias to an already | ||
| 764 | existing extension. An alias is an extension that is identical in ASN1 structure | ||
| 765 | to an existing extension but has a different OBJECT IDENTIFIER. This can be | ||
| 766 | done by calling: | ||
| 767 | |||
| 768 | int X509V3_EXT_add_alias(int nid_to, int nid_from); | ||
| 769 | |||
| 770 | 'nid_to' is the new extension NID and 'nid_from' is the already existing | ||
| 771 | extension NID. | ||
| 772 | |||
| 773 | Alternatively an extension can be written from scratch. This involves writing | ||
| 774 | the ASN1 code to encode and decode the extension and functions to print out and | ||
| 775 | generate the extension from strings. The relevant functions are then placed in | ||
| 776 | a X509V3_EXT_METHOD structure and int X509V3_EXT_add(X509V3_EXT_METHOD *ext); | ||
| 777 | called. | ||
| 778 | |||
| 779 | The X509V3_EXT_METHOD structure is described below. | ||
| 780 | |||
| 781 | struct { | ||
| 782 | int ext_nid; | ||
| 783 | int ext_flags; | ||
| 784 | X509V3_EXT_NEW ext_new; | ||
| 785 | X509V3_EXT_FREE ext_free; | ||
| 786 | X509V3_EXT_D2I d2i; | ||
| 787 | X509V3_EXT_I2D i2d; | ||
| 788 | X509V3_EXT_I2S i2s; | ||
| 789 | X509V3_EXT_S2I s2i; | ||
| 790 | X509V3_EXT_I2V i2v; | ||
| 791 | X509V3_EXT_V2I v2i; | ||
| 792 | X509V3_EXT_R2I r2i; | ||
| 793 | X509V3_EXT_I2R i2r; | ||
| 794 | |||
| 795 | void *usr_data; | ||
| 796 | }; | ||
| 797 | |||
| 798 | The elements have the following meanings. | ||
| 799 | |||
| 800 | ext_nid is the NID of the object identifier of the extension. | ||
| 801 | |||
| 802 | ext_flags is set of flags. Currently the only external flag is | ||
| 803 | X509V3_EXT_MULTILINE which means a multi valued extensions | ||
| 804 | should be printed on separate lines. | ||
| 805 | |||
| 806 | usr_data is an extension specific pointer to any relevant data. This | ||
| 807 | allows extensions to share identical code but have different | ||
| 808 | uses. An example of this is the bit string extension which uses | ||
| 809 | usr_data to contain a list of the bit names. | ||
| 810 | |||
| 811 | All the remaining elements are function pointers. | ||
| 812 | |||
| 813 | ext_new is a pointer to a function that allocates memory for the | ||
| 814 | extension ASN1 structure: for example ASN1_OBJECT_new(). | ||
| 815 | |||
| 816 | ext_free is a pointer to a function that free up memory of the extension | ||
| 817 | ASN1 structure: for example ASN1_OBJECT_free(). | ||
| 818 | |||
| 819 | d2i is the standard ASN1 function that converts a DER buffer into | ||
| 820 | the internal ASN1 structure: for example d2i_ASN1_IA5STRING(). | ||
| 821 | |||
| 822 | i2d is the standard ASN1 function that converts the internal | ||
| 823 | structure into the DER representation: for example | ||
| 824 | i2d_ASN1_IA5STRING(). | ||
| 825 | |||
| 826 | The remaining functions are depend on the type of extension. One i2X and | ||
| 827 | one X2i should be set and the rest set to NULL. The types set do not need | ||
| 828 | to match up, for example the extension could be set using the multi valued | ||
| 829 | v2i function and printed out using the raw i2r. | ||
| 830 | |||
| 831 | All functions have the X509V3_EXT_METHOD passed to them in the 'method' | ||
| 832 | parameter and an X509V3_CTX structure. Extension code can then access the | ||
| 833 | parent structure via the 'method' parameter to for example make use of the value | ||
| 834 | of usr_data. If the code needs to use detail relating to the request it can | ||
| 835 | use the 'ctx' parameter. | ||
| 836 | |||
| 837 | A note should be given here about the 'flags' member of the 'ctx' parameter. | ||
| 838 | If it has the value CTX_TEST then the configuration syntax is being checked | ||
| 839 | and no actual certificate or CRL exists. Therefore any attempt in the config | ||
| 840 | file to access such information should silently succeed. If the syntax is OK | ||
| 841 | then it should simply return a (possibly bogus) extension, otherwise it | ||
| 842 | should return NULL. | ||
| 843 | |||
| 844 | char *i2s(struct v3_ext_method *method, void *ext); | ||
| 845 | |||
| 846 | This function takes the internal structure in the ext parameter and returns | ||
| 847 | a Malloc'ed string representing its value. | ||
| 848 | |||
| 849 | void * s2i(struct v3_ext_method *method, struct v3_ext_ctx *ctx, char *str); | ||
| 850 | |||
| 851 | This function takes the string representation in the ext parameter and returns | ||
| 852 | an allocated internal structure: ext_free() will be used on this internal | ||
| 853 | structure after use. | ||
| 854 | |||
| 855 | i2v and v2i handle a STACK_OF(CONF_VALUE): | ||
| 856 | |||
| 857 | typedef struct | ||
| 858 | { | ||
| 859 | char *section; | ||
| 860 | char *name; | ||
| 861 | char *value; | ||
| 862 | } CONF_VALUE; | ||
| 863 | |||
| 864 | Only the name and value members are currently used. | ||
| 865 | |||
| 866 | STACK_OF(CONF_VALUE) * i2v(struct v3_ext_method *method, void *ext); | ||
| 867 | |||
| 868 | This function is passed the internal structure in the ext parameter and | ||
| 869 | returns a STACK of CONF_VALUE structures. The values of name, value, | ||
| 870 | section and the structure itself will be freed up with Free after use. | ||
| 871 | Several helper functions are available to add values to this STACK. | ||
| 872 | |||
| 873 | void * v2i(struct v3_ext_method *method, struct v3_ext_ctx *ctx, | ||
| 874 | STACK_OF(CONF_VALUE) *values); | ||
| 875 | |||
| 876 | This function takes a STACK_OF(CONF_VALUE) structures and should set the | ||
| 877 | values of the external structure. This typically uses the name element to | ||
| 878 | determine which structure element to set and the value element to determine | ||
| 879 | what to set it to. Several helper functions are available for this | ||
| 880 | purpose (see above). | ||
| 881 | |||
| 882 | int i2r(struct v3_ext_method *method, void *ext, BIO *out, int indent); | ||
| 883 | |||
| 884 | This function is passed the internal extension structure in the ext parameter | ||
| 885 | and sends out a human readable version of the extension to out. The 'indent' | ||
| 886 | parameter should be noted to determine the necessary amount of indentation | ||
| 887 | needed on the output. | ||
| 888 | |||
| 889 | void * r2i(struct v3_ext_method *method, struct v3_ext_ctx *ctx, char *str); | ||
| 890 | |||
| 891 | This is just passed the string representation of the extension. It is intended | ||
| 892 | to be used for more elaborate extensions where the standard single and multi | ||
| 893 | valued options are insufficient. They can use the 'ctx' parameter to parse the | ||
| 894 | configuration database themselves. See the context functions section for details | ||
| 895 | of how to do this. | ||
| 896 | |||
| 897 | Note: although this type takes the same parameters as the "r2s" function there | ||
| 898 | is a subtle difference. Whereas an "r2i" function can access a configuration | ||
| 899 | database an "s2i" function MUST NOT. This is so the internal code can safely | ||
| 900 | assume that an "s2i" function will work without a configuration database. | ||
| 901 | |||
| 902 | ============================================================================== | ||
| 903 | PKCS#12 Library | ||
| 904 | ============================================================================== | ||
| 905 | |||
| 906 | This section describes the internal PKCS#12 support. There are very few | ||
| 907 | differences between the old external library and the new internal code at | ||
| 908 | present. This may well change because the external library will not be updated | ||
| 909 | much in future. | ||
| 910 | |||
| 911 | This version now includes a couple of high level PKCS#12 functions which | ||
| 912 | generally "do the right thing" and should make it much easier to handle PKCS#12 | ||
| 913 | structures. | ||
| 914 | |||
| 915 | HIGH LEVEL FUNCTIONS. | ||
| 916 | |||
| 917 | For most applications you only need concern yourself with the high level | ||
| 918 | functions. They can parse and generate simple PKCS#12 files as produced by | ||
| 919 | Netscape and MSIE or indeed any compliant PKCS#12 file containing a single | ||
| 920 | private key and certificate pair. | ||
| 921 | |||
| 922 | 1. Initialisation and cleanup. | ||
| 923 | |||
| 924 | No special initialisation is needed for the internal PKCS#12 library: the | ||
| 925 | standard SSLeay_add_all_algorithms() is sufficient. If you do not wish to | ||
| 926 | add all algorithms (you should at least add SHA1 though) then you can manually | ||
| 927 | initialise the PKCS#12 library with: | ||
| 928 | |||
| 929 | PKCS12_PBE_add(); | ||
| 930 | |||
| 931 | The memory allocated by the PKCS#12 library is freed up when EVP_cleanup() is | ||
| 932 | called or it can be directly freed with: | ||
| 933 | |||
| 934 | EVP_PBE_cleanup(); | ||
| 935 | |||
| 936 | after this call (or EVP_cleanup() ) no more PKCS#12 library functions should | ||
| 937 | be called. | ||
| 938 | |||
| 939 | 2. I/O functions. | ||
| 940 | |||
| 941 | i2d_PKCS12_bio(bp, p12) | ||
| 942 | |||
| 943 | This writes out a PKCS12 structure to a BIO. | ||
| 944 | |||
| 945 | i2d_PKCS12_fp(fp, p12) | ||
| 946 | |||
| 947 | This is the same but for a FILE pointer. | ||
| 948 | |||
| 949 | d2i_PKCS12_bio(bp, p12) | ||
| 950 | |||
| 951 | This reads in a PKCS12 structure from a BIO. | ||
| 952 | |||
| 953 | d2i_PKCS12_fp(fp, p12) | ||
| 954 | |||
| 955 | This is the same but for a FILE pointer. | ||
| 956 | |||
| 957 | 3. High level functions. | ||
| 958 | |||
| 959 | 3.1 Parsing with PKCS12_parse(). | ||
| 960 | |||
| 961 | int PKCS12_parse(PKCS12 *p12, char *pass, EVP_PKEY **pkey, X509 **cert, | ||
| 962 | STACK **ca); | ||
| 963 | |||
| 964 | This function takes a PKCS12 structure and a password (ASCII, null terminated) | ||
| 965 | and returns the private key, the corresponding certificate and any CA | ||
| 966 | certificates. If any of these is not required it can be passed as a NULL. | ||
| 967 | The 'ca' parameter should be either NULL, a pointer to NULL or a valid STACK | ||
| 968 | structure. Typically to read in a PKCS#12 file you might do: | ||
| 969 | |||
| 970 | p12 = d2i_PKCS12_fp(fp, NULL); | ||
| 971 | PKCS12_parse(p12, password, &pkey, &cert, NULL); /* CAs not wanted */ | ||
| 972 | PKCS12_free(p12); | ||
| 973 | |||
| 974 | 3.2 PKCS#12 creation with PKCS12_create(). | ||
| 975 | |||
| 976 | PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, | ||
| 977 | STACK *ca, int nid_key, int nid_cert, int iter, | ||
| 978 | int mac_iter, int keytype); | ||
| 979 | |||
| 980 | This function will create a PKCS12 structure from a given password, name, | ||
| 981 | private key, certificate and optional STACK of CA certificates. The remaining | ||
| 982 | 5 parameters can be set to 0 and sensible defaults will be used. | ||
| 983 | |||
| 984 | The parameters nid_key and nid_cert are the key and certificate encryption | ||
| 985 | algorithms, iter is the encryption iteration count, mac_iter is the MAC | ||
| 986 | iteration count and keytype is the type of private key. If you really want | ||
| 987 | to know what these last 5 parameters do then read the low level section. | ||
| 988 | |||
| 989 | Typically to create a PKCS#12 file the following could be used: | ||
| 990 | |||
| 991 | p12 = PKCS12_create(pass, "My Certificate", pkey, cert, NULL, 0,0,0,0,0); | ||
| 992 | i2d_PKCS12_fp(fp, p12); | ||
| 993 | PKCS12_free(p12); | ||
| 994 | |||
| 995 | 3.3 Changing a PKCS#12 structure password. | ||
| 996 | |||
| 997 | int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass); | ||
| 998 | |||
| 999 | This changes the password of an already existing PKCS#12 structure. oldpass | ||
| 1000 | is the old password and newpass is the new one. An error occurs if the old | ||
| 1001 | password is incorrect. | ||
| 1002 | |||
| 1003 | LOW LEVEL FUNCTIONS. | ||
| 1004 | |||
| 1005 | In some cases the high level functions do not provide the necessary | ||
| 1006 | functionality. For example if you want to generate or parse more complex | ||
| 1007 | PKCS#12 files. The sample pkcs12 application uses the low level functions | ||
| 1008 | to display details about the internal structure of a PKCS#12 file. | ||
| 1009 | |||
| 1010 | Introduction. | ||
| 1011 | |||
| 1012 | This is a brief description of how a PKCS#12 file is represented internally: | ||
| 1013 | some knowledge of PKCS#12 is assumed. | ||
| 1014 | |||
| 1015 | A PKCS#12 object contains several levels. | ||
| 1016 | |||
| 1017 | At the lowest level is a PKCS12_SAFEBAG. This can contain a certificate, a | ||
| 1018 | CRL, a private key, encrypted or unencrypted, a set of safebags (so the | ||
| 1019 | structure can be nested) or other secrets (not documented at present). | ||
| 1020 | A safebag can optionally have attributes, currently these are: a unicode | ||
| 1021 | friendlyName (a Unicode string) or a localKeyID (a string of bytes). | ||
| 1022 | |||
| 1023 | At the next level is an authSafe which is a set of safebags collected into | ||
| 1024 | a PKCS#7 ContentInfo. This can be just plain data, or encrypted itself. | ||
| 1025 | |||
| 1026 | At the top level is the PKCS12 structure itself which contains a set of | ||
| 1027 | authSafes in an embedded PKCS#7 Contentinfo of type data. In addition it | ||
| 1028 | contains a MAC which is a kind of password protected digest to preserve | ||
| 1029 | integrity (so any unencrypted stuff below can't be tampered with). | ||
| 1030 | |||
| 1031 | The reason for these levels is so various objects can be encrypted in various | ||
| 1032 | ways. For example you might want to encrypt a set of private keys with | ||
| 1033 | triple-DES and then include the related certificates either unencrypted or | ||
| 1034 | with lower encryption. Yes it's the dreaded crypto laws at work again which | ||
| 1035 | allow strong encryption on private keys and only weak encryption on other | ||
| 1036 | stuff. | ||
| 1037 | |||
| 1038 | To build one of these things you turn all certificates and keys into safebags | ||
| 1039 | (with optional attributes). You collect the safebags into (one or more) STACKS | ||
| 1040 | and convert these into authsafes (encrypted or unencrypted). The authsafes | ||
| 1041 | are collected into a STACK and added to a PKCS12 structure. Finally a MAC | ||
| 1042 | inserted. | ||
| 1043 | |||
| 1044 | Pulling one apart is basically the reverse process. The MAC is verified against | ||
| 1045 | the given password. The authsafes are extracted and each authsafe split into | ||
| 1046 | a set of safebags (possibly involving decryption). Finally the safebags are | ||
| 1047 | decomposed into the original keys and certificates and the attributes used to | ||
| 1048 | match up private key and certificate pairs. | ||
| 1049 | |||
| 1050 | Anyway here are the functions that do the dirty work. | ||
| 1051 | |||
| 1052 | 1. Construction functions. | ||
| 1053 | |||
| 1054 | 1.1 Safebag functions. | ||
| 1055 | |||
| 1056 | M_PKCS12_x5092certbag(x509) | ||
| 1057 | |||
| 1058 | This macro takes an X509 structure and returns a certificate bag. The | ||
| 1059 | X509 structure can be freed up after calling this function. | ||
| 1060 | |||
| 1061 | M_PKCS12_x509crl2certbag(crl) | ||
| 1062 | |||
| 1063 | As above but for a CRL. | ||
| 1064 | |||
| 1065 | PKCS8_PRIV_KEY_INFO *PKEY2PKCS8(EVP_PKEY *pkey) | ||
| 1066 | |||
| 1067 | Take a private key and convert it into a PKCS#8 PrivateKeyInfo structure. | ||
| 1068 | Works for both RSA and DSA private keys. NB since the PKCS#8 PrivateKeyInfo | ||
| 1069 | structure contains a private key data in plain text form it should be free'd | ||
| 1070 | up as soon as it has been encrypted for security reasons (freeing up the | ||
| 1071 | structure zeros out the sensitive data). This can be done with | ||
| 1072 | PKCS8_PRIV_KEY_INFO_free(). | ||
| 1073 | |||
| 1074 | PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage) | ||
| 1075 | |||
| 1076 | This sets the key type when a key is imported into MSIE or Outlook 98. Two | ||
| 1077 | values are currently supported: KEY_EX and KEY_SIG. KEY_EX is an exchange type | ||
| 1078 | key that can also be used for signing but its size is limited in the export | ||
| 1079 | versions of MS software to 512 bits, it is also the default. KEY_SIG is a | ||
| 1080 | signing only key but the keysize is unlimited (well 16K is supposed to work). | ||
| 1081 | If you are using the domestic version of MSIE then you can ignore this because | ||
| 1082 | KEY_EX is not limited and can be used for both. | ||
| 1083 | |||
| 1084 | PKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG(PKCS8_PRIV_KEY_INFO *p8) | ||
| 1085 | |||
| 1086 | Convert a PKCS8 private key structure into a keybag. This routine embeds the | ||
| 1087 | p8 structure in the keybag so p8 should not be freed up or used after it is | ||
| 1088 | called. The p8 structure will be freed up when the safebag is freed. | ||
| 1089 | |||
| 1090 | PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG(int pbe_nid, unsigned char *pass, int passlen, unsigned char *salt, int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8) | ||
| 1091 | |||
| 1092 | Convert a PKCS#8 structure into a shrouded key bag (encrypted). p8 is not | ||
| 1093 | embedded and can be freed up after use. | ||
| 1094 | |||
| 1095 | int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, int namelen) | ||
| 1096 | int PKCS12_add_friendlyname(PKCS12_SAFEBAG *bag, unsigned char *name, int namelen) | ||
| 1097 | |||
| 1098 | Add a local key id or a friendlyname to a safebag. | ||
| 1099 | |||
| 1100 | 1.2 Authsafe functions. | ||
| 1101 | |||
| 1102 | PKCS7 *PKCS12_pack_p7data(STACK *sk) | ||
| 1103 | Take a stack of safebags and convert them into an unencrypted authsafe. The | ||
| 1104 | stack of safebags can be freed up after calling this function. | ||
| 1105 | |||
| 1106 | PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, unsigned char *pass, int passlen, unsigned char *salt, int saltlen, int iter, STACK *bags); | ||
| 1107 | |||
| 1108 | As above but encrypted. | ||
| 1109 | |||
| 1110 | 1.3 PKCS12 functions. | ||
| 1111 | |||
| 1112 | PKCS12 *PKCS12_init(int mode) | ||
| 1113 | |||
| 1114 | Initialise a PKCS12 structure (currently mode should be NID_pkcs7_data). | ||
| 1115 | |||
| 1116 | M_PKCS12_pack_authsafes(p12, safes) | ||
| 1117 | |||
| 1118 | This macro takes a STACK of authsafes and adds them to a PKCS#12 structure. | ||
| 1119 | |||
| 1120 | int PKCS12_set_mac(PKCS12 *p12, unsigned char *pass, int passlen, unsigned char *salt, int saltlen, int iter, EVP_MD *md_type); | ||
| 1121 | |||
| 1122 | Add a MAC to a PKCS12 structure. If EVP_MD is NULL use SHA-1, the spec suggests | ||
| 1123 | that SHA-1 should be used. | ||
| 1124 | |||
| 1125 | 2. Extraction Functions. | ||
| 1126 | |||
| 1127 | 2.1 Safebags. | ||
| 1128 | |||
| 1129 | M_PKCS12_bag_type(bag) | ||
| 1130 | |||
| 1131 | Return the type of "bag". Returns one of the following | ||
| 1132 | |||
| 1133 | NID_keyBag | ||
| 1134 | NID_pkcs8ShroudedKeyBag 7 | ||
| 1135 | NID_certBag 8 | ||
| 1136 | NID_crlBag 9 | ||
| 1137 | NID_secretBag 10 | ||
| 1138 | NID_safeContentsBag 11 | ||
| 1139 | |||
| 1140 | M_PKCS12_cert_bag_type(bag) | ||
| 1141 | |||
| 1142 | Returns type of certificate bag, following are understood. | ||
| 1143 | |||
| 1144 | NID_x509Certificate 14 | ||
| 1145 | NID_sdsiCertificate 15 | ||
| 1146 | |||
| 1147 | M_PKCS12_crl_bag_type(bag) | ||
| 1148 | |||
| 1149 | Returns crl bag type, currently only NID_crlBag is recognised. | ||
| 1150 | |||
| 1151 | M_PKCS12_certbag2x509(bag) | ||
| 1152 | |||
| 1153 | This macro extracts an X509 certificate from a certificate bag. | ||
| 1154 | |||
| 1155 | M_PKCS12_certbag2x509crl(bag) | ||
| 1156 | |||
| 1157 | As above but for a CRL. | ||
| 1158 | |||
| 1159 | EVP_PKEY * PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8) | ||
| 1160 | |||
| 1161 | Extract a private key from a PKCS8 private key info structure. | ||
| 1162 | |||
| 1163 | M_PKCS12_decrypt_skey(bag, pass, passlen) | ||
| 1164 | |||
| 1165 | Decrypt a shrouded key bag and return a PKCS8 private key info structure. | ||
| 1166 | Works with both RSA and DSA keys | ||
| 1167 | |||
| 1168 | char *PKCS12_get_friendlyname(bag) | ||
| 1169 | |||
| 1170 | Returns the friendlyName of a bag if present or NULL if none. The returned | ||
| 1171 | string is a null terminated ASCII string allocated with Malloc(). It should | ||
| 1172 | thus be freed up with Free() after use. | ||
| 1173 | |||
| 1174 | 2.2 AuthSafe functions. | ||
| 1175 | |||
| 1176 | M_PKCS12_unpack_p7data(p7) | ||
| 1177 | |||
| 1178 | Extract a STACK of safe bags from a PKCS#7 data ContentInfo. | ||
| 1179 | |||
| 1180 | #define M_PKCS12_unpack_p7encdata(p7, pass, passlen) | ||
| 1181 | |||
| 1182 | As above but for an encrypted content info. | ||
| 1183 | |||
| 1184 | 2.3 PKCS12 functions. | ||
| 1185 | |||
| 1186 | M_PKCS12_unpack_authsafes(p12) | ||
| 1187 | |||
| 1188 | Extract a STACK of authsafes from a PKCS12 structure. | ||
| 1189 | |||
| 1190 | M_PKCS12_mac_present(p12) | ||
| 1191 | |||
| 1192 | Check to see if a MAC is present. | ||
| 1193 | |||
| 1194 | int PKCS12_verify_mac(PKCS12 *p12, unsigned char *pass, int passlen) | ||
| 1195 | |||
| 1196 | Verify a MAC on a PKCS12 structure. Returns an error if MAC not present. | ||
| 1197 | |||
| 1198 | |||
| 1199 | Notes. | ||
| 1200 | |||
| 1201 | 1. All the function return 0 or NULL on error. | ||
| 1202 | 2. Encryption based functions take a common set of parameters. These are | ||
| 1203 | described below. | ||
| 1204 | |||
| 1205 | pass, passlen | ||
| 1206 | ASCII password and length. The password on the MAC is called the "integrity | ||
| 1207 | password" the encryption password is called the "privacy password" in the | ||
| 1208 | PKCS#12 documentation. The passwords do not have to be the same. If -1 is | ||
| 1209 | passed for the length it is worked out by the function itself (currently | ||
| 1210 | this is sometimes done whatever is passed as the length but that may change). | ||
| 1211 | |||
| 1212 | salt, saltlen | ||
| 1213 | A 'salt' if salt is NULL a random salt is used. If saltlen is also zero a | ||
| 1214 | default length is used. | ||
| 1215 | |||
| 1216 | iter | ||
| 1217 | Iteration count. This is a measure of how many times an internal function is | ||
| 1218 | called to encrypt the data. The larger this value is the longer it takes, it | ||
| 1219 | makes dictionary attacks on passwords harder. NOTE: Some implementations do | ||
| 1220 | not support an iteration count on the MAC. If the password for the MAC and | ||
| 1221 | encryption is the same then there is no point in having a high iteration | ||
| 1222 | count for encryption if the MAC has no count. The MAC could be attacked | ||
| 1223 | and the password used for the main decryption. | ||
| 1224 | |||
| 1225 | pbe_nid | ||
| 1226 | This is the NID of the password based encryption method used. The following are | ||
| 1227 | supported. | ||
| 1228 | NID_pbe_WithSHA1And128BitRC4 | ||
| 1229 | NID_pbe_WithSHA1And40BitRC4 | ||
| 1230 | NID_pbe_WithSHA1And3_Key_TripleDES_CBC | ||
| 1231 | NID_pbe_WithSHA1And2_Key_TripleDES_CBC | ||
| 1232 | NID_pbe_WithSHA1And128BitRC2_CBC | ||
| 1233 | NID_pbe_WithSHA1And40BitRC2_CBC | ||
| 1234 | |||
| 1235 | Which you use depends on the implementation you are exporting to. "Export | ||
| 1236 | grade" (i.e. cryptographically challenged) products cannot support all | ||
| 1237 | algorithms. Typically you may be able to use any encryption on shrouded key | ||
| 1238 | bags but they must then be placed in an unencrypted authsafe. Other authsafes | ||
| 1239 | may only support 40bit encryption. Of course if you are using SSLeay | ||
| 1240 | throughout you can strongly encrypt everything and have high iteration counts | ||
| 1241 | on everything. | ||
| 1242 | |||
| 1243 | 3. For decryption routines only the password and length are needed. | ||
| 1244 | |||
| 1245 | 4. Unlike the external version the nid's of objects are the values of the | ||
| 1246 | constants: that is NID_certBag is the real nid, therefore there is no | ||
| 1247 | PKCS12_obj_offset() function. Note the object constants are not the same as | ||
| 1248 | those of the external version. If you use these constants then you will need | ||
| 1249 | to recompile your code. | ||
| 1250 | |||
| 1251 | 5. With the exception of PKCS12_MAKE_KEYBAG(), after calling any function or | ||
| 1252 | macro of the form PKCS12_MAKE_SOMETHING(other) the "other" structure can be | ||
| 1253 | reused or freed up safely. | ||
| 1254 | |||
diff --git a/src/lib/libssl/doc/ssl.3 b/src/lib/libssl/doc/ssl.3 deleted file mode 100644 index d87d7583c4..0000000000 --- a/src/lib/libssl/doc/ssl.3 +++ /dev/null | |||
| @@ -1,1320 +0,0 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: ssl.3,v 1.2 2014/12/02 14:11:01 jmc Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: December 2 2014 $ | ||
| 5 | .Dt SSL 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL | ||
| 9 | .Nd OpenSSL SSL/TLS library | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .Sh DESCRIPTION | ||
| 12 | The OpenSSL | ||
| 13 | .Nm ssl | ||
| 14 | library implements the Secure Sockets Layer (SSL v2/v3) and | ||
| 15 | Transport Layer Security (TLS v1) protocols. | ||
| 16 | It provides a rich API which is documented here. | ||
| 17 | .Pp | ||
| 18 | At first the library must be initialized; see | ||
| 19 | .Xr SSL_library_init 3 . | ||
| 20 | .Pp | ||
| 21 | Then an | ||
| 22 | .Vt SSL_CTX | ||
| 23 | object is created as a framework to establish TLS/SSL enabled connections (see | ||
| 24 | .Xr SSL_CTX_new 3 ) . | ||
| 25 | Various options regarding certificates, algorithms, etc., can be set in this | ||
| 26 | object. | ||
| 27 | .Pp | ||
| 28 | When a network connection has been created, it can be assigned to an | ||
| 29 | .Vt SSL | ||
| 30 | object. | ||
| 31 | After the | ||
| 32 | .Vt SSL | ||
| 33 | object has been created using | ||
| 34 | .Xr SSL_new 3 , | ||
| 35 | .Xr SSL_set_fd 3 | ||
| 36 | or | ||
| 37 | .Xr SSL_set_bio 3 | ||
| 38 | can be used to associate the network connection with the object. | ||
| 39 | .Pp | ||
| 40 | Then the TLS/SSL handshake is performed using | ||
| 41 | .Xr SSL_accept 3 | ||
| 42 | or | ||
| 43 | .Xr SSL_connect 3 | ||
| 44 | respectively. | ||
| 45 | .Xr SSL_read 3 | ||
| 46 | and | ||
| 47 | .Xr SSL_write 3 | ||
| 48 | are used to read and write data on the TLS/SSL connection. | ||
| 49 | .Xr SSL_shutdown 3 | ||
| 50 | can be used to shut down the TLS/SSL connection. | ||
| 51 | .Sh DATA STRUCTURES | ||
| 52 | Currently the OpenSSL | ||
| 53 | .Nm ssl | ||
| 54 | library functions deals with the following data structures: | ||
| 55 | .Bl -tag -width Ds | ||
| 56 | .It Vt SSL_METHOD No (SSL Method) | ||
| 57 | That's a dispatch structure describing the internal | ||
| 58 | .Nm ssl | ||
| 59 | library methods/functions which implement the various protocol versions | ||
| 60 | (SSLv1, SSLv2 and TLSv1). | ||
| 61 | It's needed to create an | ||
| 62 | .Vt SSL_CTX . | ||
| 63 | .It Vt SSL_CIPHER No (SSL Cipher) | ||
| 64 | This structure holds the algorithm information for a particular cipher which | ||
| 65 | is a core part of the SSL/TLS protocol. | ||
| 66 | The available ciphers are configured on an | ||
| 67 | .Vt SSL_CTX | ||
| 68 | basis and the actually used ones are then part of the | ||
| 69 | .Vt SSL_SESSION . | ||
| 70 | .It Vt SSL_CTX No (SSL Context) | ||
| 71 | That's the global context structure which is created by a server or client | ||
| 72 | once per program lifetime and which holds mainly default values for the | ||
| 73 | .Vt SSL | ||
| 74 | structures which are later created for the connections. | ||
| 75 | .It Vt SSL_SESSION No (SSL Session) | ||
| 76 | This is a structure containing the current TLS/SSL session details for a | ||
| 77 | connection: | ||
| 78 | .Vt SSL_CIPHER Ns s, client and server certificates, keys, etc. | ||
| 79 | .It Vt SSL No (SSL Connection) | ||
| 80 | That's the main SSL/TLS structure which is created by a server or client per | ||
| 81 | established connection. | ||
| 82 | This actually is the core structure in the SSL API. | ||
| 83 | Under run-time the application usually deals with this structure which has | ||
| 84 | links to mostly all other structures. | ||
| 85 | .El | ||
| 86 | .Sh HEADER FILES | ||
| 87 | Currently the OpenSSL | ||
| 88 | .Nm ssl | ||
| 89 | library provides the following C header files containing the prototypes for the | ||
| 90 | data structures and functions: | ||
| 91 | .Bl -tag -width Ds | ||
| 92 | .It Pa ssl.h | ||
| 93 | That's the common header file for the SSL/TLS API. | ||
| 94 | Include it into your program to make the API of the | ||
| 95 | .Nm ssl | ||
| 96 | library available. | ||
| 97 | It internally includes both more private SSL headers and headers from the | ||
| 98 | .Em crypto | ||
| 99 | library. | ||
| 100 | Whenever you need hardcore details on the internals of the SSL API, look inside | ||
| 101 | this header file. | ||
| 102 | .It Pa ssl2.h | ||
| 103 | That's the sub header file dealing with the SSLv2 protocol only. | ||
| 104 | .Bf Em | ||
| 105 | Usually you don't have to include it explicitly because it's already included | ||
| 106 | by | ||
| 107 | .Pa ssl.h . | ||
| 108 | .Ef | ||
| 109 | .It Pa ssl3.h | ||
| 110 | That's the sub header file dealing with the SSLv3 protocol only. | ||
| 111 | .Bf Em | ||
| 112 | Usually you don't have to include it explicitly because it's already included | ||
| 113 | by | ||
| 114 | .Pa ssl.h . | ||
| 115 | .Ef | ||
| 116 | .It Pa ssl23.h | ||
| 117 | That's the sub header file dealing with the combined use of the SSLv2 and SSLv3 | ||
| 118 | protocols. | ||
| 119 | .Bf Em | ||
| 120 | Usually you don't have to include it explicitly because it's already included | ||
| 121 | by | ||
| 122 | .Pa ssl.h . | ||
| 123 | .Ef | ||
| 124 | .It Pa tls1.h | ||
| 125 | That's the sub header file dealing with the TLSv1 protocol only. | ||
| 126 | .Bf Em | ||
| 127 | Usually you don't have to include it explicitly because it's already included | ||
| 128 | by | ||
| 129 | .Pa ssl.h . | ||
| 130 | .Ef | ||
| 131 | .El | ||
| 132 | .Sh API FUNCTIONS | ||
| 133 | The functions that the OpenSSL | ||
| 134 | .Nm ssl | ||
| 135 | library exports are documented below: | ||
| 136 | .Ss DEALING WITH PROTOCOL METHODS | ||
| 137 | Here we document the various API functions which deal with the SSL/TLS protocol | ||
| 138 | methods defined in | ||
| 139 | .Vt SSL_METHOD | ||
| 140 | structures. | ||
| 141 | .Bl -tag -width Ds | ||
| 142 | .It Xo | ||
| 143 | .Ft const SSL_METHOD * | ||
| 144 | .Fn SSLv2_client_method void | ||
| 145 | .Xc | ||
| 146 | Constructor for the SSLv2 | ||
| 147 | .Vt SSL_METHOD | ||
| 148 | structure for a dedicated client. | ||
| 149 | .It Xo | ||
| 150 | .Ft const SSL_METHOD * | ||
| 151 | .Fn SSLv2_server_method void | ||
| 152 | .Xc | ||
| 153 | Constructor for the SSLv2 | ||
| 154 | .Vt SSL_METHOD | ||
| 155 | structure for a dedicated server. | ||
| 156 | .It Xo | ||
| 157 | .Ft const SSL_METHOD * | ||
| 158 | .Fn SSLv2_method void | ||
| 159 | .Xc | ||
| 160 | Constructor for the SSLv2 | ||
| 161 | .Vt SSL_METHOD | ||
| 162 | structure for combined client and server. | ||
| 163 | .It Xo | ||
| 164 | .Ft const SSL_METHOD * | ||
| 165 | .Fn SSLv3_client_method void | ||
| 166 | .Xc | ||
| 167 | Constructor for the SSLv3 | ||
| 168 | .Vt SSL_METHOD | ||
| 169 | structure for a dedicated client. | ||
| 170 | .It Xo | ||
| 171 | .Ft const SSL_METHOD * | ||
| 172 | .Fn SSLv3_server_method void | ||
| 173 | .Xc | ||
| 174 | Constructor for the SSLv3 | ||
| 175 | .Vt SSL_METHOD | ||
| 176 | structure for a dedicated server. | ||
| 177 | .It Xo | ||
| 178 | .Ft const SSL_METHOD * | ||
| 179 | .Fn SSLv3_method void | ||
| 180 | .Xc | ||
| 181 | Constructor for the SSLv3 | ||
| 182 | .Vt SSL_METHOD | ||
| 183 | structure for combined client and server. | ||
| 184 | .It Xo | ||
| 185 | .Ft const SSL_METHOD * | ||
| 186 | .Fn TLSv1_client_method void | ||
| 187 | .Xc | ||
| 188 | Constructor for the TLSv1 | ||
| 189 | .Vt SSL_METHOD | ||
| 190 | structure for a dedicated client. | ||
| 191 | .It Xo | ||
| 192 | .Ft const SSL_METHOD * | ||
| 193 | .Fn TLSv1_server_method void | ||
| 194 | .Xc | ||
| 195 | Constructor for the TLSv1 | ||
| 196 | .Vt SSL_METHOD | ||
| 197 | structure for a dedicated server. | ||
| 198 | .It Xo | ||
| 199 | .Ft const SSL_METHOD * | ||
| 200 | .Fn TLSv1_method void | ||
| 201 | .Xc | ||
| 202 | Constructor for the TLSv1 | ||
| 203 | .Vt SSL_METHOD | ||
| 204 | structure for combined client and server. | ||
| 205 | .El | ||
| 206 | .Ss DEALING WITH CIPHERS | ||
| 207 | Here we document the various API functions which deal with the SSL/TLS ciphers | ||
| 208 | defined in | ||
| 209 | .Vt SSL_CIPHER | ||
| 210 | structures. | ||
| 211 | .Bl -tag -width Ds | ||
| 212 | .It Xo | ||
| 213 | .Ft char * | ||
| 214 | .Fn SSL_CIPHER_description "SSL_CIPHER *cipher" "char *buf" "int len" | ||
| 215 | .Xc | ||
| 216 | Write a string to | ||
| 217 | .Fa buf | ||
| 218 | (with a maximum size of | ||
| 219 | .Fa len ) | ||
| 220 | containing a human readable description of | ||
| 221 | .Fa cipher . | ||
| 222 | Returns | ||
| 223 | .Fa buf . | ||
| 224 | .It Xo | ||
| 225 | .Ft int | ||
| 226 | .Fn SSL_CIPHER_get_bits "SSL_CIPHER *cipher" "int *alg_bits" | ||
| 227 | .Xc | ||
| 228 | Determine the number of bits in | ||
| 229 | .Fa cipher . | ||
| 230 | Because of export crippled ciphers there are two bits: | ||
| 231 | the bits the algorithm supports in general (stored to | ||
| 232 | .Fa alg_bits ) | ||
| 233 | and the bits which are actually used (the return value). | ||
| 234 | .It Xo | ||
| 235 | .Ft const char * | ||
| 236 | .Fn SSL_CIPHER_get_name "SSL_CIPHER *cipher" | ||
| 237 | .Xc | ||
| 238 | Return the internal name of | ||
| 239 | .Fa cipher | ||
| 240 | as a string. | ||
| 241 | These are the various strings defined by the | ||
| 242 | .Dv SSL2_TXT_xxx , | ||
| 243 | .Dv SSL3_TXT_xxx | ||
| 244 | and | ||
| 245 | .Dv TLS1_TXT_xxx | ||
| 246 | definitions in the header files. | ||
| 247 | .It Xo | ||
| 248 | .Ft char * | ||
| 249 | .Fn SSL_CIPHER_get_version "SSL_CIPHER *cipher" | ||
| 250 | .Xc | ||
| 251 | Returns a string like | ||
| 252 | Qq TLSv1/SSLv3 | ||
| 253 | or | ||
| 254 | Qq SSLv2 | ||
| 255 | which indicates the SSL/TLS protocol version to which | ||
| 256 | .Fa cipher | ||
| 257 | belongs (i.e., where it was defined in the specification the first time). | ||
| 258 | .El | ||
| 259 | .Ss DEALING WITH PROTOCOL CONTEXTS | ||
| 260 | Here we document the various API functions which deal with the SSL/TLS | ||
| 261 | protocol context defined in the | ||
| 262 | .Vt SSL_CTX | ||
| 263 | structure. | ||
| 264 | .Bl -tag -width Ds | ||
| 265 | .It Xo | ||
| 266 | .Ft int | ||
| 267 | .Fn SSL_CTX_add_client_CA "SSL_CTX *ctx" "X509 *x" | ||
| 268 | .Xc | ||
| 269 | .It Xo | ||
| 270 | .Ft long | ||
| 271 | .Fn SSL_CTX_add_extra_chain_cert "SSL_CTX *ctx" "X509 *x509" | ||
| 272 | .Xc | ||
| 273 | .It Xo | ||
| 274 | .Ft int | ||
| 275 | .Fn SSL_CTX_add_session "SSL_CTX *ctx" "SSL_SESSION *c" | ||
| 276 | .Xc | ||
| 277 | .It Xo | ||
| 278 | .Ft int | ||
| 279 | .Fn SSL_CTX_check_private_key "const SSL_CTX *ctx" | ||
| 280 | .Xc | ||
| 281 | .It Xo | ||
| 282 | .Ft long | ||
| 283 | .Fn SSL_CTX_ctrl "SSL_CTX *ctx" "int cmd" "long larg" "char *parg" | ||
| 284 | .Xc | ||
| 285 | .It Xo | ||
| 286 | .Ft void | ||
| 287 | .Fn SSL_CTX_flush_sessions "SSL_CTX *s" "long t" | ||
| 288 | .Xc | ||
| 289 | .It Xo | ||
| 290 | .Ft void | ||
| 291 | .Fn SSL_CTX_free "SSL_CTX *a" | ||
| 292 | .Xc | ||
| 293 | .It Xo | ||
| 294 | .Ft char * | ||
| 295 | .Fn SSL_CTX_get_app_data "SSL_CTX *ctx" | ||
| 296 | .Xc | ||
| 297 | .It Xo | ||
| 298 | .Ft X509_STORE * | ||
| 299 | .Fn SSL_CTX_get_cert_store "SSL_CTX *ctx" | ||
| 300 | .Xc | ||
| 301 | .It Xo | ||
| 302 | .Ft STACK * | ||
| 303 | .Fn SSL_CTX_get_client_CA_list "const SSL_CTX *ctx" | ||
| 304 | .Xc | ||
| 305 | .It Xo | ||
| 306 | .Ft int | ||
| 307 | .Fn "(*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx))" | ||
| 308 | .Fa "SSL *ssl" "X509 **x509" "EVP_PKEY **pkey" | ||
| 309 | .Xc | ||
| 310 | .It Xo | ||
| 311 | .Ft char * | ||
| 312 | .Fn SSL_CTX_get_ex_data "const SSL_CTX *s" "int idx" | ||
| 313 | .Xc | ||
| 314 | .It Xo | ||
| 315 | .Ft int | ||
| 316 | .Fo SSL_CTX_get_ex_new_index | ||
| 317 | .Fa "long argl" | ||
| 318 | .Fa "void *argp" | ||
| 319 | .Fa "CRYPTO_EX_new *new_func" | ||
| 320 | .Fa "CRYPTO_EX_dup *dup_func" | ||
| 321 | .Fa "CRYPTO_EX_free *free_func" | ||
| 322 | .Fc | ||
| 323 | .Xc | ||
| 324 | .It Xo | ||
| 325 | .Ft void | ||
| 326 | .Fo "(*SSL_CTX_get_info_callback(const SSL_CTX *ctx))" | ||
| 327 | .Fa "SSL *ssl" | ||
| 328 | .Fa "int cb" | ||
| 329 | .Fa "int ret" | ||
| 330 | .Fc | ||
| 331 | .Xc | ||
| 332 | .It Xo | ||
| 333 | .Ft int | ||
| 334 | .Fn SSL_CTX_get_quiet_shutdown "const SSL_CTX *ctx" | ||
| 335 | .Xc | ||
| 336 | .It Xo | ||
| 337 | .Ft int | ||
| 338 | .Fn SSL_CTX_get_session_cache_mode "SSL_CTX *ctx" | ||
| 339 | .Xc | ||
| 340 | .It Xo | ||
| 341 | .Ft long | ||
| 342 | .Fn SSL_CTX_get_timeout "const SSL_CTX *ctx" | ||
| 343 | .Xc | ||
| 344 | .It Xo | ||
| 345 | .Ft int | ||
| 346 | .Fo "(*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))" | ||
| 347 | .Fa "int ok" | ||
| 348 | .Fa "X509_STORE_CTX *ctx" | ||
| 349 | .Fc | ||
| 350 | .Xc | ||
| 351 | .It Xo | ||
| 352 | .Ft int | ||
| 353 | .Fn SSL_CTX_get_verify_mode "SSL_CTX *ctx" | ||
| 354 | .Xc | ||
| 355 | .It Xo | ||
| 356 | .Ft int | ||
| 357 | .Fn SSL_CTX_load_verify_locations "SSL_CTX *ctx" "char *CAfile" "char *CApath" | ||
| 358 | .Xc | ||
| 359 | .It Xo | ||
| 360 | .Ft long | ||
| 361 | .Fn SSL_CTX_need_tmp_RSA "SSL_CTX *ctx" | ||
| 362 | .Xc | ||
| 363 | .It Xo | ||
| 364 | .Ft SSL_CTX * | ||
| 365 | .Fn SSL_CTX_new "const SSL_METHOD *meth" | ||
| 366 | .Xc | ||
| 367 | .It Xo | ||
| 368 | .Ft int | ||
| 369 | .Fn SSL_CTX_remove_session "SSL_CTX *ctx" "SSL_SESSION *c" | ||
| 370 | .Xc | ||
| 371 | .It Xo | ||
| 372 | .Ft int | ||
| 373 | .Fn SSL_CTX_sess_accept "SSL_CTX *ctx" | ||
| 374 | .Xc | ||
| 375 | .It Xo | ||
| 376 | .Ft int | ||
| 377 | .Fn SSL_CTX_sess_accept_good "SSL_CTX *ctx" | ||
| 378 | .Xc | ||
| 379 | .It Xo | ||
| 380 | .Ft int | ||
| 381 | .Fn SSL_CTX_sess_accept_renegotiate "SSL_CTX *ctx" | ||
| 382 | .Xc | ||
| 383 | .It Xo | ||
| 384 | .Ft int | ||
| 385 | .Fn SSL_CTX_sess_cache_full "SSL_CTX *ctx" | ||
| 386 | .Xc | ||
| 387 | .It Xo | ||
| 388 | .Ft int | ||
| 389 | .Fn SSL_CTX_sess_cb_hits "SSL_CTX *ctx" | ||
| 390 | .Xc | ||
| 391 | .It Xo | ||
| 392 | .Ft int | ||
| 393 | .Fn SSL_CTX_sess_connect "SSL_CTX *ctx" | ||
| 394 | .Xc | ||
| 395 | .It Xo | ||
| 396 | .Ft int | ||
| 397 | .Fn SSL_CTX_sess_connect_good "SSL_CTX *ctx" | ||
| 398 | .Xc | ||
| 399 | .It Xo | ||
| 400 | .Ft int | ||
| 401 | .Fn SSL_CTX_sess_connect_renegotiate "SSL_CTX *ctx" | ||
| 402 | .Xc | ||
| 403 | .It Xo | ||
| 404 | .Ft int | ||
| 405 | .Fn SSL_CTX_sess_get_cache_size "SSL_CTX *ctx" | ||
| 406 | .Xc | ||
| 407 | .It Xo | ||
| 408 | .Ft SSL_SESSION * | ||
| 409 | .Fo "(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))" | ||
| 410 | .Fa "SSL *ssl" | ||
| 411 | .Fa "unsigned char *data" | ||
| 412 | .Fa "int len" | ||
| 413 | .Fa "int *copy" | ||
| 414 | .Fc | ||
| 415 | .Xc | ||
| 416 | .It Xo | ||
| 417 | .Ft int | ||
| 418 | .Fn "(*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx))" "SSL *ssl" "SSL_SESSION *sess" | ||
| 419 | .Xc | ||
| 420 | .It Xo | ||
| 421 | .Ft void | ||
| 422 | .Fo "(*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx))" | ||
| 423 | .Fa "SSL_CTX *ctx" | ||
| 424 | .Fa "SSL_SESSION *sess" | ||
| 425 | .Fc | ||
| 426 | .Xc | ||
| 427 | .It Xo | ||
| 428 | .Ft int | ||
| 429 | .Fn SSL_CTX_sess_hits "SSL_CTX *ctx" | ||
| 430 | .Xc | ||
| 431 | .It Xo | ||
| 432 | .Ft int | ||
| 433 | .Fn SSL_CTX_sess_misses "SSL_CTX *ctx" | ||
| 434 | .Xc | ||
| 435 | .It Xo | ||
| 436 | .Ft int | ||
| 437 | .Fn SSL_CTX_sess_number "SSL_CTX *ctx" | ||
| 438 | .Xc | ||
| 439 | .It Xo | ||
| 440 | .Ft void | ||
| 441 | .Fn SSL_CTX_sess_set_cache_size "SSL_CTX *ctx" "long t" | ||
| 442 | .Xc | ||
| 443 | .It Xo | ||
| 444 | .Ft void | ||
| 445 | .Fo SSL_CTX_sess_set_get_cb | ||
| 446 | .Fa "SSL_CTX *ctx" | ||
| 447 | .Fa "SSL_SESSION *(*cb)(SSL *ssl, unsigned char *data, int len, int *copy)" | ||
| 448 | .Fc | ||
| 449 | .Xc | ||
| 450 | .It Xo | ||
| 451 | .Ft void | ||
| 452 | .Fo SSL_CTX_sess_set_new_cb | ||
| 453 | .Fa "SSL_CTX *ctx" | ||
| 454 | .Fa "int (*cb)(SSL *ssl, SSL_SESSION *sess)" | ||
| 455 | .Fc | ||
| 456 | .Xc | ||
| 457 | .It Xo | ||
| 458 | .Ft void | ||
| 459 | .Fo SSL_CTX_sess_set_remove_cb | ||
| 460 | .Fa "SSL_CTX *ctx" | ||
| 461 | .Fa "void (*cb)(SSL_CTX *ctx, SSL_SESSION *sess)" | ||
| 462 | .Fc | ||
| 463 | .Xc | ||
| 464 | .It Xo | ||
| 465 | .Ft int | ||
| 466 | .Fn SSL_CTX_sess_timeouts "SSL_CTX *ctx" | ||
| 467 | .Xc | ||
| 468 | .It Xo | ||
| 469 | .Ft LHASH * | ||
| 470 | .Fn SSL_CTX_sessions "SSL_CTX *ctx" | ||
| 471 | .Xc | ||
| 472 | .It Xo | ||
| 473 | .Ft void | ||
| 474 | .Fn SSL_CTX_set_app_data "SSL_CTX *ctx" "void *arg" | ||
| 475 | .Xc | ||
| 476 | .It Xo | ||
| 477 | .Ft void | ||
| 478 | .Fn SSL_CTX_set_cert_store "SSL_CTX *ctx" "X509_STORE *cs" | ||
| 479 | .Xc | ||
| 480 | .It Xo | ||
| 481 | .Ft void | ||
| 482 | .Fn SSL_CTX_set_cert_verify_cb "SSL_CTX *ctx" "int (*cb)()" "char *arg" | ||
| 483 | .Xc | ||
| 484 | .It Xo | ||
| 485 | .Ft int | ||
| 486 | .Fn SSL_CTX_set_cipher_list "SSL_CTX *ctx" "char *str" | ||
| 487 | .Xc | ||
| 488 | .It Xo | ||
| 489 | .Ft void | ||
| 490 | .Fn SSL_CTX_set_client_CA_list "SSL_CTX *ctx" "STACK *list" | ||
| 491 | .Xc | ||
| 492 | .It Xo | ||
| 493 | .Ft void | ||
| 494 | .Fo SSL_CTX_set_client_cert_cb | ||
| 495 | .Fa "SSL_CTX *ctx" | ||
| 496 | .Fa "int (*cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey)" | ||
| 497 | .Fc | ||
| 498 | .Xc | ||
| 499 | .It Xo | ||
| 500 | .Ft void | ||
| 501 | .Fn SSL_CTX_set_default_passwd_cb "SSL_CTX *ctx" "pem_password_cb *cb" | ||
| 502 | .Xc | ||
| 503 | .It Xo | ||
| 504 | .Ft void | ||
| 505 | .Fn SSL_CTX_set_default_read_ahead "SSL_CTX *ctx" "int m" | ||
| 506 | .Xc | ||
| 507 | .It Xo | ||
| 508 | .Ft int | ||
| 509 | .Fn SSL_CTX_set_default_verify_paths "SSL_CTX *ctx" | ||
| 510 | .Xc | ||
| 511 | .It Xo | ||
| 512 | .Ft int | ||
| 513 | .Fn SSL_CTX_set_ex_data "SSL_CTX *s" "int idx" "char *arg" | ||
| 514 | .Xc | ||
| 515 | .It Xo | ||
| 516 | .Ft void | ||
| 517 | .Fo SSL_CTX_set_info_callback | ||
| 518 | .Fa "SSL_CTX *ctx" | ||
| 519 | .Fa "void (*cb)(SSL *ssl, int cb, int ret)" | ||
| 520 | .Fc | ||
| 521 | .Xc | ||
| 522 | .It Xo | ||
| 523 | .Ft void | ||
| 524 | .Fo SSL_CTX_set_msg_callback | ||
| 525 | .Fa "SSL_CTX *ctx" | ||
| 526 | .Fa "void (*cb)(int write_p, int version, int content_type, const void *buf, \ | ||
| 527 | size_t len, SSL *ssl, void *arg)" | ||
| 528 | .Fc | ||
| 529 | .Xc | ||
| 530 | .It Xo | ||
| 531 | .Ft void | ||
| 532 | .Fn SSL_CTX_set_msg_callback_arg "SSL_CTX *ctx" "void *arg" | ||
| 533 | .Xc | ||
| 534 | .It Xo | ||
| 535 | .Ft void | ||
| 536 | .Fn SSL_CTX_set_options "SSL_CTX *ctx" "unsigned long op" | ||
| 537 | .Xc | ||
| 538 | .It Xo | ||
| 539 | .Ft void | ||
| 540 | .Fn SSL_CTX_set_quiet_shutdown "SSL_CTX *ctx" "int mode" | ||
| 541 | .Xc | ||
| 542 | .It Xo | ||
| 543 | .Ft void | ||
| 544 | .Fn SSL_CTX_set_session_cache_mode "SSL_CTX *ctx" "int mode" | ||
| 545 | .Xc | ||
| 546 | .It Xo | ||
| 547 | .Ft int | ||
| 548 | .Fn SSL_CTX_set_ssl_version "SSL_CTX *ctx" "const SSL_METHOD *meth" | ||
| 549 | .Xc | ||
| 550 | .It Xo | ||
| 551 | .Ft void | ||
| 552 | .Fn SSL_CTX_set_timeout "SSL_CTX *ctx" "long t" | ||
| 553 | .Xc | ||
| 554 | .It Xo | ||
| 555 | .Ft long | ||
| 556 | .Fn SSL_CTX_set_tmp_dh "SSL_CTX* ctx" "DH *dh" | ||
| 557 | .Xc | ||
| 558 | .It Xo | ||
| 559 | .Ft long | ||
| 560 | .Fn SSL_CTX_set_tmp_dh_callback "SSL_CTX *ctx" "DH *(*cb)(void)" | ||
| 561 | .Xc | ||
| 562 | .It Xo | ||
| 563 | .Ft long | ||
| 564 | .Fn SSL_CTX_set_tmp_rsa "SSL_CTX *ctx" "RSA *rsa" | ||
| 565 | .Xc | ||
| 566 | .It Xo | ||
| 567 | .Fn SSL_CTX_set_tmp_rsa_callback | ||
| 568 | .Xc | ||
| 569 | .Ft long | ||
| 570 | .Fo SSL_CTX_set_tmp_rsa_callback | ||
| 571 | .Fa "SSL_CTX *ctx" | ||
| 572 | .Fa "RSA *(*cb)(SSL *ssl, int export, int keylength)" | ||
| 573 | .Fc | ||
| 574 | .Pp | ||
| 575 | Sets the callback which will be called when a temporary private key is | ||
| 576 | required. | ||
| 577 | The | ||
| 578 | .Fa export | ||
| 579 | flag will be set if the reason for needing a temp key is that an export | ||
| 580 | ciphersuite is in use, in which case, | ||
| 581 | .Fa keylength | ||
| 582 | will contain the required keylength in bits. | ||
| 583 | .\" XXX using what? | ||
| 584 | Generate a key of appropriate size (using ???) and return it. | ||
| 585 | .It Xo | ||
| 586 | .Fn SSL_set_tmp_rsa_callback | ||
| 587 | .Xc | ||
| 588 | .Ft long | ||
| 589 | .Fo SSL_set_tmp_rsa_callback | ||
| 590 | .Fa "SSL *ssl" | ||
| 591 | .Fa "RSA *(*cb)(SSL *ssl, int export, int keylength)" | ||
| 592 | .Fc | ||
| 593 | .Pp | ||
| 594 | The same as | ||
| 595 | .Fn SSL_CTX_set_tmp_rsa_callback , | ||
| 596 | except it operates on an | ||
| 597 | .Vt SSL | ||
| 598 | session instead of a context. | ||
| 599 | .It Xo | ||
| 600 | .Ft void | ||
| 601 | .Fn SSL_CTX_set_verify "SSL_CTX *ctx" "int mode" "int (*cb)(void)" | ||
| 602 | .Xc | ||
| 603 | .It Xo | ||
| 604 | .Ft int | ||
| 605 | .Fn SSL_CTX_use_PrivateKey "SSL_CTX *ctx" "EVP_PKEY *pkey" | ||
| 606 | .Xc | ||
| 607 | .It Xo | ||
| 608 | .Ft int | ||
| 609 | .Fo SSL_CTX_use_PrivateKey_ASN1 | ||
| 610 | .Fa "int type" | ||
| 611 | .Fa "SSL_CTX *ctx" | ||
| 612 | .Fa "unsigned char *d" | ||
| 613 | .Fa "long len" | ||
| 614 | .Fc | ||
| 615 | .Xc | ||
| 616 | .It Xo | ||
| 617 | .Ft int | ||
| 618 | .Fn SSL_CTX_use_PrivateKey_file "SSL_CTX *ctx" "char *file" "int type" | ||
| 619 | .Xc | ||
| 620 | .It Xo | ||
| 621 | .Ft int | ||
| 622 | .Fn SSL_CTX_use_RSAPrivateKey "SSL_CTX *ctx" "RSA *rsa" | ||
| 623 | .Xc | ||
| 624 | .It Xo | ||
| 625 | .Ft int | ||
| 626 | .Fn SSL_CTX_use_RSAPrivateKey_ASN1 "SSL_CTX *ctx" "unsigned char *d" "long len" | ||
| 627 | .Xc | ||
| 628 | .It Xo | ||
| 629 | .Ft int | ||
| 630 | .Fn SSL_CTX_use_RSAPrivateKey_file "SSL_CTX *ctx" "char *file" "int type" | ||
| 631 | .Xc | ||
| 632 | .It Xo | ||
| 633 | .Ft int | ||
| 634 | .Fn SSL_CTX_use_certificate "SSL_CTX *ctx" "X509 *x" | ||
| 635 | .Xc | ||
| 636 | .It Xo | ||
| 637 | .Ft int | ||
| 638 | .Fn SSL_CTX_use_certificate_ASN1 "SSL_CTX *ctx" "int len" "unsigned char *d" | ||
| 639 | .Xc | ||
| 640 | .It Xo | ||
| 641 | .Ft int | ||
| 642 | .Fn SSL_CTX_use_certificate_file "SSL_CTX *ctx" "char *file" "int type" | ||
| 643 | .Xc | ||
| 644 | .It Xo | ||
| 645 | .Ft void | ||
| 646 | .Fo SSL_CTX_set_psk_client_callback | ||
| 647 | .Fa "SSL_CTX *ctx" | ||
| 648 | .Fa "unsigned int (*callback)(SSL *ssl, const char *hint, char *identity, \ | ||
| 649 | unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len)" | ||
| 650 | .Fc | ||
| 651 | .Xc | ||
| 652 | .It Xo | ||
| 653 | .Ft int | ||
| 654 | .Fn SSL_CTX_use_psk_identity_hint "SSL_CTX *ctx" "const char *hint" | ||
| 655 | .Xc | ||
| 656 | .It Xo | ||
| 657 | .Ft void | ||
| 658 | .Fo SSL_CTX_set_psk_server_callback | ||
| 659 | .Fa "SSL_CTX *ctx" | ||
| 660 | .Fa "unsigned int (*callback)(SSL *ssl, const char *identity, \ | ||
| 661 | unsigned char *psk, int max_psk_len)" | ||
| 662 | .Fc | ||
| 663 | .Xc | ||
| 664 | .El | ||
| 665 | .Ss DEALING WITH SESSIONS | ||
| 666 | Here we document the various API functions which deal with the SSL/TLS sessions | ||
| 667 | defined in the | ||
| 668 | .Vt SSL_SESSION | ||
| 669 | structures. | ||
| 670 | .Bl -tag -width Ds | ||
| 671 | .It Xo | ||
| 672 | .Ft int | ||
| 673 | .Fn SSL_SESSION_cmp "const SSL_SESSION *a" "const SSL_SESSION *b" | ||
| 674 | .Xc | ||
| 675 | .It Xo | ||
| 676 | .Ft void | ||
| 677 | .Fn SSL_SESSION_free "SSL_SESSION *ss" | ||
| 678 | .Xc | ||
| 679 | .It Xo | ||
| 680 | .Ft char * | ||
| 681 | .Fn SSL_SESSION_get_app_data "SSL_SESSION *s" | ||
| 682 | .Xc | ||
| 683 | .It Xo | ||
| 684 | .Ft char * | ||
| 685 | .Fn SSL_SESSION_get_ex_data "const SSL_SESSION *s" "int idx" | ||
| 686 | .Xc | ||
| 687 | .It Xo | ||
| 688 | .Ft int | ||
| 689 | .Fo SSL_SESSION_get_ex_new_index | ||
| 690 | .Fa "long argl" | ||
| 691 | .Fa "char *argp" | ||
| 692 | .Fa "int (*new_func)(void)" | ||
| 693 | .Fa "int (*dup_func)(void), void (*free_func)(void)" | ||
| 694 | .Fc | ||
| 695 | .Xc | ||
| 696 | .It Xo | ||
| 697 | .Ft long | ||
| 698 | .Fn SSL_SESSION_get_time "const SSL_SESSION *s" | ||
| 699 | .Xc | ||
| 700 | .It Xo | ||
| 701 | .Ft long | ||
| 702 | .Fn SSL_SESSION_get_timeout "const SSL_SESSION *s" | ||
| 703 | .Xc | ||
| 704 | .It Xo | ||
| 705 | .Ft unsigned long | ||
| 706 | .Fn SSL_SESSION_hash "const SSL_SESSION *a" | ||
| 707 | .Xc | ||
| 708 | .It Xo | ||
| 709 | .Ft SSL_SESSION * | ||
| 710 | .Fn SSL_SESSION_new void | ||
| 711 | .Xc | ||
| 712 | .It Xo | ||
| 713 | .Ft int | ||
| 714 | .Fn SSL_SESSION_print "BIO *bp" "const SSL_SESSION *x" | ||
| 715 | .Xc | ||
| 716 | .It Xo | ||
| 717 | .Ft int | ||
| 718 | .Fn SSL_SESSION_print_fp "FILE *fp" "const SSL_SESSION *x" | ||
| 719 | .Xc | ||
| 720 | .It Xo | ||
| 721 | .Ft void | ||
| 722 | .Fn SSL_SESSION_set_app_data "SSL_SESSION *s" "char *a" | ||
| 723 | .Xc | ||
| 724 | .It Xo | ||
| 725 | .Ft int | ||
| 726 | .Fn SSL_SESSION_set_ex_data "SSL_SESSION *s" "int idx" "char *arg" | ||
| 727 | .Xc | ||
| 728 | .It Xo | ||
| 729 | .Ft long | ||
| 730 | .Fn SSL_SESSION_set_time "SSL_SESSION *s" "long t" | ||
| 731 | .Xc | ||
| 732 | .It Xo | ||
| 733 | .Ft long | ||
| 734 | .Fn SSL_SESSION_set_timeout "SSL_SESSION *s" "long t" | ||
| 735 | .Xc | ||
| 736 | .El | ||
| 737 | .Ss DEALING WITH CONNECTIONS | ||
| 738 | Here we document the various API functions which deal with the SSL/TLS | ||
| 739 | connection defined in the | ||
| 740 | .Vt SSL | ||
| 741 | structure. | ||
| 742 | .Bl -tag -width Ds | ||
| 743 | .It Xo | ||
| 744 | .Ft int | ||
| 745 | .Fn SSL_accept "SSL *ssl" | ||
| 746 | .Xc | ||
| 747 | .It Xo | ||
| 748 | .Ft int | ||
| 749 | .Fn SSL_add_dir_cert_subjects_to_stack "STACK *stack" "const char *dir" | ||
| 750 | .Xc | ||
| 751 | .It Xo | ||
| 752 | .Ft int | ||
| 753 | .Fn SSL_add_file_cert_subjects_to_stack "STACK *stack" "const char *file" | ||
| 754 | .Xc | ||
| 755 | .It Xo | ||
| 756 | .Ft int | ||
| 757 | .Fn SSL_add_client_CA "SSL *ssl" "X509 *x" | ||
| 758 | .Xc | ||
| 759 | .It Xo | ||
| 760 | .Ft char * | ||
| 761 | .Fn SSL_alert_desc_string "int value" | ||
| 762 | .Xc | ||
| 763 | .It Xo | ||
| 764 | .Ft char * | ||
| 765 | .Fn SSL_alert_desc_string_long "int value" | ||
| 766 | .Xc | ||
| 767 | .It Xo | ||
| 768 | .Ft char * | ||
| 769 | .Fn SSL_alert_type_string "int value" | ||
| 770 | .Xc | ||
| 771 | .It Xo | ||
| 772 | .Ft char * | ||
| 773 | .Fn SSL_alert_type_string_long "int value" | ||
| 774 | .Xc | ||
| 775 | .It Xo | ||
| 776 | .Ft int | ||
| 777 | .Fn SSL_check_private_key "const SSL *ssl" | ||
| 778 | .Xc | ||
| 779 | .It Xo | ||
| 780 | .Ft void | ||
| 781 | .Fn SSL_clear "SSL *ssl" | ||
| 782 | .Xc | ||
| 783 | .It Xo | ||
| 784 | .Ft long | ||
| 785 | .Fn SSL_clear_num_renegotiations "SSL *ssl" | ||
| 786 | .Xc | ||
| 787 | .It Xo | ||
| 788 | .Ft int | ||
| 789 | .Fn SSL_connect "SSL *ssl" | ||
| 790 | .Xc | ||
| 791 | .It Xo | ||
| 792 | .Ft void | ||
| 793 | .Fn SSL_copy_session_id "SSL *t" "const SSL *f" | ||
| 794 | .Xc | ||
| 795 | .It Xo | ||
| 796 | .Ft long | ||
| 797 | .Fn SSL_ctrl "SSL *ssl" "int cmd" "long larg" "char *parg" | ||
| 798 | .Xc | ||
| 799 | .It Xo | ||
| 800 | .Ft int | ||
| 801 | .Fn SSL_do_handshake "SSL *ssl" | ||
| 802 | .Xc | ||
| 803 | .It Xo | ||
| 804 | .Ft SSL * | ||
| 805 | .Fn SSL_dup "SSL *ssl" | ||
| 806 | .Xc | ||
| 807 | .It Xo | ||
| 808 | .Ft STACK * | ||
| 809 | .Fn SSL_dup_CA_list "STACK *sk" | ||
| 810 | .Xc | ||
| 811 | .It Xo | ||
| 812 | .Ft void | ||
| 813 | .Fn SSL_free "SSL *ssl" | ||
| 814 | .Xc | ||
| 815 | .It Xo | ||
| 816 | .Ft SSL_CTX * | ||
| 817 | .Fn SSL_get_SSL_CTX "const SSL *ssl" | ||
| 818 | .Xc | ||
| 819 | .It Xo | ||
| 820 | .Ft char * | ||
| 821 | .Fn SSL_get_app_data "SSL *ssl" | ||
| 822 | .Xc | ||
| 823 | .It Xo | ||
| 824 | .Ft X509 * | ||
| 825 | .Fn SSL_get_certificate "const SSL *ssl" | ||
| 826 | .Xc | ||
| 827 | .It Xo | ||
| 828 | .Ft const char * | ||
| 829 | .Fn SSL_get_cipher "const SSL *ssl" | ||
| 830 | .Xc | ||
| 831 | .It Xo | ||
| 832 | .Ft int | ||
| 833 | .Fn SSL_get_cipher_bits "const SSL *ssl" "int *alg_bits" | ||
| 834 | .Xc | ||
| 835 | .It Xo | ||
| 836 | .Ft char * | ||
| 837 | .Fn SSL_get_cipher_list "const SSL *ssl" "int n" | ||
| 838 | .Xc | ||
| 839 | .It Xo | ||
| 840 | .Ft char * | ||
| 841 | .Fn SSL_get_cipher_name "const SSL *ssl" | ||
| 842 | .Xc | ||
| 843 | .It Xo | ||
| 844 | .Ft char * | ||
| 845 | .Fn SSL_get_cipher_version "const SSL *ssl" | ||
| 846 | .Xc | ||
| 847 | .It Xo | ||
| 848 | .Ft STACK * | ||
| 849 | .Fn SSL_get_ciphers "const SSL *ssl" | ||
| 850 | .Xc | ||
| 851 | .It Xo | ||
| 852 | .Ft STACK * | ||
| 853 | .Fn SSL_get_client_CA_list "const SSL *ssl" | ||
| 854 | .Xc | ||
| 855 | .It Xo | ||
| 856 | .Ft SSL_CIPHER * | ||
| 857 | .Fn SSL_get_current_cipher "SSL *ssl" | ||
| 858 | .Xc | ||
| 859 | .It Xo | ||
| 860 | .Ft long | ||
| 861 | .Fn SSL_get_default_timeout "const SSL *ssl" | ||
| 862 | .Xc | ||
| 863 | .It Xo | ||
| 864 | .Ft int | ||
| 865 | .Fn SSL_get_error "const SSL *ssl" "int i" | ||
| 866 | .Xc | ||
| 867 | .It Xo | ||
| 868 | .Ft char * | ||
| 869 | .Fn SSL_get_ex_data "const SSL *ssl" "int idx" | ||
| 870 | .Xc | ||
| 871 | .It Xo | ||
| 872 | .Ft int | ||
| 873 | .Fn SSL_get_ex_data_X509_STORE_CTX_idx void | ||
| 874 | .Xc | ||
| 875 | .It Xo | ||
| 876 | .Ft int | ||
| 877 | .Fo SSL_get_ex_new_index | ||
| 878 | .Fa "long argl" | ||
| 879 | .Fa "char *argp" | ||
| 880 | .Fa "int (*new_func)(void)" | ||
| 881 | .Fa "int (*dup_func)(void)" | ||
| 882 | .Fa "void (*free_func)(void)" | ||
| 883 | .Fc | ||
| 884 | .Xc | ||
| 885 | .It Xo | ||
| 886 | .Ft int | ||
| 887 | .Fn SSL_get_fd "const SSL *ssl" | ||
| 888 | .Xc | ||
| 889 | .It Xo | ||
| 890 | .Ft void | ||
| 891 | .Fn "(*SSL_get_info_callback(const SSL *ssl))" | ||
| 892 | .Xc | ||
| 893 | .It Xo | ||
| 894 | .Ft STACK * | ||
| 895 | .Fn SSL_get_peer_cert_chain "const SSL *ssl" | ||
| 896 | .Xc | ||
| 897 | .It Xo | ||
| 898 | .Ft X509 * | ||
| 899 | .Fn SSL_get_peer_certificate "const SSL *ssl" | ||
| 900 | .Xc | ||
| 901 | .It Xo | ||
| 902 | .Ft EVP_PKEY * | ||
| 903 | .Fn SSL_get_privatekey "SSL *ssl" | ||
| 904 | .Xc | ||
| 905 | .It Xo | ||
| 906 | .Ft int | ||
| 907 | .Fn SSL_get_quiet_shutdown "const SSL *ssl" | ||
| 908 | .Xc | ||
| 909 | .It Xo | ||
| 910 | .Ft BIO * | ||
| 911 | .Fn SSL_get_rbio "const SSL *ssl" | ||
| 912 | .Xc | ||
| 913 | .It Xo | ||
| 914 | .Ft int | ||
| 915 | .Fn SSL_get_read_ahead "const SSL *ssl" | ||
| 916 | .Xc | ||
| 917 | .It Xo | ||
| 918 | .Ft SSL_SESSION * | ||
| 919 | .Fn SSL_get_session "const SSL *ssl" | ||
| 920 | .Xc | ||
| 921 | .It Xo | ||
| 922 | .Ft char * | ||
| 923 | .Fn SSL_get_shared_ciphers "const SSL *ssl" "char *buf" "int len" | ||
| 924 | .Xc | ||
| 925 | .It Xo | ||
| 926 | .Ft int | ||
| 927 | .Fn SSL_get_shutdown "const SSL *ssl" | ||
| 928 | .Xc | ||
| 929 | .It Xo | ||
| 930 | .Ft const SSL_METHOD * | ||
| 931 | .Fn SSL_get_ssl_method "SSL *ssl" | ||
| 932 | .Xc | ||
| 933 | .It Xo | ||
| 934 | .Ft int | ||
| 935 | .Fn SSL_get_state "const SSL *ssl" | ||
| 936 | .Xc | ||
| 937 | .It Xo | ||
| 938 | .Ft long | ||
| 939 | .Fn SSL_get_time "const SSL *ssl" | ||
| 940 | .Xc | ||
| 941 | .It Xo | ||
| 942 | .Ft long | ||
| 943 | .Fn SSL_get_timeout "const SSL *ssl" | ||
| 944 | .Xc | ||
| 945 | .It Xo | ||
| 946 | .Ft int | ||
| 947 | .Fn "(*SSL_get_verify_callback(const SSL *ssl))" int "X509_STORE_CTX *" | ||
| 948 | .Xc | ||
| 949 | .It Xo | ||
| 950 | .Ft int | ||
| 951 | .Fn SSL_get_verify_mode "const SSL *ssl" | ||
| 952 | .Xc | ||
| 953 | .It Xo | ||
| 954 | .Ft long | ||
| 955 | .Fn SSL_get_verify_result "const SSL *ssl" | ||
| 956 | .Xc | ||
| 957 | .It Xo | ||
| 958 | .Ft char * | ||
| 959 | .Fn SSL_get_version "const SSL *ssl" | ||
| 960 | .Xc | ||
| 961 | .It Xo | ||
| 962 | .Ft BIO * | ||
| 963 | .Fn SSL_get_wbio "const SSL *ssl" | ||
| 964 | .Xc | ||
| 965 | .It Xo | ||
| 966 | .Ft int | ||
| 967 | .Fn SSL_in_accept_init "SSL *ssl" | ||
| 968 | .Xc | ||
| 969 | .It Xo | ||
| 970 | .Ft int | ||
| 971 | .Fn SSL_in_before "SSL *ssl" | ||
| 972 | .Xc | ||
| 973 | .It Xo | ||
| 974 | .Ft int | ||
| 975 | .Fn SSL_in_connect_init "SSL *ssl" | ||
| 976 | .Xc | ||
| 977 | .It Xo | ||
| 978 | .Ft int | ||
| 979 | .Fn SSL_in_init "SSL *ssl" | ||
| 980 | .Xc | ||
| 981 | .It Xo | ||
| 982 | .Ft int | ||
| 983 | .Fn SSL_is_init_finished "SSL *ssl" | ||
| 984 | .Xc | ||
| 985 | .It Xo | ||
| 986 | .Ft STACK * | ||
| 987 | .Fn SSL_load_client_CA_file "char *file" | ||
| 988 | .Xc | ||
| 989 | .It Xo | ||
| 990 | .Ft void | ||
| 991 | .Fn SSL_load_error_strings "void" | ||
| 992 | .Xc | ||
| 993 | .It Xo | ||
| 994 | .Ft SSL * | ||
| 995 | .Fn SSL_new "SSL_CTX *ctx" | ||
| 996 | .Xc | ||
| 997 | .It Xo | ||
| 998 | .Ft long | ||
| 999 | .Fn SSL_num_renegotiations "SSL *ssl" | ||
| 1000 | .Xc | ||
| 1001 | .It Xo | ||
| 1002 | .Ft int | ||
| 1003 | .Fn SSL_peek "SSL *ssl" "void *buf" "int num" | ||
| 1004 | .Xc | ||
| 1005 | .It Xo | ||
| 1006 | .Ft int | ||
| 1007 | .Fn SSL_pending "const SSL *ssl" | ||
| 1008 | .Xc | ||
| 1009 | .It Xo | ||
| 1010 | .Ft int | ||
| 1011 | .Fn SSL_read "SSL *ssl" "void *buf" "int num" | ||
| 1012 | .Xc | ||
| 1013 | .It Xo | ||
| 1014 | .Ft int | ||
| 1015 | .Fn SSL_renegotiate "SSL *ssl" | ||
| 1016 | .Xc | ||
| 1017 | .It Xo | ||
| 1018 | .Ft char * | ||
| 1019 | .Fn SSL_rstate_string "SSL *ssl" | ||
| 1020 | .Xc | ||
| 1021 | .It Xo | ||
| 1022 | .Ft char * | ||
| 1023 | .Fn SSL_rstate_string_long "SSL *ssl" | ||
| 1024 | .Xc | ||
| 1025 | .It Xo | ||
| 1026 | .Ft long | ||
| 1027 | .Fn SSL_session_reused "SSL *ssl" | ||
| 1028 | .Xc | ||
| 1029 | .It Xo | ||
| 1030 | .Ft void | ||
| 1031 | .Fn SSL_set_accept_state "SSL *ssl" | ||
| 1032 | .Xc | ||
| 1033 | .It Xo | ||
| 1034 | .Ft void | ||
| 1035 | .Fn SSL_set_app_data "SSL *ssl" "char *arg" | ||
| 1036 | .Xc | ||
| 1037 | .It Xo | ||
| 1038 | .Ft void | ||
| 1039 | .Fn SSL_set_bio "SSL *ssl" "BIO *rbio" "BIO *wbio" | ||
| 1040 | .Xc | ||
| 1041 | .It Xo | ||
| 1042 | .Ft int | ||
| 1043 | .Fn SSL_set_cipher_list "SSL *ssl" "char *str" | ||
| 1044 | .Xc | ||
| 1045 | .It Xo | ||
| 1046 | .Ft void | ||
| 1047 | .Fn SSL_set_client_CA_list "SSL *ssl" "STACK *list" | ||
| 1048 | .Xc | ||
| 1049 | .It Xo | ||
| 1050 | .Ft void | ||
| 1051 | .Fn SSL_set_connect_state "SSL *ssl" | ||
| 1052 | .Xc | ||
| 1053 | .It Xo | ||
| 1054 | .Ft int | ||
| 1055 | .Fn SSL_set_ex_data "SSL *ssl" "int idx" "char *arg" | ||
| 1056 | .Xc | ||
| 1057 | .It Xo | ||
| 1058 | .Ft int | ||
| 1059 | .Fn SSL_set_fd "SSL *ssl" "int fd" | ||
| 1060 | .Xc | ||
| 1061 | .It Xo | ||
| 1062 | .Ft void | ||
| 1063 | .Fn SSL_set_info_callback "SSL *ssl" "void (*cb)(void)" | ||
| 1064 | .Xc | ||
| 1065 | .It Xo | ||
| 1066 | .Ft void | ||
| 1067 | .Fo SSL_set_msg_callback | ||
| 1068 | .Fa "SSL *ctx" | ||
| 1069 | .Fa "void (*cb)(int write_p, int version, int content_type, const void *buf, \ | ||
| 1070 | size_t len, SSL *ssl, void *arg)" | ||
| 1071 | .Fc | ||
| 1072 | .Xc | ||
| 1073 | .It Xo | ||
| 1074 | .Ft void | ||
| 1075 | .Fn SSL_set_msg_callback_arg "SSL *ctx" "void *arg" | ||
| 1076 | .Xc | ||
| 1077 | .It Xo | ||
| 1078 | .Ft void | ||
| 1079 | .Fn SSL_set_options "SSL *ssl" "unsigned long op" | ||
| 1080 | .Xc | ||
| 1081 | .It Xo | ||
| 1082 | .Ft void | ||
| 1083 | .Fn SSL_set_quiet_shutdown "SSL *ssl" "int mode" | ||
| 1084 | .Xc | ||
| 1085 | .It Xo | ||
| 1086 | .Ft void | ||
| 1087 | .Fn SSL_set_read_ahead "SSL *ssl" "int yes" | ||
| 1088 | .Xc | ||
| 1089 | .It Xo | ||
| 1090 | .Ft int | ||
| 1091 | .Fn SSL_set_rfd "SSL *ssl" "int fd" | ||
| 1092 | .Xc | ||
| 1093 | .It Xo | ||
| 1094 | .Ft int | ||
| 1095 | .Fn SSL_set_session "SSL *ssl" "SSL_SESSION *session" | ||
| 1096 | .Xc | ||
| 1097 | .It Xo | ||
| 1098 | .Ft void | ||
| 1099 | .Fn SSL_set_shutdown "SSL *ssl" "int mode" | ||
| 1100 | .Xc | ||
| 1101 | .It Xo | ||
| 1102 | .Ft int | ||
| 1103 | .Fn SSL_set_ssl_method "SSL *ssl" "const SSL_METHOD *meth" | ||
| 1104 | .Xc | ||
| 1105 | .It Xo | ||
| 1106 | .Ft void | ||
| 1107 | .Fn SSL_set_time "SSL *ssl" "long t" | ||
| 1108 | .Xc | ||
| 1109 | .It Xo | ||
| 1110 | .Ft void | ||
| 1111 | .Fn SSL_set_timeout "SSL *ssl" "long t" | ||
| 1112 | .Xc | ||
| 1113 | .It Xo | ||
| 1114 | .Ft void | ||
| 1115 | .Fn SSL_set_verify "SSL *ssl" "int mode" "int (*callback)(void)" | ||
| 1116 | .Xc | ||
| 1117 | .It Xo | ||
| 1118 | .Ft void | ||
| 1119 | .Fn SSL_set_verify_result "SSL *ssl" "long arg" | ||
| 1120 | .Xc | ||
| 1121 | .It Xo | ||
| 1122 | .Ft int | ||
| 1123 | .Fn SSL_set_wfd "SSL *ssl" "int fd" | ||
| 1124 | .Xc | ||
| 1125 | .It Xo | ||
| 1126 | .Ft int | ||
| 1127 | .Fn SSL_shutdown "SSL *ssl" | ||
| 1128 | .Xc | ||
| 1129 | .It Xo | ||
| 1130 | .Ft int | ||
| 1131 | .Fn SSL_state "const SSL *ssl" | ||
| 1132 | .Xc | ||
| 1133 | .It Xo | ||
| 1134 | .Ft char * | ||
| 1135 | .Fn SSL_state_string "const SSL *ssl" | ||
| 1136 | .Xc | ||
| 1137 | .It Xo | ||
| 1138 | .Ft char * | ||
| 1139 | .Fn SSL_state_string_long "const SSL *ssl" | ||
| 1140 | .Xc | ||
| 1141 | .It Xo | ||
| 1142 | .Ft long | ||
| 1143 | .Fn SSL_total_renegotiations "SSL *ssl" | ||
| 1144 | .Xc | ||
| 1145 | .It Xo | ||
| 1146 | .Ft int | ||
| 1147 | .Fn SSL_use_PrivateKey "SSL *ssl" "EVP_PKEY *pkey" | ||
| 1148 | .Xc | ||
| 1149 | .It Xo | ||
| 1150 | .Ft int | ||
| 1151 | .Fn SSL_use_PrivateKey_ASN1 "int type" "SSL *ssl" "unsigned char *d" "long len" | ||
| 1152 | .Xc | ||
| 1153 | .It Xo | ||
| 1154 | .Ft int | ||
| 1155 | .Fn SSL_use_PrivateKey_file "SSL *ssl" "char *file" "int type" | ||
| 1156 | .Xc | ||
| 1157 | .It Xo | ||
| 1158 | .Ft int | ||
| 1159 | .Fn SSL_use_RSAPrivateKey "SSL *ssl" "RSA *rsa" | ||
| 1160 | .Xc | ||
| 1161 | .It Xo | ||
| 1162 | .Ft int | ||
| 1163 | .Fn SSL_use_RSAPrivateKey_ASN1 "SSL *ssl" "unsigned char *d" "long len" | ||
| 1164 | .Xc | ||
| 1165 | .It Xo | ||
| 1166 | .Ft int | ||
| 1167 | .Fn SSL_use_RSAPrivateKey_file "SSL *ssl" "char *file" "int type" | ||
| 1168 | .Xc | ||
| 1169 | .It Xo | ||
| 1170 | .Ft int | ||
| 1171 | .Fn SSL_use_certificate "SSL *ssl" "X509 *x" | ||
| 1172 | .Xc | ||
| 1173 | .It Xo | ||
| 1174 | .Ft int | ||
| 1175 | .Fn SSL_use_certificate_ASN1 "SSL *ssl" "int len" "unsigned char *d" | ||
| 1176 | .Xc | ||
| 1177 | .It Xo | ||
| 1178 | .Ft int | ||
| 1179 | .Fn SSL_use_certificate_file "SSL *ssl" "char *file" "int type" | ||
| 1180 | .Xc | ||
| 1181 | .It Xo | ||
| 1182 | .Ft int | ||
| 1183 | .Fn SSL_version "const SSL *ssl" | ||
| 1184 | .Xc | ||
| 1185 | .It Xo | ||
| 1186 | .Ft int | ||
| 1187 | .Fn SSL_want "const SSL *ssl" | ||
| 1188 | .Xc | ||
| 1189 | .It Xo | ||
| 1190 | .Ft int | ||
| 1191 | .Fn SSL_want_nothing "const SSL *ssl" | ||
| 1192 | .Xc | ||
| 1193 | .It Xo | ||
| 1194 | .Ft int | ||
| 1195 | .Fn SSL_want_read "const SSL *ssl" | ||
| 1196 | .Xc | ||
| 1197 | .It Xo | ||
| 1198 | .Ft int | ||
| 1199 | .Fn SSL_want_write "const SSL *ssl" | ||
| 1200 | .Xc | ||
| 1201 | .It Xo | ||
| 1202 | .Ft int | ||
| 1203 | .Fn SSL_want_x509_lookup "const SSL *ssl" | ||
| 1204 | .Xc | ||
| 1205 | .It Xo | ||
| 1206 | .Ft int | ||
| 1207 | .Fn SSL_write "SSL *ssl" "const void *buf" "int num" | ||
| 1208 | .Xc | ||
| 1209 | .It Xo | ||
| 1210 | .Ft void | ||
| 1211 | .Fo SSL_set_psk_client_callback | ||
| 1212 | .Fa "SSL *ssl" | ||
| 1213 | .Fa "unsigned int (*callback)(SSL *ssl, const char *hint, char *identity, \ | ||
| 1214 | unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len)" | ||
| 1215 | .Fc | ||
| 1216 | .Xc | ||
| 1217 | .It Xo | ||
| 1218 | .Ft int | ||
| 1219 | .Fn SSL_use_psk_identity_hint "SSL *ssl" "const char *hint" | ||
| 1220 | .Xc | ||
| 1221 | .It Xo | ||
| 1222 | .Ft void | ||
| 1223 | .Fo SSL_set_psk_server_callback | ||
| 1224 | .Fa "SSL *ssl" | ||
| 1225 | .Fa "unsigned int (*callback)(SSL *ssl, const char *identity, \ | ||
| 1226 | unsigned char *psk, int max_psk_len)" | ||
| 1227 | .Fc | ||
| 1228 | .Xc | ||
| 1229 | .It Xo | ||
| 1230 | .Ft const char * | ||
| 1231 | .Fn SSL_get_psk_identity_hint "SSL *ssl" | ||
| 1232 | .Xc | ||
| 1233 | .It Xo | ||
| 1234 | .Ft const char * | ||
| 1235 | .Fn SSL_get_psk_identity "SSL *ssl" | ||
| 1236 | .Xc | ||
| 1237 | .El | ||
| 1238 | .Sh SEE ALSO | ||
| 1239 | .Xr openssl 1 , | ||
| 1240 | .Xr crypto 3 , | ||
| 1241 | .Xr d2i_SSL_SESSION 3 , | ||
| 1242 | .Xr SSL_accept 3 , | ||
| 1243 | .Xr SSL_alert_type_string 3 , | ||
| 1244 | .Xr SSL_CIPHER_get_name 3 , | ||
| 1245 | .Xr SSL_clear 3 , | ||
| 1246 | .Xr SSL_COMP_add_compression_method 3 , | ||
| 1247 | .Xr SSL_connect 3 , | ||
| 1248 | .Xr SSL_CTX_add_extra_chain_cert 3 , | ||
| 1249 | .Xr SSL_CTX_add_session 3 , | ||
| 1250 | .Xr SSL_CTX_ctrl 3 , | ||
| 1251 | .Xr SSL_CTX_flush_sessions 3 , | ||
| 1252 | .Xr SSL_CTX_get_ex_new_index 3 , | ||
| 1253 | .Xr SSL_CTX_get_verify_mode 3 , | ||
| 1254 | .Xr SSL_CTX_load_verify_locations 3 , | ||
| 1255 | .Xr SSL_CTX_new 3 , | ||
| 1256 | .Xr SSL_CTX_sess_number 3 , | ||
| 1257 | .Xr SSL_CTX_sess_set_cache_size 3 , | ||
| 1258 | .Xr SSL_CTX_sess_set_get_cb 3 , | ||
| 1259 | .Xr SSL_CTX_sessions 3 , | ||
| 1260 | .Xr SSL_CTX_set_cert_store 3 , | ||
| 1261 | .Xr SSL_CTX_set_cert_verify_callback 3 , | ||
| 1262 | .Xr SSL_CTX_set_cipher_list 3 , | ||
| 1263 | .Xr SSL_CTX_set_client_CA_list 3 , | ||
| 1264 | .Xr SSL_CTX_set_client_cert_cb 3 , | ||
| 1265 | .Xr SSL_CTX_set_default_passwd_cb 3 , | ||
| 1266 | .Xr SSL_CTX_set_generate_session_id 3 , | ||
| 1267 | .Xr SSL_CTX_set_info_callback 3 , | ||
| 1268 | .Xr SSL_CTX_set_max_cert_list 3 , | ||
| 1269 | .Xr SSL_CTX_set_mode 3 , | ||
| 1270 | .Xr SSL_CTX_set_msg_callback 3 , | ||
| 1271 | .Xr SSL_CTX_set_options 3 , | ||
| 1272 | .Xr SSL_CTX_set_psk_client_callback 3 , | ||
| 1273 | .Xr SSL_CTX_set_quiet_shutdown 3 , | ||
| 1274 | .Xr SSL_CTX_set_session_cache_mode 3 , | ||
| 1275 | .Xr SSL_CTX_set_session_id_context 3 , | ||
| 1276 | .Xr SSL_CTX_set_ssl_version 3 , | ||
| 1277 | .Xr SSL_CTX_set_timeout 3 , | ||
| 1278 | .Xr SSL_CTX_set_tmp_dh_callback 3 , | ||
| 1279 | .Xr SSL_CTX_set_tmp_rsa_callback 3 , | ||
| 1280 | .Xr SSL_CTX_set_verify 3 , | ||
| 1281 | .Xr SSL_CTX_use_certificate 3 , | ||
| 1282 | .Xr SSL_CTX_use_psk_identity_hint 3 , | ||
| 1283 | .Xr SSL_do_handshake 3 , | ||
| 1284 | .Xr SSL_get_ciphers 3 , | ||
| 1285 | .Xr SSL_get_client_CA_list 3 , | ||
| 1286 | .Xr SSL_get_default_timeout 3 , | ||
| 1287 | .Xr SSL_get_error 3 , | ||
| 1288 | .Xr SSL_get_ex_data_X509_STORE_CTX_idx 3 , | ||
| 1289 | .Xr SSL_get_ex_new_index 3 , | ||
| 1290 | .Xr SSL_get_fd 3 , | ||
| 1291 | .Xr SSL_get_peer_cert_chain 3 , | ||
| 1292 | .Xr SSL_get_psk_identity 3 , | ||
| 1293 | .Xr SSL_get_rbio 3 , | ||
| 1294 | .Xr SSL_get_session 3 , | ||
| 1295 | .Xr SSL_get_SSL_CTX 3 , | ||
| 1296 | .Xr SSL_get_verify_result 3 , | ||
| 1297 | .Xr SSL_get_version 3 , | ||
| 1298 | .Xr SSL_library_init 3 , | ||
| 1299 | .Xr SSL_load_client_CA_file 3 , | ||
| 1300 | .Xr SSL_new 3 , | ||
| 1301 | .Xr SSL_pending 3 , | ||
| 1302 | .Xr SSL_read 3 , | ||
| 1303 | .Xr SSL_rstate_string 3 , | ||
| 1304 | .Xr SSL_SESSION_free 3 , | ||
| 1305 | .Xr SSL_SESSION_get_ex_new_index 3 , | ||
| 1306 | .Xr SSL_SESSION_get_time 3 , | ||
| 1307 | .Xr SSL_session_reused 3 , | ||
| 1308 | .Xr SSL_set_bio 3 , | ||
| 1309 | .Xr SSL_set_connect_state 3 , | ||
| 1310 | .Xr SSL_set_fd 3 , | ||
| 1311 | .Xr SSL_set_session 3 , | ||
| 1312 | .Xr SSL_set_shutdown 3 , | ||
| 1313 | .Xr SSL_shutdown 3 , | ||
| 1314 | .Xr SSL_state_string 3 , | ||
| 1315 | .Xr SSL_want 3 , | ||
| 1316 | .Xr SSL_write 3 | ||
| 1317 | .Sh HISTORY | ||
| 1318 | The | ||
| 1319 | .Nm | ||
| 1320 | document appeared in OpenSSL 0.9.2. | ||
diff --git a/src/lib/libssl/doc/standards.txt b/src/lib/libssl/doc/standards.txt deleted file mode 100644 index 7bada8d35f..0000000000 --- a/src/lib/libssl/doc/standards.txt +++ /dev/null | |||
| @@ -1,285 +0,0 @@ | |||
| 1 | Standards related to OpenSSL | ||
| 2 | ============================ | ||
| 3 | |||
| 4 | [Please, this is currently a draft. I made a first try at finding | ||
| 5 | documents that describe parts of what OpenSSL implements. There are | ||
| 6 | big gaps, and I've most certainly done something wrong. Please | ||
| 7 | correct whatever is... Also, this note should be removed when this | ||
| 8 | file is reaching a somewhat correct state. -- Richard Levitte] | ||
| 9 | |||
| 10 | |||
| 11 | All pointers in here will be either URL's or blobs of text borrowed | ||
| 12 | from miscellaneous indexes, like rfc-index.txt (index of RFCs), | ||
| 13 | 1id-index.txt (index of Internet drafts) and the like. | ||
| 14 | |||
| 15 | To find the latest possible RFCs, it's recommended to either browse | ||
| 16 | ftp://ftp.isi.edu/in-notes/ or go to http://www.rfc-editor.org/ and | ||
| 17 | use the search mechanism found there. | ||
| 18 | To find the latest possible Internet drafts, it's recommended to | ||
| 19 | browse ftp://ftp.isi.edu/internet-drafts/. | ||
| 20 | To find the latest possible PKCS, it's recommended to browse | ||
| 21 | http://www.rsasecurity.com/rsalabs/pkcs/. | ||
| 22 | |||
| 23 | |||
| 24 | Implemented: | ||
| 25 | ------------ | ||
| 26 | |||
| 27 | These are documents that describe things that are implemented (in | ||
| 28 | whole or at least great parts) in OpenSSL. | ||
| 29 | |||
| 30 | 1319 The MD2 Message-Digest Algorithm. B. Kaliski. April 1992. | ||
| 31 | (Format: TXT=25661 bytes) (Status: INFORMATIONAL) | ||
| 32 | |||
| 33 | 1320 The MD4 Message-Digest Algorithm. R. Rivest. April 1992. (Format: | ||
| 34 | TXT=32407 bytes) (Status: INFORMATIONAL) | ||
| 35 | |||
| 36 | 1321 The MD5 Message-Digest Algorithm. R. Rivest. April 1992. (Format: | ||
| 37 | TXT=35222 bytes) (Status: INFORMATIONAL) | ||
| 38 | |||
| 39 | 2246 The TLS Protocol Version 1.0. T. Dierks, C. Allen. January 1999. | ||
| 40 | (Format: TXT=170401 bytes) (Status: PROPOSED STANDARD) | ||
| 41 | |||
| 42 | 2268 A Description of the RC2(r) Encryption Algorithm. R. Rivest. | ||
| 43 | January 1998. (Format: TXT=19048 bytes) (Status: INFORMATIONAL) | ||
| 44 | |||
| 45 | 2315 PKCS 7: Cryptographic Message Syntax Version 1.5. B. Kaliski. | ||
| 46 | March 1998. (Format: TXT=69679 bytes) (Status: INFORMATIONAL) | ||
| 47 | |||
| 48 | PKCS#8: Private-Key Information Syntax Standard | ||
| 49 | |||
| 50 | PKCS#12: Personal Information Exchange Syntax Standard, version 1.0. | ||
| 51 | |||
| 52 | 2560 X.509 Internet Public Key Infrastructure Online Certificate | ||
| 53 | Status Protocol - OCSP. M. Myers, R. Ankney, A. Malpani, S. Galperin, | ||
| 54 | C. Adams. June 1999. (Format: TXT=43243 bytes) (Status: PROPOSED | ||
| 55 | STANDARD) | ||
| 56 | |||
| 57 | 2712 Addition of Kerberos Cipher Suites to Transport Layer Security | ||
| 58 | (TLS). A. Medvinsky, M. Hur. October 1999. (Format: TXT=13763 bytes) | ||
| 59 | (Status: PROPOSED STANDARD) | ||
| 60 | |||
| 61 | 2898 PKCS #5: Password-Based Cryptography Specification Version 2.0. | ||
| 62 | B. Kaliski. September 2000. (Format: TXT=68692 bytes) (Status: | ||
| 63 | INFORMATIONAL) | ||
| 64 | |||
| 65 | 2986 PKCS #10: Certification Request Syntax Specification Version 1.7. | ||
| 66 | M. Nystrom, B. Kaliski. November 2000. (Format: TXT=27794 bytes) | ||
| 67 | (Obsoletes RFC2314) (Status: INFORMATIONAL) | ||
| 68 | |||
| 69 | 3174 US Secure Hash Algorithm 1 (SHA1). D. Eastlake 3rd, P. Jones. | ||
| 70 | September 2001. (Format: TXT=35525 bytes) (Status: INFORMATIONAL) | ||
| 71 | |||
| 72 | 3161 Internet X.509 Public Key Infrastructure, Time-Stamp Protocol (TSP) | ||
| 73 | C. Adams, P. Cain, D. Pinkas, R. Zuccherato. August 2001 | ||
| 74 | (Status: PROPOSED STANDARD) | ||
| 75 | |||
| 76 | 3268 Advanced Encryption Standard (AES) Ciphersuites for Transport | ||
| 77 | Layer Security (TLS). P. Chown. June 2002. (Format: TXT=13530 bytes) | ||
| 78 | (Status: PROPOSED STANDARD) | ||
| 79 | |||
| 80 | 3279 Algorithms and Identifiers for the Internet X.509 Public Key | ||
| 81 | Infrastructure Certificate and Certificate Revocation List (CRL) | ||
| 82 | Profile. L. Bassham, W. Polk, R. Housley. April 2002. (Format: | ||
| 83 | TXT=53833 bytes) (Status: PROPOSED STANDARD) | ||
| 84 | |||
| 85 | 3280 Internet X.509 Public Key Infrastructure Certificate and | ||
| 86 | Certificate Revocation List (CRL) Profile. R. Housley, W. Polk, W. | ||
| 87 | Ford, D. Solo. April 2002. (Format: TXT=295556 bytes) (Obsoletes | ||
| 88 | RFC2459) (Status: PROPOSED STANDARD) | ||
| 89 | |||
| 90 | 3447 Public-Key Cryptography Standards (PKCS) #1: RSA Cryptography | ||
| 91 | Specifications Version 2.1. J. Jonsson, B. Kaliski. February 2003. | ||
| 92 | (Format: TXT=143173 bytes) (Obsoletes RFC2437) (Status: | ||
| 93 | INFORMATIONAL) | ||
| 94 | |||
| 95 | 3713 A Description of the Camellia Encryption Algorithm. M. Matsui, | ||
| 96 | J. Nakajima, S. Moriai. April 2004. (Format: TXT=25031 bytes) | ||
| 97 | (Status: INFORMATIONAL) | ||
| 98 | |||
| 99 | 3820 Internet X.509 Public Key Infrastructure (PKI) Proxy Certificate | ||
| 100 | Profile. S. Tuecke, V. Welch, D. Engert, L. Pearlman, M. Thompson. | ||
| 101 | June 2004. (Format: TXT=86374 bytes) (Status: PROPOSED STANDARD) | ||
| 102 | |||
| 103 | 4132 Addition of Camellia Cipher Suites to Transport Layer Security | ||
| 104 | (TLS). S. Moriai, A. Kato, M. Kanda. July 2005. (Format: TXT=13590 | ||
| 105 | bytes) (Status: PROPOSED STANDARD) | ||
| 106 | |||
| 107 | 4162 Addition of SEED Cipher Suites to Transport Layer Security (TLS). | ||
| 108 | H.J. Lee, J.H. Yoon, J.I. Lee. August 2005. (Format: TXT=10578 bytes) | ||
| 109 | (Status: PROPOSED STANDARD) | ||
| 110 | |||
| 111 | 4269 The SEED Encryption Algorithm. H.J. Lee, S.J. Lee, J.H. Yoon, | ||
| 112 | D.H. Cheon, J.I. Lee. December 2005. (Format: TXT=34390 bytes) | ||
| 113 | (Obsoletes RFC4009) (Status: INFORMATIONAL) | ||
| 114 | |||
| 115 | |||
| 116 | Related: | ||
| 117 | -------- | ||
| 118 | |||
| 119 | These are documents that are close to OpenSSL, for example the | ||
| 120 | STARTTLS documents. | ||
| 121 | |||
| 122 | 1421 Privacy Enhancement for Internet Electronic Mail: Part I: Message | ||
| 123 | Encryption and Authentication Procedures. J. Linn. February 1993. | ||
| 124 | (Format: TXT=103894 bytes) (Obsoletes RFC1113) (Status: PROPOSED | ||
| 125 | STANDARD) | ||
| 126 | |||
| 127 | 1422 Privacy Enhancement for Internet Electronic Mail: Part II: | ||
| 128 | Certificate-Based Key Management. S. Kent. February 1993. (Format: | ||
| 129 | TXT=86085 bytes) (Obsoletes RFC1114) (Status: PROPOSED STANDARD) | ||
| 130 | |||
| 131 | 1423 Privacy Enhancement for Internet Electronic Mail: Part III: | ||
| 132 | Algorithms, Modes, and Identifiers. D. Balenson. February 1993. | ||
| 133 | (Format: TXT=33277 bytes) (Obsoletes RFC1115) (Status: PROPOSED | ||
| 134 | STANDARD) | ||
| 135 | |||
| 136 | 1424 Privacy Enhancement for Internet Electronic Mail: Part IV: Key | ||
| 137 | Certification and Related Services. B. Kaliski. February 1993. | ||
| 138 | (Format: TXT=17537 bytes) (Status: PROPOSED STANDARD) | ||
| 139 | |||
| 140 | 2025 The Simple Public-Key GSS-API Mechanism (SPKM). C. Adams. October | ||
| 141 | 1996. (Format: TXT=101692 bytes) (Status: PROPOSED STANDARD) | ||
| 142 | |||
| 143 | 2510 Internet X.509 Public Key Infrastructure Certificate Management | ||
| 144 | Protocols. C. Adams, S. Farrell. March 1999. (Format: TXT=158178 | ||
| 145 | bytes) (Status: PROPOSED STANDARD) | ||
| 146 | |||
| 147 | 2511 Internet X.509 Certificate Request Message Format. M. Myers, C. | ||
| 148 | Adams, D. Solo, D. Kemp. March 1999. (Format: TXT=48278 bytes) | ||
| 149 | (Status: PROPOSED STANDARD) | ||
| 150 | |||
| 151 | 2527 Internet X.509 Public Key Infrastructure Certificate Policy and | ||
| 152 | Certification Practices Framework. S. Chokhani, W. Ford. March 1999. | ||
| 153 | (Format: TXT=91860 bytes) (Status: INFORMATIONAL) | ||
| 154 | |||
| 155 | 2538 Storing Certificates in the Domain Name System (DNS). D. Eastlake | ||
| 156 | 3rd, O. Gudmundsson. March 1999. (Format: TXT=19857 bytes) (Status: | ||
| 157 | PROPOSED STANDARD) | ||
| 158 | |||
| 159 | 2539 Storage of Diffie-Hellman Keys in the Domain Name System (DNS). | ||
| 160 | D. Eastlake 3rd. March 1999. (Format: TXT=21049 bytes) (Status: | ||
| 161 | PROPOSED STANDARD) | ||
| 162 | |||
| 163 | 2559 Internet X.509 Public Key Infrastructure Operational Protocols - | ||
| 164 | LDAPv2. S. Boeyen, T. Howes, P. Richard. April 1999. (Format: | ||
| 165 | TXT=22889 bytes) (Updates RFC1778) (Status: PROPOSED STANDARD) | ||
| 166 | |||
| 167 | 2585 Internet X.509 Public Key Infrastructure Operational Protocols: | ||
| 168 | FTP and HTTP. R. Housley, P. Hoffman. May 1999. (Format: TXT=14813 | ||
| 169 | bytes) (Status: PROPOSED STANDARD) | ||
| 170 | |||
| 171 | 2587 Internet X.509 Public Key Infrastructure LDAPv2 Schema. S. | ||
| 172 | Boeyen, T. Howes, P. Richard. June 1999. (Format: TXT=15102 bytes) | ||
| 173 | (Status: PROPOSED STANDARD) | ||
| 174 | |||
| 175 | 2595 Using TLS with IMAP, POP3 and ACAP. C. Newman. June 1999. | ||
| 176 | (Format: TXT=32440 bytes) (Status: PROPOSED STANDARD) | ||
| 177 | |||
| 178 | 2631 Diffie-Hellman Key Agreement Method. E. Rescorla. June 1999. | ||
| 179 | (Format: TXT=25932 bytes) (Status: PROPOSED STANDARD) | ||
| 180 | |||
| 181 | 2632 S/MIME Version 3 Certificate Handling. B. Ramsdell, Ed.. June | ||
| 182 | 1999. (Format: TXT=27925 bytes) (Status: PROPOSED STANDARD) | ||
| 183 | |||
| 184 | 2716 PPP EAP TLS Authentication Protocol. B. Aboba, D. Simon. October | ||
| 185 | 1999. (Format: TXT=50108 bytes) (Status: EXPERIMENTAL) | ||
| 186 | |||
| 187 | 2773 Encryption using KEA and SKIPJACK. R. Housley, P. Yee, W. Nace. | ||
| 188 | February 2000. (Format: TXT=20008 bytes) (Updates RFC0959) (Status: | ||
| 189 | EXPERIMENTAL) | ||
| 190 | |||
| 191 | 2797 Certificate Management Messages over CMS. M. Myers, X. Liu, J. | ||
| 192 | Schaad, J. Weinstein. April 2000. (Format: TXT=103357 bytes) (Status: | ||
| 193 | PROPOSED STANDARD) | ||
| 194 | |||
| 195 | 2817 Upgrading to TLS Within HTTP/1.1. R. Khare, S. Lawrence. May | ||
| 196 | 2000. (Format: TXT=27598 bytes) (Updates RFC2616) (Status: PROPOSED | ||
| 197 | STANDARD) | ||
| 198 | |||
| 199 | 2818 HTTP Over TLS. E. Rescorla. May 2000. (Format: TXT=15170 bytes) | ||
| 200 | (Status: INFORMATIONAL) | ||
| 201 | |||
| 202 | 2876 Use of the KEA and SKIPJACK Algorithms in CMS. J. Pawling. July | ||
| 203 | 2000. (Format: TXT=29265 bytes) (Status: INFORMATIONAL) | ||
| 204 | |||
| 205 | 2984 Use of the CAST-128 Encryption Algorithm in CMS. C. Adams. | ||
| 206 | October 2000. (Format: TXT=11591 bytes) (Status: PROPOSED STANDARD) | ||
| 207 | |||
| 208 | 2985 PKCS #9: Selected Object Classes and Attribute Types Version 2.0. | ||
| 209 | M. Nystrom, B. Kaliski. November 2000. (Format: TXT=70703 bytes) | ||
| 210 | (Status: INFORMATIONAL) | ||
| 211 | |||
| 212 | 3029 Internet X.509 Public Key Infrastructure Data Validation and | ||
| 213 | Certification Server Protocols. C. Adams, P. Sylvester, M. Zolotarev, | ||
| 214 | R. Zuccherato. February 2001. (Format: TXT=107347 bytes) (Status: | ||
| 215 | EXPERIMENTAL) | ||
| 216 | |||
| 217 | 3039 Internet X.509 Public Key Infrastructure Qualified Certificates | ||
| 218 | Profile. S. Santesson, W. Polk, P. Barzin, M. Nystrom. January 2001. | ||
| 219 | (Format: TXT=67619 bytes) (Status: PROPOSED STANDARD) | ||
| 220 | |||
| 221 | 3058 Use of the IDEA Encryption Algorithm in CMS. S. Teiwes, P. | ||
| 222 | Hartmann, D. Kuenzi. February 2001. (Format: TXT=17257 bytes) | ||
| 223 | (Status: INFORMATIONAL) | ||
| 224 | |||
| 225 | 3161 Internet X.509 Public Key Infrastructure Time-Stamp Protocol | ||
| 226 | (TSP). C. Adams, P. Cain, D. Pinkas, R. Zuccherato. August 2001. | ||
| 227 | (Format: TXT=54585 bytes) (Status: PROPOSED STANDARD) | ||
| 228 | |||
| 229 | 3185 Reuse of CMS Content Encryption Keys. S. Farrell, S. Turner. | ||
| 230 | October 2001. (Format: TXT=20404 bytes) (Status: PROPOSED STANDARD) | ||
| 231 | |||
| 232 | 3207 SMTP Service Extension for Secure SMTP over Transport Layer | ||
| 233 | Security. P. Hoffman. February 2002. (Format: TXT=18679 bytes) | ||
| 234 | (Obsoletes RFC2487) (Status: PROPOSED STANDARD) | ||
| 235 | |||
| 236 | 3217 Triple-DES and RC2 Key Wrapping. R. Housley. December 2001. | ||
| 237 | (Format: TXT=19855 bytes) (Status: INFORMATIONAL) | ||
| 238 | |||
| 239 | 3274 Compressed Data Content Type for Cryptographic Message Syntax | ||
| 240 | (CMS). P. Gutmann. June 2002. (Format: TXT=11276 bytes) (Status: | ||
| 241 | PROPOSED STANDARD) | ||
| 242 | |||
| 243 | 3278 Use of Elliptic Curve Cryptography (ECC) Algorithms in | ||
| 244 | Cryptographic Message Syntax (CMS). S. Blake-Wilson, D. Brown, P. | ||
| 245 | Lambert. April 2002. (Format: TXT=33779 bytes) (Status: | ||
| 246 | INFORMATIONAL) | ||
| 247 | |||
| 248 | 3281 An Internet Attribute Certificate Profile for Authorization. S. | ||
| 249 | Farrell, R. Housley. April 2002. (Format: TXT=90580 bytes) (Status: | ||
| 250 | PROPOSED STANDARD) | ||
| 251 | |||
| 252 | 3369 Cryptographic Message Syntax (CMS). R. Housley. August 2002. | ||
| 253 | (Format: TXT=113975 bytes) (Obsoletes RFC2630, RFC3211) (Status: | ||
| 254 | PROPOSED STANDARD) | ||
| 255 | |||
| 256 | 3370 Cryptographic Message Syntax (CMS) Algorithms. R. Housley. August | ||
| 257 | 2002. (Format: TXT=51001 bytes) (Obsoletes RFC2630, RFC3211) (Status: | ||
| 258 | PROPOSED STANDARD) | ||
| 259 | |||
| 260 | 3377 Lightweight Directory Access Protocol (v3): Technical | ||
| 261 | Specification. J. Hodges, R. Morgan. September 2002. (Format: | ||
| 262 | TXT=9981 bytes) (Updates RFC2251, RFC2252, RFC2253, RFC2254, RFC2255, | ||
| 263 | RFC2256, RFC2829, RFC2830) (Status: PROPOSED STANDARD) | ||
| 264 | |||
| 265 | 3394 Advanced Encryption Standard (AES) Key Wrap Algorithm. J. Schaad, | ||
| 266 | R. Housley. September 2002. (Format: TXT=73072 bytes) (Status: | ||
| 267 | INFORMATIONAL) | ||
| 268 | |||
| 269 | 3436 Transport Layer Security over Stream Control Transmission | ||
| 270 | Protocol. A. Jungmaier, E. Rescorla, M. Tuexen. December 2002. | ||
| 271 | (Format: TXT=16333 bytes) (Status: PROPOSED STANDARD) | ||
| 272 | |||
| 273 | 3657 Use of the Camellia Encryption Algorithm in Cryptographic | ||
| 274 | Message Syntax (CMS). S. Moriai, A. Kato. January 2004. | ||
| 275 | (Format: TXT=26282 bytes) (Status: PROPOSED STANDARD) | ||
| 276 | |||
| 277 | "Securing FTP with TLS", 01/27/2000, <draft-murray-auth-ftp-ssl-05.txt> | ||
| 278 | |||
| 279 | |||
| 280 | To be implemented: | ||
| 281 | ------------------ | ||
| 282 | |||
| 283 | These are documents that describe things that are planed to be | ||
| 284 | implemented in the hopefully short future. | ||
| 285 | |||
