Allow unsafe_code everywhere.

Since the unsafe code is already in `unsafe` blocks, it's redundant to
also require `#[allow(unsafe_code)]`.
This commit is contained in:
Brian Smith 2016-09-16 16:37:42 -10:00
parent 0cf761264c
commit 77c8c8091c
19 changed files with 2 additions and 36 deletions

View File

@ -12,8 +12,6 @@
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#![allow(unsafe_code)]
use {aead, bssl, c, error, polyfill};
const AES_128_KEY_LEN: usize = 128 / 8;

View File

@ -12,8 +12,6 @@
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#![allow(unsafe_code)]
use {aead, c, error, polyfill};
use core;

View File

@ -31,7 +31,6 @@ pub fn map_result(bssl_result: c::int) -> Result<(), error::Unspecified> {
macro_rules! bssl_test {
( $fn_name:ident, $bssl_test_main_fn_name:ident ) => {
#[test]
#[allow(unsafe_code)]
fn $fn_name() {
use $crate::{c, init};
extern {
@ -54,7 +53,7 @@ macro_rules! bssl_test {
macro_rules! bssl_test_rng {
( $fn_name:ident, $bssl_test_main_fn_name:ident ) => {
#[test]
#[allow(improper_ctypes, unsafe_code)]
#[allow(improper_ctypes)]
fn $fn_name() {
use $crate::{c, init, rand};
extern {

View File

@ -52,7 +52,6 @@ macro_rules! define_metrics_tests {
#[cfg(test)]
#[test]
#[allow(unsafe_code)]
fn $test_c_metrics() {
use std::mem;

View File

@ -14,8 +14,6 @@
//! Constant-time operations.
#![allow(unsafe_code)]
use {c, error};
/// Returns `Ok(())` if `a == b` and `Err(error::Unspecified)` otherwise.

View File

@ -24,8 +24,6 @@
// The goal for this implementation is to drive the overhead as close to zero
// as possible.
#![allow(unsafe_code)]
use {c, init, polyfill};
use core;

View File

@ -12,8 +12,6 @@
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#![allow(unsafe_code)]
//! EdDSA Signatures.
use {bssl, c, error, private, rand, signature};

View File

@ -141,7 +141,6 @@ fn ecdh(private_key_ops: &PrivateKeyOps, public_key_ops: &PublicKeyOps,
}
#[allow(unsafe_code)]
#[cfg(test)]
mod tests {
use core;

View File

@ -12,8 +12,6 @@
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#![allow(unsafe_code)]
use {c, der, error};
use core;
use untrusted;

View File

@ -19,7 +19,6 @@ use {ec, error, rand};
use super::ops::*;
use super::verify_affine_point_is_on_the_curve;
#[allow(unsafe_code)]
pub fn generate_private_key(ops: &PrivateKeyOps, rng: &rand::SecureRandom)
-> Result<ec::PrivateKey, error::Unspecified> {
// [NSA Suite B Implementer's Guide to ECDSA] Appendix A.1.2, and

View File

@ -44,7 +44,6 @@ fn x25519_generate_private_key(rng: &rand::SecureRandom)
Ok(result)
}
#[allow(unsafe_code)]
fn x25519_public_from_private(public_out: &mut [u8],
private_key: &ec::PrivateKey)
-> Result<(), error::Unspecified> {
@ -63,7 +62,6 @@ fn x25519_public_from_private(public_out: &mut [u8],
Ok(())
}
#[allow(unsafe_code)]
fn x25519_ecdh(out: &mut [u8], my_private_key: &ec::PrivateKey,
peer_public_key: untrusted::Input)
-> Result<(), error::Unspecified> {

View File

@ -12,7 +12,6 @@
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#[allow(unsafe_code)]
#[inline(always)]
#[cfg(not(all(target_arch = "aarch64", target_os = "ios")))]
pub fn init_once() {

View File

@ -39,6 +39,7 @@
#![allow(
missing_copy_implementations,
missing_debug_implementations,
unsafe_code,
// TODO: Deny `unused_unsafe` when Rust 1.13 goes stable.
unused_unsafe,
)]
@ -69,7 +70,6 @@
unknown_crate_types,
unknown_lints,
unreachable_code,
unsafe_code,
unstable_features,
unused_allocation,
unused_assignments,

View File

@ -133,7 +133,6 @@ fn most_significant_limb_mask_variable_time(most_significant_limb: Limb)
}
}
#[allow(unsafe_code)]
#[allow(non_snake_case)]
#[doc(hidden)]
#[no_mangle]
@ -177,14 +176,12 @@ fn limbs_as_bytes_mut<'a>(src: &'a mut [Limb]) -> &'a mut [u8] {
polyfill::slice::u32_as_u8_mut(src)
}
#[allow(unsafe_code)]
#[inline]
pub fn limbs_less_than_limbs_constant_time(a: &[Limb], b: &[Limb]) -> LimbMask {
assert_eq!(a.len(), b.len());
unsafe { GFp_constant_time_limbs_lt_limbs(a.as_ptr(), b.as_ptr(), b.len()) }
}
#[allow(unsafe_code)]
#[inline]
pub fn limbs_are_zero_constant_time(limbs: &[Limb]) -> LimbMask {
unsafe { GFp_constant_time_limbs_are_zero(limbs.as_ptr(), limbs.len()) }

View File

@ -15,8 +15,6 @@
//! Polyfills for functionality that will (hopefully) be added to Rust's
//! standard library soon.
#![allow(unsafe_code)]
use core;
#[inline(always)]
@ -139,7 +137,6 @@ macro_rules! slice_as_array_ref {
{
use error;
#[allow(unsafe_code)]
fn slice_as_array_ref<T>(slice: &[T])
-> Result<&[T; $len], error::Unspecified> {
if slice.len() != $len {
@ -161,7 +158,6 @@ macro_rules! slice_as_array_ref_mut {
{
use error;
#[allow(unsafe_code)]
fn slice_as_array_ref<T>(slice: &mut [T])
-> Result<&mut [T; $len],
error::Unspecified> {

View File

@ -26,8 +26,6 @@
//! documentation for more details.
#![allow(unsafe_code)]
#[cfg(any(target_os = "linux", windows, test))]
use c;

View File

@ -45,7 +45,6 @@ struct PositiveInteger {
value: Option<*mut BIGNUM>,
}
#[allow(unsafe_code)]
impl PositiveInteger {
#[cfg(feature = "rsa_signing")]
// Parses a single ASN.1 DER-encoded `Integer`, which most be positive.
@ -87,7 +86,6 @@ impl PositiveInteger {
}
}
#[allow(unsafe_code)]
impl Drop for PositiveInteger {
fn drop(&mut self) {
match self.value {

View File

@ -12,8 +12,6 @@
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#![allow(unsafe_code)]
/// RSA PKCS#1 1.5 signatures.
use {bssl, c, der, error};

View File

@ -12,8 +12,6 @@
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#![allow(unsafe_code)]
/// RSA PKCS#1 1.5 signatures.
use {bssl, c, error, private, signature};