diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/man/BIO.3 | 11 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BIO_ctrl.3 | 43 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BIO_f_base64.3 | 14 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BIO_f_buffer.3 | 12 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BIO_f_cipher.3 | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BIO_f_md.3 | 14 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BIO_f_null.3 | 7 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BIO_find_type.3 | 12 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BIO_new.3 | 36 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BIO_push.3 | 42 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BIO_read.3 | 30 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BIO_s_accept.3 | 28 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BIO_s_bio.3 | 36 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BIO_s_connect.3 | 24 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BIO_s_fd.3 | 8 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BIO_s_file.3 | 10 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BIO_s_mem.3 | 12 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BIO_s_null.3 | 8 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BIO_s_socket.3 | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BIO_set_callback.3 | 13 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/BIO_should_retry.3 | 21 |
21 files changed, 193 insertions, 200 deletions
diff --git a/src/lib/libcrypto/man/BIO.3 b/src/lib/libcrypto/man/BIO.3 index f3a419721f..89b51720a6 100644 --- a/src/lib/libcrypto/man/BIO.3 +++ b/src/lib/libcrypto/man/BIO.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: BIO.3,v 1.3 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: BIO.3,v 1.4 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO 3 | 4 | .Dt BIO 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -10,14 +10,14 @@ | |||
| 10 | .In openssl/bio.h | 10 | .In openssl/bio.h |
| 11 | .Sh DESCRIPTION | 11 | .Sh DESCRIPTION |
| 12 | A BIO is an I/O abstraction, | 12 | A BIO is an I/O abstraction, |
| 13 | it hides many of the underlying I/O details from an application. | 13 | hiding many of the underlying I/O details from an application. |
| 14 | If an application uses a BIO for its I/O, it can transparently handle | 14 | If an application uses a BIO for its I/O, it can transparently handle |
| 15 | SSL connections, unencrypted network connections and file I/O. | 15 | SSL connections, unencrypted network connections and file I/O. |
| 16 | .Pp | 16 | .Pp |
| 17 | There are two types of BIO, a source/sink BIO and a filter BIO. | 17 | There are two types of BIO, a source/sink BIO and a filter BIO. |
| 18 | .Pp | 18 | .Pp |
| 19 | As its name implies, a source/sink BIO is a source and/or sink of data, | 19 | As its name implies, a source/sink BIO is a source and/or sink of data. |
| 20 | examples include a socket BIO and a file BIO. | 20 | Examples include a socket BIO and a file BIO. |
| 21 | .Pp | 21 | .Pp |
| 22 | A filter BIO takes data from one BIO and passes it through | 22 | A filter BIO takes data from one BIO and passes it through |
| 23 | to another, or to the application. | 23 | to another, or to the application. |
| @@ -43,7 +43,6 @@ to the end (normally a source/sink BIO). | |||
| 43 | .Xr BIO_f_ssl 3 , | 43 | .Xr BIO_f_ssl 3 , |
| 44 | .Xr BIO_find_type 3 , | 44 | .Xr BIO_find_type 3 , |
| 45 | .Xr BIO_new 3 , | 45 | .Xr BIO_new 3 , |
| 46 | .Xr BIO_new_bio_pair 3 , | ||
| 47 | .Xr BIO_push 3 , | 46 | .Xr BIO_push 3 , |
| 48 | .Xr BIO_read 3 , | 47 | .Xr BIO_read 3 , |
| 49 | .Xr BIO_s_accept 3 , | 48 | .Xr BIO_s_accept 3 , |
diff --git a/src/lib/libcrypto/man/BIO_ctrl.3 b/src/lib/libcrypto/man/BIO_ctrl.3 index 391158bd42..6557d10730 100644 --- a/src/lib/libcrypto/man/BIO_ctrl.3 +++ b/src/lib/libcrypto/man/BIO_ctrl.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: BIO_ctrl.3,v 1.3 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: BIO_ctrl.3,v 1.4 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO_CTRL 3 | 4 | .Dt BIO_CTRL 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -122,16 +122,17 @@ | |||
| 122 | and | 122 | and |
| 123 | .Fn BIO_int_ctrl | 123 | .Fn BIO_int_ctrl |
| 124 | are BIO "control" operations taking arguments of various types. | 124 | are BIO "control" operations taking arguments of various types. |
| 125 | These functions are not normally called directly, | 125 | These functions are not normally called directly - |
| 126 | various macros are used instead. | 126 | various macros are used instead. |
| 127 | The standard macros are described below, macros specific to a | 127 | The standard macros are described below. |
| 128 | particular type of BIO are described in the specific BIO's manual | 128 | Macros specific to a particular type of BIO |
| 129 | page as well as any special features of the standard calls. | 129 | are described in the specific BIO's manual page |
| 130 | as well as any special features of the standard calls. | ||
| 130 | .Pp | 131 | .Pp |
| 131 | .Fn BIO_reset | 132 | .Fn BIO_reset |
| 132 | typically resets a BIO to some initial state, in the case | 133 | typically resets a BIO to some initial state. |
| 133 | of file related BIOs for example it rewinds the file pointer | 134 | In the case of file related BIOs, for example, |
| 134 | to the start of the file. | 135 | it rewinds the file pointer to the start of the file. |
| 135 | .Pp | 136 | .Pp |
| 136 | .Fn BIO_seek | 137 | .Fn BIO_seek |
| 137 | resets a file related BIO's (that is file descriptor and | 138 | resets a file related BIO's (that is file descriptor and |
| @@ -143,12 +144,12 @@ bytes from start of file. | |||
| 143 | returns the current file position of a file related BIO. | 144 | returns the current file position of a file related BIO. |
| 144 | .Pp | 145 | .Pp |
| 145 | .Fn BIO_flush | 146 | .Fn BIO_flush |
| 146 | normally writes out any internally buffered data, in some cases | 147 | normally writes out any internally buffered data. |
| 147 | it is used to signal EOF and that no more data will be written. | 148 | In some cases it is used to signal EOF and that no more data will be written. |
| 148 | .Pp | 149 | .Pp |
| 149 | .Fn BIO_eof | 150 | .Fn BIO_eof |
| 150 | returns 1 if the BIO has read EOF, the precise meaning of | 151 | returns 1 if the BIO has read EOF. |
| 151 | "EOF" varies according to the BIO type. | 152 | The precise meaning of "EOF" varies according to the BIO type. |
| 152 | .Pp | 153 | .Pp |
| 153 | .Fn BIO_set_close | 154 | .Fn BIO_set_close |
| 154 | sets the BIO | 155 | sets the BIO |
| @@ -180,7 +181,7 @@ and | |||
| 180 | .Fn BIO_ctrl_wpending | 181 | .Fn BIO_ctrl_wpending |
| 181 | return a | 182 | return a |
| 182 | .Vt size_t | 183 | .Vt size_t |
| 183 | type and are functions, | 184 | type and are functions. |
| 184 | .Fn BIO_pending | 185 | .Fn BIO_pending |
| 185 | and | 186 | and |
| 186 | .Fn BIO_wpending | 187 | .Fn BIO_wpending |
| @@ -189,7 +190,7 @@ are macros which call | |||
| 189 | .Sh RETURN VALUES | 190 | .Sh RETURN VALUES |
| 190 | .Fn BIO_reset | 191 | .Fn BIO_reset |
| 191 | normally returns 1 for success and 0 or -1 for failure. | 192 | normally returns 1 for success and 0 or -1 for failure. |
| 192 | File BIOs are an exception, they return 0 for success and -1 for failure. | 193 | File BIOs are an exception, returning 0 for success and -1 for failure. |
| 193 | .Pp | 194 | .Pp |
| 194 | .Fn BIO_seek | 195 | .Fn BIO_seek |
| 195 | and | 196 | and |
| @@ -203,7 +204,7 @@ always return 0 for success and -1 for failure. | |||
| 203 | returns 1 for success and 0 or -1 for failure. | 204 | returns 1 for success and 0 or -1 for failure. |
| 204 | .Pp | 205 | .Pp |
| 205 | .Fn BIO_eof | 206 | .Fn BIO_eof |
| 206 | returns 1 if EOF has been reached 0 otherwise. | 207 | returns 1 if EOF has been reached or 0 otherwise. |
| 207 | .Pp | 208 | .Pp |
| 208 | .Fn BIO_set_close | 209 | .Fn BIO_set_close |
| 209 | always returns 1. | 210 | always returns 1. |
| @@ -228,7 +229,7 @@ in a similar manner to | |||
| 228 | .Fn BIO_write . | 229 | .Fn BIO_write . |
| 229 | The | 230 | The |
| 230 | .Fn BIO_should_retry | 231 | .Fn BIO_should_retry |
| 231 | call should be used and appropriate action taken is the call fails. | 232 | call should be used and appropriate action taken if the call fails. |
| 232 | .Pp | 233 | .Pp |
| 233 | The return values of | 234 | The return values of |
| 234 | .Fn BIO_pending | 235 | .Fn BIO_pending |
| @@ -238,7 +239,7 @@ may not reliably determine the amount of pending data in all cases. | |||
| 238 | For example in the case of a file BIO some data may be available in the | 239 | For example in the case of a file BIO some data may be available in the |
| 239 | .Vt FILE | 240 | .Vt FILE |
| 240 | structure's internal buffers but it is not possible | 241 | structure's internal buffers but it is not possible |
| 241 | to determine this in a portably way. | 242 | to determine this in a portable way. |
| 242 | For other types of BIO they may not be supported. | 243 | For other types of BIO they may not be supported. |
| 243 | .Pp | 244 | .Pp |
| 244 | If they do not internally handle a particular | 245 | If they do not internally handle a particular |
| @@ -246,10 +247,10 @@ If they do not internally handle a particular | |||
| 246 | operation, filter BIOs usually pass the operation | 247 | operation, filter BIOs usually pass the operation |
| 247 | to the next BIO in the chain. | 248 | to the next BIO in the chain. |
| 248 | This often means there is no need to locate the required BIO for | 249 | This often means there is no need to locate the required BIO for |
| 249 | a particular operation, it can be called on a chain and it will | 250 | a particular operation: it can be called on a chain and it will |
| 250 | be automatically passed to the relevant BIO. | 251 | be automatically passed to the relevant BIO. |
| 251 | However this can cause unexpected results: | 252 | However this can cause unexpected results. |
| 252 | for example no current filter BIOs implement | 253 | For example no current filter BIOs implement |
| 253 | .Fn BIO_seek , | 254 | .Fn BIO_seek , |
| 254 | but this may still succeed if the chain ends | 255 | but this may still succeed if the chain ends |
| 255 | in a FILE or file descriptor BIO. | 256 | in a FILE or file descriptor BIO. |
diff --git a/src/lib/libcrypto/man/BIO_f_base64.3 b/src/lib/libcrypto/man/BIO_f_base64.3 index d86a2e0daa..5051ad14b8 100644 --- a/src/lib/libcrypto/man/BIO_f_base64.3 +++ b/src/lib/libcrypto/man/BIO_f_base64.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: BIO_f_base64.3,v 1.3 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: BIO_f_base64.3,v 1.4 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO_F_BASE64 3 | 4 | .Dt BIO_F_BASE64 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -32,10 +32,10 @@ this is used to flush the final block through the BIO. | |||
| 32 | The flag | 32 | The flag |
| 33 | .Dv BIO_FLAGS_BASE64_NO_NL | 33 | .Dv BIO_FLAGS_BASE64_NO_NL |
| 34 | can be set with | 34 | can be set with |
| 35 | .Xr BIO_set_flags 3 | 35 | .Fn BIO_set_flags |
| 36 | to encode the data all on one line | 36 | to encode the data all on one line |
| 37 | or expect the data to be all on one line. | 37 | or expect the data to be all on one line. |
| 38 | .Sh NOTES | 38 | .Pp |
| 39 | Because of the format of base64 encoding the end of the encoded | 39 | Because of the format of base64 encoding the end of the encoded |
| 40 | block cannot always be reliably determined. | 40 | block cannot always be reliably determined. |
| 41 | .Sh RETURN VALUES | 41 | .Sh RETURN VALUES |
| @@ -57,7 +57,7 @@ BIO_flush(b64); | |||
| 57 | BIO_free_all(b64); | 57 | BIO_free_all(b64); |
| 58 | .Ed | 58 | .Ed |
| 59 | .Pp | 59 | .Pp |
| 60 | Read Base64 encoded data from standard input | 60 | Read Base64-encoded data from standard input |
| 61 | and write the decoded data to standard output: | 61 | and write the decoded data to standard output: |
| 62 | .Bd -literal -offset indent | 62 | .Bd -literal -offset indent |
| 63 | BIO *bio, *b64, *bio_out; | 63 | BIO *bio, *b64, *bio_out; |
| @@ -75,8 +75,8 @@ BIO_flush(bio_out); | |||
| 75 | BIO_free_all(b64); | 75 | BIO_free_all(b64); |
| 76 | .Ed | 76 | .Ed |
| 77 | .Sh BUGS | 77 | .Sh BUGS |
| 78 | The ambiguity of EOF in base64 encoded data can cause additional | 78 | The ambiguity of EOF in base64-encoded data can cause additional |
| 79 | data following the base64 encoded block to be misinterpreted. | 79 | data following the base64-encoded block to be misinterpreted. |
| 80 | .Pp | 80 | .Pp |
| 81 | There should be some way of specifying a test that the BIO can perform | 81 | There should be some way of specifying a test that the BIO can perform |
| 82 | to reliably determine EOF (for example a MIME boundary). | 82 | to reliably determine EOF (for example a MIME boundary). |
diff --git a/src/lib/libcrypto/man/BIO_f_buffer.3 b/src/lib/libcrypto/man/BIO_f_buffer.3 index 785934d553..c673fe535e 100644 --- a/src/lib/libcrypto/man/BIO_f_buffer.3 +++ b/src/lib/libcrypto/man/BIO_f_buffer.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: BIO_f_buffer.3,v 1.3 2015/11/11 22:14:39 jmc Exp $ | 1 | .\" $OpenBSD: BIO_f_buffer.3,v 1.4 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 11 2015 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO_F_BUFFER 3 | 4 | .Dt BIO_F_BUFFER 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -72,16 +72,16 @@ bytes of | |||
| 72 | If | 72 | If |
| 73 | .Fa num | 73 | .Fa num |
| 74 | is larger than the current buffer size the buffer is expanded. | 74 | is larger than the current buffer size the buffer is expanded. |
| 75 | .Sh NOTES | 75 | .Pp |
| 76 | Buffering BIOs implement | 76 | Buffering BIOs implement |
| 77 | .Xr BIO_gets 3 | 77 | .Xr BIO_gets 3 |
| 78 | by using | 78 | by using |
| 79 | .Xr BIO_read 3 | 79 | .Xr BIO_read 3 |
| 80 | operations on the next BIO in the chain. | 80 | operations on the next BIO in the chain. |
| 81 | By prepending a buffering BIO to a chain | 81 | By prepending a buffering BIO to a chain |
| 82 | it is therefore possible to provide | 82 | it is therefore possible to provide the functionality of |
| 83 | .Xr BIO_gets 3 | 83 | .Xr BIO_gets 3 |
| 84 | functionality if the following BIOs do not support it (for example SSL BIOs). | 84 | if the following BIOs do not support it (for example SSL BIOs). |
| 85 | .Pp | 85 | .Pp |
| 86 | Data is only written to the next BIO in the chain | 86 | Data is only written to the next BIO in the chain |
| 87 | when the write buffer fills or when | 87 | when the write buffer fills or when |
| @@ -93,7 +93,7 @@ whenever any pending data should be written | |||
| 93 | such as when removing a buffering BIO using | 93 | such as when removing a buffering BIO using |
| 94 | .Xr BIO_pop 3 . | 94 | .Xr BIO_pop 3 . |
| 95 | .Xr BIO_flush 3 | 95 | .Xr BIO_flush 3 |
| 96 | may need to be retried if the ultimate source/sink BIO is non blocking. | 96 | may need to be retried if the ultimate source/sink BIO is non-blocking. |
| 97 | .Sh RETURN VALUES | 97 | .Sh RETURN VALUES |
| 98 | .Fn BIO_f_buffer | 98 | .Fn BIO_f_buffer |
| 99 | returns the buffering BIO method. | 99 | returns the buffering BIO method. |
diff --git a/src/lib/libcrypto/man/BIO_f_cipher.3 b/src/lib/libcrypto/man/BIO_f_cipher.3 index 4ecde4f69d..b6a7cb1ab9 100644 --- a/src/lib/libcrypto/man/BIO_f_cipher.3 +++ b/src/lib/libcrypto/man/BIO_f_cipher.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: BIO_f_cipher.3,v 1.3 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: BIO_f_cipher.3,v 1.4 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO_F_CIPHER 3 | 4 | .Dt BIO_F_CIPHER 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -83,7 +83,7 @@ with the standard cipher routines to set it up. | |||
| 83 | This is useful when | 83 | This is useful when |
| 84 | .Fn BIO_set_cipher | 84 | .Fn BIO_set_cipher |
| 85 | is not flexible enough for the applications needs. | 85 | is not flexible enough for the applications needs. |
| 86 | .Sh NOTES | 86 | .Pp |
| 87 | When encrypting, | 87 | When encrypting, |
| 88 | .Xr BIO_flush 3 | 88 | .Xr BIO_flush 3 |
| 89 | must be called to flush the final block through the BIO. | 89 | must be called to flush the final block through the BIO. |
diff --git a/src/lib/libcrypto/man/BIO_f_md.3 b/src/lib/libcrypto/man/BIO_f_md.3 index 3b3f1de329..8514883943 100644 --- a/src/lib/libcrypto/man/BIO_f_md.3 +++ b/src/lib/libcrypto/man/BIO_f_md.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: BIO_f_md.3,v 1.3 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: BIO_f_md.3,v 1.4 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO_F_MD 3 | 4 | .Dt BIO_F_MD 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -80,7 +80,7 @@ macro. | |||
| 80 | .Fn BIO_get_md_ctx | 80 | .Fn BIO_get_md_ctx |
| 81 | returns the digest BIOs context in | 81 | returns the digest BIOs context in |
| 82 | .Fa mdcp . | 82 | .Fa mdcp . |
| 83 | .Sh NOTES | 83 | .Pp |
| 84 | The context returned by | 84 | The context returned by |
| 85 | .Fn BIO_get_md_ctx | 85 | .Fn BIO_get_md_ctx |
| 86 | can be used in calls to | 86 | can be used in calls to |
| @@ -112,10 +112,10 @@ then this can be done by prepending a buffering BIO. | |||
| 112 | .Pp | 112 | .Pp |
| 113 | Before OpenSSL 1.0.0 the call to | 113 | Before OpenSSL 1.0.0 the call to |
| 114 | .Fn BIO_get_md_ctx | 114 | .Fn BIO_get_md_ctx |
| 115 | would only work if the BIO had been initialized for example by calling | 115 | would only work if the BIO had been initialized, for example by calling |
| 116 | .Fn BIO_set_md . | 116 | .Fn BIO_set_md . |
| 117 | In OpenSSL 1.0.0 and later the context is always returned | 117 | In OpenSSL 1.0.0 and later the context is always returned |
| 118 | and the BIO is state is set to initialized. | 118 | and the state of the BIO is set to initialized. |
| 119 | This allows applications to initialize the context externally | 119 | This allows applications to initialize the context externally |
| 120 | if the standard calls such as | 120 | if the standard calls such as |
| 121 | .Fn BIO_set_md | 121 | .Fn BIO_set_md |
| @@ -130,7 +130,7 @@ and | |||
| 130 | .Fn BIO_get_md_ctx | 130 | .Fn BIO_get_md_ctx |
| 131 | return 1 for success and 0 for failure. | 131 | return 1 for success and 0 for failure. |
| 132 | .Sh EXAMPLES | 132 | .Sh EXAMPLES |
| 133 | The following example creates a BIO chain containing an SHA1 and MD5 | 133 | The following example creates a BIO chain containing an SHA-1 and MD5 |
| 134 | digest BIO and passes the string "Hello World" through it. | 134 | digest BIO and passes the string "Hello World" through it. |
| 135 | Error checking has been omitted for clarity. | 135 | Error checking has been omitted for clarity. |
| 136 | .Bd -literal -offset 2n | 136 | .Bd -literal -offset 2n |
| @@ -198,7 +198,7 @@ BIO_free_all(bio); | |||
| 198 | .Sh BUGS | 198 | .Sh BUGS |
| 199 | The lack of support for | 199 | The lack of support for |
| 200 | .Xr BIO_puts 3 | 200 | .Xr BIO_puts 3 |
| 201 | and the non standard behaviour of | 201 | and the non-standard behaviour of |
| 202 | .Xr BIO_gets 3 | 202 | .Xr BIO_gets 3 |
| 203 | could be regarded as anomalous. | 203 | could be regarded as anomalous. |
| 204 | It could be argued that | 204 | It could be argued that |
diff --git a/src/lib/libcrypto/man/BIO_f_null.3 b/src/lib/libcrypto/man/BIO_f_null.3 index 236d233e57..8e1e58f159 100644 --- a/src/lib/libcrypto/man/BIO_f_null.3 +++ b/src/lib/libcrypto/man/BIO_f_null.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: BIO_f_null.3,v 1.3 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: BIO_f_null.3,v 1.4 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO_F_NULL 3 | 4 | .Dt BIO_F_NULL 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -16,12 +16,11 @@ | |||
| 16 | .Fn BIO_f_null | 16 | .Fn BIO_f_null |
| 17 | returns the null filter BIO method. | 17 | returns the null filter BIO method. |
| 18 | This is a filter BIO that does nothing. | 18 | This is a filter BIO that does nothing. |
| 19 | As may be apparent, a null filter BIO is not particularly useful. | ||
| 19 | .Pp | 20 | .Pp |
| 20 | All requests to a null filter BIO are passed through to the next BIO | 21 | All requests to a null filter BIO are passed through to the next BIO |
| 21 | in the chain: this means that a BIO chain containing a null filter BIO | 22 | in the chain: this means that a BIO chain containing a null filter BIO |
| 22 | behaves just as though the BIO was not there. | 23 | behaves just as though the BIO was not there. |
| 23 | .Sh NOTES | ||
| 24 | As may be apparent, a null filter BIO is not particularly useful. | ||
| 25 | .Sh RETURN VALUES | 24 | .Sh RETURN VALUES |
| 26 | .Fn BIO_f_null | 25 | .Fn BIO_f_null |
| 27 | returns the null filter BIO method. | 26 | returns the null filter BIO method. |
diff --git a/src/lib/libcrypto/man/BIO_find_type.3 b/src/lib/libcrypto/man/BIO_find_type.3 index 1db2fe85c6..be0e0d0b3d 100644 --- a/src/lib/libcrypto/man/BIO_find_type.3 +++ b/src/lib/libcrypto/man/BIO_find_type.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: BIO_find_type.3,v 1.3 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: BIO_find_type.3,v 1.4 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO_FIND_TYPE 3 | 4 | .Dt BIO_FIND_TYPE 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -86,14 +86,6 @@ returns the next BIO in a chain. | |||
| 86 | .Fn BIO_method_type | 86 | .Fn BIO_method_type |
| 87 | returns the type of the BIO | 87 | returns the type of the BIO |
| 88 | .Fa b . | 88 | .Fa b . |
| 89 | .Sh NOTES | ||
| 90 | .Fn BIO_next | ||
| 91 | was added to OpenSSL 0.9.6 to provide a 'clean' way to traverse a BIO | ||
| 92 | chain or find multiple matches using | ||
| 93 | .Fn BIO_find_type . | ||
| 94 | Previous versions had to use: | ||
| 95 | .Pp | ||
| 96 | .Dl next = bio->next_bio; | ||
| 97 | .Sh EXAMPLES | 89 | .Sh EXAMPLES |
| 98 | Traverse a chain looking for digest BIOs: | 90 | Traverse a chain looking for digest BIOs: |
| 99 | .Bd -literal -offset 2n | 91 | .Bd -literal -offset 2n |
diff --git a/src/lib/libcrypto/man/BIO_new.3 b/src/lib/libcrypto/man/BIO_new.3 index b08de9c650..7138598674 100644 --- a/src/lib/libcrypto/man/BIO_new.3 +++ b/src/lib/libcrypto/man/BIO_new.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: BIO_new.3,v 1.3 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: BIO_new.3,v 1.4 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO_NEW 3 | 4 | .Dt BIO_NEW 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -43,7 +43,7 @@ function returns a new BIO using method | |||
| 43 | sets the method of an already existing BIO. | 43 | sets the method of an already existing BIO. |
| 44 | .Pp | 44 | .Pp |
| 45 | .Fn BIO_free | 45 | .Fn BIO_free |
| 46 | frees up a single BIO, | 46 | frees up a single BIO; |
| 47 | .Fn BIO_vfree | 47 | .Fn BIO_vfree |
| 48 | also frees up a single BIO, but it does not return a value. | 48 | also frees up a single BIO, but it does not return a value. |
| 49 | Calling | 49 | Calling |
| @@ -59,22 +59,7 @@ descriptions. | |||
| 59 | frees up an entire BIO chain. | 59 | frees up an entire BIO chain. |
| 60 | It does not halt if an error occurs | 60 | It does not halt if an error occurs |
| 61 | freeing up an individual BIO in the chain. | 61 | freeing up an individual BIO in the chain. |
| 62 | .Sh RETURN VALUES | ||
| 63 | .Fn BIO_new | ||
| 64 | returns a newly created BIO or | ||
| 65 | .Dv NULL | ||
| 66 | if the call fails. | ||
| 67 | .Pp | 62 | .Pp |
| 68 | .Fn BIO_set | ||
| 69 | and | ||
| 70 | .Fn BIO_free | ||
| 71 | return 1 for success and 0 for failure. | ||
| 72 | .Pp | ||
| 73 | .Fn BIO_free_all | ||
| 74 | and | ||
| 75 | .Fn BIO_vfree | ||
| 76 | do not return values. | ||
| 77 | .Sh NOTES | ||
| 78 | Some BIOs (such as memory BIOs) can be used immediately after calling | 63 | Some BIOs (such as memory BIOs) can be used immediately after calling |
| 79 | .Fn BIO_new . | 64 | .Fn BIO_new . |
| 80 | Others (such as file BIOs) need some additional initialization, and | 65 | Others (such as file BIOs) need some additional initialization, and |
| @@ -100,6 +85,21 @@ a source/sink BIO is normally called | |||
| 100 | .Fn BIO_s_* | 85 | .Fn BIO_s_* |
| 101 | and a filter BIO | 86 | and a filter BIO |
| 102 | .Fn BIO_f_* . | 87 | .Fn BIO_f_* . |
| 88 | .Sh RETURN VALUES | ||
| 89 | .Fn BIO_new | ||
| 90 | returns a newly created BIO or | ||
| 91 | .Dv NULL | ||
| 92 | if the call fails. | ||
| 93 | .Pp | ||
| 94 | .Fn BIO_set | ||
| 95 | and | ||
| 96 | .Fn BIO_free | ||
| 97 | return 1 for success and 0 for failure. | ||
| 98 | .Pp | ||
| 99 | .Fn BIO_free_all | ||
| 100 | and | ||
| 101 | .Fn BIO_vfree | ||
| 102 | do not return values. | ||
| 103 | .Sh EXAMPLES | 103 | .Sh EXAMPLES |
| 104 | Create a memory BIO: | 104 | Create a memory BIO: |
| 105 | .Pp | 105 | .Pp |
diff --git a/src/lib/libcrypto/man/BIO_push.3 b/src/lib/libcrypto/man/BIO_push.3 index 0357a8446c..eff3619fb3 100644 --- a/src/lib/libcrypto/man/BIO_push.3 +++ b/src/lib/libcrypto/man/BIO_push.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: BIO_push.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: BIO_push.3,v 1.3 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO_PUSH 3 | 4 | .Dt BIO_PUSH 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -35,22 +35,14 @@ from a chain and returns the next BIO in the chain, or | |||
| 35 | .Dv NULL | 35 | .Dv NULL |
| 36 | if there is no next BIO. | 36 | if there is no next BIO. |
| 37 | The removed BIO then becomes a single BIO with no association with the | 37 | The removed BIO then becomes a single BIO with no association with the |
| 38 | original chain, it can thus be freed or attached to a different chain. | 38 | original chain. |
| 39 | .Sh RETURN VALUES | 39 | it can thus be freed or attached to a different chain. |
| 40 | .Fn BIO_push | ||
| 41 | returns the beginning of the chain, | ||
| 42 | .Fa b . | ||
| 43 | .Pp | 40 | .Pp |
| 44 | .Fn BIO_pop | ||
| 45 | returns the next BIO in the chain, or | ||
| 46 | .Dv NULL | ||
| 47 | if there is no next BIO. | ||
| 48 | .Sh NOTES | ||
| 49 | The names of these functions are perhaps a little misleading. | 41 | The names of these functions are perhaps a little misleading. |
| 50 | .Fn BIO_push | 42 | .Fn BIO_push |
| 51 | joins two BIO chains whereas | 43 | joins two BIO chains whereas |
| 52 | .Fn BIO_pop | 44 | .Fn BIO_pop |
| 53 | deletes a single BIO from a chain, | 45 | deletes a single BIO from a chain; |
| 54 | the deleted BIO does not need to be at the end of a chain. | 46 | the deleted BIO does not need to be at the end of a chain. |
| 55 | .Pp | 47 | .Pp |
| 56 | The process of calling | 48 | The process of calling |
| @@ -60,6 +52,15 @@ and | |||
| 60 | on a BIO may have additional consequences: | 52 | on a BIO may have additional consequences: |
| 61 | a control call is made to the affected BIOs. | 53 | a control call is made to the affected BIOs. |
| 62 | Any effects will be noted in the descriptions of individual BIOs. | 54 | Any effects will be noted in the descriptions of individual BIOs. |
| 55 | .Sh RETURN VALUES | ||
| 56 | .Fn BIO_push | ||
| 57 | returns the beginning of the chain, | ||
| 58 | .Fa b . | ||
| 59 | .Pp | ||
| 60 | .Fn BIO_pop | ||
| 61 | returns the next BIO in the chain, or | ||
| 62 | .Dv NULL | ||
| 63 | if there is no next BIO. | ||
| 63 | .Sh EXAMPLES | 64 | .Sh EXAMPLES |
| 64 | For these examples suppose | 65 | For these examples suppose |
| 65 | .Sy md1 | 66 | .Sy md1 |
| @@ -67,7 +68,7 @@ and | |||
| 67 | .Sy md2 | 68 | .Sy md2 |
| 68 | are digest BIOs, | 69 | are digest BIOs, |
| 69 | .Sy b64 | 70 | .Sy b64 |
| 70 | is a base64 BIO and | 71 | is a Base64 BIO and |
| 71 | .Sy f | 72 | .Sy f |
| 72 | is a file BIO. | 73 | is a file BIO. |
| 73 | .Pp | 74 | .Pp |
| @@ -92,17 +93,14 @@ by | |||
| 92 | .Sy md1 | 93 | .Sy md1 |
| 93 | and | 94 | and |
| 94 | .Sy md2 , | 95 | .Sy md2 , |
| 95 | .Sy base64 | 96 | Base64-encoded and written to |
| 96 | encoded and written to | ||
| 97 | .Sy f . | 97 | .Sy f . |
| 98 | .Pp | 98 | .Pp |
| 99 | It should be noted that reading causes data to pass | 99 | It should be noted that reading causes data to pass |
| 100 | in the reverse direction, that is data is read from | 100 | in the reverse direction. |
| 101 | That is, data is read from | ||
| 101 | .Sy f , | 102 | .Sy f , |
| 102 | base64 | 103 | Base64-decoded and digested by |
| 103 | .Sy decoded | ||
| 104 | and digested | ||
| 105 | by | ||
| 106 | .Sy md1 | 104 | .Sy md1 |
| 107 | and | 105 | and |
| 108 | .Sy md2 . | 106 | .Sy md2 . |
| @@ -113,7 +111,7 @@ If this call is made: | |||
| 113 | The call will return | 111 | The call will return |
| 114 | .Sy b64 | 112 | .Sy b64 |
| 115 | and the new chain will be | 113 | and the new chain will be |
| 116 | .Sy md1-b64-f Ns ; | 114 | .Sy md1-b64-f ; |
| 117 | data can be written to | 115 | data can be written to |
| 118 | .Sy md1 | 116 | .Sy md1 |
| 119 | as before. | 117 | as before. |
diff --git a/src/lib/libcrypto/man/BIO_read.3 b/src/lib/libcrypto/man/BIO_read.3 index 94a4fb1461..f19c31ecab 100644 --- a/src/lib/libcrypto/man/BIO_read.3 +++ b/src/lib/libcrypto/man/BIO_read.3 | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | .\" $OpenBSD: BIO_read.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: BIO_read.3,v 1.3 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO_READ 3 | 4 | .Dt BIO_READ 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| 7 | .Nm BIO_read , | 7 | .Nm BIO_read , |
| 8 | .Nm BIO_write , | ||
| 9 | .Nm BIO_gets , | 8 | .Nm BIO_gets , |
| 9 | .Nm BIO_write , | ||
| 10 | .Nm BIO_puts | 10 | .Nm BIO_puts |
| 11 | .Nd BIO I/O functions | 11 | .Nd BIO I/O functions |
| 12 | .Sh SYNOPSIS | 12 | .Sh SYNOPSIS |
| @@ -69,17 +69,6 @@ attempts to write a null terminated string | |||
| 69 | .Fa buf | 69 | .Fa buf |
| 70 | to BIO | 70 | to BIO |
| 71 | .Fa b . | 71 | .Fa b . |
| 72 | .Sh RETURN VALUES | ||
| 73 | All these functions return either the amount of data successfully | ||
| 74 | read or written (if the return value is positive) or that no data | ||
| 75 | was successfully read or written if the result is 0 or -1. | ||
| 76 | If the return value is -2, then the operation is not implemented | ||
| 77 | in the specific BIO type. | ||
| 78 | .Sh NOTES | ||
| 79 | A 0 or -1 return is not necessarily an indication of an error. | ||
| 80 | In particular when the source/sink is non-blocking or of a certain type | ||
| 81 | it may merely be an indication that no data is currently available and that | ||
| 82 | the application should retry the operation later. | ||
| 83 | .Pp | 72 | .Pp |
| 84 | One technique sometimes used with blocking sockets | 73 | One technique sometimes used with blocking sockets |
| 85 | is to use a system call (such as | 74 | is to use a system call (such as |
| @@ -100,7 +89,7 @@ can cause several reads (and writes in the case of SSL BIOs) | |||
| 100 | on the underlying I/O structure and may block as a result. | 89 | on the underlying I/O structure and may block as a result. |
| 101 | Instead | 90 | Instead |
| 102 | .Xr select 2 | 91 | .Xr select 2 |
| 103 | (or equivalent) should be combined with non blocking I/O | 92 | (or equivalent) should be combined with non-blocking I/O |
| 104 | so successive reads will request a retry instead of blocking. | 93 | so successive reads will request a retry instead of blocking. |
| 105 | .Pp | 94 | .Pp |
| 106 | See | 95 | See |
| @@ -113,5 +102,16 @@ function is not supported by a BIO then it is possible to | |||
| 113 | work around this by adding a buffering BIO | 102 | work around this by adding a buffering BIO |
| 114 | .Xr BIO_f_buffer 3 | 103 | .Xr BIO_f_buffer 3 |
| 115 | to the chain. | 104 | to the chain. |
| 105 | .Sh RETURN VALUES | ||
| 106 | All these functions return either the amount of data successfully | ||
| 107 | read or written (if the return value is positive) or that no data | ||
| 108 | was successfully read or written if the result is 0 or -1. | ||
| 109 | If the return value is -2, then the operation is not implemented | ||
| 110 | in the specific BIO type. | ||
| 111 | .Pp | ||
| 112 | A 0 or -1 return is not necessarily an indication of an error. | ||
| 113 | In particular when the source/sink is non-blocking or of a certain type | ||
| 114 | it may merely be an indication that no data is currently available and that | ||
| 115 | the application should retry the operation later. | ||
| 116 | .Sh SEE ALSO | 116 | .Sh SEE ALSO |
| 117 | .Xr BIO_should_retry 3 | 117 | .Xr BIO_should_retry 3 |
diff --git a/src/lib/libcrypto/man/BIO_s_accept.3 b/src/lib/libcrypto/man/BIO_s_accept.3 index 766d86e2a4..3cfb574977 100644 --- a/src/lib/libcrypto/man/BIO_s_accept.3 +++ b/src/lib/libcrypto/man/BIO_s_accept.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: BIO_s_accept.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: BIO_s_accept.3,v 1.3 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO_S_ACCEPT 3 | 4 | .Dt BIO_S_ACCEPT 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -63,7 +63,9 @@ | |||
| 63 | .Sh DESCRIPTION | 63 | .Sh DESCRIPTION |
| 64 | .Fn BIO_s_accept | 64 | .Fn BIO_s_accept |
| 65 | returns the accept BIO method. | 65 | returns the accept BIO method. |
| 66 | This is a wrapper round the platform's TCP/IP socket accept routines. | 66 | This is a wrapper round the platform's TCP/IP socket |
| 67 | .Xr accept 2 | ||
| 68 | routines. | ||
| 67 | .Pp | 69 | .Pp |
| 68 | Using accept BIOs, TCP/IP connections can be accepted | 70 | Using accept BIOs, TCP/IP connections can be accepted |
| 69 | and data transferred using only BIO routines. | 71 | and data transferred using only BIO routines. |
| @@ -81,12 +83,12 @@ but not | |||
| 81 | .Xr BIO_gets 3 . | 83 | .Xr BIO_gets 3 . |
| 82 | .Pp | 84 | .Pp |
| 83 | If the close flag is set on an accept BIO, then any active | 85 | If the close flag is set on an accept BIO, then any active |
| 84 | connection on that chain is shutdown and the socket closed when | 86 | connection on that chain is shut down and the socket closed when |
| 85 | the BIO is freed. | 87 | the BIO is freed. |
| 86 | .Pp | 88 | .Pp |
| 87 | Calling | 89 | Calling |
| 88 | .Xr BIO_reset 3 | 90 | .Xr BIO_reset 3 |
| 89 | on a accept BIO will close any active connection and reset the BIO | 91 | on an accept BIO will close any active connection and reset the BIO |
| 90 | into a state where it awaits another incoming connection. | 92 | into a state where it awaits another incoming connection. |
| 91 | .Pp | 93 | .Pp |
| 92 | .Xr BIO_get_fd 3 | 94 | .Xr BIO_get_fd 3 |
| @@ -108,13 +110,13 @@ is the interface to use and | |||
| 108 | .Ar port | 110 | .Ar port |
| 109 | is the port. | 111 | is the port. |
| 110 | Either or both values can be | 112 | Either or both values can be |
| 111 | .Qq * | 113 | .Qq * , |
| 112 | which is interpreted as meaning any interface or port respectively. | 114 | which is interpreted as meaning any interface or port respectively. |
| 113 | .Ar port | 115 | .Ar port |
| 114 | has the same syntax as the port specified in | 116 | has the same syntax as the port specified in |
| 115 | .Xr BIO_set_conn_port 3 | 117 | .Xr BIO_set_conn_port 3 |
| 116 | for connect BIOs. | 118 | for connect BIOs. |
| 117 | It can be a numerical port string or a string to lookup using | 119 | It can be a numerical port string or a string to look up using |
| 118 | .Xr getservbyname 3 | 120 | .Xr getservbyname 3 |
| 119 | and a string table. | 121 | and a string table. |
| 120 | .Pp | 122 | .Pp |
| @@ -130,7 +132,7 @@ It creates a new accept BIO with port | |||
| 130 | .Fn BIO_set_nbio_accept | 132 | .Fn BIO_set_nbio_accept |
| 131 | sets the accept socket to blocking mode (the default) if | 133 | sets the accept socket to blocking mode (the default) if |
| 132 | .Fa n | 134 | .Fa n |
| 133 | is 0 or non blocking mode if | 135 | is 0 or non-blocking mode if |
| 134 | .Fa n | 136 | .Fa n |
| 135 | is 1. | 137 | is 1. |
| 136 | .Pp | 138 | .Pp |
| @@ -139,7 +141,7 @@ can be used to set a chain of BIOs which will be duplicated | |||
| 139 | and prepended to the chain when an incoming connection is received. | 141 | and prepended to the chain when an incoming connection is received. |
| 140 | This is useful if, for example, a buffering or SSL BIO | 142 | This is useful if, for example, a buffering or SSL BIO |
| 141 | is required for each connection. | 143 | is required for each connection. |
| 142 | The chain of BIOs must not be freed after this call, | 144 | The chain of BIOs must not be freed after this call - |
| 143 | they will be automatically freed when the accept BIO is freed. | 145 | they will be automatically freed when the accept BIO is freed. |
| 144 | .Pp | 146 | .Pp |
| 145 | .Fn BIO_set_bind_mode | 147 | .Fn BIO_set_bind_mode |
| @@ -162,11 +164,11 @@ then a second attempt is made using | |||
| 162 | .Pp | 164 | .Pp |
| 163 | .Fn BIO_do_accept | 165 | .Fn BIO_do_accept |
| 164 | serves two purposes. | 166 | serves two purposes. |
| 165 | When it is first called, after the accept BIO has been setup, | 167 | When it is first called, after the accept BIO has been set up, |
| 166 | it will attempt to create the accept socket and bind an address to it. | 168 | it will attempt to create the accept socket and bind an address to it. |
| 167 | Second and subsequent calls to | 169 | Second and subsequent calls to |
| 168 | .Fn BIO_do_accept | 170 | .Fn BIO_do_accept |
| 169 | will await an incoming connection, or request a retry in non blocking mode. | 171 | will await an incoming connection, or request a retry in non-blocking mode. |
| 170 | .Sh NOTES | 172 | .Sh NOTES |
| 171 | When an accept BIO is at the end of a chain, it will await an | 173 | When an accept BIO is at the end of a chain, it will await an |
| 172 | incoming connection before processing I/O calls. | 174 | incoming connection before processing I/O calls. |
| @@ -181,8 +183,8 @@ socket will await an incoming connection then perform I/O on it. | |||
| 181 | .Pp | 183 | .Pp |
| 182 | If any additional BIOs have been set using | 184 | If any additional BIOs have been set using |
| 183 | .Fn BIO_set_accept_bios , | 185 | .Fn BIO_set_accept_bios , |
| 184 | then they are placed between the socket and the accept BIO, | 186 | then they are placed between the socket and the accept BIO; |
| 185 | that is the chain will be accept->otherbios->socket. | 187 | that is, the chain will be accept->otherbios->socket. |
| 186 | .Pp | 188 | .Pp |
| 187 | If a server wishes to process multiple connections (as is normally | 189 | If a server wishes to process multiple connections (as is normally |
| 188 | the case), then the accept BIO must be made available for further | 190 | the case), then the accept BIO must be made available for further |
diff --git a/src/lib/libcrypto/man/BIO_s_bio.3 b/src/lib/libcrypto/man/BIO_s_bio.3 index c7d602990e..ccd3bf8ef9 100644 --- a/src/lib/libcrypto/man/BIO_s_bio.3 +++ b/src/lib/libcrypto/man/BIO_s_bio.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: BIO_s_bio.3,v 1.4 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: BIO_s_bio.3,v 1.5 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO_S_BIO 3 | 4 | .Dt BIO_S_BIO 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -79,7 +79,7 @@ have all the data processed by the chain under application control. | |||
| 79 | .Pp | 79 | .Pp |
| 80 | One typical use of BIO pairs is | 80 | One typical use of BIO pairs is |
| 81 | to place TLS/SSL I/O under application control. | 81 | to place TLS/SSL I/O under application control. |
| 82 | This can be used when the application wishes to use a non standard | 82 | This can be used when the application wishes to use a non-standard |
| 83 | transport for TLS/SSL or the normal socket routines are inappropriate. | 83 | transport for TLS/SSL or the normal socket routines are inappropriate. |
| 84 | .Pp | 84 | .Pp |
| 85 | Calls to | 85 | Calls to |
| @@ -147,7 +147,7 @@ does not check whether | |||
| 147 | .Fa bio1 | 147 | .Fa bio1 |
| 148 | or | 148 | or |
| 149 | .Fa bio2 | 149 | .Fa bio2 |
| 150 | do point to some other BIO, the values are overwritten, | 150 | point to some other BIO; the values are overwritten and |
| 151 | .Xr BIO_free 3 | 151 | .Xr BIO_free 3 |
| 152 | is not called. | 152 | is not called. |
| 153 | .Pp | 153 | .Pp |
| @@ -186,19 +186,7 @@ never returns an amount larger than that returned by | |||
| 186 | can also be used to reset the value returned by | 186 | can also be used to reset the value returned by |
| 187 | .Fn BIO_get_read_request | 187 | .Fn BIO_get_read_request |
| 188 | to zero. | 188 | to zero. |
| 189 | .Sh RETURN VALUES | 189 | .Pp |
| 190 | .Fn BIO_new_bio_pair | ||
| 191 | returns 1 on success, with the new BIOs available in | ||
| 192 | .Fa bio1 | ||
| 193 | and | ||
| 194 | .Fa bio2 , | ||
| 195 | or 0 on failure, with NULL pointers stored into the locations for | ||
| 196 | .Fa bio1 | ||
| 197 | and | ||
| 198 | .Fa bio2 . | ||
| 199 | Check the error stack for more information. | ||
| 200 | .\" XXX More return values need to be added here. | ||
| 201 | .Sh NOTES | ||
| 202 | Both halves of a BIO pair should be freed. | 190 | Both halves of a BIO pair should be freed. |
| 203 | Even if one half is implicitly freed due to a | 191 | Even if one half is implicitly freed due to a |
| 204 | .Xr BIO_free_all 3 | 192 | .Xr BIO_free_all 3 |
| @@ -233,12 +221,24 @@ will be true. | |||
| 233 | If the application then waits for data to become available | 221 | If the application then waits for data to become available |
| 234 | on the underlying transport before flushing the write buffer, | 222 | on the underlying transport before flushing the write buffer, |
| 235 | it will never succeed because the request was never sent. | 223 | it will never succeed because the request was never sent. |
| 224 | .Sh RETURN VALUES | ||
| 225 | .Fn BIO_new_bio_pair | ||
| 226 | returns 1 on success, with the new BIOs available in | ||
| 227 | .Fa bio1 | ||
| 228 | and | ||
| 229 | .Fa bio2 , | ||
| 230 | or 0 on failure, with NULL pointers stored into the locations for | ||
| 231 | .Fa bio1 | ||
| 232 | and | ||
| 233 | .Fa bio2 . | ||
| 234 | Check the error stack for more information. | ||
| 235 | .\" XXX More return values need to be added here. | ||
| 236 | .Sh EXAMPLES | 236 | .Sh EXAMPLES |
| 237 | The BIO pair can be used to have full control | 237 | The BIO pair can be used to have full control |
| 238 | over the network access of an application. | 238 | over the network access of an application. |
| 239 | The application can call | 239 | The application can call |
| 240 | .Xr select 2 | 240 | .Xr select 2 |
| 241 | on the socket as required without having to go through the SSL-interface. | 241 | on the socket as required without having to go through the SSL interface. |
| 242 | .Bd -literal -offset 2n | 242 | .Bd -literal -offset 2n |
| 243 | BIO *internal_bio, *network_bio; | 243 | BIO *internal_bio, *network_bio; |
| 244 | \&... | 244 | \&... |
diff --git a/src/lib/libcrypto/man/BIO_s_connect.3 b/src/lib/libcrypto/man/BIO_s_connect.3 index e0da157e12..cc2790fca6 100644 --- a/src/lib/libcrypto/man/BIO_s_connect.3 +++ b/src/lib/libcrypto/man/BIO_s_connect.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: BIO_s_connect.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: BIO_s_connect.3,v 1.3 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO_S_CONNECT 3 | 4 | .Dt BIO_S_CONNECT 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -106,8 +106,8 @@ into a state where it can connect to the same host again. | |||
| 106 | places the underlying socket in | 106 | places the underlying socket in |
| 107 | .Fa c | 107 | .Fa c |
| 108 | if it is not | 108 | if it is not |
| 109 | .Dv NULL , | 109 | .Dv NULL |
| 110 | it also returns the socket. | 110 | and also returns the socket. |
| 111 | If | 111 | If |
| 112 | .Fa c | 112 | .Fa c |
| 113 | is not | 113 | is not |
| @@ -151,7 +151,7 @@ and | |||
| 151 | .Fn BIO_set_conn_ip | 151 | .Fn BIO_set_conn_ip |
| 152 | sets the IP address to | 152 | sets the IP address to |
| 153 | .Fa ip | 153 | .Fa ip |
| 154 | using binary form, that is four bytes specifying the IP address | 154 | using binary form i.e. four bytes specifying the IP address |
| 155 | in big-endian form. | 155 | in big-endian form. |
| 156 | .Pp | 156 | .Pp |
| 157 | .Fn BIO_set_conn_int_port | 157 | .Fn BIO_set_conn_int_port |
| @@ -179,19 +179,19 @@ returns the port as an | |||
| 179 | .Vt int . | 179 | .Vt int . |
| 180 | .Pp | 180 | .Pp |
| 181 | .Fn BIO_set_nbio | 181 | .Fn BIO_set_nbio |
| 182 | sets the non blocking I/O flag to | 182 | sets the non-blocking I/O flag to |
| 183 | .Fa n . | 183 | .Fa n . |
| 184 | If | 184 | If |
| 185 | .Fa n | 185 | .Fa n |
| 186 | is zero then blocking I/O is set. | 186 | is zero then blocking I/O is set. |
| 187 | If | 187 | If |
| 188 | .Fa n | 188 | .Fa n |
| 189 | is 1 then non blocking I/O is set. | 189 | is 1 then non-blocking I/O is set. |
| 190 | Blocking I/O is the default. | 190 | Blocking I/O is the default. |
| 191 | The call to | 191 | The call to |
| 192 | .Fn BIO_set_nbio | 192 | .Fn BIO_set_nbio |
| 193 | should be made before the connection is established | 193 | should be made before the connection is established |
| 194 | because non blocking I/O is set during the connect process. | 194 | because non-blocking I/O is set during the connect process. |
| 195 | .Pp | 195 | .Pp |
| 196 | .Fn BIO_new_connect | 196 | .Fn BIO_new_connect |
| 197 | combines | 197 | combines |
| @@ -209,10 +209,10 @@ A zero or negative value is returned if the connection | |||
| 209 | could not be established. | 209 | could not be established. |
| 210 | The call | 210 | The call |
| 211 | .Xr BIO_should_retry 3 | 211 | .Xr BIO_should_retry 3 |
| 212 | should be used for non blocking connect BIOs | 212 | should be used for non-blocking connect BIOs |
| 213 | to determine if the call should be retried. | 213 | to determine if the call should be retried. |
| 214 | .Sh NOTES | 214 | .Pp |
| 215 | If blocking I/O is set then a non positive return value from any | 215 | If blocking I/O is set then a non-positive return value from any |
| 216 | I/O call is caused by an error condition, although a zero return | 216 | I/O call is caused by an error condition, although a zero return |
| 217 | will normally mean that the connection was closed. | 217 | will normally mean that the connection was closed. |
| 218 | .Pp | 218 | .Pp |
| @@ -244,7 +244,7 @@ from other I/O processing. | |||
| 244 | If non-blocking I/O is set, | 244 | If non-blocking I/O is set, |
| 245 | then retries will be requested as appropriate. | 245 | then retries will be requested as appropriate. |
| 246 | .Pp | 246 | .Pp |
| 247 | It addition to | 247 | In addition to |
| 248 | .Xr BIO_should_read 3 | 248 | .Xr BIO_should_read 3 |
| 249 | and | 249 | and |
| 250 | .Xr BIO_should_write 3 | 250 | .Xr BIO_should_write 3 |
diff --git a/src/lib/libcrypto/man/BIO_s_fd.3 b/src/lib/libcrypto/man/BIO_s_fd.3 index 591b25d2f2..9365eaf973 100644 --- a/src/lib/libcrypto/man/BIO_s_fd.3 +++ b/src/lib/libcrypto/man/BIO_s_fd.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: BIO_s_fd.3,v 1.3 2016/11/06 16:43:53 schwarze Exp $ | 1 | .\" $OpenBSD: BIO_s_fd.3,v 1.4 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO_S_FD 3 | 4 | .Dt BIO_S_FD 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -91,7 +91,7 @@ returns a file descriptor BIO using | |||
| 91 | .Fa fd | 91 | .Fa fd |
| 92 | and | 92 | and |
| 93 | .Fa close_flag . | 93 | .Fa close_flag . |
| 94 | .Sh NOTES | 94 | .Pp |
| 95 | The behaviour of | 95 | The behaviour of |
| 96 | .Xr BIO_read 3 | 96 | .Xr BIO_read 3 |
| 97 | and | 97 | and |
| @@ -101,7 +101,7 @@ depends on the behavior of the platform's | |||
| 101 | and | 101 | and |
| 102 | .Xr write 2 | 102 | .Xr write 2 |
| 103 | calls on the descriptor. | 103 | calls on the descriptor. |
| 104 | If the underlying file descriptor is in a non blocking mode, | 104 | If the underlying file descriptor is in a non-blocking mode, |
| 105 | then the BIO will behave in the manner described in the | 105 | then the BIO will behave in the manner described in the |
| 106 | .Xr BIO_read 3 | 106 | .Xr BIO_read 3 |
| 107 | and | 107 | and |
diff --git a/src/lib/libcrypto/man/BIO_s_file.3 b/src/lib/libcrypto/man/BIO_s_file.3 index 9676e4f0a5..47d5806d7e 100644 --- a/src/lib/libcrypto/man/BIO_s_file.3 +++ b/src/lib/libcrypto/man/BIO_s_file.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: BIO_s_file.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: BIO_s_file.3,v 1.3 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO_S_FILE 3 | 4 | .Dt BIO_S_FILE 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -13,7 +13,7 @@ | |||
| 13 | .Nm BIO_write_filename , | 13 | .Nm BIO_write_filename , |
| 14 | .Nm BIO_append_filename , | 14 | .Nm BIO_append_filename , |
| 15 | .Nm BIO_rw_filename | 15 | .Nm BIO_rw_filename |
| 16 | .Nd FILE bio | 16 | .Nd FILE BIO |
| 17 | .Sh SYNOPSIS | 17 | .Sh SYNOPSIS |
| 18 | .In openssl/bio.h | 18 | .In openssl/bio.h |
| 19 | .Ft BIO_METHOD * | 19 | .Ft BIO_METHOD * |
| @@ -153,7 +153,7 @@ set the file BIO | |||
| 153 | to use file | 153 | to use file |
| 154 | .Fa name | 154 | .Fa name |
| 155 | for reading, writing, append or read write respectively. | 155 | for reading, writing, append or read write respectively. |
| 156 | .Sh NOTES | 156 | .Pp |
| 157 | When wrapping stdout, stdin, or stderr, the underlying stream | 157 | When wrapping stdout, stdin, or stderr, the underlying stream |
| 158 | should not normally be closed, so the | 158 | should not normally be closed, so the |
| 159 | .Dv BIO_NOCLOSE | 159 | .Dv BIO_NOCLOSE |
| @@ -247,4 +247,4 @@ The return value for | |||
| 247 | .Xr fseek 3 | 247 | .Xr fseek 3 |
| 248 | is 0 for success or -1 if an error occurred. | 248 | is 0 for success or -1 if an error occurred. |
| 249 | This differs from other types of BIO which will typically return | 249 | This differs from other types of BIO which will typically return |
| 250 | 1 for success and a non positive value if an error occurred. | 250 | 1 for success and a non-positive value if an error occurred. |
diff --git a/src/lib/libcrypto/man/BIO_s_mem.3 b/src/lib/libcrypto/man/BIO_s_mem.3 index 1512ebbb77..1fff26442c 100644 --- a/src/lib/libcrypto/man/BIO_s_mem.3 +++ b/src/lib/libcrypto/man/BIO_s_mem.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: BIO_s_mem.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: BIO_s_mem.3,v 1.3 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO_S_MEM 3 | 4 | .Dt BIO_S_MEM 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -86,7 +86,7 @@ when it is empty. | |||
| 86 | If | 86 | If |
| 87 | .Fa v | 87 | .Fa v |
| 88 | is zero, then an empty memory BIO will return EOF: | 88 | is zero, then an empty memory BIO will return EOF: |
| 89 | It will return zero and | 89 | it will return zero and |
| 90 | .Fn BIO_should_retry | 90 | .Fn BIO_should_retry |
| 91 | will be false. | 91 | will be false. |
| 92 | If | 92 | If |
| @@ -111,8 +111,8 @@ It is implemented as a macro. | |||
| 111 | sets the internal BUF_MEM structure to | 111 | sets the internal BUF_MEM structure to |
| 112 | .Fa bm | 112 | .Fa bm |
| 113 | and sets the close flag to | 113 | and sets the close flag to |
| 114 | .Fa c , | 114 | .Fa c . |
| 115 | that is | 115 | That is, |
| 116 | .Fa c | 116 | .Fa c |
| 117 | should be either | 117 | should be either |
| 118 | .Dv BIO_CLOSE | 118 | .Dv BIO_CLOSE |
| @@ -147,7 +147,7 @@ it is | |||
| 147 | .Em not | 147 | .Em not |
| 148 | copied first, so the supplied area of memory must be unchanged | 148 | copied first, so the supplied area of memory must be unchanged |
| 149 | until the BIO is freed. | 149 | until the BIO is freed. |
| 150 | .Sh NOTES | 150 | .Pp |
| 151 | Writes to memory BIOs will always succeed if memory is available: | 151 | Writes to memory BIOs will always succeed if memory is available: |
| 152 | their size can grow indefinitely. | 152 | their size can grow indefinitely. |
| 153 | .Pp | 153 | .Pp |
diff --git a/src/lib/libcrypto/man/BIO_s_null.3 b/src/lib/libcrypto/man/BIO_s_null.3 index 5910bd5ce1..c98d2affd3 100644 --- a/src/lib/libcrypto/man/BIO_s_null.3 +++ b/src/lib/libcrypto/man/BIO_s_null.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: BIO_s_null.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: BIO_s_null.3,v 1.3 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO_S_NULL 3 | 4 | .Dt BIO_S_NULL 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -16,12 +16,12 @@ | |||
| 16 | .Fn BIO_s_null | 16 | .Fn BIO_s_null |
| 17 | returns the null sink BIO method. | 17 | returns the null sink BIO method. |
| 18 | Data written to the null sink is discarded, reads return EOF. | 18 | Data written to the null sink is discarded, reads return EOF. |
| 19 | .Sh NOTES | 19 | .Pp |
| 20 | A null sink BIO behaves in a similar manner to the | 20 | A null sink BIO behaves in a similar manner to the |
| 21 | .Xr null 4 | 21 | .Xr null 4 |
| 22 | device. | 22 | device. |
| 23 | .Pp | 23 | .Pp |
| 24 | A null bio can be placed on the end of a chain to discard any data | 24 | A null BIO can be placed on the end of a chain to discard any data |
| 25 | passed through it. | 25 | passed through it. |
| 26 | .Pp | 26 | .Pp |
| 27 | A null sink is useful if, for example, an application wishes | 27 | A null sink is useful if, for example, an application wishes |
diff --git a/src/lib/libcrypto/man/BIO_s_socket.3 b/src/lib/libcrypto/man/BIO_s_socket.3 index 8cc0243066..29d3cf83b0 100644 --- a/src/lib/libcrypto/man/BIO_s_socket.3 +++ b/src/lib/libcrypto/man/BIO_s_socket.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: BIO_s_socket.3,v 1.3 2016/11/06 16:43:53 schwarze Exp $ | 1 | .\" $OpenBSD: BIO_s_socket.3,v 1.4 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO_S_SOCKET 3 | 4 | .Dt BIO_S_SOCKET 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -40,7 +40,7 @@ returns a socket BIO using | |||
| 40 | .Fa sock | 40 | .Fa sock |
| 41 | and | 41 | and |
| 42 | .Fa close_flag . | 42 | .Fa close_flag . |
| 43 | .Sh NOTES | 43 | .Pp |
| 44 | Socket BIOs also support any relevant functionality of file descriptor BIOs. | 44 | Socket BIOs also support any relevant functionality of file descriptor BIOs. |
| 45 | .Pp | 45 | .Pp |
| 46 | The reason for having separate file descriptor and socket BIOs | 46 | The reason for having separate file descriptor and socket BIOs |
diff --git a/src/lib/libcrypto/man/BIO_set_callback.3 b/src/lib/libcrypto/man/BIO_set_callback.3 index 68ca2780f8..62b7b3773b 100644 --- a/src/lib/libcrypto/man/BIO_set_callback.3 +++ b/src/lib/libcrypto/man/BIO_set_callback.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: BIO_set_callback.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: BIO_set_callback.3,v 1.3 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO_SET_CALLBACK 3 | 4 | .Dt BIO_SET_CALLBACK 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -38,7 +38,7 @@ | |||
| 38 | .Fn BIO_set_callback | 38 | .Fn BIO_set_callback |
| 39 | and | 39 | and |
| 40 | .Fn BIO_get_callback | 40 | .Fn BIO_get_callback |
| 41 | set and retrieve the BIO callback, they are both macros. | 41 | set and retrieve the BIO callback; they are both macros. |
| 42 | The callback is called during most high level BIO operations. | 42 | The callback is called during most high level BIO operations. |
| 43 | It can be used for debugging purposes to trace operations on a BIO | 43 | It can be used for debugging purposes to trace operations on a BIO |
| 44 | or to modify its operation. | 44 | or to modify its operation. |
| @@ -77,8 +77,8 @@ The meaning of the arguments | |||
| 77 | and | 77 | and |
| 78 | .Fa argl | 78 | .Fa argl |
| 79 | depends on the value of | 79 | depends on the value of |
| 80 | .Fa oper , | 80 | .Fa oper |
| 81 | that is the operation being performed. | 81 | (i.e. the operation being performed). |
| 82 | .Pp | 82 | .Pp |
| 83 | .Fa retvalue | 83 | .Fa retvalue |
| 84 | is the return value that would be returned to the application | 84 | is the return value that would be returned to the application |
| @@ -127,5 +127,6 @@ after. | |||
| 127 | .Sh EXAMPLES | 127 | .Sh EXAMPLES |
| 128 | The | 128 | The |
| 129 | .Fn BIO_debug_callback | 129 | .Fn BIO_debug_callback |
| 130 | function is a good example, its source is in the file | 130 | function is a good example. |
| 131 | Its source is in the file | ||
| 131 | .Pa crypto/bio/bio_cb.c . | 132 | .Pa crypto/bio/bio_cb.c . |
diff --git a/src/lib/libcrypto/man/BIO_should_retry.3 b/src/lib/libcrypto/man/BIO_should_retry.3 index c06e907235..f512e08b89 100644 --- a/src/lib/libcrypto/man/BIO_should_retry.3 +++ b/src/lib/libcrypto/man/BIO_should_retry.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: BIO_should_retry.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: BIO_should_retry.3,v 1.3 2016/11/07 15:52:47 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 7 2016 $ |
| 4 | .Dt BIO_SHOULD_RETRY 3 | 4 | .Dt BIO_SHOULD_RETRY 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -9,6 +9,7 @@ | |||
| 9 | .Nm BIO_should_write , | 9 | .Nm BIO_should_write , |
| 10 | .Nm BIO_should_io_special , | 10 | .Nm BIO_should_io_special , |
| 11 | .Nm BIO_retry_type , | 11 | .Nm BIO_retry_type , |
| 12 | .Nm BIO_should_retry , | ||
| 12 | .Nm BIO_get_retry_BIO , | 13 | .Nm BIO_get_retry_BIO , |
| 13 | .Nm BIO_get_retry_reason | 14 | .Nm BIO_get_retry_reason |
| 14 | .Nd BIO retry functions | 15 | .Nd BIO retry functions |
| @@ -58,8 +59,8 @@ is true if the cause of the condition is that a BIO needs to read data. | |||
| 58 | is true if the cause of the condition is that a BIO needs to write data. | 59 | is true if the cause of the condition is that a BIO needs to write data. |
| 59 | .Pp | 60 | .Pp |
| 60 | .Fn BIO_should_io_special | 61 | .Fn BIO_should_io_special |
| 61 | is true if some "special" condition, that is a reason other than | 62 | is true if some "special" condition |
| 62 | reading or writing, is the cause of the condition. | 63 | (i.e. a reason other than reading or writing) is the cause of the condition. |
| 63 | .Pp | 64 | .Pp |
| 64 | .Fn BIO_retry_type | 65 | .Fn BIO_retry_type |
| 65 | returns a mask of the cause of a retry condition consisting of the values | 66 | returns a mask of the cause of a retry condition consisting of the values |
| @@ -82,7 +83,7 @@ depends on the type of BIO that resulted in this condition. | |||
| 82 | returns the reason for a special condition | 83 | returns the reason for a special condition |
| 83 | if passed the relevant BIO, for example as returned by | 84 | if passed the relevant BIO, for example as returned by |
| 84 | .Fn BIO_get_retry_BIO . | 85 | .Fn BIO_get_retry_BIO . |
| 85 | .Sh NOTES | 86 | .Pp |
| 86 | If | 87 | If |
| 87 | .Fn BIO_should_retry | 88 | .Fn BIO_should_retry |
| 88 | returns false, then the precise "error condition" depends on | 89 | returns false, then the precise "error condition" depends on |
| @@ -114,7 +115,7 @@ or avoid this situation by setting | |||
| 114 | .Dv SSL_MODE_AUTO_RETRY | 115 | .Dv SSL_MODE_AUTO_RETRY |
| 115 | on the underlying SSL structure. | 116 | on the underlying SSL structure. |
| 116 | .Pp | 117 | .Pp |
| 117 | While an application may retry a failed non blocking call immediately, | 118 | While an application may retry a failed non-blocking call immediately, |
| 118 | this is likely to be very inefficient because the call will fail | 119 | this is likely to be very inefficient because the call will fail |
| 119 | repeatedly until data can be processed or is available. | 120 | repeatedly until data can be processed or is available. |
| 120 | An application will normally wait until the necessary condition | 121 | An application will normally wait until the necessary condition |
| @@ -127,7 +128,7 @@ is true then a call to | |||
| 127 | .Xr select 2 | 128 | .Xr select 2 |
| 128 | may be made to wait until data is available | 129 | may be made to wait until data is available |
| 129 | and then retry the BIO operation. | 130 | and then retry the BIO operation. |
| 130 | By combining the retry conditions of several non blocking BIOs in a single | 131 | By combining the retry conditions of several non-blocking BIOs in a single |
| 131 | .Xr select 2 | 132 | .Xr select 2 |
| 132 | call it is possible to service several BIOs in a single thread, | 133 | call it is possible to service several BIOs in a single thread, |
| 133 | though the performance may be poor if SSL BIOs are present because | 134 | though the performance may be poor if SSL BIOs are present because |
| @@ -136,12 +137,12 @@ long delays can occur during the initial handshake process. | |||
| 136 | It is possible for a BIO to block indefinitely if the underlying I/O | 137 | It is possible for a BIO to block indefinitely if the underlying I/O |
| 137 | structure cannot process or return any data. | 138 | structure cannot process or return any data. |
| 138 | This depends on the behaviour of the platforms I/O functions. | 139 | This depends on the behaviour of the platforms I/O functions. |
| 139 | This is often not desirable: one solution is to use non blocking I/O | 140 | This is often not desirable: one solution is to use non-blocking I/O |
| 140 | and use a timeout on the | 141 | and use a timeout on the |
| 141 | .Xr select 2 | 142 | .Xr select 2 |
| 142 | (or equivalent) call. | 143 | (or equivalent) call. |
| 143 | .Sh BUGS | 144 | .Sh BUGS |
| 144 | The OpenSSL ASN1 functions cannot gracefully deal with non blocking I/O: | 145 | The OpenSSL ASN.1 functions cannot gracefully deal with non-blocking I/O: |
| 145 | they cannot retry after a partial read or write. | 146 | they cannot retry after a partial read or write. |
| 146 | This is usually worked around by only passing the relevant data to ASN1 | 147 | This is usually worked around by only passing the relevant data to ASN.1 |
| 147 | functions when the entire structure can be read or written. | 148 | functions when the entire structure can be read or written. |
