diff options
author | Stefan Walter <stefw@src.gnome.org> | 2009-01-03 19:23:59 +0000 |
---|---|---|
committer | Stefan Walter <stefw@src.gnome.org> | 2009-01-03 19:23:59 +0000 |
commit | 3683806dbc5a2aea5937657ba20a65ef4e746f26 (patch) | |
tree | 8e06d0126a827f8266bd5e0a8bd74a545d720399 /daemon | |
parent | 1be2e800aa6309619e70a51469c9fc8ee0d818d0 (diff) |
Allow starting one operation on top of another by cancelling the first.
* daemon/pkcs11/gkr-pkcs11-daemon-session.c: Allow starting one operation
on top of another by cancelling the first.
* common/gkr-buffer.c: Use a default allocator when none present.
svn path=/trunk/; revision=1416
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/pkcs11/gkr-pkcs11-daemon-session.c | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/daemon/pkcs11/gkr-pkcs11-daemon-session.c b/daemon/pkcs11/gkr-pkcs11-daemon-session.c index c889b7b7..c20aff13 100644 --- a/daemon/pkcs11/gkr-pkcs11-daemon-session.c +++ b/daemon/pkcs11/gkr-pkcs11-daemon-session.c @@ -432,9 +432,6 @@ session_C_CreateObject (SessionInfo *sinfo, GkrPkcs11Message *req, CK_BBOOL token; CK_RV ret; - if (sinfo->operation_type) - return CKR_OPERATION_ACTIVE; - if (!(attrs = read_attribute_array (req))) return PROTOCOL_ERROR; @@ -628,8 +625,11 @@ session_C_FindObjectsInit (SessionInfo *sinfo, GkrPkcs11Message *req, GArray *attrs; gboolean all; - if (sinfo->operation_type) - return CKR_OPERATION_ACTIVE; + /* Abandon any current operation */ + if (sinfo->operation_type) { + finish_operation (sinfo); + g_assert (!sinfo->operation_type); + } if (!(attrs = read_attribute_array (req))) return PROTOCOL_ERROR; @@ -749,8 +749,11 @@ session_C_EncryptInit (SessionInfo *sinfo, GkrPkcs11Message *req, CK_MECHANISM mech; CK_RV ret; - if (sinfo->operation_type) - return CKR_OPERATION_ACTIVE; + /* Abandon any current operation */ + if (sinfo->operation_type) { + finish_operation (sinfo); + g_assert (!sinfo->operation_type); + } if (!read_mechanism (req, &mech)) return PROTOCOL_ERROR; @@ -848,8 +851,11 @@ session_C_DecryptInit (SessionInfo *sinfo, GkrPkcs11Message *req, CK_MECHANISM mech; CK_RV ret; - if (sinfo->operation_type) - return CKR_OPERATION_ACTIVE; + /* Abandon any current operation */ + if (sinfo->operation_type) { + finish_operation (sinfo); + g_assert (!sinfo->operation_type); + } if (!read_mechanism (req, &mech)) return PROTOCOL_ERROR; @@ -991,8 +997,11 @@ session_C_SignInit (SessionInfo *sinfo, GkrPkcs11Message *req, CK_MECHANISM mech; CK_RV ret; - if (sinfo->operation_type) - return CKR_OPERATION_ACTIVE; + /* Abandon any current operation */ + if (sinfo->operation_type) { + finish_operation (sinfo); + g_assert (!sinfo->operation_type); + } if (!read_mechanism (req, &mech)) return PROTOCOL_ERROR; @@ -1113,8 +1122,11 @@ session_C_VerifyInit (SessionInfo *sinfo, GkrPkcs11Message *req, CK_MECHANISM mech; CK_RV ret; - if (sinfo->operation_type) - return CKR_OPERATION_ACTIVE; + /* Abandon any current operation */ + if (sinfo->operation_type) { + finish_operation (sinfo); + g_assert (!sinfo->operation_type); + } if (!read_mechanism (req, &mech)) return PROTOCOL_ERROR; |