summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr/src/lib/pkcs11/libpkcs11/common/metaDigest.c5
-rw-r--r--usr/src/lib/pkcs11/pkcs11_kernel/common/kernelDigest.c3
-rw-r--r--usr/src/lib/pkcs11/pkcs11_softtoken/common/softDigest.c3
3 files changed, 6 insertions, 5 deletions
diff --git a/usr/src/lib/pkcs11/libpkcs11/common/metaDigest.c b/usr/src/lib/pkcs11/libpkcs11/common/metaDigest.c
index 673b83cbfd..aecf391807 100644
--- a/usr/src/lib/pkcs11/libpkcs11/common/metaDigest.c
+++ b/usr/src/lib/pkcs11/libpkcs11/common/metaDigest.c
@@ -21,10 +21,9 @@
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2018, Joyent, Inc.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Message Digesting Functions
* (as defined in PKCS#11 spec section 11.10)
@@ -70,7 +69,7 @@ meta_Digest(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen,
meta_session_t *session;
- if (pData == NULL || pulDigestLen == NULL)
+ if ((pData == NULL && ulDataLen != 0) || pulDigestLen == NULL)
return (CKR_ARGUMENTS_BAD);
rv = meta_handle2session(hSession, &session);
diff --git a/usr/src/lib/pkcs11/pkcs11_kernel/common/kernelDigest.c b/usr/src/lib/pkcs11/pkcs11_kernel/common/kernelDigest.c
index ec65a97caf..9b9ad981d5 100644
--- a/usr/src/lib/pkcs11/pkcs11_kernel/common/kernelDigest.c
+++ b/usr/src/lib/pkcs11/pkcs11_kernel/common/kernelDigest.c
@@ -22,6 +22,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2018, Joyent, Inc.
*/
#include <pthread.h>
@@ -158,7 +159,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;
}
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;
}