@@ -76,8 +76,12 @@ Object load_persistent_object(const std::shared_ptr<Context>& ctx,
7676 Object object (ctx);
7777
7878 check_rc (" Esys_TR_FromTPMPublic" ,
79- Esys_TR_FromTPMPublic (
80- *ctx, persistent_object_handle, sessions[0 ], sessions[1 ], sessions[2 ], out_transient_handle (object)));
79+ Esys_TR_FromTPMPublic (*ctx,
80+ persistent_object_handle,
81+ static_cast <ESYS_TR>(sessions[0 ]),
82+ static_cast <ESYS_TR>(sessions[1 ]),
83+ static_cast <ESYS_TR>(sessions[2 ]),
84+ out_transient_handle (object)));
8185
8286 if (!auth_value.empty ()) {
8387 const auto user_auth = copy_into<TPM2B_AUTH>(auth_value);
@@ -141,9 +145,9 @@ std::unique_ptr<PublicKey> PublicKey::load_transient(const std::shared_ptr<Conte
141145 Object handle (ctx);
142146 check_rc (" Esys_LoadExternal" ,
143147 Esys_LoadExternal (*ctx,
144- sessions[0 ],
145- sessions[1 ],
146- sessions[2 ],
148+ static_cast <ESYS_TR>( sessions[0 ]) ,
149+ static_cast <ESYS_TR>( sessions[1 ]) ,
150+ static_cast <ESYS_TR>( sessions[2 ]) ,
147151 nullptr /* no private data to be loaded */ ,
148152 &public_data,
149153 TPM2_RH_NULL,
@@ -199,9 +203,9 @@ std::unique_ptr<PrivateKey> PrivateKey::load_transient(const std::shared_ptr<Con
199203 check_rc (" Esys_Load" ,
200204 Esys_Load (*ctx,
201205 parent.handles ().transient_handle (),
202- sessions[0 ],
203- sessions[1 ],
204- sessions[2 ],
206+ static_cast <ESYS_TR>( sessions[0 ]) ,
207+ static_cast <ESYS_TR>( sessions[1 ]) ,
208+ static_cast <ESYS_TR>( sessions[2 ]) ,
205209 &private_data,
206210 &public_data,
207211 out_transient_handle (handle)));
@@ -256,9 +260,9 @@ std::unique_ptr<PrivateKey> PrivateKey::create_transient_from_template(const std
256260 check_rc (" Esys_CreateLoaded" ,
257261 Esys_CreateLoaded (*ctx,
258262 parent,
259- sessions[0 ],
260- sessions[1 ],
261- sessions[2 ],
263+ static_cast <ESYS_TR>( sessions[0 ]) ,
264+ static_cast <ESYS_TR>( sessions[1 ]) ,
265+ static_cast <ESYS_TR>( sessions[2 ]) ,
262266 &sensitive_data,
263267 &marshalled_template,
264268 out_transient_handle (handle),
0 commit comments