mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-24 15:21:33 +00:00
Some fixes to #[cfg] regarding Wasi (#1633)
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
This commit is contained in:
@ -24,7 +24,7 @@
|
||||
//! helps you with.
|
||||
|
||||
use crate::error::SecioError;
|
||||
#[cfg(not(any(target_os = "emscripten", target_os = "unknown")))]
|
||||
#[cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))]
|
||||
use ring::digest;
|
||||
use std::cmp::Ordering;
|
||||
use crate::stream_cipher::Cipher;
|
||||
@ -204,7 +204,7 @@ pub fn select_digest(r: Ordering, ours: &str, theirs: &str) -> Result<Digest, Se
|
||||
Err(SecioError::NoSupportIntersection)
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "emscripten", target_os = "unknown")))]
|
||||
#[cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))]
|
||||
impl Into<&'static digest::Algorithm> for Digest {
|
||||
#[inline]
|
||||
fn into(self) -> &'static digest::Algorithm {
|
||||
|
@ -24,10 +24,10 @@ use futures::prelude::*;
|
||||
use crate::SecioError;
|
||||
|
||||
#[path = "exchange/impl_ring.rs"]
|
||||
#[cfg(not(any(target_os = "emscripten", target_os = "unknown")))]
|
||||
#[cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))]
|
||||
mod platform;
|
||||
#[path = "exchange/impl_webcrypto.rs"]
|
||||
#[cfg(any(target_os = "emscripten", target_os = "unknown"))]
|
||||
#[cfg(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown"))]
|
||||
mod platform;
|
||||
|
||||
/// Possible key agreement algorithms.
|
||||
|
@ -371,7 +371,7 @@ mod tests {
|
||||
use futures::{prelude::*, channel::oneshot};
|
||||
|
||||
#[test]
|
||||
#[cfg(not(any(target_os = "emscripten", target_os = "unknown")))]
|
||||
#[cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))]
|
||||
fn handshake_with_self_succeeds_rsa() {
|
||||
let key1 = {
|
||||
let mut private = include_bytes!("../tests/test-rsa-private-key.pk8").to_vec();
|
||||
|
Reference in New Issue
Block a user