Skip to content

Commit

Permalink
Merge pull request #87 from GnomedDev/fix/esp-hal-v0.18
Browse files Browse the repository at this point in the history
Fix esp-mbedtls support after bump to esp-hal 0.18
  • Loading branch information
lulf committed Aug 8, 2024
2 parents a3ce81a + aedd0c5 commit 6cd0ebb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub struct TlsConfig<'a> {
certificates: crate::Certificates<'a>,

/// Will use hardware acceleration on the ESP32 if it contains the RSA peripheral.
rsa: Option<&'a mut esp_mbedtls::Rsa<'a>>,
rsa: Option<&'a mut esp_mbedtls::hal::peripherals::RSA>,
}

/// Type for TLS configuration of HTTP client.
Expand Down Expand Up @@ -73,7 +73,7 @@ impl<'a> TlsConfig<'a> {
pub fn new(
version: crate::TlsVersion,
certificates: crate::Certificates<'a>,
rsa: Option<&'a mut esp_mbedtls::Rsa<'a>>,
rsa: Option<&'a mut esp_mbedtls::hal::peripherals::RSA>,
) -> Self {
Self {
version,
Expand Down Expand Up @@ -137,7 +137,7 @@ where
tls.version,
tls.certificates,
// Create a inner Some(&mut Rsa) because Rsa doesn't implement Copy
tls.rsa.as_mut().map(|inner| inner as &mut esp_mbedtls::Rsa),
tls.rsa.as_mut().map(|p| p as &mut esp_mbedtls::hal::peripherals::RSA),
)?
.connect()
.await?;
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl From<embedded_tls::TlsError> for Error {

/// Re-export those members since they're used for [client::TlsConfig].
#[cfg(feature = "esp-mbedtls")]
pub use esp_mbedtls::{Certificates, Rsa, TlsVersion, X509};
pub use esp_mbedtls::{Certificates, TlsVersion, X509};

#[cfg(feature = "esp-mbedtls")]
impl From<esp_mbedtls::TlsError> for Error {
Expand Down

0 comments on commit 6cd0ebb

Please sign in to comment.