File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -361,8 +361,14 @@ tool_rc tpm2_session_close(tpm2_session **s) {
361361 }
362362
363363 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+ }
366372 }
367373
368374 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
156156unsealed=` tpm2 unseal -c seal_key.ctx -p sealkeypass -S enc_session.ctx`
157157test " $unsealed " == " $secret "
158158
159+ if [ -e enc_session.ctx ]; then
160+ echo " enc_session.ctx was not deleted." ;
161+ exit 1
162+ fi
163+
159164exit 0
You can’t perform that action at this time.
0 commit comments