Skip to content

Commit

Permalink
11154 pkcs11_tpm: NULL pointer errors
Browse files Browse the repository at this point in the history
Reviewed by: Jason Lippert <jason@glasspelican.ca>
Approved by: Dan McDonald <danmcd@joyent.com>
  • Loading branch information
tsoome committed Jun 25, 2019
1 parent 4b788a9 commit e2e372a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion usr/src/lib/pkcs11/pkcs11_tpm/common/new_host.c
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions usr/src/lib/pkcs11/pkcs11_tpm/common/tpm_specific.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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: "
Expand Down

0 comments on commit e2e372a

Please sign in to comment.