summaryrefslogtreecommitdiff
path: root/usr/src/lib/pkcs11/pkcs11_softtoken
diff options
context:
space:
mode:
authorizick <none@none>2006-01-23 13:07:36 -0800
committerizick <none@none>2006-01-23 13:07:36 -0800
commite81dd421aa6d230abe00ec58cd0bc87915d72406 (patch)
treecf4c650fb0d572934b50e9129a7695daf4daaf94 /usr/src/lib/pkcs11/pkcs11_softtoken
parent84c5a1550ecbf7356ab4133238160367c507f4fb (diff)
downloadillumos-gate-e81dd421aa6d230abe00ec58cd0bc87915d72406.tar.gz
6372169 blowfish can read past mblk and panic in cbc mode
6372587 pkcs11_softtoken should use getpwnam_r(3C) to avoid overwriting thread-specific data
Diffstat (limited to 'usr/src/lib/pkcs11/pkcs11_softtoken')
-rw-r--r--usr/src/lib/pkcs11/pkcs11_softtoken/common/softKeystore.c3
-rw-r--r--usr/src/lib/pkcs11/pkcs11_softtoken/common/softKeystore.h3
-rw-r--r--usr/src/lib/pkcs11/pkcs11_softtoken/common/softKeystoreUtil.c7
3 files changed, 7 insertions, 6 deletions
diff --git a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softKeystore.c b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softKeystore.c
index 0fa1a005b7..c9426be05f 100644
--- a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softKeystore.c
+++ b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softKeystore.c
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -62,7 +62,6 @@ soft_gen_iv(CK_BYTE *iv)
}
-#define PWD_BUFFER_SIZE 1024
/*
* soft_gen_hashed_pin()
diff --git a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softKeystore.h b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softKeystore.h
index 8c093f94f1..87a02479ae 100644
--- a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softKeystore.h
+++ b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softKeystore.h
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -38,6 +38,7 @@ extern "C" {
#define PBKD2_SALT_SIZE 16
#define PBKD2_ITERATIONS (1000)
+#define PWD_BUFFER_SIZE 1024
extern boolean_t soft_token_present;
diff --git a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softKeystoreUtil.c b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softKeystoreUtil.c
index d67efb6b3d..87153034cc 100644
--- a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softKeystoreUtil.c
+++ b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softKeystoreUtil.c
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -162,9 +162,10 @@ static int desc_fd = 0;
static char *
get_user_home_sunw_path(char *home_path)
{
- struct passwd *user_info;
+ struct passwd pwd, *user_info;
+ char pwdbuf[PWD_BUFFER_SIZE];
- user_info = getpwuid(getuid());
+ (void) getpwuid_r(getuid(), &pwd, pwdbuf, PWD_BUFFER_SIZE, &user_info);
(void) snprintf(home_path, MAXPATHLEN, "%s/%s",
user_info ? user_info->pw_dir : "", SUNW_PATH);