|
6 | 6 |
|
7 | 7 | pub mod common; |
8 | 8 |
|
| 9 | +use std::num::NonZeroUsize; |
| 10 | + |
9 | 11 | use common::{ |
10 | 12 | callback::MyCallbacks, |
11 | 13 | param::PASSWORD, |
@@ -50,7 +52,7 @@ fn test_nv_write() { |
50 | 52 | tpm_initialize!(context, PASSWORD, MyCallbacks::new(PASSWORD, None)); |
51 | 53 |
|
52 | 54 | // Create NV index, if not already created |
53 | | - match context.create_nv(nv_path, Some(NV_ORDINARY_FLAGS), data.len(), None, None) { |
| 55 | + match context.create_nv(nv_path, Some(NV_ORDINARY_FLAGS), NonZeroUsize::new(data.len()), None, None) { |
54 | 56 | Ok(_) => debug!("NV index created."), |
55 | 57 | Err(error) => panic!("NV index creation has failed: {:?}", error), |
56 | 58 | } |
@@ -96,7 +98,7 @@ fn test_nv_read() { |
96 | 98 | tpm_initialize!(context, PASSWORD, MyCallbacks::new(PASSWORD, None)); |
97 | 99 |
|
98 | 100 | // Create NV index, if not already created |
99 | | - match context.create_nv(nv_path, Some(NV_ORDINARY_FLAGS), data.len(), None, None) { |
| 101 | + match context.create_nv(nv_path, Some(NV_ORDINARY_FLAGS), NonZeroUsize::new(data.len()), None, None) { |
100 | 102 | Ok(_) => debug!("NV index created."), |
101 | 103 | Err(error) => panic!("NV index creation has failed: {:?}", error), |
102 | 104 | } |
@@ -142,7 +144,7 @@ fn test_nv_counter() { |
142 | 144 | tpm_initialize!(context, PASSWORD, MyCallbacks::new(PASSWORD, None)); |
143 | 145 |
|
144 | 146 | // Create NV index, if not already created |
145 | | - match context.create_nv(nv_path, Some(NV_COUNTER_FLAGS), 0usize, None, None) { |
| 147 | + match context.create_nv(nv_path, Some(NV_COUNTER_FLAGS), None, None, None) { |
146 | 148 | Ok(_) => debug!("NV index created."), |
147 | 149 | Err(error) => panic!("NV index creation has failed: {:?}", error), |
148 | 150 | } |
@@ -200,7 +202,7 @@ fn test_nv_bitset() { |
200 | 202 | tpm_initialize!(context, PASSWORD, MyCallbacks::new(PASSWORD, None)); |
201 | 203 |
|
202 | 204 | // Create NV index, if not already created |
203 | | - match context.create_nv(nv_path, Some(NV_BITFIELD_FLAGS), 0usize, None, None) { |
| 205 | + match context.create_nv(nv_path, Some(NV_BITFIELD_FLAGS), None, None, None) { |
204 | 206 | Ok(_) => debug!("NV index created."), |
205 | 207 | Err(error) => panic!("NV index creation has failed: {:?}", error), |
206 | 208 | } |
@@ -275,7 +277,7 @@ fn test_nv_pcr() { |
275 | 277 | tpm_initialize!(context, PASSWORD, MyCallbacks::new(PASSWORD, None)); |
276 | 278 |
|
277 | 279 | // Create NV index, if not already created |
278 | | - match context.create_nv(nv_path, Some(NV_PCR_FLAGS), 0usize, None, None) { |
| 280 | + match context.create_nv(nv_path, Some(NV_PCR_FLAGS), None, None, None) { |
279 | 281 | Ok(_) => debug!("NV index created."), |
280 | 282 | Err(error) => panic!("NV index creation has failed: {:?}", error), |
281 | 283 | } |
|
0 commit comments