aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2020-12-01 11:13:08 +1000
committerPauli <paul.dale@oracle.com>2020-12-03 11:21:33 +1000
commit7b42408756f53d38022363e2f0ac999db7d23a65 (patch)
tree0f6b7ed81a98fc645fca03c529d9c27f0fe79381
parent30742e8e7f93f58964bf7619f9c1783e6b3b03fc (diff)
downloadopenssl-7b42408756f53d38022363e2f0ac999db7d23a65.zip
openssl-7b42408756f53d38022363e2f0ac999db7d23a65.tar.gz
openssl-7b42408756f53d38022363e2f0ac999db7d23a65.tar.bz2
remove unused assignments
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13577)
-rw-r--r--crypto/asn1/asn1_par.c4
-rw-r--r--crypto/asn1/tasn_dec.c2
-rw-r--r--crypto/bio/b_print.c2
-rw-r--r--crypto/bn/bn_exp.c3
-rw-r--r--crypto/evp/e_aes_cbc_hmac_sha1.c4
-rw-r--r--crypto/evp/e_aes_cbc_hmac_sha256.c5
-rw-r--r--crypto/store/store_result.c2
-rw-r--r--crypto/x509/x509_vfy.c2
-rw-r--r--providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_hw.c4
-rw-r--r--providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_hw.c6
10 files changed, 10 insertions, 24 deletions
diff --git a/crypto/asn1/asn1_par.c b/crypto/asn1/asn1_par.c
index b2a1b3a..cf6d48c 100644
--- a/crypto/asn1/asn1_par.c
+++ b/crypto/asn1/asn1_par.c
@@ -72,10 +72,8 @@ static int asn1_print_info(BIO *bp, long offset, int depth, int hl, long len,
if (saved_indent >= 0)
BIO_set_indent(bp, saved_indent);
if (pop_f_prefix) {
- BIO *next = BIO_pop(bp);
-
+ BIO_pop(bp);
BIO_free(bp);
- bp = next;
}
return i;
}
diff --git a/crypto/asn1/tasn_dec.c b/crypto/asn1/tasn_dec.c
index 3fbf168..09adbf5 100644
--- a/crypto/asn1/tasn_dec.c
+++ b/crypto/asn1/tasn_dec.c
@@ -344,7 +344,6 @@ static int asn1_item_embed_d2i(ASN1_VALUE **pval, const unsigned char **in,
}
len -= p - q;
seq_eoc = 0;
- q = p;
break;
}
/*
@@ -519,7 +518,6 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
aclass = flags & ASN1_TFLG_TAG_CLASS;
p = *in;
- q = p;
/*
* If field is embedded then val needs fixing so it is a pointer to
diff --git a/crypto/bio/b_print.c b/crypto/bio/b_print.c
index 8192534..08d43d3 100644
--- a/crypto/bio/b_print.c
+++ b/crypto/bio/b_print.c
@@ -328,7 +328,7 @@ _dopr(char **sbuffer,
break;
case 'w':
/* not supported yet, treat as next char */
- ch = *format++;
+ format++;
break;
default:
/* unknown, skip */
diff --git a/crypto/bn/bn_exp.c b/crypto/bn/bn_exp.c
index 15e0853..1254415 100644
--- a/crypto/bn/bn_exp.c
+++ b/crypto/bn/bn_exp.c
@@ -252,7 +252,6 @@ int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
* 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++) {
@@ -409,7 +408,6 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
* 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++) {
@@ -1354,7 +1352,6 @@ int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
* 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/evp/e_aes_cbc_hmac_sha1.c b/crypto/evp/e_aes_cbc_hmac_sha1.c
index f787d01..cdf5985 100644
--- a/crypto/evp/e_aes_cbc_hmac_sha1.c
+++ b/crypto/evp/e_aes_cbc_hmac_sha1.c
@@ -702,8 +702,7 @@ static int aesni_cbc_hmac_sha1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
size_t off = out - p;
unsigned int c, cmask;
- maxpad += SHA_DIGEST_LENGTH;
- for (res = 0, i = 0, j = 0; j < maxpad; j++) {
+ for (res = 0, i = 0, j = 0; j < maxpad + SHA_DIGEST_LENGTH; j++) {
c = p[j];
cmask =
((int)(j - off - SHA_DIGEST_LENGTH)) >> (sizeof(int) *
@@ -713,7 +712,6 @@ static int aesni_cbc_hmac_sha1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
res |= (c ^ pmac->c[i]) & cmask;
i += 1 & cmask;
}
- maxpad -= SHA_DIGEST_LENGTH;
res = 0 - ((0 - res) >> (sizeof(res) * 8 - 1));
ret &= (int)~res;
diff --git a/crypto/evp/e_aes_cbc_hmac_sha256.c b/crypto/evp/e_aes_cbc_hmac_sha256.c
index 6227002..906ec9f 100644
--- a/crypto/evp/e_aes_cbc_hmac_sha256.c
+++ b/crypto/evp/e_aes_cbc_hmac_sha256.c
@@ -706,8 +706,8 @@ static int aesni_cbc_hmac_sha256_cipher(EVP_CIPHER_CTX *ctx,
size_t off = out - p;
unsigned int c, cmask;
- maxpad += SHA256_DIGEST_LENGTH;
- for (res = 0, i = 0, j = 0; j < maxpad; j++) {
+ for (res = 0, i = 0, j = 0; j < maxpad + SHA256_DIGEST_LENGTH;
+ j++) {
c = p[j];
cmask =
((int)(j - off - SHA256_DIGEST_LENGTH)) >>
@@ -717,7 +717,6 @@ static int aesni_cbc_hmac_sha256_cipher(EVP_CIPHER_CTX *ctx,
res |= (c ^ pmac->c[i]) & cmask;
i += 1 & cmask;
}
- maxpad -= SHA256_DIGEST_LENGTH;
res = 0 - ((0 - res) >> (sizeof(res) * 8 - 1));
ret &= (int)~res;
diff --git a/crypto/store/store_result.c b/crypto/store/store_result.c
index 25100e0..e0c0532 100644
--- a/crypto/store/store_result.c
+++ b/crypto/store/store_result.c
@@ -366,8 +366,6 @@ static EVP_PKEY *try_key_value_legacy(struct extracted_param_data_st *data,
*store_info_new = OSSL_STORE_INFO_new_PKEY;
OPENSSL_free(new_der);
- der = data->octet_data;
- der_len = (long)data->octet_data_size;
}
CLEAR_ERR_MARK();
diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c
index d73e078..2da11ec 100644
--- a/crypto/x509/x509_vfy.c
+++ b/crypto/x509/x509_vfy.c
@@ -3303,7 +3303,7 @@ static int build_chain(X509_STORE_CTX *ctx)
x = xtmp;
++ctx->num_untrusted;
- self_signed = X509_self_signed(xtmp, 0);
+ self_signed = X509_self_signed(x, 0);
if (self_signed < 0) {
sk_X509_free(sktmp);
ctx->error = X509_V_ERR_UNSPECIFIED;
diff --git a/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_hw.c b/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_hw.c
index 5be237b..bd1c611 100644
--- a/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_hw.c
+++ b/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_hw.c
@@ -603,8 +603,7 @@ static int aesni_cbc_hmac_sha1_cipher(PROV_CIPHER_CTX *vctx,
size_t off = out - p;
unsigned int c, cmask;
- maxpad += SHA_DIGEST_LENGTH;
- for (res = 0, i = 0, j = 0; j < maxpad; j++) {
+ for (res = 0, i = 0, j = 0; j < maxpad + SHA_DIGEST_LENGTH; j++) {
c = p[j];
cmask =
((int)(j - off - SHA_DIGEST_LENGTH)) >> (sizeof(int) *
@@ -614,7 +613,6 @@ static int aesni_cbc_hmac_sha1_cipher(PROV_CIPHER_CTX *vctx,
res |= (c ^ pmac->c[i]) & cmask;
i += 1 & cmask;
}
- maxpad -= SHA_DIGEST_LENGTH;
res = 0 - ((0 - res) >> (sizeof(res) * 8 - 1));
ret &= (int)~res;
diff --git a/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_hw.c b/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_hw.c
index 03d06f8..7001dfc 100644
--- a/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_hw.c
+++ b/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_hw.c
@@ -655,8 +655,9 @@ static int aesni_cbc_hmac_sha256_cipher(PROV_CIPHER_CTX *vctx,
size_t off = out - p;
unsigned int c, cmask;
- maxpad += SHA256_DIGEST_LENGTH;
- for (res = 0, i = 0, j = 0; j < maxpad; j++) {
+ for (res = 0, i = 0, j = 0;
+ j < maxpad + SHA256_DIGEST_LENGTH;
+ j++) {
c = p[j];
cmask =
((int)(j - off - SHA256_DIGEST_LENGTH)) >>
@@ -666,7 +667,6 @@ static int aesni_cbc_hmac_sha256_cipher(PROV_CIPHER_CTX *vctx,
res |= (c ^ pmac->c[i]) & cmask;
i += 1 & cmask;
}
- maxpad -= SHA256_DIGEST_LENGTH;
res = 0 - ((0 - res) >> (sizeof(res) * 8 - 1));
ret &= (int)~res;