File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,20 @@ static int hmac_init_tfm(struct crypto_shash *parent)
160160 return 0 ;
161161}
162162
163+ static int hmac_clone_tfm (struct crypto_shash * dst , struct crypto_shash * src )
164+ {
165+ struct hmac_ctx * sctx = hmac_ctx (src );
166+ struct hmac_ctx * dctx = hmac_ctx (dst );
167+ struct crypto_shash * hash ;
168+
169+ hash = crypto_clone_shash (sctx -> hash );
170+ if (IS_ERR (hash ))
171+ return PTR_ERR (hash );
172+
173+ dctx -> hash = hash ;
174+ return 0 ;
175+ }
176+
163177static void hmac_exit_tfm (struct crypto_shash * parent )
164178{
165179 struct hmac_ctx * ctx = hmac_ctx (parent );
@@ -227,6 +241,7 @@ static int hmac_create(struct crypto_template *tmpl, struct rtattr **tb)
227241 inst -> alg .import = hmac_import ;
228242 inst -> alg .setkey = hmac_setkey ;
229243 inst -> alg .init_tfm = hmac_init_tfm ;
244+ inst -> alg .clone_tfm = hmac_clone_tfm ;
230245 inst -> alg .exit_tfm = hmac_exit_tfm ;
231246
232247 inst -> free = shash_free_singlespawn_instance ;
You can’t perform that action at this time.
0 commit comments