Skip to content

Commit 242f3cd

Browse files
Merge 53d8474 into 0bfddf5
2 parents 0bfddf5 + 53d8474 commit 242f3cd

25 files changed

Lines changed: 194 additions & 194 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,8 @@ The resulting file can then be exported to Wireshark to decrypt data traffic. Th
516516
https://www.wireshark.org/docs/wsug_html_chunked/ChIOExportSection.html#ChIOExportTLSSessionKeys
517517
https://wiki.wireshark.org/TLS#using-the-pre-master-secret
518518

519-
### WolfSSL debug logging
519+
### TLS debug logging
520520

521521
Both `lightway-client` and `lightway-server` support a `--tls-debug`
522522
option when built with their respective `debug` feature enabled. This
523-
enables WolfSSL's debug logging.
523+
enables TLS's debug logging.

docs/connection_state_machine.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ stateDiagram-v2
1919
note left of Connecting
2020
Secure (D)TLS connection negotiated
2121
22-
wolfssl#colon;#colon;Session#colon;#colon;try_negotiate()
22+
tls#colon;#colon;Session#colon;#colon;try_negotiate()
2323
called until success or failure.
2424
end note
2525

docs/inside_packet_codec.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
Lightway core in UDP supports encoding the inside packets through the packet codec interface.
44

55
A codec consists of:
6-
- An encoder that encodes the inside packets that are sent from the tunnel (i.e., before they are encrypted by WolfSSL).
7-
- A decoder that decodes the inside packets that are to be sent to the tunnel (i.e., after they are decrypted by WolfSSL).
6+
- An encoder that encodes the inside packets that are sent from the tunnel (i.e., before they are encrypted by TLS).
7+
- A decoder that decodes the inside packets that are to be sent to the tunnel (i.e., after they are decrypted by TLS).
88

