summaryrefslogtreecommitdiffstats
path: root/crypto/userspace/ncr-pk.c
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-07-31 00:53:54 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-07-31 00:53:54 +0200
commit2bc2319cbe2ec8ead62b816cc15ed155486f0ae0 (patch)
tree3c2336749da4cbb881ebe56903f9f026e17b4a4e /crypto/userspace/ncr-pk.c
parent682bdfb751e081a6633c78a2cf20e2d81a2ca03c (diff)
parent49d7012c4c62f6681378a56d9af4d721178b8ad3 (diff)
downloadkernel-crypto-2bc2319cbe2ec8ead62b816cc15ed155486f0ae0.tar.gz
kernel-crypto-2bc2319cbe2ec8ead62b816cc15ed155486f0ae0.tar.xz
kernel-crypto-2bc2319cbe2ec8ead62b816cc15ed155486f0ae0.zip
Merge branch 'standalone-rename' into userspace-crypto
Conflicts: crypto/userspace/ncr-int.h crypto/userspace/ncr-limits.c
Diffstat (limited to 'crypto/userspace/ncr-pk.c')
-rw-r--r--crypto/userspace/ncr-pk.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/userspace/ncr-pk.c b/crypto/userspace/ncr-pk.c
index 54a505fb77b..679860a8a1f 100644
--- a/crypto/userspace/ncr-pk.c
+++ b/crypto/userspace/ncr-pk.c
@@ -614,6 +614,10 @@ void * input, *output;
switch(ctx->algorithm->algo) {
case NCR_ALG_RSA:
+ if (ctx->sign_hash == NULL) {
+ err();
+ return -EINVAL;
+ }
cret = rsa_sign_hash_ex( input, isg_size, output, &osize,
ctx->type, ctx->sign_hash, ctx->salt_len, &ctx->key->key.pk.rsa);
if (cret != CRYPT_OK) {
@@ -674,6 +678,10 @@ uint8_t* sig;
switch(ctx->algorithm->algo) {
case NCR_ALG_RSA:
+ if (ctx->sign_hash == NULL) {
+ err();
+ return -EINVAL;
+ }
cret = rsa_verify_hash_ex( sig, sign_sg_size,
hash, hash_size, ctx->type, ctx->sign_hash,
ctx->salt_len, &stat, &ctx->key->key.pk.rsa);