summaryrefslogtreecommitdiff
path: root/lib/smime
diff options
context:
space:
mode:
Diffstat (limited to 'lib/smime')
-rw-r--r--lib/smime/cmsasn1.c4
-rw-r--r--lib/smime/cmscipher.c2
-rw-r--r--lib/smime/cmsencode.c5
-rw-r--r--lib/smime/cmsrecinfo.c4
-rw-r--r--lib/smime/cmsudf.c6
-rw-r--r--lib/smime/smimeutil.c6
6 files changed, 6 insertions, 21 deletions
diff --git a/lib/smime/cmsasn1.c b/lib/smime/cmsasn1.c
index 4519363b9..b09a2e18c 100644
--- a/lib/smime/cmsasn1.c
+++ b/lib/smime/cmsasn1.c
@@ -51,10 +51,6 @@ const SEC_ASN1Template NSSCMSMessageTemplate[] = {
{ 0 }
};
-static const SEC_ASN1Template NSS_PointerToCMSMessageTemplate[] = {
- { SEC_ASN1_POINTER, 0, NSSCMSMessageTemplate }
-};
-
/* -----------------------------------------------------------------------------
* ENCAPSULATED & ENCRYPTED CONTENTINFO
* (both use a NSSCMSContentInfo)
diff --git a/lib/smime/cmscipher.c b/lib/smime/cmscipher.c
index 16d643615..958d4e473 100644
--- a/lib/smime/cmscipher.c
+++ b/lib/smime/cmscipher.c
@@ -366,7 +366,7 @@ NSS_CMSCipherContext_Decrypt(NSSCMSCipherContext *cc, unsigned char *output,
const unsigned char *input, unsigned int input_len,
PRBool final)
{
- int blocks, bsize, pcount, padsize;
+ unsigned int blocks, bsize, pcount, padsize;
unsigned int max_needed, ifraglen, ofraglen, output_len;
unsigned char *pbuf;
SECStatus rv;
diff --git a/lib/smime/cmsencode.c b/lib/smime/cmsencode.c
index 651f0865a..3025740b5 100644
--- a/lib/smime/cmsencode.c
+++ b/lib/smime/cmsencode.c
@@ -122,7 +122,6 @@ nss_cms_encoder_notify(void *arg, PRBool before, void *dest, int depth)
NSSCMSEncoderContext *p7ecx;
NSSCMSContentInfo *rootcinfo, *cinfo;
PRBool after = !before;
- PLArenaPool *poolp;
SECOidTag childtype;
SECItem *item;
@@ -130,7 +129,6 @@ nss_cms_encoder_notify(void *arg, PRBool before, void *dest, int depth)
PORT_Assert(p7ecx != NULL);
rootcinfo = &(p7ecx->cmsg->contentInfo);
- poolp = p7ecx->cmsg->poolp;
#ifdef CMSDEBUG
fprintf(stderr, "%6.6s, dest = 0x%08x, depth = %d\n", before ? "before" : "after", dest, depth);
@@ -201,12 +199,9 @@ nss_cms_before_data(NSSCMSEncoderContext *p7ecx)
SECStatus rv;
SECOidTag childtype;
NSSCMSContentInfo *cinfo;
- PLArenaPool *poolp;
NSSCMSEncoderContext *childp7ecx;
const SEC_ASN1Template *template;
- poolp = p7ecx->cmsg->poolp;
-
/* call _Encode_BeforeData handlers */
switch (p7ecx->type) {
case SEC_OID_PKCS7_SIGNED_DATA:
diff --git a/lib/smime/cmsrecinfo.c b/lib/smime/cmsrecinfo.c
index 5e08870b2..abc22542c 100644
--- a/lib/smime/cmsrecinfo.c
+++ b/lib/smime/cmsrecinfo.c
@@ -526,7 +526,6 @@ NSS_CMSRecipientInfo_UnwrapBulkKey(NSSCMSRecipientInfo *ri, int subIndex,
CERTCertificate *cert, SECKEYPrivateKey *privkey, SECOidTag bulkalgtag)
{
PK11SymKey *bulkkey = NULL;
- SECAlgorithmID *encalg;
SECOidTag encalgtag;
SECItem *enckey;
int error;
@@ -536,7 +535,6 @@ NSS_CMSRecipientInfo_UnwrapBulkKey(NSSCMSRecipientInfo *ri, int subIndex,
switch (ri->recipientInfoType) {
case NSSCMSRecipientInfoID_KeyTrans:
- encalg = &(ri->ri.keyTransRecipientInfo.keyEncAlg);
encalgtag = SECOID_GetAlgorithmTag(&(ri->ri.keyTransRecipientInfo.keyEncAlg));
enckey = &(ri->ri.keyTransRecipientInfo.encKey); /* ignore subIndex */
switch (encalgtag) {
@@ -551,7 +549,6 @@ NSS_CMSRecipientInfo_UnwrapBulkKey(NSSCMSRecipientInfo *ri, int subIndex,
}
break;
case NSSCMSRecipientInfoID_KeyAgree:
- encalg = &(ri->ri.keyAgreeRecipientInfo.keyEncAlg);
encalgtag = SECOID_GetAlgorithmTag(&(ri->ri.keyAgreeRecipientInfo.keyEncAlg));
enckey = &(ri->ri.keyAgreeRecipientInfo.recipientEncryptedKeys[subIndex]->encKey);
switch (encalgtag) {
@@ -573,7 +570,6 @@ NSS_CMSRecipientInfo_UnwrapBulkKey(NSSCMSRecipientInfo *ri, int subIndex,
}
break;
case NSSCMSRecipientInfoID_KEK:
- encalg = &(ri->ri.kekRecipientInfo.keyEncAlg);
encalgtag = SECOID_GetAlgorithmTag(&(ri->ri.kekRecipientInfo.keyEncAlg));
enckey = &(ri->ri.kekRecipientInfo.encKey);
/* not supported yet */
diff --git a/lib/smime/cmsudf.c b/lib/smime/cmsudf.c
index 13071113e..472b6d663 100644
--- a/lib/smime/cmsudf.c
+++ b/lib/smime/cmsudf.c
@@ -79,14 +79,14 @@ nss_cmstype_shutdown(void *appData, void *reserved)
static PLHashNumber
nss_cmstype_hash_key(const void *key)
{
- return (PLHashNumber) key;
+ return (PLHashNumber)((char *)key - (char *)NULL);
}
static PRIntn
nss_cmstype_compare_keys(const void *v1, const void *v2)
{
- PLHashNumber value1 = (PLHashNumber) v1;
- PLHashNumber value2 = (PLHashNumber) v2;
+ PLHashNumber value1 = nss_cmstype_hash_key(v1);
+ PLHashNumber value2 = nss_cmstype_hash_key(v2);
return (value1 == value2);
}
diff --git a/lib/smime/smimeutil.c b/lib/smime/smimeutil.c
index fbb61b9c1..84d1960a0 100644
--- a/lib/smime/smimeutil.c
+++ b/lib/smime/smimeutil.c
@@ -759,6 +759,8 @@ extern const char __nss_smime_version[];
PRBool
NSSSMIME_VersionCheck(const char *importedVersion)
{
+#define NSS_VERSION_VARIABLE __nss_smime_version
+#include "verref.h"
/*
* This is the secret handshake algorithm.
*
@@ -768,10 +770,6 @@ NSSSMIME_VersionCheck(const char *importedVersion)
* not compatible with future major, minor, or
* patch releases.
*/
- volatile char c; /* force a reference that won't get optimized away */
-
- c = __nss_smime_version[0];
-
return NSS_VersionCheck(importedVersion);
}