Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mbedtls/src/bignum/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl Mpi {
mpi_write_string(
&self.inner,
radix,
buf.as_mut_ptr() as *mut i8,
buf.as_mut_ptr() as *mut _,
buf.len(),
&mut olen,
)
Expand Down
2 changes: 1 addition & 1 deletion mbedtls/src/pk/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const CUSTOM_PK_INFO: pk_info_t = {
sign_func: None,
verify_func: None,
get_bitlen: None,
name: b"\0" as *const u8 as *const i8,
name: b"\0" as *const u8 as *const _,
ctx_alloc_func: Some(alloc_custom_pk_ctx),
ctx_free_func: Some(free_custom_pk_ctx),
}
Expand Down
2 changes: 2 additions & 0 deletions mbedtls/src/pkcs12/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ impl BERDecodable for EncryptedData {

// EncryptedContentInfo from PKCS7 see RFC 2315 section 10.1
#[derive(Debug, Clone)]
#[allow(dead_code)]
struct EncryptedContentInfo {
content_type: ObjectIdentifier,
encryption_algo: AlgorithmIdentifier,
Expand Down Expand Up @@ -458,6 +459,7 @@ enum Pkcs12BagSet {
}

#[derive(Debug, Clone)]
#[allow(dead_code)]
struct SafeBag {
bag_id: ObjectIdentifier,
bag_value: Pkcs12BagSet,
Expand Down
3 changes: 3 additions & 0 deletions mbedtls/src/ssl/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ use crate::ssl::context::HandshakeContext;
use crate::ssl::ticket::TicketCallback;
use crate::x509::{certificate, Crl, LinkedCertificate, Profile, VerifyError};

#[cfg(not(feature = "std"))]
use crate::alloc_prelude::*;

extern "C" {
fn calloc(n: usize, size: usize) -> *mut c_void;
fn free(ptr: *mut c_void);
Expand Down
5 changes: 4 additions & 1 deletion mbedtls/tests/alpn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
extern crate mbedtls;

use std::net::TcpStream;
use std::thread;

use mbedtls::pk::Pk;
use mbedtls::rng::CtrDrbg;
Expand Down Expand Up @@ -83,8 +82,10 @@ fn server(mut conn: TcpStream, alpn_list: Option<&[&str]>, expected: Expected<'_
Ok(())
}

#[cfg(unix)]
#[test]
fn alpn() {
use std::thread;
#[derive(Clone)]
struct TestConfig {
client_list: Option<&'static [&'static str]>,
Expand Down Expand Up @@ -119,8 +120,10 @@ fn alpn() {
}
}

#[cfg(unix)]
#[test]
fn nothing_in_common() {
use std::thread;
let (c, s) = support::net::create_tcp_pair().unwrap();
let c = thread::spawn(move || client(c, Some(&["a1\0", "a2\0"]), Expected::FailedHandshake(Error::SslFatalAlertMessage)).unwrap());
let s = thread::spawn(move || server(s, Some(&["b1\0", "b2\0"]), Expected::FailedHandshake(Error::SslBadHsClientHello)).unwrap());
Expand Down