Bugzilla bug 225808: 1. Use a 32-bit integer type for cert->nsCertType so

that it can be safely passed to PR_AtomicSet on all platforms.  Note that
we still use an unsigned type to avoid introducing signed/unsigned compiler
warnings.  2. Added a (PRInt32 *) cast to eliminate a pre-existing
signed/unsigned warning.  r=nelsonb.
Modified Files: certdb.c certt.h
This commit is contained in:
wchang0222%aol.com 2004-02-07 01:41:15 +00:00
Родитель e040b470c9
Коммит bf2c5e5f16
2 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -34,7 +34,7 @@
/*
* Certificate handling code
*
* $Id: certdb.c,v 1.62 2004/01/28 23:23:43 nelsonb%netscape.com Exp $
* $Id: certdb.c,v 1.63 2004/02/07 01:41:15 wchang0222%aol.com Exp $
*/
#include "nssilock.h"
@ -659,7 +659,9 @@ cert_GetCertType(CERTCertificate *cert)
PORT_Free(encodedExtKeyUsage.data);
CERT_DestroyOidSequence(extKeyUsage);
}
PR_AtomicSet(&cert->nsCertType, nsCertType);
/* Assert that it is safe to cast &cert->nsCertType to "PRInt32 *" */
PORT_Assert(sizeof(cert->nsCertType) == sizeof(PRInt32));
PR_AtomicSet((PRInt32 *)&cert->nsCertType, nsCertType);
return(SECSuccess);
}

Просмотреть файл

@ -33,7 +33,7 @@
/*
* certt.h - public data structures for the certificate library
*
* $Id: certt.h,v 1.25 2004/01/28 23:23:43 nelsonb%netscape.com Exp $
* $Id: certt.h,v 1.26 2004/02/07 01:41:15 wchang0222%aol.com Exp $
*/
#ifndef _CERTT_H_
#define _CERTT_H_
@ -253,7 +253,8 @@ struct CERTCertificateStr {
unsigned int keyUsage; /* what uses are allowed for this cert */
unsigned int rawKeyUsage; /* value of the key usage extension */
PRBool keyUsagePresent; /* was the key usage extension present */
unsigned int nsCertType; /* value of the ns cert type extension */
PRUint32 nsCertType; /* value of the ns cert type extension */
/* must be 32-bit for PR_AtomicSet */
/* these values can be set by the application to bypass certain checks
* or to keep the cert in memory for an entire session.