File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -451,6 +451,7 @@ static int crypto_ahash_init_tfm(struct crypto_tfm *tfm)
451
451
struct ahash_alg * alg = crypto_ahash_alg (hash );
452
452
453
453
hash -> setkey = ahash_nosetkey ;
454
+ hash -> has_setkey = false;
454
455
hash -> export = ahash_no_export ;
455
456
hash -> import = ahash_no_import ;
456
457
@@ -463,8 +464,10 @@ static int crypto_ahash_init_tfm(struct crypto_tfm *tfm)
463
464
hash -> finup = alg -> finup ?: ahash_def_finup ;
464
465
hash -> digest = alg -> digest ;
465
466
466
- if (alg -> setkey )
467
+ if (alg -> setkey ) {
467
468
hash -> setkey = alg -> setkey ;
469
+ hash -> has_setkey = true;
470
+ }
468
471
if (alg -> export )
469
472
hash -> export = alg -> export ;
470
473
if (alg -> import )
Original file line number Diff line number Diff line change @@ -355,8 +355,10 @@ int crypto_init_shash_ops_async(struct crypto_tfm *tfm)
355
355
crt -> finup = shash_async_finup ;
356
356
crt -> digest = shash_async_digest ;
357
357
358
- if (alg -> setkey )
358
+ if (alg -> setkey ) {
359
359
crt -> setkey = shash_async_setkey ;
360
+ crt -> has_setkey = true;
361
+ }
360
362
if (alg -> export )
361
363
crt -> export = shash_async_export ;
362
364
if (alg -> import )
Original file line number Diff line number Diff line change @@ -204,6 +204,7 @@ struct crypto_ahash {
204
204
unsigned int keylen );
205
205
206
206
unsigned int reqsize ;
207
+ bool has_setkey ;
207
208
struct crypto_tfm base ;
208
209
};
209
210
@@ -375,6 +376,11 @@ static inline void *ahash_request_ctx(struct ahash_request *req)
375
376
int crypto_ahash_setkey (struct crypto_ahash * tfm , const u8 * key ,
376
377
unsigned int keylen );
377
378
379
+ static inline bool crypto_ahash_has_setkey (struct crypto_ahash * tfm )
380
+ {
381
+ return tfm -> has_setkey ;
382
+ }
383
+
378
384
/**
379
385
* crypto_ahash_finup() - update and finalize message digest
380
386
* @req: reference to the ahash_request handle that holds all information
You can’t perform that action at this time.
0 commit comments