Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable -Woverriding-t-option #584

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions aws-lc-fips-sys/builder/cmake_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ impl CmakeBuilder {
// If the build environment vendor is Apple
#[cfg(target_vendor = "apple")]
{
cmake_cfg.cflag("-Wno-overriding-t-option");
if target_arch() == "aarch64" {
cmake_cfg.define("CMAKE_OSX_ARCHITECTURES", "arm64");
cmake_cfg.define("CMAKE_SYSTEM_PROCESSOR", "arm64");
Expand Down
12 changes: 6 additions & 6 deletions aws-lc-rs/src/aead/tests/fips.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const TEST_NONCE_96_BIT: [u8; 12] = [
0xe4, 0x39, 0x17, 0x95, 0x86, 0xcd, 0xcd, 0x5a, 0x1b, 0x46, 0x7b, 0x1d,
];

const TEST_MESSAGE: &str = "test message";
const TEST_MESSAGE: &[u8] = "test message".as_bytes();

macro_rules! nonce_sequence_api {
($name:ident, $alg:expr, $key:expr, $seal_expect:path, $open_expect:path) => {
Expand Down Expand Up @@ -59,7 +59,7 @@ macro_rules! nonce_sequence_api {
)
.unwrap();

assert_eq!(TEST_MESSAGE.as_bytes(), result);
assert_eq!(TEST_MESSAGE, result);
}

{
Expand Down Expand Up @@ -89,7 +89,7 @@ macro_rules! nonce_sequence_api {
)
.unwrap();

assert_eq!(TEST_MESSAGE.as_bytes(), result);
assert_eq!(TEST_MESSAGE, result);
}
}
};
Expand Down Expand Up @@ -137,7 +137,7 @@ macro_rules! randnonce_api {
)
.unwrap();

assert_eq!(TEST_MESSAGE.as_bytes(), in_out);
assert_eq!(TEST_MESSAGE, in_out);
}

{
Expand All @@ -157,7 +157,7 @@ macro_rules! randnonce_api {
)
.unwrap();

assert_eq!(TEST_MESSAGE.as_bytes(), in_out);
assert_eq!(TEST_MESSAGE, in_out);
}
}
};
Expand Down Expand Up @@ -213,7 +213,7 @@ macro_rules! tls_nonce_api {
)
.unwrap();

assert_eq!(in_out, TEST_MESSAGE.as_bytes());
assert_eq!(in_out, TEST_MESSAGE);
}
};
// Match for unsupported variants
Expand Down
6 changes: 3 additions & 3 deletions aws-lc-rs/src/aead/tests/fips/chacha20_poly1305_openssh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ fn test() {

#[allow(clippy::cast_possible_truncation)]
message.extend_from_slice({
let len = TEST_MESSAGE.as_bytes().len() as u32;
let len = TEST_MESSAGE.len() as u32;
&[
((len & 0xFF00_0000) >> 24) as u8,
((len & 0xFF_0000) >> 16) as u8,
((len & 0xFF00) >> 8) as u8,
(len & 0xFF) as u8,
]
});
message.extend_from_slice(TEST_MESSAGE.as_bytes());
message.extend_from_slice(TEST_MESSAGE);

let mut tag = [0u8; 16];

Expand Down Expand Up @@ -58,5 +58,5 @@ fn test() {
key.open_in_place(1024, &mut message, &tag).unwrap(),
FipsServiceStatus::NonApproved
);
assert_eq!(TEST_MESSAGE.as_bytes(), message);
assert_eq!(TEST_MESSAGE, message);
}
2 changes: 1 addition & 1 deletion aws-lc-rs/src/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ mod tests {
let public_key = key_pair.public_key();
let signature = key_pair.sign(MESSAGE);
let unparsed_public_key = UnparsedPublicKey::new(&ED25519, public_key.as_ref());
let _ = unparsed_public_key
unparsed_public_key
.verify(MESSAGE, signature.as_ref())
.unwrap();
}
Expand Down
4 changes: 2 additions & 2 deletions aws-lc-rs/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ impl TestCase {
let s = self.consume_optional_string(key)?;
let result = if s.starts_with('\"') {
// The value is a quoted UTF-8 string.

let s = s.as_bytes();
let mut bytes = Vec::with_capacity(s.len());
let mut s = s.as_bytes().iter().skip(1);
let mut s = s.iter().skip(1);
loop {
let b = match s.next() {
Some(b'\\') => {
Expand Down
Loading