Loading apex/Android.bp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -46,7 +46,7 @@ apex { // so that the package can be installed. // so that the package can be installed. // - build artifacts (lib/javalib/bin) against Android 10 SDK // - build artifacts (lib/javalib/bin) against Android 10 SDK // so that the artifacts can run. // so that the artifacts can run. defaults: ["q-launched-apex-module"], defaults: ["q-launched-dcla-enabled-apex-module"], } } apex_key { apex_key { Loading doh/connection/driver.rs +1 −1 Original line number Original line Diff line number Diff line Loading @@ -445,7 +445,7 @@ impl H3Driver { self.respond(stream_id) self.respond(stream_id) } } h3::Event::Reset(e) => { h3::Event::Reset(e) => { debug!( warn!( "process_h3_event: h3::Event::Reset with error code {} on stream ID {}, network {}", "process_h3_event: h3::Event::Reset with error code {} on stream ID {}, network {}", e, stream_id, self.driver.net_id e, stream_id, self.driver.net_id ); ); Loading doh/encoding.rs +4 −2 Original line number Original line Diff line number Diff line Loading @@ -17,6 +17,7 @@ //! Format DoH requests //! Format DoH requests use anyhow::{anyhow, Context, Result}; use anyhow::{anyhow, Context, Result}; use base64::{prelude::BASE64_URL_SAFE_NO_PAD, Engine}; use quiche::h3; use quiche::h3; use ring::rand::SecureRandom; use ring::rand::SecureRandom; use url::Url; use url::Url; Loading Loading @@ -53,7 +54,7 @@ pub fn probe_query() -> Result<String> { 0, NS_T_AAAA, // QTYPE 0, NS_T_AAAA, // QTYPE 0, NS_C_IN // QCLASS 0, NS_C_IN // QCLASS ]; ]; Ok(base64::encode_config(query, base64::URL_SAFE_NO_PAD)) Ok(BASE64_URL_SAFE_NO_PAD.encode(query)) } } /// Takes in a base64-encoded copy of a traditional DNS request and a /// Takes in a base64-encoded copy of a traditional DNS request and a Loading @@ -80,6 +81,7 @@ pub fn dns_request(base64_query: &str, url: &Url) -> Result<DnsRequest> { #[cfg(test)] #[cfg(test)] mod tests { mod tests { use base64::{prelude::BASE64_URL_SAFE_NO_PAD, Engine}; use quiche::h3::NameValue; use quiche::h3::NameValue; use url::Url; use url::Url; Loading Loading @@ -109,7 +111,7 @@ mod tests { assert_eq!(request[5].value(), b"application/dns-message"); assert_eq!(request[5].value(), b"application/dns-message"); // Verify DNS probe packet. // Verify DNS probe packet. let bytes = base64::decode_config(probe_query, base64::URL_SAFE_NO_PAD).unwrap(); let bytes = BASE64_URL_SAFE_NO_PAD.decode(probe_query).unwrap(); assert_eq!(bytes.len(), PROBE_QUERY_SIZE); assert_eq!(bytes.len(), PROBE_QUERY_SIZE); } } } } doh/ffi.rs +2 −1 Original line number Original line Diff line number Diff line Loading @@ -19,6 +19,7 @@ use crate::boot_time::{timeout, BootTime, Duration}; use crate::boot_time::{timeout, BootTime, Duration}; use crate::dispatcher::{Command, Dispatcher, Response, ServerInfo}; use crate::dispatcher::{Command, Dispatcher, Response, ServerInfo}; use crate::network::{SocketTagger, ValidationReporter}; use crate::network::{SocketTagger, ValidationReporter}; use base64::{prelude::BASE64_URL_SAFE_NO_PAD, Engine}; use futures::FutureExt; use futures::FutureExt; use libc::{c_char, int32_t, size_t, ssize_t, uint32_t, uint64_t}; use libc::{c_char, int32_t, size_t, ssize_t, uint32_t, uint64_t}; use log::{error, warn}; use log::{error, warn}; Loading Loading @@ -270,7 +271,7 @@ pub unsafe extern "C" fn doh_query( if let Some(expired_time) = BootTime::now().checked_add(t) { if let Some(expired_time) = BootTime::now().checked_add(t) { let cmd = Command::Query { let cmd = Command::Query { net_id, net_id, base64_query: base64::encode_config(q, base64::URL_SAFE_NO_PAD), base64_query: BASE64_URL_SAFE_NO_PAD.encode(q), expired_time, expired_time, resp: resp_tx, resp: resp_tx, }; }; Loading doh/tests/doh_frontend/include/lib.rs.h +5 −0 Original line number Original line Diff line number Diff line Loading @@ -103,6 +103,11 @@ bool frontend_set_max_streams_bidi(DohFrontend* doh, uint64_t value); /// Sets the `DohFrontend` to block or unblock sending any data. /// Sets the `DohFrontend` to block or unblock sending any data. bool frontend_block_sending(DohFrontend* doh, bool block); bool frontend_block_sending(DohFrontend* doh, bool block); /// If this function is called, the `DohFrontend` will send RESET_STREAM frame as a response /// instead of a DoH answer on the stream |stream_id|. This will make the client fail to receive /// this DoH answer. bool frontend_set_reset_stream_id(DohFrontend* doh, uint64_t stream_id); /// Gets the statistics of the `DohFrontend` and writes the result to |out|. /// Gets the statistics of the `DohFrontend` and writes the result to |out|. bool frontend_stats(DohFrontend* doh, Stats* out); bool frontend_stats(DohFrontend* doh, Stats* out); Loading Loading
apex/Android.bp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -46,7 +46,7 @@ apex { // so that the package can be installed. // so that the package can be installed. // - build artifacts (lib/javalib/bin) against Android 10 SDK // - build artifacts (lib/javalib/bin) against Android 10 SDK // so that the artifacts can run. // so that the artifacts can run. defaults: ["q-launched-apex-module"], defaults: ["q-launched-dcla-enabled-apex-module"], } } apex_key { apex_key { Loading
doh/connection/driver.rs +1 −1 Original line number Original line Diff line number Diff line Loading @@ -445,7 +445,7 @@ impl H3Driver { self.respond(stream_id) self.respond(stream_id) } } h3::Event::Reset(e) => { h3::Event::Reset(e) => { debug!( warn!( "process_h3_event: h3::Event::Reset with error code {} on stream ID {}, network {}", "process_h3_event: h3::Event::Reset with error code {} on stream ID {}, network {}", e, stream_id, self.driver.net_id e, stream_id, self.driver.net_id ); ); Loading
doh/encoding.rs +4 −2 Original line number Original line Diff line number Diff line Loading @@ -17,6 +17,7 @@ //! Format DoH requests //! Format DoH requests use anyhow::{anyhow, Context, Result}; use anyhow::{anyhow, Context, Result}; use base64::{prelude::BASE64_URL_SAFE_NO_PAD, Engine}; use quiche::h3; use quiche::h3; use ring::rand::SecureRandom; use ring::rand::SecureRandom; use url::Url; use url::Url; Loading Loading @@ -53,7 +54,7 @@ pub fn probe_query() -> Result<String> { 0, NS_T_AAAA, // QTYPE 0, NS_T_AAAA, // QTYPE 0, NS_C_IN // QCLASS 0, NS_C_IN // QCLASS ]; ]; Ok(base64::encode_config(query, base64::URL_SAFE_NO_PAD)) Ok(BASE64_URL_SAFE_NO_PAD.encode(query)) } } /// Takes in a base64-encoded copy of a traditional DNS request and a /// Takes in a base64-encoded copy of a traditional DNS request and a Loading @@ -80,6 +81,7 @@ pub fn dns_request(base64_query: &str, url: &Url) -> Result<DnsRequest> { #[cfg(test)] #[cfg(test)] mod tests { mod tests { use base64::{prelude::BASE64_URL_SAFE_NO_PAD, Engine}; use quiche::h3::NameValue; use quiche::h3::NameValue; use url::Url; use url::Url; Loading Loading @@ -109,7 +111,7 @@ mod tests { assert_eq!(request[5].value(), b"application/dns-message"); assert_eq!(request[5].value(), b"application/dns-message"); // Verify DNS probe packet. // Verify DNS probe packet. let bytes = base64::decode_config(probe_query, base64::URL_SAFE_NO_PAD).unwrap(); let bytes = BASE64_URL_SAFE_NO_PAD.decode(probe_query).unwrap(); assert_eq!(bytes.len(), PROBE_QUERY_SIZE); assert_eq!(bytes.len(), PROBE_QUERY_SIZE); } } } }
doh/ffi.rs +2 −1 Original line number Original line Diff line number Diff line Loading @@ -19,6 +19,7 @@ use crate::boot_time::{timeout, BootTime, Duration}; use crate::boot_time::{timeout, BootTime, Duration}; use crate::dispatcher::{Command, Dispatcher, Response, ServerInfo}; use crate::dispatcher::{Command, Dispatcher, Response, ServerInfo}; use crate::network::{SocketTagger, ValidationReporter}; use crate::network::{SocketTagger, ValidationReporter}; use base64::{prelude::BASE64_URL_SAFE_NO_PAD, Engine}; use futures::FutureExt; use futures::FutureExt; use libc::{c_char, int32_t, size_t, ssize_t, uint32_t, uint64_t}; use libc::{c_char, int32_t, size_t, ssize_t, uint32_t, uint64_t}; use log::{error, warn}; use log::{error, warn}; Loading Loading @@ -270,7 +271,7 @@ pub unsafe extern "C" fn doh_query( if let Some(expired_time) = BootTime::now().checked_add(t) { if let Some(expired_time) = BootTime::now().checked_add(t) { let cmd = Command::Query { let cmd = Command::Query { net_id, net_id, base64_query: base64::encode_config(q, base64::URL_SAFE_NO_PAD), base64_query: BASE64_URL_SAFE_NO_PAD.encode(q), expired_time, expired_time, resp: resp_tx, resp: resp_tx, }; }; Loading
doh/tests/doh_frontend/include/lib.rs.h +5 −0 Original line number Original line Diff line number Diff line Loading @@ -103,6 +103,11 @@ bool frontend_set_max_streams_bidi(DohFrontend* doh, uint64_t value); /// Sets the `DohFrontend` to block or unblock sending any data. /// Sets the `DohFrontend` to block or unblock sending any data. bool frontend_block_sending(DohFrontend* doh, bool block); bool frontend_block_sending(DohFrontend* doh, bool block); /// If this function is called, the `DohFrontend` will send RESET_STREAM frame as a response /// instead of a DoH answer on the stream |stream_id|. This will make the client fail to receive /// this DoH answer. bool frontend_set_reset_stream_id(DohFrontend* doh, uint64_t stream_id); /// Gets the statistics of the `DohFrontend` and writes the result to |out|. /// Gets the statistics of the `DohFrontend` and writes the result to |out|. bool frontend_stats(DohFrontend* doh, Stats* out); bool frontend_stats(DohFrontend* doh, Stats* out); Loading