From 7bbeead507ad0a6822fbf6f62486c001ed228b19 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Fri, 25 Jul 2014 03:56:20 -0400 Subject: [PATCH] A bunch of dead assignments. Caught by clang scan-build. Change-Id: I4f10c879dc137d4a14a7a395764d28e5caa033ff Reviewed-on: https://boringssl-review.googlesource.com/1342 Reviewed-by: Adam Langley --- crypto/bn/convert.c | 2 -- crypto/bn/exponentiation.c | 1 - crypto/des/des.c | 6 +----- ssl/s3_clnt.c | 3 +-- 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/crypto/bn/convert.c b/crypto/bn/convert.c index 9befc493..048ac730 100644 --- a/crypto/bn/convert.c +++ b/crypto/bn/convert.c @@ -232,7 +232,6 @@ static void decode_hex(BIGNUM *bn, const char *in, int i) { BN_ULONG l=0; j = i; /* least significant 'hex' */ - m = 0; h = 0; while (j > 0) { m = ((BN_BYTES * 2) <= j) ? (BN_BYTES * 2) : j; @@ -383,7 +382,6 @@ char *BN_bn2dec(const BIGNUM *a) { *p++ = '-'; } - i = 0; while (!BN_is_zero(t)) { *lp = BN_div_word(t, BN_DEC_CONV); lp++; diff --git a/crypto/bn/exponentiation.c b/crypto/bn/exponentiation.c index 0c9d7a78..69c2f903 100644 --- a/crypto/bn/exponentiation.c +++ b/crypto/bn/exponentiation.c @@ -509,7 +509,6 @@ static int mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, * how bit a window to do. To do this we need to scan * forward until the last set bit before the end of the * window */ - j = wstart; wvalue = 1; wend = 0; for (i = 1; i < window; i++) { diff --git a/crypto/des/des.c b/crypto/des/des.c index ca87ee30..6d000113 100644 --- a/crypto/des/des.c +++ b/crypto/des/des.c @@ -413,7 +413,6 @@ static void DES_encrypt1(uint32_t *data, const DES_key_schedule *ks, int enc) { FP(r, l); data[0] = l; data[1] = r; - l = r = t = u = 0; } static void DES_encrypt2(uint32_t *data, const DES_key_schedule *ks, int enc) { @@ -473,7 +472,6 @@ static void DES_encrypt2(uint32_t *data, const DES_key_schedule *ks, int enc) { /* rotate and clear the top bits on machines with 8byte longs */ data[0] = ROTATE(l, 3) & 0xffffffffL; data[1] = ROTATE(r, 3) & 0xffffffffL; - l = r = t = u = 0; } static void DES_encrypt3(uint32_t *data, const DES_key_schedule *ks1, @@ -532,7 +530,7 @@ void DES_ecb_encrypt(const DES_cblock *in_block, DES_cblock *out_block, l2c(l, out); l = ll[1]; l2c(l, out); - l = ll[0] = ll[1] = 0; + ll[0] = ll[1] = 0; } void DES_ncbc_encrypt(const uint8_t *in, uint8_t *out, size_t len, @@ -608,7 +606,6 @@ void DES_ncbc_encrypt(const uint8_t *in, uint8_t *out, size_t len, l2c(xor0, iv); l2c(xor1, iv); } - tin0 = tin1 = tout0 = tout1 = xor0 = xor1 = 0; tin[0] = tin[1] = 0; } @@ -709,6 +706,5 @@ void DES_ede3_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t len, l2c(xor1, iv); } - tin0 = tin1 = tout0 = tout1 = xor0 = xor1 = 0; tin[0] = tin[1] = 0; } diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index 13e3ae5d..b61568a8 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -2701,8 +2701,7 @@ int ssl3_send_client_certificate(SSL *s) { /* If we get an error, we need to * ssl->rwstate=SSL_X509_LOOKUP; return(-1); - * We then get retied later */ - i=0; + * We then get retried later */ i = ssl_do_client_cert_cb(s, &x509, &pkey); if (i < 0) {