diff options
Diffstat (limited to 'usr/src/lib/pkcs11/pkcs11_softtoken/common/softSlotToken.c')
| -rw-r--r-- | usr/src/lib/pkcs11/pkcs11_softtoken/common/softSlotToken.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softSlotToken.c b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softSlotToken.c index 602b72486e..c8c3753f63 100644 --- a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softSlotToken.c +++ b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softSlotToken.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2018, Joyent, Inc. */ #include <strings.h> @@ -337,8 +338,11 @@ C_GetTokenInfo(CK_SLOT_ID slotID, CK_TOKEN_INFO_PTR pInfo) pInfo->flags |= CKF_USER_PIN_TO_BE_CHANGED; } - if (ks_cryptpin) - free(ks_cryptpin); + if (ks_cryptpin != NULL) { + size_t cplen = strlen(ks_cryptpin) + 1; + + freezero(ks_cryptpin, cplen); + } /* Provide information about a token in the provided buffer */ (void) strncpy((char *)pInfo->label, SOFT_TOKEN_LABEL, 32); |
