aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2014-11-12 09:11:15 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2014-11-12 09:11:15 -0500
commit4c7912e9198b141b6cd85999d28b48cb5a037aa0 (patch)
tree901b2bc822976f6092fd06c709876e96d78bd50d /crypto
parentbdcf83b7831e41f666b50ee6cd946c733bbea1ef (diff)
parent206c5f60a3d902bc4b56dab2de3e88de5eb06108 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
Merging 3.18-rc4 in order to pick up the memzero_explicit helper.
Diffstat (limited to 'crypto')
-rw-r--r--crypto/cts.c3
-rw-r--r--crypto/sha1_generic.c2
-rw-r--r--crypto/sha256_generic.c5
-rw-r--r--crypto/sha512_generic.c2
-rw-r--r--crypto/tgr192.c4
-rw-r--r--crypto/vmac.c2
-rw-r--r--crypto/wp512.c8
7 files changed, 13 insertions, 13 deletions
diff --git a/crypto/cts.c b/crypto/cts.c
index 042223f8e733..133f0874c95e 100644
--- a/crypto/cts.c
+++ b/crypto/cts.c
@@ -202,7 +202,8 @@ static int cts_cbc_decrypt(struct crypto_cts_ctx *ctx,
202 /* 5. Append the tail (BB - Ln) bytes of Xn (tmp) to Cn to create En */ 202 /* 5. Append the tail (BB - Ln) bytes of Xn (tmp) to Cn to create En */
203 memcpy(s + bsize + lastn, tmp + lastn, bsize - lastn); 203 memcpy(s + bsize + lastn, tmp + lastn, bsize - lastn);
204 /* 6. Decrypt En to create Pn-1 */ 204 /* 6. Decrypt En to create Pn-1 */
205 memset(iv, 0, sizeof(iv)); 205 memzero_explicit(iv, sizeof(iv));
206
206 sg_set_buf(&sgsrc[0], s + bsize, bsize); 207 sg_set_buf(&sgsrc[0], s + bsize, bsize);
207 sg_set_buf(&sgdst[0], d, bsize); 208 sg_set_buf(&sgdst[0], d, bsize);
208 err = crypto_blkcipher_decrypt_iv(&lcldesc, sgdst, sgsrc, bsize); 209 err = crypto_blkcipher_decrypt_iv(&lcldesc, sgdst, sgsrc, bsize);
diff --git a/crypto/sha1_generic.c b/crypto/sha1_generic.c
index 42794803c480..7bb047432782 100644
--- a/crypto/sha1_generic.c
+++ b/crypto/sha1_generic.c
@@ -64,7 +64,7 @@ int crypto_sha1_update(struct shash_desc *desc, const u8 *data,
64 src = data + done; 64 src = data + done;
65 } while (done + SHA1_BLOCK_SIZE <= len); 65 } while (done + SHA1_BLOCK_SIZE <= len);
66 66
67 memset(temp, 0, sizeof(temp)); 67 memzero_explicit(temp, sizeof(temp));
68 partial = 0; 68 partial = 0;
69 } 69 }
70 memcpy(sctx->buffer + partial, src, len - done); 70 memcpy(sctx->buffer + partial, src, len - done);
diff --git a/crypto/sha256_generic.c b/crypto/sha256_generic.c
index 0bb558344699..65e7b76b057f 100644
--- a/crypto/sha256_generic.c
+++ b/crypto/sha256_generic.c
@@ -211,10 +211,9 @@ static void sha256_transform(u32 *state, const u8 *input)
211 211
212 /* clear any sensitive info... */ 212 /* clear any sensitive info... */
213 a = b = c = d = e = f = g = h = t1 = t2 = 0; 213 a = b = c = d = e = f = g = h = t1 = t2 = 0;
214 memset(W, 0, 64 * sizeof(u32)); 214 memzero_explicit(W, 64 * sizeof(u32));
215} 215}
216 216
217
218static int sha224_init(struct shash_desc *desc) 217static int sha224_init(struct shash_desc *desc)
219{ 218{
220 struct sha256_state *sctx = shash_desc_ctx(desc); 219 struct sha256_state *sctx = shash_desc_ctx(desc);
@@ -317,7 +316,7 @@ static int sha224_final(struct shash_desc *desc, u8 *hash)
317 sha256_final(desc, D); 316 sha256_final(desc, D);
318 317
319 memcpy(hash, D, SHA224_DIGEST_SIZE); 318 memcpy(hash, D, SHA224_DIGEST_SIZE);
320 memset(D, 0, SHA256_DIGEST_SIZE); 319 memzero_explicit(D, SHA256_DIGEST_SIZE);
321 320
322 return 0; 321 return 0;
323} 322}
diff --git a/crypto/sha512_generic.c b/crypto/sha512_generic.c
index 6dde57dc511b..95db67197cd9 100644
--- a/crypto/sha512_generic.c
+++ b/crypto/sha512_generic.c
@@ -239,7 +239,7 @@ static int sha384_final(struct shash_desc *desc, u8 *hash)
239 sha512_final(desc, D); 239 sha512_final(desc, D);
240 240
241 memcpy(hash, D, 48); 241 memcpy(hash, D, 48);
242 memset(D, 0, 64); 242 memzero_explicit(D, 64);
243 243
244 return 0; 244 return 0;
245} 245}
diff --git a/crypto/tgr192.c b/crypto/tgr192.c
index 87403556fd0b..3c7af0d1ff7a 100644
--- a/crypto/tgr192.c
+++ b/crypto/tgr192.c
@@ -612,7 +612,7 @@ static int tgr160_final(struct shash_desc *desc, u8 * out)
612 612
613 tgr192_final(desc, D); 613 tgr192_final(desc, D);
614 memcpy(out, D, TGR160_DIGEST_SIZE); 614 memcpy(out, D, TGR160_DIGEST_SIZE);
615 memset(D, 0, TGR192_DIGEST_SIZE); 615 memzero_explicit(D, TGR192_DIGEST_SIZE);
616 616
617 return 0; 617 return 0;
618} 618}
@@ -623,7 +623,7 @@ static int tgr128_final(struct shash_desc *desc, u8 * out)
623 623
624 tgr192_final(desc, D); 624 tgr192_final(desc, D);
625 memcpy(out, D, TGR128_DIGEST_SIZE); 625 memcpy(out, D, TGR128_DIGEST_SIZE);
626 memset(D, 0, TGR192_DIGEST_SIZE); 626 memzero_explicit(D, TGR192_DIGEST_SIZE);
627 627
628 return 0; 628 return 0;
629} 629}
diff --git a/crypto/vmac.c b/crypto/vmac.c
index 2eb11a30c29c..d84c24bd7ff7 100644
--- a/crypto/vmac.c
+++ b/crypto/vmac.c
@@ -613,7 +613,7 @@ static int vmac_final(struct shash_desc *pdesc, u8 *out)
613 } 613 }
614 mac = vmac(ctx->partial, ctx->partial_size, nonce, NULL, ctx); 614 mac = vmac(ctx->partial, ctx->partial_size, nonce, NULL, ctx);
615 memcpy(out, &mac, sizeof(vmac_t)); 615 memcpy(out, &mac, sizeof(vmac_t));
616 memset(&mac, 0, sizeof(vmac_t)); 616 memzero_explicit(&mac, sizeof(vmac_t));
617 memset(&ctx->__vmac_ctx, 0, sizeof(struct vmac_ctx)); 617 memset(&ctx->__vmac_ctx, 0, sizeof(struct vmac_ctx));
618 ctx->partial_size = 0; 618 ctx->partial_size = 0;
619 return 0; 619 return 0;
diff --git a/crypto/wp512.c b/crypto/wp512.c
index 180f1d6e03f4..ec64e7762fbb 100644
--- a/crypto/wp512.c
+++ b/crypto/wp512.c
@@ -1102,8 +1102,8 @@ static int wp384_final(struct shash_desc *desc, u8 *out)
1102 u8 D[64]; 1102 u8 D[64];
1103 1103
1104 wp512_final(desc, D); 1104 wp512_final(desc, D);
1105 memcpy (out, D, WP384_DIGEST_SIZE); 1105 memcpy(out, D, WP384_DIGEST_SIZE);
1106 memset (D, 0, WP512_DIGEST_SIZE); 1106 memzero_explicit(D, WP512_DIGEST_SIZE);
1107 1107
1108 return 0; 1108 return 0;
1109} 1109}
@@ -1113,8 +1113,8 @@ static int wp256_final(struct shash_desc *desc, u8 *out)
1113 u8 D[64]; 1113 u8 D[64];
1114 1114
1115 wp512_final(desc, D); 1115 wp512_final(desc, D);
1116 memcpy (out, D, WP256_DIGEST_SIZE); 1116 memcpy(out, D, WP256_DIGEST_SIZE);
1117 memset (D, 0, WP512_DIGEST_SIZE); 1117 memzero_explicit(D, WP512_DIGEST_SIZE);
1118 1118
1119 return 0; 1119 return 0;
1120} 1120}