summaryrefslogtreecommitdiff
path: root/usr/src/lib/pkcs11/pkcs11_softtoken/common/softSignUtil.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/pkcs11/pkcs11_softtoken/common/softSignUtil.c')
-rw-r--r--usr/src/lib/pkcs11/pkcs11_softtoken/common/softSignUtil.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softSignUtil.c b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softSignUtil.c
index f8824df2dd..ccf746dc40 100644
--- a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softSignUtil.c
+++ b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softSignUtil.c
@@ -22,6 +22,7 @@
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
* Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+ * Copyright (c) 2018, Joyent, Inc.
*/
#include <stdlib.h>
@@ -562,8 +563,10 @@ soft_sign_verify_cleanup(soft_session_t *session_p, boolean_t sign,
case CKM_SHA384_HMAC:
case CKM_SHA512_HMAC_GENERAL:
case CKM_SHA512_HMAC:
- if (active_op->context != NULL)
- bzero(active_op->context, sizeof (soft_hmac_ctx_t));
+ if (active_op->context != NULL) {
+ explicit_bzero(active_op->context,
+ sizeof (soft_hmac_ctx_t));
+ }
break;
case CKM_DES_MAC_GENERAL:
case CKM_DES_MAC:
@@ -572,8 +575,10 @@ soft_sign_verify_cleanup(soft_session_t *session_p, boolean_t sign,
session_p->encrypt.context = NULL;
session_p->encrypt.flags = 0;
}
- if (active_op->context != NULL)
- bzero(active_op->context, sizeof (soft_des_ctx_t));
+ if (active_op->context != NULL) {
+ explicit_bzero(active_op->context,
+ sizeof (soft_des_ctx_t));
+ }
break;
case CKM_AES_CMAC_GENERAL:
@@ -583,8 +588,10 @@ soft_sign_verify_cleanup(soft_session_t *session_p, boolean_t sign,
session_p->encrypt.context = NULL;
session_p->encrypt.flags = 0;
}
- if (active_op->context != NULL)
- bzero(active_op->context, sizeof (soft_aes_ctx_t));
+ if (active_op->context != NULL) {
+ explicit_bzero(active_op->context,
+ sizeof (soft_aes_ctx_t));
+ }
break;
}