summaryrefslogtreecommitdiffstats
path: root/ncr-pk.c
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-07-24 01:44:19 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-07-24 04:21:07 +0200
commit10d1f115ffc8ea9cb03c4685a0a1b18850ae4feb (patch)
tree20213b481c11e263cfe80bbf22b6b5daaef98c94 /ncr-pk.c
parent785cc374c65b2e206db4e38d686dfede50fdb9f5 (diff)
downloadkernel-crypto-10d1f115ffc8ea9cb03c4685a0a1b18850ae4feb.tar.gz
kernel-crypto-10d1f115ffc8ea9cb03c4685a0a1b18850ae4feb.tar.xz
kernel-crypto-10d1f115ffc8ea9cb03c4685a0a1b18850ae4feb.zip
Use algo_properties_st in ncr_pk_ctx.sign_hash
Diffstat (limited to 'ncr-pk.c')
-rw-r--r--ncr-pk.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/ncr-pk.c b/ncr-pk.c
index 0f9ca53e484..78a9030529f 100644
--- a/ncr-pk.c
+++ b/ncr-pk.c
@@ -349,7 +349,7 @@ int ret;
err();
return ret;
}
- ctx->sign_hash = ret;
+ ctx->sign_hash = _ncr_algo_to_properties(ret);
switch(algo->algo) {
case NCR_ALG_RSA:
@@ -448,8 +448,12 @@ unsigned long osize = *output_size;
switch(ctx->algorithm->algo) {
case NCR_ALG_RSA:
+ if (ctx->sign_hash == NULL) {
+ err();
+ return -EINVAL;
+ }
cret = rsa_sign_hash_ex( input, input_size, output, &osize,
- ctx->type, ctx->sign_hash, ctx->salt_len, &ctx->key->key.pk.rsa);
+ ctx->type, ctx->sign_hash->algo, ctx->salt_len, &ctx->key->key.pk.rsa);
if (cret != CRYPT_OK) {
err();
@@ -484,8 +488,12 @@ int stat;
switch(ctx->algorithm->algo) {
case NCR_ALG_RSA:
+ if (ctx->sign_hash == NULL) {
+ err();
+ return -EINVAL;
+ }
cret = rsa_verify_hash_ex( signature, signature_size,
- hash, hash_size, ctx->type, ctx->sign_hash,
+ hash, hash_size, ctx->type, ctx->sign_hash->algo,
ctx->salt_len, &stat, &ctx->key->key.pk.rsa);
if (cret != CRYPT_OK) {