summaryrefslogtreecommitdiff
path: root/usr/src/lib/pkcs11/pkcs11_softtoken/common/softDigest.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/pkcs11/pkcs11_softtoken/common/softDigest.c')
-rw-r--r--usr/src/lib/pkcs11/pkcs11_softtoken/common/softDigest.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softDigest.c b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softDigest.c
index 56d43ba5c9..32b7d24254 100644
--- a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softDigest.c
+++ b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softDigest.c
@@ -21,6 +21,7 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2018, Joyent, Inc.
*/
#include <pthread.h>
@@ -120,7 +121,7 @@ C_Digest(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen,
if (rv != CKR_OK)
return (rv);
- if (pData == NULL || pulDigestLen == NULL) {
+ if ((pData == NULL && ulDataLen != 0) || pulDigestLen == NULL) {
rv = CKR_ARGUMENTS_BAD;
goto clean_exit;
}