diff options
Diffstat (limited to 'usr/src/lib/pkcs11/pkcs11_softtoken/common/softEncryptUtil.c')
-rw-r--r-- | usr/src/lib/pkcs11/pkcs11_softtoken/common/softEncryptUtil.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softEncryptUtil.c b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softEncryptUtil.c index d51fe787c1..8fa02ea1d0 100644 --- a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softEncryptUtil.c +++ b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softEncryptUtil.c @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <pthread.h> #include <stdlib.h> #include <string.h> @@ -818,8 +816,11 @@ soft_encrypt_final(soft_session_t *session_p, CK_BYTE_PTR pLastEncryptedPart, case CKM_RC4: { ARCFour_key *key = (ARCFour_key *)session_p->encrypt.context; - bzero(key, sizeof (*key)); + /* Remaining data size is always zero for RC4. */ *pulLastEncryptedPartLen = 0; + if (pLastEncryptedPart == NULL) + goto clean1; + bzero(key, sizeof (*key)); break; } default: |