Blob Blame History Raw
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/CryptoManager.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/CryptoManager.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/CryptoManager.c	2011-08-10 16:21:30.609765000 -0700
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/CryptoManager.c	2011-08-11 17:54:57.255176000 -0700
@@ -55,7 +55,7 @@
 
 #include "pk11util.h"
 
-#if defined(AIX) || defined(HPUX) || defined(LINUX)
+#if defined(AIX) || defined(HPUX)
 #include <signal.h>
 #endif
 
@@ -90,11 +90,11 @@ const char * jss_sccsid() {
 /********************************************************************/
 
 /* JSS_VERSION from  mozilla/security/jss/org/mozilla/jss/util/jssver.h */
-static const char* DLL_JSS_VERSION     = "JSS_VERSION = " JSS_VERSION;
+static const char* VARIABLE_MAY_NOT_BE_USED DLL_JSS_VERSION     = "JSS_VERSION = " JSS_VERSION;
 /* NSS_VERSION from mozilla/security/nss/lib/nss/nss.h */
-static const char* DLL_NSS_VERSION     = "NSS_VERSION = " NSS_VERSION;
+static const char* VARIABLE_MAY_NOT_BE_USED DLL_NSS_VERSION     = "NSS_VERSION = " NSS_VERSION;
 /* NSPR_version from mozilla/nsprpub/pr/include/prinit.h */
-static const char* DLL_NSPR_VERSION    = "NSPR_VERSION = " PR_VERSION;
+static const char* VARIABLE_MAY_NOT_BE_USED DLL_NSPR_VERSION    = "NSPR_VERSION = " PR_VERSION;
 
 
 
@@ -106,13 +106,13 @@ static char*
 getPWFromCallback(PK11SlotInfo *slot, PRBool retry, void *arg);
 
 /*************************************************************
- * AIX, HP, and Linux signal handling madness
+ * AIX and HP signal handling madness
  *
  * In order for the JVM, kernel, and NSPR to work together, we setup
  * a signal handler for SIGCHLD that does nothing.  This is only done
- * on AIX, HP, and Linux.
+ * on AIX and HP.
  *************************************************************/
-#if defined(AIX) || defined(HPUX) || defined(LINUX)
+#if defined(AIX) || defined(HPUX)
 
 static PRStatus
 handleSigChild(JNIEnv *env) {
@@ -333,8 +333,6 @@ Java_org_mozilla_jss_CryptoManager_initi
         jboolean initializeJavaOnly )
 {
     SECStatus rv = SECFailure;
-    JavaVM *VMs[5];
-    jint numVMs;
     char *szConfigDir = NULL;
     char *szCertPrefix = NULL;
     char *szKeyPrefix = NULL;
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/PK11Finder.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/PK11Finder.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/PK11Finder.c	2011-08-10 16:21:30.849767000 -0700
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/PK11Finder.c	2011-08-10 18:22:37.887077000 -0700
@@ -263,7 +263,7 @@ JNIEXPORT jobject JNICALL
 Java_org_mozilla_jss_CryptoManager_findPrivKeyByCertNative
   (JNIEnv *env, jobject this, jobject Cert)
 {
-    PRThread *pThread;
+    PRThread * VARIABLE_MAY_NOT_BE_USED pThread=NULL;
     CERTCertificate *cert;
     PK11SlotInfo *slot;
     SECKEYPrivateKey *privKey=NULL;
@@ -458,7 +458,7 @@ JNIEXPORT jobjectArray JNICALL
 Java_org_mozilla_jss_CryptoManager_buildCertificateChainNative
     (JNIEnv *env, jobject this, jobject leafCert)
 {
-    PRThread *pThread;
+    PRThread * VARIABLE_MAY_NOT_BE_USED pThread=NULL;
     CERTCertificate *leaf;
     jobjectArray chainArray=NULL;
     CERTCertDBHandle *certdb;
@@ -812,7 +812,7 @@ Java_org_mozilla_jss_CryptoManager_impor
     SECItem *derCerts=NULL;
     int certi= -1;
     SECItem theDerCert;
-    int numCerts;
+    int numCerts = 0;
     jbyte *packageBytes=NULL;
     jsize packageLen;
     SECStatus status;
@@ -1486,7 +1486,7 @@ Java_org_mozilla_jss_CryptoManager_impor
     CERTSignedCrl *crl = NULL;
     SECItem *packageItem = NULL;
     int status = SECFailure;
-    char *url;
+    char *url = NULL;
     char *errmsg = NULL;
 
     /***************************************************
@@ -1651,7 +1651,7 @@ JNIEXPORT jint JNICALL
 Java_org_mozilla_jss_CryptoManager_verifyCertificateNowCUNative(JNIEnv *env,
         jobject self, jstring nickString, jboolean checkSig)
 {
-    SECStatus         rv    = SECFailure;
+    SECStatus VARIABLE_MAY_NOT_BE_USED rv    = SECFailure;
     SECCertificateUsage      currUsage = 0x0000;
 
     rv = verifyCertificateNow(env, self, nickString, checkSig, 0, &currUsage);
@@ -1736,7 +1736,6 @@ Java_org_mozilla_jss_CryptoManager_verif
     SECStatus         rv    = SECFailure;
     SECCertUsage      certUsage;
     SECItem *derCerts[2];
-    SECStatus status;
     CERTCertificate **certArray = NULL;
     CERTCertDBHandle *certdb = CERT_GetDefaultCertDB();
 
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/SecretDecoderRing/KeyManager.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/SecretDecoderRing/KeyManager.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/SecretDecoderRing/KeyManager.c	2003-12-19 11:36:30.000000000 -0800
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/SecretDecoderRing/KeyManager.c	2011-08-10 16:58:52.527501000 -0700
@@ -358,7 +358,6 @@ Java_org_mozilla_jss_SecretDecoderRing_K
 {
     PK11SlotInfo *slot = NULL;
     PK11SymKey *symk = NULL;
-    SECStatus status;
 
     /* get the slot */
     if( JSS_PK11_getTokenSlotPtr(env, tokenObj, &slot) != PR_SUCCESS ) {
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/PQGParams.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/PQGParams.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/PQGParams.c	2004-04-25 08:02:21.000000000 -0700
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/crypto/PQGParams.c	2011-08-11 09:40:34.001421000 -0700
@@ -371,7 +371,7 @@ Java_org_mozilla_jss_crypto_PQGParams_pa
     /***********************************************************************
      * Perform the verification.
      */
-    if( PK11_PQG_VerifyParams(pParams, pVfy, &verifyResult) != PR_SUCCESS) {
+    if( PK11_PQG_VerifyParams(pParams, pVfy, &verifyResult) != SECSuccess) {
         JSS_throw(env, OUT_OF_MEMORY_ERROR);
         goto finish;
     }
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Cert.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Cert.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Cert.c	2004-04-25 08:02:22.000000000 -0700
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Cert.c	2011-08-10 18:30:07.942629000 -0700
@@ -62,7 +62,7 @@
 JNIEXPORT jbyteArray JNICALL Java_org_mozilla_jss_pkcs11_PK11Cert_getEncoded
   (JNIEnv *env, jobject this)
 {
-	PRThread *pThread;
+	PRThread * VARIABLE_MAY_NOT_BE_USED pThread;
 	CERTCertificate *cert;
 	SECItem *derCert;
 	jbyteArray derArray=NULL;
@@ -118,9 +118,9 @@ finish:
 JNIEXPORT jint JNICALL Java_org_mozilla_jss_pkcs11_PK11Cert_getVersion
   (JNIEnv *env, jobject this)
 {
-	PRThread *pThread;
+	PRThread * VARIABLE_MAY_NOT_BE_USED pThread;
 	CERTCertificate *cert;
-	long lVersion;
+	long lVersion = 0;
 
 	pThread = PR_AttachThread(PR_SYSTEM_THREAD, 0, NULL);
 	PR_ASSERT(pThread != NULL);
@@ -165,7 +165,7 @@ Java_org_mozilla_jss_pkcs11_PK11Cert_get
 {
 	CERTCertificate *cert;
 	SECKEYPublicKey *pubk=NULL;
-	PRThread *pThread;
+	PRThread * VARIABLE_MAY_NOT_BE_USED pThread;
 	jobject pubKey=NULL;
 
 	PR_ASSERT(env!=NULL && this!=NULL);
@@ -210,7 +210,7 @@ Java_org_mozilla_jss_pkcs11_CertProxy_re
   (JNIEnv *env, jobject this)
 {
 	CERTCertificate *cert;
-	PRThread *pThread;
+	PRThread * VARIABLE_MAY_NOT_BE_USED pThread;
 
 	PR_ASSERT(env!=NULL && this!=NULL);
 
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Cipher.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Cipher.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Cipher.c	2004-04-25 08:02:22.000000000 -0700
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Cipher.c	2011-08-10 16:42:43.822494000 -0700
@@ -73,7 +73,7 @@ Java_org_mozilla_jss_pkcs11_PK11Cipher_i
     SECItem *iv=NULL;
     PK11Context *context=NULL;
     CK_ATTRIBUTE_TYPE op;
-    jobject contextObj;
+    jobject contextObj = NULL;
 
     PR_ASSERT(env!=NULL && clazz!=NULL && keyObj!=NULL && algObj!=NULL);
 
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11KeyGenerator.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11KeyGenerator.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11KeyGenerator.c	2005-11-14 14:15:06.000000000 -0800
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11KeyGenerator.c	2011-08-11 09:23:03.220470000 -0700
@@ -207,7 +207,7 @@ finish:
 }
 #endif
 
-static void
+static void FUNCTION_MAY_NOT_BE_USED
 print_secitem(SECItem *item) {
     int i;
     int online;
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11KeyPairGenerator.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11KeyPairGenerator.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11KeyPairGenerator.c	2011-08-10 16:21:30.270767000 -0700
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11KeyPairGenerator.c	2011-08-10 18:33:11.773445000 -0700
@@ -450,7 +450,7 @@ DumpItem(SECItem *item)
   for (i=0; i < item->len; i++) {
     printf(" %02x",data[i]);
   }
-  printf(" : 0x%08x %d\n", data, item->len);
+  printf(" : %8p %d\n", data, item->len);
 }
 
 /**********************************************************************
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.c	2006-02-22 17:21:42.000000000 -0800
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11KeyWrapper.c	2011-08-10 16:52:03.052910000 -0700
@@ -562,7 +562,7 @@ Java_org_mozilla_jss_pkcs11_PK11KeyWrapp
         jint keyLen, jbyteArray ivBA, jint usageEnum)
 {
     PK11SymKey *symKey=NULL;
-    CK_MECHANISM_TYPE wrappingMech, keyTypeMech;
+    CK_MECHANISM_TYPE wrappingMech=0, keyTypeMech=0;
     SECItem *wrappedKey=NULL, *iv=NULL, *param=NULL;
     jobject keyObj=NULL;
     SECKEYPrivateKey *wrappingKey=NULL;
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11MessageDigest.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11MessageDigest.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11MessageDigest.c	2004-04-25 08:02:22.000000000 -0700
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11MessageDigest.c	2011-08-10 16:52:54.951857000 -0700
@@ -88,7 +88,6 @@ Java_org_mozilla_jss_pkcs11_PK11MessageD
     PK11Context *context = NULL;
     CK_MECHANISM_TYPE mech;
     SECItem param;
-    PK11SlotInfo *slot=NULL;
     jobject contextObj=NULL;
 
     mech = JSS_getPK11MechFromAlg(env, algObj);
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Module.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Module.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Module.c	2007-02-23 09:40:21.000000000 -0800
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Module.c	2011-08-10 16:53:28.788823000 -0700
@@ -254,7 +254,7 @@ Java_org_mozilla_jss_pkcs11_ModuleProxy_
 {
     SECMODModule *module;
 
-    if (JSS_getPtrFromProxy(env, this, &module) != PR_SUCCESS) {
+    if (JSS_getPtrFromProxy(env, this, (void **)&module) != PR_SUCCESS) {
         ASSERT_OUTOFMEM(env);
         goto finish;
     }
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11PrivKey.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11PrivKey.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11PrivKey.c	2006-04-24 18:26:42.000000000 -0700
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11PrivKey.c	2011-08-10 18:34:20.954376000 -0700
@@ -174,7 +174,7 @@ JNIEXPORT jobject JNICALL
 Java_org_mozilla_jss_pkcs11_PK11PrivKey_getKeyType
   (JNIEnv *env, jobject this)
 {
-    PRThread *pThread;
+    PRThread * VARIABLE_MAY_NOT_BE_USED pThread;
     SECKEYPrivateKey *privk;
     KeyType keyType;
     char* keyTypeFieldName;
@@ -259,7 +259,7 @@ Java_org_mozilla_jss_pkcs11_PrivateKeyPr
   (JNIEnv *env, jobject this)
 {
     SECKEYPrivateKey *privk;
-    PRThread *pThread;
+    PRThread * VARIABLE_MAY_NOT_BE_USED pThread;
 
     PR_ASSERT(env!=NULL && this!=NULL);
 
@@ -358,7 +358,6 @@ Java_org_mozilla_jss_pkcs11_PK11PrivKey_
     (JNIEnv *env, jobject this)
 {
     SECKEYPrivateKey *key = NULL;
-    PK11SlotInfo *slot = NULL;
     SECItem *idItem = NULL;
     jbyteArray byteArray = NULL;
 
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11PubKey.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11PubKey.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11PubKey.c	2006-02-22 17:21:42.000000000 -0800
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11PubKey.c	2011-08-10 18:35:04.390333000 -0700
@@ -62,7 +62,7 @@ JNIEXPORT void JNICALL Java_org_mozilla_
   (JNIEnv *env, jobject this)
 {
     SECKEYPublicKey *pubk;
-    PRThread *pThread;
+    PRThread * VARIABLE_MAY_NOT_BE_USED pThread;
 
     PR_ASSERT(env!=NULL && this!=NULL);
 
@@ -179,7 +179,7 @@ JNIEXPORT void JNICALL
 Java_org_mozilla_jss_pkcs11_PK11PubKey_verifyKeyIsOnToken
   (JNIEnv *env, jobject this, jobject token)
 {
-	PRThread *pThread;
+    PRThread * VARIABLE_MAY_NOT_BE_USED pThread;
 	SECKEYPublicKey *key = NULL;
 	PK11SlotInfo *slot = NULL;
 	PK11SlotInfo *keySlot = NULL;
@@ -231,7 +231,7 @@ JNIEXPORT jobject JNICALL
 Java_org_mozilla_jss_pkcs11_PK11PubKey_getKeyType
   (JNIEnv *env, jobject this)
 {
-    PRThread *pThread;
+    PRThread * VARIABLE_MAY_NOT_BE_USED pThread;
     SECKEYPublicKey *pubk;
     KeyType keyType;
     char* keyTypeFieldName;
@@ -454,7 +454,7 @@ get_public_key_info
 {
     SECKEYPublicKey *pubk;
     jbyteArray byteArray=NULL;
-    SECItem *item;
+    SECItem *item=NULL;
 
     PR_ASSERT(env!=NULL && this!=NULL);
 
@@ -526,7 +526,6 @@ pubkFromRaw(JNIEnv *env, CK_KEY_TYPE typ
 {
     jobject pubkObj=NULL;
     SECKEYPublicKey *pubk=NULL;
-    SECStatus rv;
     SECItem *pubkDER=NULL;
 
     /* validate args */
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11SecureRandom.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11SecureRandom.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11SecureRandom.c	2005-01-28 11:16:11.000000000 -0800
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11SecureRandom.c	2011-08-10 18:36:05.252271000 -0700
@@ -112,7 +112,7 @@ Java_org_mozilla_jss_pkcs11_PK11SecureRa
      * "C" data members
      */
 
-    PRThread*     pThread = NULL;
+    PRThread*     VARIABLE_MAY_NOT_BE_USED pThread = NULL;
     SECStatus     status  = PR_FALSE;
     PK11SlotInfo* slot    = NULL;
 
@@ -262,7 +262,7 @@ Java_org_mozilla_jss_pkcs11_PK11SecureRa
      * "C" data members
      */
 
-    PRThread*     pThread = NULL;
+    PRThread*     VARIABLE_MAY_NOT_BE_USED pThread = NULL;
     SECStatus     status  = PR_FALSE;
 
 
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Store.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Store.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Store.c	2006-04-03 16:09:49.000000000 -0700
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Store.c	2011-08-10 18:38:12.365145000 -0700
@@ -319,7 +319,7 @@ Java_org_mozilla_jss_pkcs11_PK11Store_de
     (JNIEnv *env, jobject this, jobject certObject)
 {
     CERTCertificate *cert;
-    SECStatus status;
+    SECStatus VARIABLE_MAY_NOT_BE_USED status;
 
     PR_ASSERT(env!=NULL && this!=NULL);
     if(certObject == NULL) {
@@ -349,7 +349,7 @@ Java_org_mozilla_jss_pkcs11_PK11Store_de
     (JNIEnv *env, jobject this, jobject certObject)
 {
     CERTCertificate *cert;
-    SECStatus status;
+    SECStatus VARIABLE_MAY_NOT_BE_USED status;
 
     PR_ASSERT(env!=NULL && this!=NULL);
     if(certObject == NULL) {
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11SymKey.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11SymKey.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11SymKey.c	2004-04-25 08:02:22.000000000 -0700
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11SymKey.c	2011-08-11 09:42:52.967282000 -0700
@@ -233,7 +233,7 @@ Java_org_mozilla_jss_pkcs11_PK11SymKey_g
     jfieldID typeField=NULL;
     jobject typeObject=NULL;
 
-    if( JSS_PK11_getSymKeyPtr(env, this, &key) != SECSuccess ) {
+    if( JSS_PK11_getSymKeyPtr(env, this, &key) != PR_SUCCESS ) {
         ASSERT_OUTOFMEM(env);
         goto finish;
     }
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Token.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Token.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Token.c	2007-11-09 16:37:57.000000000 -0800
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/pkcs11/PK11Token.c	2011-08-10 18:38:52.421104000 -0700
@@ -961,9 +961,9 @@ JNIEXPORT jstring JNICALL Java_org_mozil
    jstring keyType, jbyteArray P, jbyteArray Q, jbyteArray G)
 {
     PK11SlotInfo *slot;
-    const char* c_subject;
+    const char* c_subject=NULL;
     jboolean isCopy;
-    unsigned char *b64request;
+    unsigned char *b64request=NULL;
     SECItem p, q, g;
     PQGParams *dsaParams=NULL;
     const char* c_keyType;
@@ -1080,7 +1080,7 @@ GenerateCertRequest(JNIEnv *env, 
 	SECStatus rv;
 	PRArenaPool *arena;
 	SECItem result_der, result;
-	SECItem *blob;
+	SECItem * VARIABLE_MAY_NOT_BE_USED blob;
 	CK_MECHANISM_TYPE signMech;
 	CK_MECHANISM_TYPE keygenMech;
 
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/provider/java/security/JSSKeyStoreSpi.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/provider/java/security/JSSKeyStoreSpi.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/provider/java/security/JSSKeyStoreSpi.c	2003-09-24 15:20:05.000000000 -0700
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/provider/java/security/JSSKeyStoreSpi.c	2011-08-10 16:57:42.991570000 -0700
@@ -89,7 +89,6 @@ traverseTokenObjects
     SECKEYPublicKeyList* pubkList = NULL;
     PK11SymKey *symKey = NULL;
     CERTCertList *certList = NULL;
-    SECStatus secstat;
 
     /*
      * Get all private keys
@@ -508,7 +507,6 @@ lookupCertByNickname(JNIEnv *env, jobjec
 {
     PK11SlotInfo *slot;
     EngineGetCertificateCBInfo cbinfo = {NULL,NULL};
-    jbyteArray derCertBA = NULL;
     PRStatus status = PR_FAILURE;
 
     if( alias == NULL ) goto finish;
@@ -813,7 +811,6 @@ Java_org_mozilla_jss_provider_java_secur
     PK11SlotInfo *slot;
     EngineGetCertificateCBInfo cbinfo = {NULL,NULL};
     jboolean retVal = JNI_FALSE;
-    SECKEYPrivateKey *privk = NULL;
 
     if( alias == NULL ) goto finish;
 
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/ssl/SSLSocket.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/ssl/SSLSocket.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/ssl/SSLSocket.c	2011-08-10 16:21:30.395765000 -0700
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/ssl/SSLSocket.c	2011-08-10 17:05:15.363117000 -0700
@@ -397,7 +397,7 @@ Java_org_mozilla_jss_ssl_SSLSocket_getSo
 {
     PRSocketOptionData sockOptions;
     JSSL_SocketData *sock = NULL;
-    jint retval;
+    jint retval=-1;
     PRStatus status;
 
     if( JSSL_getSockData(env, self, &sock) != PR_SUCCESS ) {
@@ -874,7 +874,7 @@ JNIEXPORT jint JNICALL
 Java_org_mozilla_jss_ssl_SSLSocket_socketAvailable(
     JNIEnv *env, jobject self)
 {
-    jint available;
+    jint available=0;
     JSSL_SocketData *sock = NULL;
 
     if( JSSL_getSockData(env, self, &sock) != PR_SUCCESS ) {
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/ssl/common.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/ssl/common.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/ssl/common.c	2011-08-10 16:21:30.434766000 -0700
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/ssl/common.c	2011-08-11 09:44:12.310202000 -0700
@@ -64,7 +64,7 @@ JSSL_throwSSLSocketException(JNIEnv *env
     jmethodID excepCons;
     jobject excepObj;
     jstring msgString;
-    jint result;
+    jint VARIABLE_MAY_NOT_BE_USED result;
 
     /*
      * get the error code and error string
@@ -149,8 +149,8 @@ Java_org_mozilla_jss_ssl_SocketBase_sock
     jbyteArray sdArray = NULL;
     JSSL_SocketData *sockdata = NULL;
     SECStatus status;
-    PRFileDesc *newFD;
-    PRFileDesc *tmpFD;
+    PRFileDesc *newFD = NULL;
+    PRFileDesc *tmpFD = NULL;
     PRFilePrivate *priv = NULL;
     int socketFamily = 0;
 
@@ -627,7 +627,7 @@ Java_org_mozilla_jss_ssl_SocketBase_getS
     SECStatus status = SECSuccess;
     PRBool bOption = PR_FALSE;
 
-    if( JSSL_getSockData(env, self, &sock) != SECSuccess ) {
+    if( JSSL_getSockData(env, self, &sock) != PR_SUCCESS ) {
         goto finish;
     }
 
@@ -649,7 +649,7 @@ JSSL_getSockAddr
     (JNIEnv *env, jobject self, PRNetAddr *addr, LocalOrPeer localOrPeer)
 {
     JSSL_SocketData *sock = NULL;
-    PRStatus status;
+    PRStatus status=PR_FAILURE;
 
     /* get my fd */
     if( JSSL_getSockData(env, self, &sock) != PR_SUCCESS ) {
@@ -893,7 +893,7 @@ JSS_SSL_processExceptions(JNIEnv *env, P
 
 finish:
     if( currentExcep != NULL && (*env)->ExceptionOccurred(env) == NULL) {
-        int ret = (*env)->Throw(env, currentExcep);
+        int VARIABLE_MAY_NOT_BE_USED ret = (*env)->Throw(env, currentExcep);
         PR_ASSERT(ret == 0);
     }
 }
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/ssl/javasock.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/ssl/javasock.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/ssl/javasock.c	2011-08-10 16:21:30.446765000 -0700
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/ssl/javasock.c	2011-08-10 17:03:48.769206000 -0700
@@ -92,7 +92,7 @@ writebuf(JNIEnv *env, PRFileDesc *fd, jo
     jmethodID getOutputStream, writeMethod;
     jclass sockClass, osClass;
     jobject outputStream;
-    jint arrayLen;
+    jint arrayLen=-1;
     PRInt32 retval;
 
     /*
@@ -211,7 +211,7 @@ jsock_write(PRFileDesc *fd, const PRIOVe
     jobject sockObj;
     JNIEnv *env;
     jbyteArray outbufArray;
-    PRInt32 retval;
+    PRInt32 retval=-1;
 
     if( GET_ENV(fd->secret->javaVM, env) ) goto finish;
 
@@ -500,7 +500,7 @@ static PRInt32
 jsock_recv(PRFileDesc *fd, void *buf, PRInt32 amount,
     PRIntn flags, PRIntervalTime timeout)
 {
-    PRInt32 retval;
+    PRInt32 retval=-1;
     JNIEnv *env;
     jobject sockObj;
     jbyteArray byteArray;
@@ -637,7 +637,7 @@ getIntProperty(JNIEnv *env, jobject sock
 {
     jclass sockClass;
     jmethodID method;
-    jint retval;
+    jint retval=0;
 
     sockClass = (*env)->GetObjectClass(env, sock);
     if( sockClass == NULL ) goto finish;
@@ -1001,12 +1001,6 @@ static const PRIOMethods jsockMethods = 
     (PRReservedFN) invalidInt
 };
 
-static const PRIOMethods*
-getJsockMethods()
-{
-    return &jsockMethods;
-}
-
 static void
 jsockDestructor(PRFileDesc *fd)
 {
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/util/jssutil.c alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/util/jssutil.c
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/util/jssutil.c	2004-04-25 08:02:29.000000000 -0700
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/util/jssutil.c	2011-08-10 18:24:58.470937000 -0700
@@ -115,7 +115,7 @@ void
 JSS_throwMsg(JNIEnv *env, char *throwableClassName, char *message) {
 
     jclass throwableClass;
-    jint result;
+    jint VARIABLE_MAY_NOT_BE_USED result;
 
     /* validate arguments */
     PR_ASSERT(env!=NULL && throwableClassName!=NULL && message!=NULL);
@@ -156,7 +156,7 @@ JSS_throw(JNIEnv *env, char *throwableCl
     jclass throwableClass;
     jobject throwable;
     jmethodID constructor;
-    jint result;
+    jint VARIABLE_MAY_NOT_BE_USED result;
     
     PR_ASSERT( (*env)->ExceptionOccurred(env) == NULL );
 
@@ -222,7 +222,9 @@ JSS_throw(JNIEnv *env, char *throwableCl
 PRStatus
 JSS_getPtrFromProxy(JNIEnv *env, jobject nativeProxy, void **ptr)
 {
+#ifdef DEBUG
     jclass nativeProxyClass;
+#endif
 	jclass proxyClass;
     jfieldID byteArrayField;
     jbyteArray byteArray;
@@ -745,7 +747,7 @@ JSS_trace(JNIEnv *env, jint level, char 
 void
 JSS_assertOutOfMem(JNIEnv *env)
 {
-    jclass memErrClass;
+    jclass VARIABLE_MAY_NOT_BE_USED memErrClass;
     jthrowable excep;
 
     PR_ASSERT(env != NULL);
@@ -804,7 +806,7 @@ JSS_SECItemToByteArray(JNIEnv *env, SECI
         goto finish;
     }
 
-    (*env)->SetByteArrayRegion(env, array, 0, item->len, item->data);
+    (*env)->SetByteArrayRegion(env, array, 0, item->len, (jbyte*)item->data);
 
 finish:
     return array;
diff -rupN patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/util/jssutil.h alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/util/jssutil.h
--- patched-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/util/jssutil.h	2004-04-25 08:02:29.000000000 -0700
+++ alt-jss-4.2.6/mozilla/security/jss/org/mozilla/jss/util/jssutil.h	2011-08-11 18:12:56.926098000 -0700
@@ -36,6 +36,19 @@
 #ifndef JSS_NATIVE_UTIL_H
 #define JSS_NATIVE_UTIL_H
 
+/* The following #defines are used to suppress undesired compiler warnings
+ * that have been deemed inappropriate.
+ *
+ * IMPORTANT:  These are ONLY used on an "as-needed" basis!
+ */
+#ifdef __GNUC__
+#define FUNCTION_MAY_NOT_BE_USED __attribute__ ((unused))
+#define VARIABLE_MAY_NOT_BE_USED __attribute__ ((unused))
+#else
+#define FUNCTION_MAY_NOT_BE_USED
+#define VARIABLE_MAY_NOT_BE_USED
+#endif
+
 /* Need to include these first.
  * #include <nspr.h>
  * #include <jni.h>