Skip to content

Commit b3563a0

Browse files
committed
add more whitespace to doc comments, fix var names
Small readability tweaks to the comments that were updated in the previous commit to add some whitespace. Also fixes some parameter names that were referenced in `rustls_client_config_builder_new_custom` with the incorrect name.
1 parent 6495251 commit b3563a0

File tree

2 files changed

+56
-38
lines changed

2 files changed

+56
-38
lines changed

src/client.rs

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ box_castable! {
3131
/// A client config being constructed. A builder can be modified by,
3232
/// e.g. rustls_client_config_builder_load_roots_from_file. Once you're
3333
/// done configuring settings, call rustls_client_config_builder_build
34-
/// to turn it into a *rustls_client_config. Alternatively, if an error
35-
/// occurs or, you don't wish to build a config, call
36-
/// `rustls_client_config_builder_free` to free the builder directly.
34+
/// to turn it into a *rustls_client_config.
35+
///
36+
/// Alternatively, if an error occurs or, you don't wish to build a config,
37+
/// call `rustls_client_config_builder_free` to free the builder directly.
38+
///
3739
/// This object is not safe for concurrent mutation. Under the hood,
3840
/// it corresponds to a `Box<ClientConfig>`.
3941
/// <https://docs.rs/rustls/latest/rustls/struct.ConfigBuilder.html>
@@ -98,14 +100,17 @@ impl ServerCertVerifier for NoneVerifier {
98100
impl rustls_client_config_builder {
99101
/// Create a rustls_client_config_builder. Caller owns the memory and must
100102
/// eventually call rustls_client_config_builder_build, then free the
101-
/// resulting rustls_client_config. Alternatively, if an error occurs
102-
/// or, you don't wish to build a config, call `rustls_client_config_builder_free`
103-
/// to free the builder directly.
103+
/// resulting rustls_client_config.
104+
///
105+
/// Alternatively, if an error occurs or, you don't wish to build a config,
106+
/// call `rustls_client_config_builder_free` to free the builder directly.
107+
///
104108
/// This uses rustls safe default values for the cipher suites, key exchange
105109
/// groups and protocol versions.
106-
/// This starts out with no trusted roots.
107-
/// Caller must add roots with rustls_client_config_builder_load_roots_from_file
108-
/// or provide a custom verifier.
110+
///
111+
/// This starts out with no trusted roots. Caller must add roots with
112+
/// rustls_client_config_builder_load_roots_from_file or provide a custom
113+
/// verifier.
109114
#[no_mangle]
110115
pub extern "C" fn rustls_client_config_builder_new() -> *mut rustls_client_config_builder {
111116
ffi_panic_boundary! {
@@ -129,22 +134,26 @@ impl rustls_client_config_builder {
129134

130135
/// Create a rustls_client_config_builder. Caller owns the memory and must
131136
/// eventually call rustls_client_config_builder_build, then free the
132-
/// resulting rustls_client_config. Alternatively, if an error occurs
133-
/// or, you don't wish to build a config, call `rustls_client_config_builder_free`
134-
/// to free the builder directly. Specify cipher suites in preference
135-
/// order; the `cipher_suites` parameter must point to an array containing
136-
/// `len` pointers to `rustls_supported_ciphersuite` previously obtained
137-
/// from `rustls_all_ciphersuites_get_entry()`, or to a provided array,
138-
/// RUSTLS_DEFAULT_CIPHER_SUITES or RUSTLS_ALL_CIPHER_SUITES. Set the TLS
139-
/// protocol versions to use when negotiating a TLS session.
137+
/// resulting rustls_client_config.
138+
///
139+
/// Alternatively, if an error occurs or, you don't wish to build a config,
140+
/// call `rustls_client_config_builder_free` to free the builder directly.
141+
///
142+
/// Specify cipher suites in preference order; the `cipher_suites` parameter
143+
/// must point to an array containing `cipher_suites_len` pointers to
144+
/// `rustls_supported_ciphersuite` previously obtained from
145+
/// `rustls_all_ciphersuites_get_entry()`, or to a provided array,
146+
/// RUSTLS_DEFAULT_CIPHER_SUITES or RUSTLS_ALL_CIPHER_SUITES.
140147
///
148+
/// Set the TLS protocol versions to use when negotiating a TLS session.
141149
/// `tls_version` is the version of the protocol, as defined in rfc8446,
142150
/// ch. 4.2.1 and end of ch. 5.1. Some values are defined in
143151
/// `rustls_tls_version` for convenience, and the arrays
144152
/// RUSTLS_DEFAULT_VERSIONS or RUSTLS_ALL_VERSIONS can be used directly.
145153
///
146-
/// `versions` will only be used during the call and the application retains
147-
/// ownership. `len` is the number of consecutive `uint16_t` pointed to by `versions`.
154+
/// `tls_versions` will only be used during the call and the application retains
155+
/// ownership. `tls_versions_len` is the number of consecutive `uint16_t`
156+
/// pointed to by `tls_versions`.
148157
#[no_mangle]
149158
pub extern "C" fn rustls_client_config_builder_new_custom(
150159
cipher_suites: *const *const rustls_supported_ciphersuite,

src/rustls.h

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,11 @@ typedef struct rustls_client_config rustls_client_config;
203203
* A client config being constructed. A builder can be modified by,
204204
* e.g. rustls_client_config_builder_load_roots_from_file. Once you're
205205
* done configuring settings, call rustls_client_config_builder_build
206-
* to turn it into a *rustls_client_config. Alternatively, if an error
207-
* occurs or, you don't wish to build a config, call
208-
* `rustls_client_config_builder_free` to free the builder directly.
206+
* to turn it into a *rustls_client_config.
207+
*
208+
* Alternatively, if an error occurs or, you don't wish to build a config,
209+
* call `rustls_client_config_builder_free` to free the builder directly.
210+
*
209211
* This object is not safe for concurrent mutation. Under the hood,
210212
* it corresponds to a `Box<ClientConfig>`.
211213
* <https://docs.rs/rustls/latest/rustls/struct.ConfigBuilder.html>
@@ -1275,36 +1277,43 @@ void rustls_server_cert_verifier_free(struct rustls_server_cert_verifier *verifi
12751277
/**
12761278
* Create a rustls_client_config_builder. Caller owns the memory and must
12771279
* eventually call rustls_client_config_builder_build, then free the
1278-
* resulting rustls_client_config. Alternatively, if an error occurs
1279-
* or, you don't wish to build a config, call `rustls_client_config_builder_free`
1280-
* to free the builder directly.
1280+
* resulting rustls_client_config.
1281+
*
1282+
* Alternatively, if an error occurs or, you don't wish to build a config,
1283+
* call `rustls_client_config_builder_free` to free the builder directly.
1284+
*
12811285
* This uses rustls safe default values for the cipher suites, key exchange
12821286
* groups and protocol versions.
1283-
* This starts out with no trusted roots.
1284-
* Caller must add roots with rustls_client_config_builder_load_roots_from_file
1285-
* or provide a custom verifier.
1287+
*
1288+
* This starts out with no trusted roots. Caller must add roots with
1289+
* rustls_client_config_builder_load_roots_from_file or provide a custom
1290+
* verifier.
12861291
*/
12871292
struct rustls_client_config_builder *rustls_client_config_builder_new(void);
12881293

12891294
/**
12901295
* Create a rustls_client_config_builder. Caller owns the memory and must
12911296
* eventually call rustls_client_config_builder_build, then free the
1292-
* resulting rustls_client_config. Alternatively, if an error occurs
1293-
* or, you don't wish to build a config, call `rustls_client_config_builder_free`
1294-
* to free the builder directly. Specify cipher suites in preference
1295-
* order; the `cipher_suites` parameter must point to an array containing
1296-
* `len` pointers to `rustls_supported_ciphersuite` previously obtained
1297-
* from `rustls_all_ciphersuites_get_entry()`, or to a provided array,
1298-
* RUSTLS_DEFAULT_CIPHER_SUITES or RUSTLS_ALL_CIPHER_SUITES. Set the TLS
1299-
* protocol versions to use when negotiating a TLS session.
1297+
* resulting rustls_client_config.
13001298
*
1299+
* Alternatively, if an error occurs or, you don't wish to build a config,
1300+
* call `rustls_client_config_builder_free` to free the builder directly.
1301+
*
1302+
* Specify cipher suites in preference order; the `cipher_suites` parameter
1303+
* must point to an array containing `cipher_suites_len` pointers to
1304+
* `rustls_supported_ciphersuite` previously obtained from
1305+
* `rustls_all_ciphersuites_get_entry()`, or to a provided array,
1306+
* RUSTLS_DEFAULT_CIPHER_SUITES or RUSTLS_ALL_CIPHER_SUITES.
1307+
*
1308+
* Set the TLS protocol versions to use when negotiating a TLS session.
13011309
* `tls_version` is the version of the protocol, as defined in rfc8446,
13021310
* ch. 4.2.1 and end of ch. 5.1. Some values are defined in
13031311
* `rustls_tls_version` for convenience, and the arrays
13041312
* RUSTLS_DEFAULT_VERSIONS or RUSTLS_ALL_VERSIONS can be used directly.
13051313
*
1306-
* `versions` will only be used during the call and the application retains
1307-
* ownership. `len` is the number of consecutive `uint16_t` pointed to by `versions`.
1314+
* `tls_versions` will only be used during the call and the application retains
1315+
* ownership. `tls_versions_len` is the number of consecutive `uint16_t`
1316+
* pointed to by `tls_versions`.
13081317
*/
13091318
rustls_result rustls_client_config_builder_new_custom(const struct rustls_supported_ciphersuite *const *cipher_suites,
13101319
size_t cipher_suites_len,

0 commit comments

Comments
 (0)