summaryrefslogtreecommitdiff
path: root/usr/src/lib/pkcs11/pkcs11_softtoken/common
diff options
context:
space:
mode:
authorVladimir Kotal <Vladimir.Kotal@Sun.COM>2008-09-26 20:37:41 +0200
committerVladimir Kotal <Vladimir.Kotal@Sun.COM>2008-09-26 20:37:41 +0200
commit429cc41d92fdd244dcd640e4c85506c035c8ba63 (patch)
tree9eb43a59da0bcfe9b3eebd2b5ab29f8428980d25 /usr/src/lib/pkcs11/pkcs11_softtoken/common
parente25114606324e602221c0929ba86c88e159df849 (diff)
downloadillumos-joyent-429cc41d92fdd244dcd640e4c85506c035c8ba63.tar.gz
6638987 soft_delete_session() clears magic_marker too soon for soft_remove_object_from_session()
Diffstat (limited to 'usr/src/lib/pkcs11/pkcs11_softtoken/common')
-rw-r--r--usr/src/lib/pkcs11/pkcs11_softtoken/common/softSessionUtil.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softSessionUtil.c b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softSessionUtil.c
index 4c0859f41e..70693b36e1 100644
--- a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softSessionUtil.c
+++ b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softSessionUtil.c
@@ -334,16 +334,20 @@ soft_delete_session(soft_session_t *session_p,
session_p->ses_close_sync &= ~SESSION_REFCNT_WAITING;
- /* Mark session as no longer valid. */
- session_p->magic_marker = 0;
-
- (void) pthread_cond_destroy(&session_p->ses_free_cond);
-
/*
* Remove all the objects created in this session.
*/
soft_delete_all_objects_in_session(session_p);
+ /*
+ * Mark session as no longer valid. This can only be done after all
+ * objects created by this session are free'd since the marker is
+ * still needed in the process of removing objects from the session.
+ */
+ session_p->magic_marker = 0;
+
+ (void) pthread_cond_destroy(&session_p->ses_free_cond);
+
/* In case application did not call Final */
if (session_p->digest.context != NULL)
free(session_p->digest.context);