File tree 2 files changed +13
-2
lines changed 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -361,8 +361,14 @@ tool_rc tpm2_session_close(tpm2_session **s) {
361
361
}
362
362
363
363
if ((* s )-> internal .delete && path ) {
364
- rc = tool_rc_success ;
365
- goto out2 ;
364
+ if (remove (path )) {
365
+ LOG_ERR ("File \"%s\" can't be deleted." , path );
366
+ rc = tool_rc_general_error ;
367
+ goto out2 ;
368
+ } else {
369
+ rc = tool_rc_success ;
370
+ goto out2 ;
371
+ }
366
372
}
367
373
368
374
FILE * session_file = path ? fopen (path , "w+b" ) : NULL ;
Original file line number Diff line number Diff line change @@ -156,4 +156,9 @@ tpm2 sessionconfig enc_session.ctx --enable-encrypt --disable-continuesession
156
156
unsealed=` tpm2 unseal -c seal_key.ctx -p sealkeypass -S enc_session.ctx`
157
157
test " $unsealed " == " $secret "
158
158
159
+ if [ -e enc_session.ctx ]; then
160
+ echo " enc_session.ctx was not deleted." ;
161
+ exit 1
162
+ fi
163
+
159
164
exit 0
You can’t perform that action at this time.
0 commit comments