summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-01-22 13:44:02 +0200
committerToomas Soome <tsoome@me.com>2019-06-25 23:27:32 +0300
commite2e372a44e0036831b4a1b5f80a7c680223275fa (patch)
tree87748a80d778aabd59d6dd1cd164c2da3835a668
parent4b788a9f64f8a617e410f058ca415898b54c3ab9 (diff)
downloadillumos-joyent-e2e372a44e0036831b4a1b5f80a7c680223275fa.tar.gz
11154 pkcs11_tpm: NULL pointer errors
Reviewed by: Jason Lippert <jason@glasspelican.ca> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/lib/pkcs11/pkcs11_tpm/common/new_host.c2
-rw-r--r--usr/src/lib/pkcs11/pkcs11_tpm/common/tpm_specific.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/usr/src/lib/pkcs11/pkcs11_tpm/common/new_host.c b/usr/src/lib/pkcs11/pkcs11_tpm/common/new_host.c
index 577be6a89e..30257751fd 100644
--- a/usr/src/lib/pkcs11/pkcs11_tpm/common/new_host.c
+++ b/usr/src/lib/pkcs11/pkcs11_tpm/common/new_host.c
@@ -2317,7 +2317,7 @@ SC_SeedRandom(ST_SESSION_HANDLE sSession,
if (st_Initialized() == FALSE) {
return (CKR_CRYPTOKI_NOT_INITIALIZED);
}
- if (pSeed == NULL || ulSeedLen == NULL)
+ if (pSeed == NULL || ulSeedLen == 0)
return (CKR_ARGUMENTS_BAD);
return (CKR_OK);
diff --git a/usr/src/lib/pkcs11/pkcs11_tpm/common/tpm_specific.c b/usr/src/lib/pkcs11/pkcs11_tpm/common/tpm_specific.c
index 7fdd3dcba2..3c39e2b8b5 100644
--- a/usr/src/lib/pkcs11/pkcs11_tpm/common/tpm_specific.c
+++ b/usr/src/lib/pkcs11/pkcs11_tpm/common/tpm_specific.c
@@ -2275,7 +2275,7 @@ token_rsa_load_key(
hParentKey = hPublicRootKey;
}
- *phKey = NULL;
+ *phKey = 0;
if (template_attribute_find(key_obj->template, CKA_CLASS,
&attr) == FALSE) {
return (CKR_TEMPLATE_INCOMPLETE);
@@ -2306,7 +2306,7 @@ token_rsa_load_key(
*/
if (class == CKO_PRIVATE_KEY) {
/* If we already have a handle, just load it */
- if (*phKey != NULL) {
+ if (*phKey != 0) {
result = Tspi_Key_LoadKey(*phKey, hParentKey);
if (result) {
stlogit("Tspi_Context_LoadKeyByBlob: "