Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmastrac committed Apr 24, 2024
1 parent e152446 commit dd27eb2
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 28 deletions.
3 changes: 1 addition & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions cli/args/mod.rs
Expand Up @@ -44,8 +44,8 @@ use deno_core::parking_lot::Mutex;
use deno_core::serde_json;
use deno_core::url::Url;
use deno_runtime::deno_node::PackageJson;
use deno_runtime::deno_tls::deno_native_certs::load_native_certs;
use deno_runtime::deno_tls::rustls;


use deno_runtime::deno_tls::rustls::RootCertStore;
use deno_runtime::deno_tls::rustls_pemfile;
use deno_runtime::deno_tls::webpki_roots;
Expand Down Expand Up @@ -660,7 +660,7 @@ pub fn get_root_cert_store(
};

match result {
Ok(certs) => {
Ok(_certs) => {
unreachable!()
// root_cert_store.add(&certs);
}
Expand Down
28 changes: 14 additions & 14 deletions ext/tls/lib.rs
Expand Up @@ -35,7 +35,7 @@ use std::io::BufReader;
use std::io::Cursor;
use std::net::IpAddr;
use std::sync::Arc;
use std::time::SystemTime;


/// Lazily resolves the root cert store.
///
Expand All @@ -57,27 +57,27 @@ impl ServerCertVerifier for DefaultSignatureVerification {
}
fn verify_server_cert(
&self,
end_entity: &rustls::pki_types::CertificateDer<'_>,
intermediates: &[rustls::pki_types::CertificateDer<'_>],
server_name: &rustls::pki_types::ServerName<'_>,
ocsp_response: &[u8],
now: rustls::pki_types::UnixTime,
_end_entity: &rustls::pki_types::CertificateDer<'_>,
_intermediates: &[rustls::pki_types::CertificateDer<'_>],
_server_name: &rustls::pki_types::ServerName<'_>,
_ocsp_response: &[u8],
_now: rustls::pki_types::UnixTime,
) -> Result<ServerCertVerified, Error> {
Err(Error::General("Should not be used".to_string()))
}
fn verify_tls12_signature(
&self,
message: &[u8],
cert: &rustls::pki_types::CertificateDer<'_>,
dss: &DigitallySignedStruct,
_message: &[u8],
_cert: &rustls::pki_types::CertificateDer<'_>,
_dss: &DigitallySignedStruct,
) -> Result<HandshakeSignatureValid, Error> {
Err(Error::General("Should not be used".to_string()))
}
fn verify_tls13_signature(
&self,
message: &[u8],
cert: &rustls::pki_types::CertificateDer<'_>,
dss: &DigitallySignedStruct,
_message: &[u8],
_cert: &rustls::pki_types::CertificateDer<'_>,
_dss: &DigitallySignedStruct,
) -> Result<HandshakeSignatureValid, Error> {
Err(Error::General("Should not be used".to_string()))
}
Expand Down Expand Up @@ -108,7 +108,7 @@ impl ServerCertVerifier for NoCertificateVerification {
let dns_name_or_ip_address = match server_name {
ServerName::DnsName(dns_name) => dns_name.as_ref().to_owned(),
ServerName::IpAddress(ip_address) => {
Into::<IpAddr>::into(ip_address.clone()).to_string()
Into::<IpAddr>::into(*ip_address).to_string()
}
_ => {
// NOTE(bartlomieju): `ServerName` is a non-exhaustive enum
Expand Down Expand Up @@ -290,7 +290,7 @@ pub fn load_certs(
return Err(cert_not_found_err());
}

Ok(certs.into_iter().map(|x| CertificateDer::from(x)).collect())
Ok(certs.into_iter().map(CertificateDer::from).collect())
}

fn key_decode_err() -> AnyError {
Expand Down
3 changes: 1 addition & 2 deletions tests/util/server/Cargo.toml
Expand Up @@ -20,6 +20,7 @@ base64.workspace = true
bytes.workspace = true
console_static_text.workspace = true
deno_unsync = "0"
deno_tls.workspace = true
denokv_proto.workspace = true
fastwebsockets.workspace = true
flate2 = { workspace = true, features = ["default"] }
Expand All @@ -43,8 +44,6 @@ pretty_assertions.workspace = true
prost.workspace = true
regex.workspace = true
reqwest.workspace = true
rustls-pemfile.workspace = true
rustls-tokio-stream.workspace = true
semver = "=1.0.14"
serde.workspace = true
serde_json.workspace = true
Expand Down
15 changes: 8 additions & 7 deletions tests/util/server/src/https.rs
@@ -1,12 +1,13 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
use anyhow::anyhow;

use futures::Stream;
use futures::StreamExt;
use rustls_tokio_stream::rustls;
use rustls_tokio_stream::rustls::pki_types::CertificateDer;
use rustls_tokio_stream::rustls::pki_types::PrivateKeyDer;
use rustls_tokio_stream::rustls::pki_types::PrivatePkcs1KeyDer;
use rustls_tokio_stream::TlsStream;
use deno_tls::rustls;
use deno_tls::rustls::pki_types::CertificateDer;
use deno_tls::rustls::pki_types::PrivateKeyDer;
use deno_tls::rustls::pki_types::PrivatePkcs1KeyDer;
use deno_tls::rustls_tokio_stream::TlsStream;
use deno_tls::rustls_pemfile;
use std::io;
use std::num::NonZeroUsize;
use std::result::Result;
Expand Down Expand Up @@ -74,7 +75,7 @@ pub fn get_tls_config(
rustls_pemfile::certs(&mut cert_reader)
.unwrap()
.into_iter()
.map(|x| CertificateDer::from(x))
.map(CertificateDer::from)
.collect()
};

Expand Down

0 comments on commit dd27eb2

Please sign in to comment.