]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
remove unused assignments
authorPauli <paul.dale@oracle.com>
Tue, 1 Dec 2020 01:13:08 +0000 (11:13 +1000)
committerPauli <paul.dale@oracle.com>
Thu, 3 Dec 2020 01:21:33 +0000 (11:21 +1000)
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13577)

crypto/asn1/asn1_par.c
crypto/asn1/tasn_dec.c
crypto/bio/b_print.c
crypto/bn/bn_exp.c
crypto/evp/e_aes_cbc_hmac_sha1.c
crypto/evp/e_aes_cbc_hmac_sha256.c
crypto/store/store_result.c
crypto/x509/x509_vfy.c
providers/implementations/ciphers/cipher_aes_cbc_hmac_sha1_hw.c
providers/implementations/ciphers/cipher_aes_cbc_hmac_sha256_hw.c

index b2a1b3a27de3e46d992512dd0189e932802d05e0..cf6d48ce101e6fbfa7e854a61d6c87206db46a2e 100644 (file)
@@ -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;
 }
index 3fbf168558bd9e040a36f4605cf0c20b0694e8e2..09adbf5d0747c982bf7469316c783ff5eaedf4f8 100644 (file)
@@ -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
index 8192534ef20bf0c9b701cea43745833058a0f1d1..08d43d3bd5f711d4cffc3dcf42ecd9c4c01961e5 100644 (file)
@@ -328,7 +328,7 @@ _dopr(char **sbuffer,
                 break;
             case 'w':
                 /* not supported yet, treat as next char */
-                ch = *format++;
+                format++;
                 break;
             default:
                 /* unknown, skip */
index 15e085339b954ffdb77d4e28f5bb9e40937a2fd7..1254415a439674bac6165fbcc1c897e15499cf09 100644 (file)
@@ -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++) {
index f787d014d272c9a52c21fc3911e7d37467e3a644..cdf5985e8bc857a37321405faebb62fe3d25f7ad 100644 (file)
@@ -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;
index 622700239519a7f09abcb1e019dc880fbe4806cf..906ec9f7fc5a638429bad25c164d6af0b410185b 100644 (file)
@@ -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;
index 25100e0248c71f8dc4afe339914c2abd5077aca6..e0c05321529433bfecd458f79717043fa15da146 100644 (file)
@@ -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();
 
index d73e078cfe2aa9b63b2253ddcefbf5aff2f8d351..2da11ecf9d977c975b20f2898059a2cfa7739e2d 100644 (file)
@@ -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;
index 5be237b4855391b347e91c0d065301b2df53d61e..bd1c611b425a4cf2ea46a4dabf8cdca2d80de7ba 100644 (file)
@@ -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;
index 03d06f8870f33c22a71a74fbb2bc4a099d0945d7..7001dfcd1cdfeb208bc6a2e4aa85406842becb99 100644 (file)
@@ -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;