Some fixes to #[cfg] regarding Wasi (#1633)

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
This commit is contained in:
Pierre Krieger
2020-06-30 17:31:02 +02:00
committed by GitHub
parent 826f5130cd
commit 79ff1e4d31
11 changed files with 39 additions and 39 deletions

View File

@ -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 {

View File

@ -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.

View File

@ -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();