Skip to content

Commit 4329f17

Browse files
Rename esp-mbedtls to mbedtls-rs (#107)
* Rename esp-mbedtls to mbedtls-rs * chore: auto-push built libraries --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 0d86dcc commit 4329f17

File tree

103 files changed

+138
-144
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+138
-144
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# This CI builds the `esp-mbedtls*` crates and their examples.
1+
# This CI builds the `mbedtls-rs*` crates and their examples.
22
#
3-
# If a change is detected within `esp-mbedtls-sys/`, a rebuild is triggered and this CI will automatically
3+
# If a change is detected within `mbedtls-rs-sys/`, a rebuild is triggered and this CI will automatically
44
# rebuild the libraries using the xtask. Then the tests are executed against the rebuilt libraries.
55
#
66
# If no rebuild occurs, the examples are built against the latest libraries present in the main branch.
@@ -110,13 +110,13 @@ jobs:
110110
# ./
111111
# xtask
112112

113-
- name: Detect esp-mbedtls-sys/ changes
113+
- name: Detect mbedtls-rs-sys/ changes
114114
uses: dorny/paths-filter@v3
115115
id: detect-changes
116116
with:
117117
filters: |
118118
libs:
119-
- 'esp-mbedtls-sys/**'
119+
- 'mbedtls-rs-sys/**'
120120
121121
- name: Detect host target triple
122122
run: |
@@ -157,7 +157,7 @@ jobs:
157157
steps.detect-changes.outputs.libs == 'true' ||
158158
contains(github.event.pull_request.labels.*.name, 'rebuild-libs')
159159
run: |
160-
rm -rf esp-mbedtls-sys/libs/*
160+
rm -rf mbedtls-rs-sys/libs/*
161161
cargo +stable xtask gen xtensa-esp32-none-elf
162162
cargo +stable xtask gen xtensa-esp32s2-none-elf
163163
cargo +stable xtask gen xtensa-esp32s3-none-elf
@@ -171,11 +171,11 @@ jobs:
171171
contains(github.event.pull_request.labels.*.name, 'rebuild-libs')
172172
uses: actions/upload-artifact@v4
173173
with:
174-
name: esp-mbedtls-sys
174+
name: mbedtls-rs-sys
175175
retention-days: 1
176176
path: |
177-
esp-mbedtls-sys/libs
178-
esp-mbedtls-sys/src
177+
mbedtls-rs-sys/libs
178+
mbedtls-rs-sys/src
179179
180180
build-mcu:
181181
name: Build-MCU
@@ -321,16 +321,16 @@ jobs:
321321
- name: Download artifacts
322322
uses: actions/download-artifact@v4
323323
with:
324-
name: esp-mbedtls-sys
324+
name: mbedtls-rs-sys
325325
# Required because else artifacts will be put into the base directory
326-
path: esp-mbedtls-sys/
326+
path: mbedtls-rs-sys/
327327

328328
- name: Commit and push libraries to ${{ github.head_ref || github.ref_name }}
329329
run: |
330330
git config user.name "github-actions[bot]"
331331
git config user.email "github-actions[bot]@users.noreply.github.com"
332-
git add esp-mbedtls-sys/libs
333-
git add esp-mbedtls-sys/src
332+
git add mbedtls-rs-sys/libs
333+
git add mbedtls-rs-sys/src
334334
# Only commit and push when there are changes
335335
git diff --cached --quiet || (
336336
git commit -m "chore: auto-push built libraries"

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "mbedtls"]
2-
path = esp-mbedtls-sys/mbedtls
2+
path = mbedtls-rs-sys/mbedtls
33
url = https://github.com/espressif/mbedtls

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[workspace]
22
resolver = "2"
33
members = [
4-
"esp-mbedtls",
5-
"esp-mbedtls-sys",
4+
"mbedtls-rs",
5+
"mbedtls-rs-sys",
66
]
77

88
exclude = ["examples", "xtask"]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# esp-mbedtls
1+
# mbedtls-rs
22

3-
This repository hosts the [esp-mbedtls](esp-mbedtls), [esp-mbedtls-sys](esp-mbedtls-sys) and [examples](examples) crates.
3+
This repository hosts the [mbedtls-rs](mbedtls-rs), [mbedtls-rs-sys](mbedtls-rs-sys) and [examples](examples) crates.
44

55
For more information, consult the respective README of each crate.
66

esp-mbedtls/Cargo.toml

Lines changed: 0 additions & 42 deletions
This file was deleted.

examples/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# `esp-mbedtls` Examples
1+
# `mbedtls-rs` Examples
22

33
The examples currently run on the following platforms:
44

@@ -111,4 +111,4 @@ Similar to `server` but utilizing the true HTTP server from `edge-http`
111111

112112
### crypto_self_tests
113113

114-
Runs the MbedTLS crypto self tests for all hookable MbedTLS algorithms in `esp-mbedtls-sys`
114+
Runs the MbedTLS crypto self tests for all hookable MbedTLS algorithms in `mbedtls-rs-sys`

examples/common/blocking_client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
33
use core::ffi::CStr;
44

5-
use esp_mbedtls::blocking::io::{Read, Write};
6-
use esp_mbedtls::blocking::Session;
7-
use esp_mbedtls::{SessionConfig, SessionError, TlsReference};
5+
use mbedtls_rs::blocking::io::{Read, Write};
6+
use mbedtls_rs::blocking::Session;
7+
use mbedtls_rs::{SessionConfig, SessionError, TlsReference};
88

99
use log::info;
1010

examples/common/blocking_server.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! A platform-agnostic HTTPS 1.0 server using the blocking API.
22
3-
use esp_mbedtls::blocking::io::{Read, Write};
4-
use esp_mbedtls::blocking::Session;
5-
use esp_mbedtls::{SessionConfig, SessionError, TlsReference};
3+
use mbedtls_rs::blocking::io::{Read, Write};
4+
use mbedtls_rs::blocking::Session;
5+
use mbedtls_rs::{SessionConfig, SessionError, TlsReference};
66

77
use log::{info, warn};
88

@@ -51,7 +51,7 @@ where
5151
core::str::from_utf8(&buf[..headers_end]).unwrap_or("???")
5252
);
5353

54-
session.write_all(b"HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\nConnection: Close\r\n\r\nHello from esp-mbedtls!\r\n")?;
54+
session.write_all(b"HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\nConnection: Close\r\n\r\nHello from mbedtls-rs!\r\n")?;
5555
} else {
5656
info!("No valid HTTP request received");
5757
}

examples/common/certs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use core::ffi::CStr;
44

5-
use esp_mbedtls::{Certificate, ClientSessionConfig, Credentials, ServerSessionConfig, X509};
5+
use mbedtls_rs::{Certificate, ClientSessionConfig, Credentials, ServerSessionConfig, X509};
66

77
const CA_BUNDLE: &CStr = match CStr::from_bytes_with_nul(
88
concat!(include_str!("certs/ca-bundle-small.pem"), "\0").as_bytes(),
@@ -24,7 +24,7 @@ pub fn client_conf<'a>(mtls: bool, server_name: Option<&'a CStr>) -> ClientSessi
2424
if mtls {
2525
conf.creds = Some(Credentials {
2626
certificate: Certificate::new_no_copy(CERT).unwrap(),
27-
private_key: esp_mbedtls::PrivateKey::new(X509::DER(KEY), None).unwrap(),
27+
private_key: mbedtls_rs::PrivateKey::new(X509::DER(KEY), None).unwrap(),
2828
});
2929
}
3030

@@ -38,7 +38,7 @@ pub fn server_conf(mtls: bool) -> ServerSessionConfig<'static> {
3838
ca_chain: Some(cert.clone()),
3939
..ServerSessionConfig::new(Credentials {
4040
certificate: cert.clone(),
41-
private_key: esp_mbedtls::PrivateKey::new(X509::DER(KEY), None).unwrap(),
41+
private_key: mbedtls_rs::PrivateKey::new(X509::DER(KEY), None).unwrap(),
4242
})
4343
};
4444

examples/common/certs/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Certificates for the `esp-mbedtls` Examples
1+
# Certificates for the `mbedtls-rs` Examples
22

33
This folder contains certificates used by the examples:
44
- `ca-bundle.pem`
@@ -9,12 +9,12 @@ This folder contains certificates used by the examples:
99
```
1010
- `ca-bundle-small.pem`
1111
- A manual extraction of just two root CAs from `ca-bundle.pem` which are known to be used by the websites used in the client examples (`httpbin.org` and `certauth.cryptomix.com`)
12-
- Done for reducing memory and flash size when using `esp-mbedtls`
12+
- Done for reducing memory and flash size when using `mbedtls-rs`
1313
- `cert.der` / `cert.pem` + `key.der` / `key.pem`
1414
- Self-signed certificate used by the server examples and its corresponding key
1515
- Can be re-generated with:
1616
```sh
17-
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -sha256 -days 3650 -nodes -subj "/CN=esp-mbedtls.local"
17+
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -sha256 -days 3650 -nodes -subj "/CN=mbedtls-rs.local"
1818
openssl x509 -in cert.pem -out cert.der -outform DER
1919
openssl rsa -in key.pem -out key.der -outform DER
2020
```

0 commit comments

Comments
 (0)