Skip to content

Commit 9a009b6

Browse files
Update windows requirement from 0.60.0 to 0.61.3 (#11)
* Update windows requirement from 0.60.0 to 0.61.3 Updates the requirements on [windows](https://github.com/microsoft/windows-rs) to permit the latest version. - [Release notes](https://github.com/microsoft/windows-rs/releases) - [Commits](https://github.com/microsoft/windows-rs/commits) --- updated-dependencies: - dependency-name: windows dependency-version: 0.61.3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * use repeat_n * clippy fix --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tom Fay <tom@teamfay.co.uk>
1 parent f39082c commit 9a009b6

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pkcs1 = { version = "0.7.5", features = ["std"] }
1515
pkcs8 = "0.10.2"
1616
rustls = { version = "0.23.20", default-features = false, features = ["std"] }
1717
sec1 = "0.7.3"
18-
windows = { version = "0.60.0", features = [
18+
windows = { version = "0.61.3", features = [
1919
"Win32_Security_Cryptography",
2020
"Win32_System_WinRT",
2121
] }

src/aead.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ mod test {
214214

215215
match &test.result {
216216
TestResult::Invalid => {
217-
if test.flags.iter().any(|flag| *flag == TestFlag::ModifiedTag) {
217+
if test.flags.contains(&TestFlag::ModifiedTag) {
218218
assert_ne!(
219219
actual_tag[..],
220220
test.tag[..],

src/kx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl ActiveKeyExchange for EcKeyExchange {
169169
));
170170
}
171171

172-
let key_len = (self.kx_group.key_bits() + 7) / 8;
172+
let key_len = self.kx_group.key_bits().div_ceil(8);
173173
let num_parts = if self.kx_group.is_nist() { 2 } else { 1 };
174174
if new_peer_pub_key.len() != key_len * num_parts {
175175
return Err(Error::PeerMisbehaved(

src/verify.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,17 +305,17 @@ impl<const HASH_SIZE: usize> SignatureVerificationAlgorithm for VerificationAlgo
305305
.map_err(|_| InvalidSignature)?;
306306
u32::from_le_bytes(bytes) as usize
307307
};
308-
let size = (bit_size + 7) / 8;
308+
let size = bit_size.div_ceil(8);
309309

310310
// r and s are expected to be the same size as the curve size
311311
let mut signature = Vec::with_capacity(size * 2);
312312

313313
if r.len() < size {
314-
signature.extend(std::iter::repeat(0).take(size - r.len()));
314+
signature.extend(std::iter::repeat_n(0, size - r.len()));
315315
}
316316
signature.extend_from_slice(r);
317317
if s.len() < size {
318-
signature.extend(std::iter::repeat(0).take(size - s.len()));
318+
signature.extend(std::iter::repeat_n(0, size - s.len()));
319319
}
320320
signature.extend_from_slice(s);
321321

0 commit comments

Comments
 (0)