Commit 489b24f2cbdcc1c93f55a2707733bba702ba8dbf

Authored by Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  random: Remove unused inode variable
  crypto: padlock-sha - Add import/export support
  random: drop weird m_time/a_time manipulation

Showing 2 changed files Side-by-side Diff

drivers/char/random.c
... ... @@ -1051,12 +1051,6 @@
1051 1051 /* like a named pipe */
1052 1052 }
1053 1053  
1054   - /*
1055   - * If we gave the user some bytes, update the access time.
1056   - */
1057   - if (count)
1058   - file_accessed(file);
1059   -
1060 1054 return (count ? count : retval);
1061 1055 }
1062 1056  
... ... @@ -1107,7 +1101,6 @@
1107 1101 size_t count, loff_t *ppos)
1108 1102 {
1109 1103 size_t ret;
1110   - struct inode *inode = file->f_path.dentry->d_inode;
1111 1104  
1112 1105 ret = write_pool(&blocking_pool, buffer, count);
1113 1106 if (ret)
... ... @@ -1116,8 +1109,6 @@
1116 1109 if (ret)
1117 1110 return ret;
1118 1111  
1119   - inode->i_mtime = current_fs_time(inode->i_sb);
1120   - mark_inode_dirty(inode);
1121 1112 return (ssize_t)count;
1122 1113 }
1123 1114  
drivers/crypto/padlock-sha.c
... ... @@ -57,6 +57,23 @@
57 57 return crypto_shash_update(&dctx->fallback, data, length);
58 58 }
59 59  
  60 +static int padlock_sha_export(struct shash_desc *desc, void *out)
  61 +{
  62 + struct padlock_sha_desc *dctx = shash_desc_ctx(desc);
  63 +
  64 + return crypto_shash_export(&dctx->fallback, out);
  65 +}
  66 +
  67 +static int padlock_sha_import(struct shash_desc *desc, const void *in)
  68 +{
  69 + struct padlock_sha_desc *dctx = shash_desc_ctx(desc);
  70 + struct padlock_sha_ctx *ctx = crypto_shash_ctx(desc->tfm);
  71 +
  72 + dctx->fallback.tfm = ctx->fallback;
  73 + dctx->fallback.flags = desc->flags & CRYPTO_TFM_REQ_MAY_SLEEP;
  74 + return crypto_shash_import(&dctx->fallback, in);
  75 +}
  76 +
60 77 static inline void padlock_output_block(uint32_t *src,
61 78 uint32_t *dst, size_t count)
62 79 {
63 80  
... ... @@ -235,7 +252,10 @@
235 252 .update = padlock_sha_update,
236 253 .finup = padlock_sha1_finup,
237 254 .final = padlock_sha1_final,
  255 + .export = padlock_sha_export,
  256 + .import = padlock_sha_import,
238 257 .descsize = sizeof(struct padlock_sha_desc),
  258 + .statesize = sizeof(struct sha1_state),
239 259 .base = {
240 260 .cra_name = "sha1",
241 261 .cra_driver_name = "sha1-padlock",
242 262  
... ... @@ -256,7 +276,10 @@
256 276 .update = padlock_sha_update,
257 277 .finup = padlock_sha256_finup,
258 278 .final = padlock_sha256_final,
  279 + .export = padlock_sha_export,
  280 + .import = padlock_sha_import,
259 281 .descsize = sizeof(struct padlock_sha_desc),
  282 + .statesize = sizeof(struct sha256_state),
260 283 .base = {
261 284 .cra_name = "sha256",
262 285 .cra_driver_name = "sha256-padlock",