summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-08-06 01:26:17 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-08-23 20:01:59 +0200
commit1f6b4a82c825f253c94e74fe0969bf27c6598ac2 (patch)
tree036ce5235ee5b66637add2479ee0b2ddfa72599a
parent7f0366558145a1bcdd5e877d7e5e25e246e01a37 (diff)
downloadcryptodev-linux-1f6b4a82c825f253c94e74fe0969bf27c6598ac2.tar.gz
cryptodev-linux-1f6b4a82c825f253c94e74fe0969bf27c6598ac2.tar.xz
cryptodev-linux-1f6b4a82c825f253c94e74fe0969bf27c6598ac2.zip
Allow empty id_size
The ids are not really used for anything so far
-rw-r--r--userspace/ncrypto_key.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/userspace/ncrypto_key.c b/userspace/ncrypto_key.c
index 758ff6f..6d9548d 100644
--- a/userspace/ncrypto_key.c
+++ b/userspace/ncrypto_key.c
@@ -210,7 +210,7 @@ ncr_key_import(ncr_key_t key, void *idata, size_t idata_size, void *id, size_t i
struct ncr_key_data_st io;
memset(&io, 0, sizeof(io));
- if (key == NCR_KEY_INVALID || !idata || !idata_size || !id || !id_size || algorithm == NCR_ALG_NONE) {
+ if (key == NCR_KEY_INVALID || !idata || !idata_size || (!id && id_size != 0) || algorithm == NCR_ALG_NONE) {
errno = EINVAL;
return -1;
}