Skip to content

Commit

Permalink
all: replace "crustls" invocations with "rustls-ffi" (rustls#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinburke authored Nov 15, 2021
1 parent 40d302b commit 7bb5c5d
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

Welcome to crustls! We're excited to work with you. If you've got a big chunk of
Welcome to rustls-ffi! We're excited to work with you. If you've got a big chunk of
work that you'd like to do, please file an issue before starting on the code, so
we can get on the same page. If you've just got a small tweak, it's fine to send
a PR without filing an issue first.
Expand Down
2 changes: 1 addition & 1 deletion src/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub(crate) trait NullParameterOrDefault {
fn value() -> Self;
}

// Defaultable is a subset of Default that can be returned by crustls.
// Defaultable is a subset of Default that can be returned by rustls-ffi.
// We use this rather than Default directly so that we can do a blanket
// impl for `T: Defaultable`. The compiler disallows a blanket impl for
// `T: Default` because `std::default` could later implement `Default`
Expand Down
8 changes: 4 additions & 4 deletions src/rslice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::{

/// A read-only view on a Rust byte slice.
///
/// This is used to pass data from crustls to callback functions provided
/// This is used to pass data from rustls-ffi to callback functions provided
/// by the user of the API.
/// `len` indicates the number of bytes than can be safely read.
///
Expand Down Expand Up @@ -46,7 +46,7 @@ fn test_rustls_slice_bytes() {

/// A read-only view of a slice of Rust byte slices.
///
/// This is used to pass data from crustls to callback functions provided
/// This is used to pass data from rustls-ffi to callback functions provided
/// by the user of the API. Because Vec and slice are not `#[repr(C)]`, we
/// provide access via a pointer to an opaque struct and an accessor method
/// that acts on that struct to get entries of type `rustls_slice_bytes`.
Expand Down Expand Up @@ -195,7 +195,7 @@ fn test_rustls_str_rejects_nul() {
/// strings). Like `rustls_str`, this guarantees that each string contains
/// UTF-8 and no NUL bytes. Strings are not NUL-terminated.
///
/// This is used to pass data from crustls to callback functions provided
/// This is used to pass data from rustls-ffi to callback functions provided
/// by the user of the API. Because Vec and slice are not `#[repr(C)]`, we
/// can't provide a straightforward `data` and `len` structure. Instead, we
/// provide access via a pointer to an opaque struct and accessor methods.
Expand Down Expand Up @@ -276,7 +276,7 @@ fn test_rustls_slice_str() {

/// A read-only view on a Rust slice of 16-bit integers in platform endianness.
///
/// This is used to pass data from crustls to callback functions provided
/// This is used to pass data from rustls-ffi to callback functions provided
/// by the user of the API.
/// `len` indicates the number of bytes than can be safely read.
///
Expand Down
14 changes: 7 additions & 7 deletions src/rustls.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ typedef struct rustls_server_config_builder rustls_server_config_builder;
/**
* A read-only view of a slice of Rust byte slices.
*
* This is used to pass data from crustls to callback functions provided
* This is used to pass data from rustls-ffi to callback functions provided
* by the user of the API. Because Vec and slice are not `#[repr(C)]`, we
* provide access via a pointer to an opaque struct and an accessor method
* that acts on that struct to get entries of type `rustls_slice_bytes`.
Expand All @@ -204,7 +204,7 @@ typedef struct rustls_slice_slice_bytes rustls_slice_slice_bytes;
* strings). Like `rustls_str`, this guarantees that each string contains
* UTF-8 and no NUL bytes. Strings are not NUL-terminated.
*
* This is used to pass data from crustls to callback functions provided
* This is used to pass data from rustls-ffi to callback functions provided
* by the user of the API. Because Vec and slice are not `#[repr(C)]`, we
* can't provide a straightforward `data` and `len` structure. Instead, we
* provide access via a pointer to an opaque struct and accessor methods.
Expand Down Expand Up @@ -244,7 +244,7 @@ typedef struct rustls_str {
/**
* A read-only view on a Rust byte slice.
*
* This is used to pass data from crustls to callback functions provided
* This is used to pass data from rustls-ffi to callback functions provided
* by the user of the API.
* `len` indicates the number of bytes than can be safely read.
*
Expand Down Expand Up @@ -351,7 +351,7 @@ typedef void *rustls_client_hello_userdata;
/**
* A read-only view on a Rust slice of 16-bit integers in platform endianness.
*
* This is used to pass data from crustls to callback functions provided
* This is used to pass data from rustls-ffi to callback functions provided
* by the user of the API.
* `len` indicates the number of bytes than can be safely read.
*
Expand Down Expand Up @@ -380,7 +380,7 @@ typedef struct rustls_slice_u16 {
* the call and may not be modified. Users of this API must copy any values that
* they want to access when the callback returned.
*
* EXPERIMENTAL: this feature of crustls is likely to change in the future, as
* EXPERIMENTAL: this feature of rustls-ffi is likely to change in the future, as
* the rustls library is re-evaluating their current approach to client hello handling.
*/
typedef struct rustls_client_hello {
Expand All @@ -404,7 +404,7 @@ typedef struct rustls_client_hello {
* with the same userdata, unless there is only a single config and connection
* where it is installed.
*
* EXPERIMENTAL: this feature of crustls is likely to change in the future, as
* EXPERIMENTAL: this feature of rustls-ffi is likely to change in the future, as
* the rustls library is re-evaluating their current approach to client hello handling.
*/
typedef const struct rustls_certified_key *(*rustls_client_hello_callback)(rustls_client_hello_userdata userdata, const struct rustls_client_hello *hello);
Expand Down Expand Up @@ -1183,7 +1183,7 @@ rustls_result rustls_server_connection_get_sni_hostname(const struct rustls_conn
* will overwrite the first registration. It is not permitted to pass a NULL
* value for `callback`.
*
* EXPERIMENTAL: this feature of crustls is likely to change in the future, as
* EXPERIMENTAL: this feature of rustls-ffi is likely to change in the future, as
* the rustls library is re-evaluating their current approach to client hello handling.
* Installing a client_hello callback will replace any configured certified keys
* and vice versa. Same holds true for the set_certified_keys variant.
Expand Down
6 changes: 3 additions & 3 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ impl ResolvesServerCert for ResolvesServerCertFromChoices {
/// the call and may not be modified. Users of this API must copy any values that
/// they want to access when the callback returned.
///
/// EXPERIMENTAL: this feature of crustls is likely to change in the future, as
/// EXPERIMENTAL: this feature of rustls-ffi is likely to change in the future, as
/// the rustls library is re-evaluating their current approach to client hello handling.
#[repr(C)]
pub struct rustls_client_hello<'a> {
Expand Down Expand Up @@ -466,7 +466,7 @@ pub type rustls_client_hello_userdata = *mut c_void;
/// with the same userdata, unless there is only a single config and connection
/// where it is installed.
///
/// EXPERIMENTAL: this feature of crustls is likely to change in the future, as
/// EXPERIMENTAL: this feature of rustls-ffi is likely to change in the future, as
/// the rustls library is re-evaluating their current approach to client hello handling.
pub type rustls_client_hello_callback = Option<
unsafe extern "C" fn(
Expand Down Expand Up @@ -553,7 +553,7 @@ impl rustls_server_config_builder {
/// will overwrite the first registration. It is not permitted to pass a NULL
/// value for `callback`.
///
/// EXPERIMENTAL: this feature of crustls is likely to change in the future, as
/// EXPERIMENTAL: this feature of rustls-ffi is likely to change in the future, as
/// the rustls library is re-evaluating their current approach to client hello handling.
/// Installing a client_hello callback will replace any configured certified keys
/// and vice versa. Same holds true for the set_certified_keys variant.
Expand Down
2 changes: 1 addition & 1 deletion src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl SessionStoreBroker {
let userdata = userdata_get().ok()?;
// This is excessive in size, but the returned data in rustls is
// only read once and then dropped.
// See <https://github.com/abetterinternet/crustls/pull/64#issuecomment-800766940>
// See <https://github.com/rustls/rustls-ffi/pull/64#issuecomment-800766940>
let mut data: Vec<u8> = vec![0; 65 * 1024];
let mut out_n: size_t = 0;
unsafe {
Expand Down
2 changes: 1 addition & 1 deletion tests/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#endif
#endif

/* crustls.h is autogenerated in the Makefile using cbindgen. */
/* rustls.h is autogenerated in the Makefile using cbindgen. */
#include "rustls.h"
#include "common.h"

Expand Down
6 changes: 3 additions & 3 deletions tests/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#endif /* !STDOUT_FILENO */
#endif /* _WIN32 */

/* crustls.h is autogenerated in the Makefile using cbindgen. */
/* rustls.h is autogenerated in the Makefile using cbindgen. */
#include "rustls.h"
#include "common.h"

Expand Down Expand Up @@ -162,8 +162,8 @@ send_response(struct conndata *conn)

rustls_connection_write(
rconn, (const uint8_t *)response, response_size, &n);
free(response);

free(response);
if(n != response_size) {
fprintf(stderr, "server: failed to write all response bytes. wrote %ld\n", n);
return CRUSTLS_DEMO_ERROR;
Expand Down

0 comments on commit 7bb5c5d

Please sign in to comment.