summaryrefslogtreecommitdiffstats
path: root/ncr-pk.c
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-07-24 04:30:14 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-07-24 04:30:14 +0200
commitd750b60952619af570ac4d91cd650ffa6bbe311d (patch)
tree894b9abfd9eaaa8e241994136c06700a38fcd991 /ncr-pk.c
parent6c29ce243f2d106648d93bc3cf44060db38fdf9a (diff)
downloadkernel-crypto-d750b60952619af570ac4d91cd650ffa6bbe311d.tar.gz
kernel-crypto-d750b60952619af570ac4d91cd650ffa6bbe311d.tar.xz
kernel-crypto-d750b60952619af570ac4d91cd650ffa6bbe311d.zip
Only look up the sign_hash algorithm once
Diffstat (limited to 'ncr-pk.c')
-rw-r--r--ncr-pk.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/ncr-pk.c b/ncr-pk.c
index 0837d4cacd0..bfe575d937e 100644
--- a/ncr-pk.c
+++ b/ncr-pk.c
@@ -335,7 +335,7 @@ void ncr_pk_cipher_deinit(struct ncr_pk_ctx* ctx)
int ncr_pk_cipher_init(const struct algo_properties_st *algo,
struct ncr_pk_ctx* ctx, struct ncr_key_params_st* params,
- struct key_item_st *key)
+ struct key_item_st *key, const struct algo_properties_st *sign_hash)
{
memset(ctx, 0, sizeof(*ctx));
@@ -346,11 +346,7 @@ int ncr_pk_cipher_init(const struct algo_properties_st *algo,
ctx->algorithm = algo;
ctx->key = key;
- ctx->sign_hash = ncr_key_params_get_sign_hash(algo, params);
- if (IS_ERR(ctx->sign_hash)) {
- err();
- return PTR_ERR(ctx->sign_hash);
- }
+ ctx->sign_hash = sign_hash;
switch(algo->algo) {
case NCR_ALG_RSA: