|
2 | 2 | // SPDX-License-Identifier: Apache-2.0 |
3 | 3 |
|
4 | 4 | use crate::{ |
| 5 | + ffi::take_from_esys, |
5 | 6 | structures::{CreateKeyResult, CreationData, CreationTicket, Digest, Private, Public}, |
6 | 7 | tss2_esys::{TPM2B_CREATION_DATA, TPM2B_DIGEST, TPM2B_PRIVATE, TPM2B_PUBLIC, TPMT_TK_CREATION}, |
7 | | - Error, Result, ffi::take_from_esys, |
| 8 | + Error, Result, |
8 | 9 | }; |
9 | 10 | use std::convert::TryFrom; |
10 | 11 | use std::ptr::null_mut; |
@@ -68,23 +69,26 @@ impl TryFrom<CreateCommandOutputHandler> for CreateKeyResult { |
68 | 69 | let out_private_owned = unsafe { take_from_esys(ffi_data_handler.ffi_out_private_ptr)? }; |
69 | 70 | ffi_data_handler.ffi_out_private_ptr = null_mut(); |
70 | 71 |
|
71 | | - let out_public_owned = unsafe { take_from_esys(ffi_data_handler.ffi_out_public_ptr)? }; |
| 72 | + let out_public_owned = unsafe { take_from_esys(ffi_data_handler.ffi_out_public_ptr)? }; |
72 | 73 | ffi_data_handler.ffi_out_public_ptr = null_mut(); |
73 | 74 |
|
74 | | - let creation_data_owned = unsafe { take_from_esys(ffi_data_handler.ffi_creation_data_ptr)? }; |
| 75 | + let creation_data_owned = |
| 76 | + unsafe { take_from_esys(ffi_data_handler.ffi_creation_data_ptr)? }; |
75 | 77 | ffi_data_handler.ffi_creation_data_ptr = null_mut(); |
76 | 78 |
|
77 | | - let creation_hash_owned = unsafe { take_from_esys(ffi_data_handler.ffi_creation_hash_ptr)? }; |
| 79 | + let creation_hash_owned = |
| 80 | + unsafe { take_from_esys(ffi_data_handler.ffi_creation_hash_ptr)? }; |
78 | 81 | ffi_data_handler.ffi_creation_hash_ptr = null_mut(); |
79 | 82 |
|
80 | | - let creation_ticket_owned = unsafe { take_from_esys(ffi_data_handler.ffi_creation_ticket_ptr)? }; |
| 83 | + let creation_ticket_owned = |
| 84 | + unsafe { take_from_esys(ffi_data_handler.ffi_creation_ticket_ptr)? }; |
81 | 85 | ffi_data_handler.ffi_creation_ticket_ptr = null_mut(); |
82 | 86 |
|
83 | 87 | Ok(CreateKeyResult { |
84 | | - out_private: Private::try_from(out_private_owned)?, |
85 | | - out_public: Public::try_from(out_public_owned)?, |
86 | | - creation_data: CreationData::try_from(creation_data_owned)?, |
87 | | - creation_hash: Digest::try_from(creation_hash_owned)?, |
| 88 | + out_private: Private::try_from(out_private_owned)?, |
| 89 | + out_public: Public::try_from(out_public_owned)?, |
| 90 | + creation_data: CreationData::try_from(creation_data_owned)?, |
| 91 | + creation_hash: Digest::try_from(creation_hash_owned)?, |
88 | 92 | creation_ticket: CreationTicket::try_from(creation_ticket_owned)?, |
89 | 93 | }) |
90 | 94 | } |
|
0 commit comments