99
The codec is not necessarily used all the time; it is not required that all packets are encoded throughout the connection.
1010
1. The codec can decide whether the packet should be encoded based on its internal implementation.
@@ -18,11 +18,11 @@ Lightway-core accepts either encoded or non-encoded packets when its state is `C
1818
The following describes the path the packet flows through when a codec is enabled and the packet is accepted by the codec:
1919
### Inside to Outside
2020
```
21-
Tunnel -> Inside IO Loop -> Plugin -> Encoder -> Encoded Packet Handler Loop -> WolfSSL Encrypt -> ...
21+
Tunnel -> Inside IO Loop -> Plugin -> Encoder -> Encoded Packet Handler Loop -> TLS Encrypt -> ...
2222
```
2323
### Outside to Inside
2424
```
25-
... -> WolfSSL Decrypt -> Decoder -> Decoded Packet Handler Loop -> Plugin -> Tunnel
25+
... -> TLS Decrypt -> Decoder -> Decoded Packet Handler Loop -> Plugin -> Tunnel
2626
```
2727

2828
## Implementation

docs/logs_and_metrics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Lightway server also supports metrics to monitor. The following are the metrics
3030
| connection_accept_proxy_header_failed | server | Counter | A new connection did cnot present a valid PROXY header |
3131
| conn_create_failed | server | Counter | A new connection could not be created |
3232
| conn_alloc_frag_map | core | Counter | A connection has used a fragmented data packet.<br>Therefore the 2M FragmentMap has been allocated |
33-
| wolfssl_appdata | core | Counter | An AppData result occurred during a WolfSSL operation.<br><br>Given current configuration we do not expect this to be non-zero |
33+
| tls_appdata | core | Counter | An AppData result occurred during a TLS operation.<br><br>Given current configuration we do not expect this to be non-zero |
3434
| session_id_mismatch | core | Counter | Server has received a mismatched session_id in the header after the packet content has been validated <br><br>Should generally be expected to happen rarely|
3535
| received_encoding_req_non_online | core | Counter | Server received an encoding request when the Connection state is not Online |
3636
| received_encoding_req_with_tcp | core | Counter | Server received an encoding request when the Connection type is TCP |
@@ -43,8 +43,8 @@ Lightway server also supports metrics to monitor. The following are the metrics
4343
| conn_online | server | Counter | Counts connection which have reached the “online” state after successful authentication |
4444
| conn_rejected_no_free_ip | server | Counter | Counts connections which were rejected at auth time due to a lack of free IPs in the server pool<br><br>Should generally be expected to be 0 |
4545
| conn_rejected_access_denied | server | Counter | Counts connections rejected due to invalid auth |
46-
| conn_tls_error | server | Counter | Counts connections which failed due to a TLS failure from WolfSSL |
47-
| conn_unknown_error | server | Counter | Counts connections which failed due to a non-TLS failure from WolfSSL |
46+
| conn_tls_error | server | Counter | Counts connections which failed due to a TLS failure|
47+
| conn_unknown_error | server | Counter | Counts connections which failed due to a non-TLS failure |
4848
| conn_aged_out | server | Counter | Counts connections which are disconnected due to being idle (after 1 day of inactivity) |
4949
| user_auth_eviction | server | Counter | Counts connections which are disconnected due to their auth expiring |
5050
| conn_client_closed | server | Counter | Counts connections which have been closed since client initiate Disconnect |

lightway-app-utils/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ pub use utils::{Validate, validate_configuration_file_path};
3737

3838
mod packet_codec;
3939
#[cfg(feature = "debug")]
40-
mod wolfssl_tracing;
40+
mod tracing;
4141
#[cfg(feature = "debug")]
42-
pub use wolfssl_tracing::wolfssl_tracing_callback;
42+
pub use tracing::tls_tracing_callback;
4343

4444
pub use packet_codec::{PacketCodec, PacketCodecFactory, PacketCodecFactoryType};
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
use std::ffi::CStr;
44
use tracing::debug;
55

6-
/// Callback function to WolfSSL's [`set_logging_callback`] (which conforms to [`WolfsslLoggingCallback`])
6+
/// Callback function to TLS's [`set_logging_callback`] (which conforms to [`TlsLoggingCallback`])
77
/// It will pass the log message to [`tracing`] via `debug` macro.
88
/// This is marked `unsafe` to match the `bindgen`-generated function type for FFI compatibility.
99
/// # SAFETY
10-
/// The caller must originate from the WolfSSL library's logging callback,
10+
/// The caller must originate from the TLS library's logging callback,
1111
/// as it is not designed to be used or called from Rust.
1212
#[allow(non_snake_case)]
13-
pub unsafe extern "C" fn wolfssl_tracing_callback(
13+
pub unsafe extern "C" fn tls_tracing_callback(
1414
_logLevel: std::os::raw::c_int,
1515
logMessage: *const std::os::raw::c_char,
1616
) {
@@ -20,7 +20,7 @@ pub unsafe extern "C" fn wolfssl_tracing_callback(
2020
// SAFETY: Based on the safety requirements for CStr
2121
// https://doc.rust-lang.org/std/ffi/struct.CStr.html#safety
2222
// We check the pointer is not null, and the string pointed will be
23-
// null terminated since it is generated as snprintf from wolfssl
23+
// null terminated since it is generated as snprintf from tls
2424
// Ref: https://github.com/wolfSSL/wolfssl/blob/master/wolfcrypt/src/logging.c
2525
let c_str = unsafe { CStr::from_ptr(logMessage) };
2626
let msg = c_str.to_str().unwrap_or("Unable to decode C string");

lightway-client/src/config.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ impl Config {
284284
}
285285

286286
/// Try build CA from ca_crt
287-
pub fn load_ca(&self) -> Result<lightway_core::wolfssl::RootCertificate<'_>, Error> {
287+
pub fn load_ca(&self) -> Result<lightway_core::tls::RootCertificate<'_>, Error> {
288288
load_ca(&self.ca_cert)
289289
}
290290

@@ -293,7 +293,7 @@ impl Config {
293293
pub fn load_ca_file<'a>(
294294
&self,
295295
ca_path: &'a mut Option<PathBuf>,
296-
) -> lightway_core::wolfssl::RootCertificate<'a> {
296+
) -> lightway_core::tls::RootCertificate<'a> {
297297
if ca_path.is_none() {
298298
*ca_path = Some(PathBuf::from(&self.ca_cert));
299299
}
@@ -461,7 +461,7 @@ impl ConnectionConfig {
461461

462462
/// Try build CA from ca_crt
463463
#[cfg(feature = "mobile")]
464-
pub fn load_ca(&self) -> Result<lightway_core::wolfssl::RootCertificate<'_>, Error> {
464+
pub fn load_ca(&self) -> Result<lightway_core::tls::RootCertificate<'_>, Error> {
465465
self.ca_cert
466466
.as_ref()
467467
.map(|ca| load_ca(ca))
@@ -644,7 +644,7 @@ fn take_auth(
644644
}
645645
}
646646

647-
fn load_ca(ca: &String) -> Result<lightway_core::wolfssl::RootCertificate<'_>, Error> {
647+
fn load_ca(ca: &String) -> Result<lightway_core::tls::RootCertificate<'_>, Error> {
648648
if ca.starts_with("-----BEGIN CERTIFICATE-----") {
649649
Ok(RootCertificate::PemBuffer(ca.as_bytes()))
650650
} else {

lightway-client/src/io/outside/udp.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl Udp {
3838
};
3939
let default_ip_pmtudisc = sockopt::get_ip_mtu_discover(&sock)?;
4040
// Check for the socket's writable ready status, so that it can be used
41-
// successfuly in WolfSsl's `OutsideIOSendCallback` callback
41+
// successfuly in TLS's `OutsideIOSendCallback` callback
4242
sock.writable().await?;
4343

4444
Ok(Self {
@@ -162,14 +162,14 @@ impl OutsideIOSendCallback for Udp {
162162
Err(err) if matches!(err.kind(), std::io::ErrorKind::ConnectionRefused) => {
163163
// Possibly the server isn't listening (yet).
164164
//
165-
// Swallow the error so the WolfSSL socket does not
166-
// enter the error state, and DTLS would handle retransmission as well.
165+
// Swallow the error so the TLS socket does not
166+
// enter the error state, and DTLS would handles the retransmission as well.
167167
//
168168
// This way we can continue if/when the server shows up.
169169
//
170170
// Returning the number of bytes requested to be sent to mock
171171
// that the send is successful.
172-
// Otherwise, WolfSSL perceives that no data is sent and try
172+
// Otherwise, TLS perceives that no data is sent and try
173173
// to send the same data again, creating a live-lock until
174174
// the network is reachable.
175175
IOCallbackResult::Ok(buf.len())

lightway-client/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ use crate::keepalive::Config as KeepaliveConfig;
4141
#[cfg(desktop)]
4242
use crate::route_manager::{RouteManager, RouteMode};
4343
#[cfg(feature = "debug")]
44-
use lightway_app_utils::wolfssl_tracing_callback;
44+
use lightway_app_utils::tls_tracing_callback;
4545
#[cfg(batch_receive)]
4646
use lightway_core::MAX_IO_BATCH_SIZE;
4747
pub use lightway_core::{
@@ -263,7 +263,7 @@ pub struct ClientConfig<'cert, ExtAppState: Send + Sync> {
263263
#[educe(Debug(ignore))]
264264
pub best_connection_selected_signal: Option<oneshot::Sender<BestConnectionInfo>>,
265265

266-
/// Enable WolfSsl debugging
266+
/// Enable TLS debugging
267267
#[cfg(feature = "debug")]
268268
pub tls_debug: bool,
269269

@@ -843,7 +843,7 @@ pub async fn connect<
843843

844844
#[cfg(feature = "debug")]
845845
if config.tls_debug {
846-
set_logging_callback(Some(wolfssl_tracing_callback));
846+
set_logging_callback(Some(tls_tracing_callback));
847847
}
848848

849849
let (inside_io_codec, encoded_pkt_receiver, decoded_pkt_receiver) =

lightway-client/src/mobile.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ fn get_lightway_client_hash() -> String {
7272

7373
/// Get the version for WolfSSL
7474
#[cfg_attr(not(feature = "mobile-test"), uniffi::export)]
75-
fn get_wolfssl_version() -> String {
76-
lightway_core::wolfssl::get_wolfssl_version_string().to_string()
75+
fn get_tls_library_version() -> String {
76+
lightway_core::tls::get_version_string().to_string()
7777
}
7878

7979
/// Sets up a global default logging bridge between Rust and the mobile app, while

0 commit comments

Comments
 (0)