summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorkrishna <none@none>2008-07-10 14:32:30 -0700
committerkrishna <none@none>2008-07-10 14:32:30 -0700
commit79127a733e8489dfecc0596d03531bebb481a95c (patch)
tree9d5657d637be25ff6d6fa2c16e7525d5fb7df129 /usr/src
parente6beb20cc8b2b323c3efa99bffc570d547089a7c (diff)
downloadillumos-joyent-79127a733e8489dfecc0596d03531bebb481a95c.tar.gz
6705398 kernel_get_operationstate() returns CKR_FUNCTION_NOT_SUPPORTED when no operation is active
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/lib/pkcs11/pkcs11_kernel/common/kernelSession.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/usr/src/lib/pkcs11/pkcs11_kernel/common/kernelSession.c b/usr/src/lib/pkcs11/pkcs11_kernel/common/kernelSession.c
index 956187606c..67967bb223 100644
--- a/usr/src/lib/pkcs11/pkcs11_kernel/common/kernelSession.c
+++ b/usr/src/lib/pkcs11/pkcs11_kernel/common/kernelSession.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -225,12 +225,21 @@ kernel_get_operationstate(kernel_session_t *session_p, CK_STATE ses_state,
CK_BYTE_PTR dst;
digest_buf_t *bufp;
- /*
- * We return CKR_FUNCTION_NOT_SUPPORTED because some clients
- * check for this code and work around the lack of this routine.
- */
if (!(session_p->digest.flags & CRYPTO_EMULATE)) {
- return (CKR_FUNCTION_NOT_SUPPORTED);
+ /*
+ * Return CKR_OPERATION_NOT_INITIALIZED if the slot
+ * is capable of C_GetOperationState(). Return
+ * CKR_FUNCTION_NOT_SUPPORTED otherwise.
+ *
+ * We return these codes because some clients
+ * check the return code to determine if C_GetOperationState()
+ * is supported.
+ */
+ if (slot_table[session_p->ses_slotid]->sl_flags &
+ CRYPTO_LIMITED_HASH_SUPPORT)
+ return (CKR_OPERATION_NOT_INITIALIZED);
+ else
+ return (CKR_FUNCTION_NOT_SUPPORTED);
}
/*