summaryrefslogtreecommitdiff
path: root/security/nss/lib/softoken/legacydb
diff options
context:
space:
mode:
authorrrelyea%redhat.com <devnull@localhost>2007-06-13 21:01:29 +0000
committerrrelyea%redhat.com <devnull@localhost>2007-06-13 21:01:29 +0000
commite5487c9a836e877fb9139eaa88c246e211f30144 (patch)
treec374d780d2504f0e9c049414268012d43392047b /security/nss/lib/softoken/legacydb
parent679e1e7102d0f8a60bdd88cede6d56dba696bff8 (diff)
downloadnss-hg-e5487c9a836e877fb9139eaa88c246e211f30144.tar.gz
This fix some of the 64 bit issues.
Diffstat (limited to 'security/nss/lib/softoken/legacydb')
-rw-r--r--security/nss/lib/softoken/legacydb/lgattr.c2
-rw-r--r--security/nss/lib/softoken/legacydb/lgcreate.c8
-rw-r--r--security/nss/lib/softoken/legacydb/lgutil.c2
3 files changed, 8 insertions, 4 deletions
diff --git a/security/nss/lib/softoken/legacydb/lgattr.c b/security/nss/lib/softoken/legacydb/lgattr.c
index 428d2ae66..2416a6b18 100644
--- a/security/nss/lib/softoken/legacydb/lgattr.c
+++ b/security/nss/lib/softoken/legacydb/lgattr.c
@@ -85,6 +85,8 @@ lg_NewObjectCache(SDB *sdb, const SECItem *dbKey, CK_OBJECT_HANDLE handle)
obj->sdb = sdb;
obj->objectInfo = NULL;
obj->infoFree = NULL;
+ obj->dbKey.data = NULL;
+ obj->dbKey.len = 0;
lg_DBLock(sdb);
if (dbKey == NULL) {
dbKey = lg_lookupTokenKeyByHandle(sdb,handle);
diff --git a/security/nss/lib/softoken/legacydb/lgcreate.c b/security/nss/lib/softoken/legacydb/lgcreate.c
index c3ab0781d..1dd1b2709 100644
--- a/security/nss/lib/softoken/legacydb/lgcreate.c
+++ b/security/nss/lib/softoken/legacydb/lgcreate.c
@@ -66,6 +66,7 @@ lg_createCertObject(SDB *sdb, CK_OBJECT_HANDLE *handle,
char *label = NULL;
char *email = NULL;
SECStatus rv;
+ CK_RV crv;
PRBool inDB = PR_TRUE;
NSSLOWCERTCertDBHandle *certHandle = lg_getCertDB(sdb);
NSSLOWKEYDBHandle *keyHandle = NULL;
@@ -78,9 +79,10 @@ lg_createCertObject(SDB *sdb, CK_OBJECT_HANDLE *handle,
}
/* We only support X.509 Certs for now */
- attribute = lg_FindAttribute(CKA_CERTIFICATE_TYPE, templ, count);
- if (attribute == NULL) return CKR_TEMPLATE_INCOMPLETE;
- type = *(CK_CERTIFICATE_TYPE *)attribute->pValue;
+ crv = lg_GetULongAttribute(CKA_CERTIFICATE_TYPE, templ, count, &type);
+ if (crv != CKR_OK) {
+ return crv;
+ }
if (type != CKC_X_509) {
return CKR_ATTRIBUTE_VALUE_INVALID;
diff --git a/security/nss/lib/softoken/legacydb/lgutil.c b/security/nss/lib/softoken/legacydb/lgutil.c
index 3df08de09..6bb6902f5 100644
--- a/security/nss/lib/softoken/legacydb/lgutil.c
+++ b/security/nss/lib/softoken/legacydb/lgutil.c
@@ -226,7 +226,7 @@ lg_GetULongAttribute(CK_ATTRIBUTE_TYPE type, const CK_ATTRIBUTE *templ,
attribute = lg_FindAttribute(type, templ, count);
if (attribute == NULL) return CKR_TEMPLATE_INCOMPLETE;
- if (attribute->ulValueLen != sizeof(CK_ULONG)) {
+ if (attribute->ulValueLen != 4) {
return CKR_ATTRIBUTE_VALUE_INVALID;
}
data = (const unsigned char *)attribute->pValue;