diff options
author | Martin Thomson <martin.thomson@gmail.com> | 2015-08-07 17:34:12 -0700 |
---|---|---|
committer | Martin Thomson <martin.thomson@gmail.com> | 2015-08-07 17:34:12 -0700 |
commit | df18e4c7e5e9ad31fab45575896fba7d2bc24250 (patch) | |
tree | f07ff7f0e8d1d06e564917eb58af355c1fa7d456 /lib/crmf | |
parent | c084b875adee244f5f56dd03e8948239d1f6c076 (diff) | |
download | nss-hg-df18e4c7e5e9ad31fab45575896fba7d2bc24250.tar.gz |
Bug 1182667 - Removing warnings, enabling -Werror, r=rrelyea
Diffstat (limited to 'lib/crmf')
-rw-r--r-- | lib/crmf/cmmfchal.c | 3 | ||||
-rw-r--r-- | lib/crmf/crmfcont.c | 16 | ||||
-rw-r--r-- | lib/crmf/crmfi.h | 2 | ||||
-rw-r--r-- | lib/crmf/crmfpop.c | 9 | ||||
-rw-r--r-- | lib/crmf/crmftmpl.c | 29 |
5 files changed, 17 insertions, 42 deletions
diff --git a/lib/crmf/cmmfchal.c b/lib/crmf/cmmfchal.c index 8f7b2982a..bf0b7ba37 100644 --- a/lib/crmf/cmmfchal.c +++ b/lib/crmf/cmmfchal.c @@ -30,7 +30,6 @@ cmmf_create_witness_and_challenge(PLArenaPool *poolp, CMMFRand randStr= { {siBuffer, NULL, 0}, {siBuffer, NULL, 0}}; PK11SlotInfo *slot; PK11SymKey *symKey = NULL; - CK_OBJECT_HANDLE id; CERTSubjectPublicKeyInfo *spki = NULL; @@ -76,7 +75,7 @@ cmmf_create_witness_and_challenge(PLArenaPool *poolp, rv = SECFailure; goto loser; } - id = PK11_ImportPublicKey(slot, inPubKey, PR_FALSE); + (void)PK11_ImportPublicKey(slot, inPubKey, PR_FALSE); /* In order to properly encrypt the data, we import as a symmetric * key, and then wrap that key. That in essence encrypts the data. * This is the method recommended in the PK11 world in order diff --git a/lib/crmf/crmfcont.c b/lib/crmf/crmfcont.c index cc386ea30..4e274d32c 100644 --- a/lib/crmf/crmfcont.c +++ b/lib/crmf/crmfcont.c @@ -857,7 +857,6 @@ CRMF_CreateEncryptedKeyWithEncryptedValue (SECKEYPrivateKey *inPrivKey, { SECKEYPublicKey *caPubKey = NULL; CRMFEncryptedKey *encKey = NULL; - CRMFEncryptedValue *dummy; PORT_Assert(inPrivKey != NULL && inCACert != NULL); if (inPrivKey == NULL || inCACert == NULL) { @@ -873,10 +872,17 @@ CRMF_CreateEncryptedKeyWithEncryptedValue (SECKEYPrivateKey *inPrivKey, if (encKey == NULL) { goto loser; } - dummy = crmf_create_encrypted_value_wrapped_privkey(inPrivKey, - caPubKey, - &encKey->value.encryptedValue); - PORT_Assert(dummy == &encKey->value.encryptedValue); +#ifdef DEBUG + { + CRMFEncryptedValue *dummy = + crmf_create_encrypted_value_wrapped_privkey( + inPrivKey, caPubKey, &encKey->value.encryptedValue); + PORT_Assert(dummy == &encKey->value.encryptedValue); + } +#else + crmf_create_encrypted_value_wrapped_privkey( + inPrivKey, caPubKey, &encKey->value.encryptedValue); +#endif /* We won't add the der value here, but rather when it * becomes part of a certificate request. */ diff --git a/lib/crmf/crmfi.h b/lib/crmf/crmfi.h index 0dc9b4986..fd27a9b9a 100644 --- a/lib/crmf/crmfi.h +++ b/lib/crmf/crmfi.h @@ -52,7 +52,7 @@ struct crmfEncoderArg { SECItem *buffer; - long allocatedLen; + unsigned long allocatedLen; }; struct crmfEncoderOutput { diff --git a/lib/crmf/crmfpop.c b/lib/crmf/crmfpop.c index 78381bf79..2d4e32699 100644 --- a/lib/crmf/crmfpop.c +++ b/lib/crmf/crmfpop.c @@ -10,7 +10,7 @@ #include "keyhi.h" #include "cryptohi.h" -#define CRMF_DEFAULT_ALLOC_SIZE 1024 +#define CRMF_DEFAULT_ALLOC_SIZE 1024U SECStatus crmf_init_encoder_callback_arg (struct crmfEncoderArg *encoderArg, @@ -33,7 +33,6 @@ crmf_init_encoder_callback_arg (struct crmfEncoderArg *encoderArg, SECStatus CRMF_CertReqMsgSetRAVerifiedPOP(CRMFCertReqMsg *inCertReqMsg) { - SECItem *dummy; CRMFProofOfPossession *pop; PLArenaPool *poolp; void *mark; @@ -52,9 +51,9 @@ CRMF_CertReqMsgSetRAVerifiedPOP(CRMFCertReqMsg *inCertReqMsg) pop->popChoice.raVerified.data = NULL; pop->popChoice.raVerified.len = 0; inCertReqMsg->pop = pop; - dummy = SEC_ASN1EncodeItem(poolp, &(inCertReqMsg->derPOP), - &(pop->popChoice.raVerified), - CRMFRAVerifiedTemplate); + (void)SEC_ASN1EncodeItem(poolp, &(inCertReqMsg->derPOP), + &(pop->popChoice.raVerified), + CRMFRAVerifiedTemplate); return SECSuccess; loser: PORT_ArenaRelease(poolp, mark); diff --git a/lib/crmf/crmftmpl.c b/lib/crmf/crmftmpl.c index 73d75f8b7..320d52463 100644 --- a/lib/crmf/crmftmpl.c +++ b/lib/crmf/crmftmpl.c @@ -138,19 +138,6 @@ const SEC_ASN1Template CRMFCertReqMessagesTemplate[] = { CRMFCertReqMsgTemplate, sizeof (CRMFCertReqMessages)} }; -static const SEC_ASN1Template CRMFPOPOSigningKeyInputTemplate[] = { - { SEC_ASN1_SEQUENCE, 0, NULL,sizeof(CRMFPOPOSigningKeyInput) }, - { SEC_ASN1_OPTIONAL | SEC_ASN1_CONSTRUCTED | - SEC_ASN1_CONTEXT_SPECIFIC | 0, - offsetof(CRMFPOPOSigningKeyInput, authInfo.sender) }, - { SEC_ASN1_BIT_STRING | SEC_ASN1_OPTIONAL | 1, - offsetof (CRMFPOPOSigningKeyInput, authInfo.publicKeyMAC) }, - { SEC_ASN1_INLINE | SEC_ASN1_XTRN, - offsetof(CRMFPOPOSigningKeyInput, publicKey), - SEC_ASN1_SUB(CERT_SubjectPublicKeyInfoTemplate) }, - { 0 } -}; - const SEC_ASN1Template CRMFRAVerifiedTemplate[] = { { SEC_ASN1_CONTEXT_SPECIFIC | 0 | SEC_ASN1_XTRN, 0, @@ -252,19 +239,3 @@ const SEC_ASN1Template CRMFEncryptedKeyWithEncryptedValueTemplate [] = { CRMFEncryptedValueTemplate}, { 0 } }; - -static const SEC_ASN1Template CRMFSinglePubInfoTemplate[] = { - { SEC_ASN1_SEQUENCE, 0, NULL, sizeof (CRMFSinglePubInfo)}, - { SEC_ASN1_INTEGER, offsetof(CRMFSinglePubInfo, pubMethod) }, - { SEC_ASN1_OPTIONAL | SEC_ASN1_CONSTRUCTED | SEC_ASN1_CONTEXT_SPECIFIC, - offsetof(CRMFSinglePubInfo, pubLocation) }, - { 0 } -}; - -static const SEC_ASN1Template CRMFPublicationInfoTemplate[] ={ - { SEC_ASN1_SEQUENCE, 0, NULL, sizeof(CRMFPKIPublicationInfo) }, - { SEC_ASN1_INTEGER, offsetof(CRMFPKIPublicationInfo, action) }, - { SEC_ASN1_POINTER, offsetof(CRMFPKIPublicationInfo, pubInfos), - CRMFSinglePubInfoTemplate}, - { 0 } -}; |