summaryrefslogtreecommitdiff
path: root/onlineupdate/source/libmar
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-11-03 23:05:42 +0100
committerMichael Stahl <mstahl@redhat.com>2015-11-04 13:22:27 +0100
commit8d9e85ec5c2fa765696040f3c343d37cb52eead7 (patch)
treee811c21a1ff73f348576a931f81818ce9efeee93 /onlineupdate/source/libmar
parent53433719f6449dfa2597c11aba24d82382479ec3 (diff)
onlineupdate: -Werror=unused-but-set-variable
Change-Id: I136eb25d2831cdbd3f1ce81714039cbd28b16577
Diffstat (limited to 'onlineupdate/source/libmar')
-rw-r--r--onlineupdate/source/libmar/sign/mar_sign.c6
-rw-r--r--onlineupdate/source/libmar/verify/mar_verify.c4
2 files changed, 4 insertions, 6 deletions
diff --git a/onlineupdate/source/libmar/sign/mar_sign.c b/onlineupdate/source/libmar/sign/mar_sign.c
index 3e7ef205d49c..68bff67acce6 100644
--- a/onlineupdate/source/libmar/sign/mar_sign.c
+++ b/onlineupdate/source/libmar/sign/mar_sign.c
@@ -262,7 +262,7 @@ strip_signature_block(const char *src, const char * dest)
FILE *fpSrc = NULL, *fpDest = NULL;
int rv = -1, hasSignatureBlock;
char buf[BLOCKSIZE];
- char *indexBuf = NULL, *indexBufLoc;
+ char *indexBuf = NULL;
if (!src || !dest) {
fprintf(stderr, "ERROR: Invalid parameter passed in.\n");
@@ -432,7 +432,6 @@ strip_signature_block(const char *src, const char * dest)
/* Consume the index and adjust each index by the difference */
indexBuf = malloc(indexLength);
- indexBufLoc = indexBuf;
if (fread(indexBuf, indexLength, 1, fpSrc) != 1) {
fprintf(stderr, "ERROR: Could not read index\n");
goto failure;
@@ -836,7 +835,7 @@ mar_repackage_and_sign(const char *NSSConfigDir,
char buf[BLOCKSIZE];
SECKEYPrivateKey *privKeys[MAX_SIGNATURES];
CERTCertificate *certs[MAX_SIGNATURES];
- char *indexBuf = NULL, *indexBufLoc;
+ char *indexBuf = NULL;
uint32_t k;
memset(signatureLengths, 0, sizeof(signatureLengths));
@@ -1058,7 +1057,6 @@ mar_repackage_and_sign(const char *NSSConfigDir,
/* Consume the index and adjust each index by signatureSectionLength */
indexBuf = malloc(indexLength);
- indexBufLoc = indexBuf;
if (fread(indexBuf, indexLength, 1, fpSrc) != 1) {
fprintf(stderr, "ERROR: Could not read index\n");
goto failure;
diff --git a/onlineupdate/source/libmar/verify/mar_verify.c b/onlineupdate/source/libmar/verify/mar_verify.c
index c9f715a4dc65..c07ca20f88a3 100644
--- a/onlineupdate/source/libmar/verify/mar_verify.c
+++ b/onlineupdate/source/libmar/verify/mar_verify.c
@@ -13,6 +13,7 @@
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
+#include <assert.h>
#include "mar_private.h"
#include "mar.h"
#include "cryptox.h"
@@ -197,7 +198,6 @@ mar_extract_and_verify_signatures_fp(FILE *fp,
uint32_t signatureCount, signatureLen, numVerified = 0;
uint32_t signatureAlgorithmIDs[MAX_SIGNATURES];
int rv = -1;
- int64_t curPos;
uint8_t *extractedSignatures[MAX_SIGNATURES];
uint32_t i;
@@ -285,7 +285,6 @@ mar_extract_and_verify_signatures_fp(FILE *fp,
}
}
- curPos = ftello(fp);
rv = mar_verify_signatures_for_fp(fp,
provider,
keys,
@@ -299,6 +298,7 @@ mar_extract_and_verify_signatures_fp(FILE *fp,
/* If we reached here and we verified every
signature, return success. */
if (numVerified == signatureCount && keyCount == numVerified) {
+ assert(rv == 0); (void) rv;
return CryptoX_Success;
}