From e5487c9a836e877fb9139eaa88c246e211f30144 Mon Sep 17 00:00:00 2001 From: "rrelyea%redhat.com" Date: Wed, 13 Jun 2007 21:01:29 +0000 Subject: This fix some of the 64 bit issues. --- security/nss/lib/softoken/legacydb/lgattr.c | 2 ++ security/nss/lib/softoken/legacydb/lgcreate.c | 8 +++++--- security/nss/lib/softoken/legacydb/lgutil.c | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'security/nss/lib/softoken/legacydb') 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; -- cgit v1.2.1