diff options
| author | bentley <> | 2014-10-12 09:33:04 +0000 |
|---|---|---|
| committer | bentley <> | 2014-10-12 09:33:04 +0000 |
| commit | 78332233d01faa45e0bb0b1583d47cb5ad1ddc19 (patch) | |
| tree | a5087bf8d016a6041c2b6822fbecfd8f6c5e70b1 /src/lib/libssl/doc/SSL_CTX_set_msg_callback.3 | |
| parent | 4e737c824fafe5f105e5f4849a9db2569b5d53d8 (diff) | |
| download | openbsd-78332233d01faa45e0bb0b1583d47cb5ad1ddc19.tar.gz openbsd-78332233d01faa45e0bb0b1583d47cb5ad1ddc19.tar.bz2 openbsd-78332233d01faa45e0bb0b1583d47cb5ad1ddc19.zip | |
Convert libssl manpages from pod to mdoc(7).
libcrypto has not been started yet.
ok schwarze@ miod@
Diffstat (limited to 'src/lib/libssl/doc/SSL_CTX_set_msg_callback.3')
| -rw-r--r-- | src/lib/libssl/doc/SSL_CTX_set_msg_callback.3 | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/src/lib/libssl/doc/SSL_CTX_set_msg_callback.3 b/src/lib/libssl/doc/SSL_CTX_set_msg_callback.3 new file mode 100644 index 0000000000..82c1479af0 --- /dev/null +++ b/src/lib/libssl/doc/SSL_CTX_set_msg_callback.3 | |||
| @@ -0,0 +1,132 @@ | |||
| 1 | .Dd $Mdocdate: October 12 2014 $ | ||
| 2 | .Dt SSL_CTX_SET_MSG_CALLBACK 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm SSL_CTX_set_msg_callback , | ||
| 6 | .Nm SSL_CTX_set_msg_callback_arg , | ||
| 7 | .Nm SSL_set_msg_callback , | ||
| 8 | .Nm SSL_get_msg_callback_arg | ||
| 9 | .Nd install callback for observing protocol messages | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft void | ||
| 13 | .Fo SSL_CTX_set_msg_callback | ||
| 14 | .Fa "SSL_CTX *ctx" | ||
| 15 | .Fa "void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)" | ||
| 16 | .Fc | ||
| 17 | .Ft void | ||
| 18 | .Fn SSL_CTX_set_msg_callback_arg "SSL_CTX *ctx" "void *arg" | ||
| 19 | .Ft void | ||
| 20 | .Fo SSL_set_msg_callback | ||
| 21 | .Fa "SSL *ssl" | ||
| 22 | .Fa "void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)" | ||
| 23 | .Fc | ||
| 24 | .Ft void | ||
| 25 | .Fn SSL_set_msg_callback_arg "SSL *ssl" "void *arg" | ||
| 26 | .Sh DESCRIPTION | ||
| 27 | .Fn SSL_CTX_set_msg_callback | ||
| 28 | or | ||
| 29 | .Fn SSL_set_msg_callback | ||
| 30 | can be used to define a message callback function | ||
| 31 | .Fa cb | ||
| 32 | for observing all SSL/TLS protocol messages (such as handshake messages) | ||
| 33 | that are received or sent. | ||
| 34 | .Fn SSL_CTX_set_msg_callback_arg | ||
| 35 | and | ||
| 36 | .Fn SSL_set_msg_callback_arg | ||
| 37 | can be used to set argument | ||
| 38 | .Fa arg | ||
| 39 | to the callback function, which is available for arbitrary application use. | ||
| 40 | .Pp | ||
| 41 | .Fn SSL_CTX_set_msg_callback | ||
| 42 | and | ||
| 43 | .Fn SSL_CTX_set_msg_callback_arg | ||
| 44 | specify default settings that will be copied to new | ||
| 45 | .Vt SSL | ||
| 46 | objects by | ||
| 47 | .Xr SSL_new 3 . | ||
| 48 | .Fn SSL_set_msg_callback | ||
| 49 | and | ||
| 50 | .Fn SSL_set_msg_callback_arg | ||
| 51 | modify the actual settings of an | ||
| 52 | .Vt SSL | ||
| 53 | object. | ||
| 54 | Using a | ||
| 55 | .Dv NULL | ||
| 56 | pointer for | ||
| 57 | .Fa cb | ||
| 58 | disables the message callback. | ||
| 59 | .Pp | ||
| 60 | When | ||
| 61 | .Fa cb | ||
| 62 | is called by the SSL/TLS library for a protocol message, | ||
| 63 | the function arguments have the following meaning: | ||
| 64 | .Bl -tag -width Ds | ||
| 65 | .It Fa write_p | ||
| 66 | This flag is 0 when a protocol message has been received and 1 when a protocol | ||
| 67 | message has been sent. | ||
| 68 | .It Fa version | ||
| 69 | The protocol version according to which the protocol message is | ||
| 70 | interpreted by the library. | ||
| 71 | Currently, this is one of | ||
| 72 | .Dv SSL2_VERSION , | ||
| 73 | .Dv SSL3_VERSION | ||
| 74 | and | ||
| 75 | .Dv TLS1_VERSION | ||
| 76 | (for SSL 2.0, SSL 3.0 and TLS 1.0, respectively). | ||
| 77 | .It Fa content_type | ||
| 78 | In the case of SSL 2.0, this is always 0. | ||
| 79 | In the case of SSL 3.0 or TLS 1.0, this is one of the | ||
| 80 | .Em ContentType | ||
| 81 | values defined in the protocol specification | ||
| 82 | .Po | ||
| 83 | .Dq change_cipher_spec(20) , | ||
| 84 | .Dq alert(21) , | ||
| 85 | .Dq handshake(22) ; | ||
| 86 | but never | ||
| 87 | .Dq application_data(23) | ||
| 88 | because the callback will only be called for protocol messages. | ||
| 89 | .Pc | ||
| 90 | .It Fa buf , Fa len | ||
| 91 | .Fa buf | ||
| 92 | points to a buffer containing the protocol message, which consists of | ||
| 93 | .Fa len | ||
| 94 | bytes. | ||
| 95 | The buffer is no longer valid after the callback function has returned. | ||
| 96 | .It Fa ssl | ||
| 97 | The | ||
| 98 | .Vt SSL | ||
| 99 | object that received or sent the message. | ||
| 100 | .It Fa arg | ||
| 101 | The user-defined argument optionally defined by | ||
| 102 | .Fn SSL_CTX_set_msg_callback_arg | ||
| 103 | or | ||
| 104 | .Fn SSL_set_msg_callback_arg . | ||
| 105 | .El | ||
| 106 | .Sh NOTES | ||
| 107 | Protocol messages are passed to the callback function after decryption | ||
| 108 | and fragment collection where applicable. | ||
| 109 | (Thus record boundaries are not visible.) | ||
| 110 | .Pp | ||
| 111 | If processing a received protocol message results in an error, | ||
| 112 | the callback function may not be called. | ||
| 113 | For example, the callback function will never see messages that are considered | ||
| 114 | too large to be processed. | ||
| 115 | .Pp | ||
| 116 | Due to automatic protocol version negotiation, | ||
| 117 | .Fa version | ||
| 118 | is not necessarily the protocol version used by the sender of the message: | ||
| 119 | If a TLS 1.0 ClientHello message is received by an SSL 3.0-only server, | ||
| 120 | .Fa version | ||
| 121 | will be | ||
| 122 | .Dv SSL3_VERSION . | ||
| 123 | .Sh SEE ALSO | ||
| 124 | .Xr ssl 3 , | ||
| 125 | .Xr SSL_new 3 | ||
| 126 | .Sh HISTORY | ||
| 127 | .Fn SSL_CTX_set_msg_callback , | ||
| 128 | .Fn SSL_CTX_set_msg_callback_arg , | ||
| 129 | .Fn SSL_set_msg_callback | ||
| 130 | and | ||
| 131 | .Fn SSL_get_msg_callback_arg | ||
| 132 | were added in OpenSSL 0.9.7. | ||
