diff options
author | Miloslav Trmač <mitr@redhat.com> | 2010-08-06 01:26:17 +0200 |
---|---|---|
committer | Miloslav Trmač <mitr@redhat.com> | 2010-08-23 20:01:59 +0200 |
commit | 1f6b4a82c825f253c94e74fe0969bf27c6598ac2 (patch) | |
tree | 036ce5235ee5b66637add2479ee0b2ddfa72599a | |
parent | 7f0366558145a1bcdd5e877d7e5e25e246e01a37 (diff) | |
download | cryptodev-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.c | 2 |
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; } |