Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
- name: Build the container
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools
- name: Run the tests
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi -e RUST_TOOLCHAIN_VERSION="1.82" ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/valgrind.sh
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi -e RUST_TOOLCHAIN_VERSION="1.87" ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/valgrind.sh

# Check that the documentation builds as well.
docs:
Expand Down
7 changes: 3 additions & 4 deletions tss-esapi/src/abstraction/nv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ impl Read for NvReaderWriter<'_> {
let res = self
.context
.nv_read(self.auth_handle, self.nv_idx, size, self.offset as u16)
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?;
.map_err(std::io::Error::other)?;
buf[0..size as usize].copy_from_slice(&res);
self.offset += size as usize;

Expand All @@ -219,11 +219,10 @@ impl std::io::Write for NvReaderWriter<'_> {
let desired_size = std::cmp::min(buf.len(), self.data_size - self.offset);
let size = std::cmp::min(self.buffer_size, desired_size) as u16;

let data = MaxNvBuffer::from_bytes(&buf[0..size.into()])
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?;
let data = MaxNvBuffer::from_bytes(&buf[0..size.into()]).map_err(std::io::Error::other)?;
self.context
.nv_write(self.auth_handle, self.nv_idx, data, self.offset as u16)
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?;
.map_err(std::io::Error::other)?;
self.offset += size as usize;

Ok(size.into())
Expand Down
2 changes: 1 addition & 1 deletion tss-esapi/src/structures/lists/tagged_pcr_property.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl TaggedPcrPropertyList {
self.tagged_pcr_properties
.iter()
.fold(Vec::<&TaggedPcrSelect>::new(), |mut acc, tps| {
if tps.selected_pcrs().iter().any(|&ps| ps == pcr_slot) {
if tps.selected_pcrs().contains(&pcr_slot) {
acc.push(tps);
}
acc
Expand Down