diff options
author | Miloslav Trmač <mitr@redhat.com> | 2010-08-06 01:26:17 +0200 |
---|---|---|
committer | Miloslav Trmač <mitr@redhat.com> | 2010-08-24 20:58:31 +0200 |
commit | f51d3e8a57786198b301acbe02ca521e1fbb050c (patch) | |
tree | 8076159f4cc14a21a3095205081feace9db535e1 | |
parent | 750e7a6282a4eaf58b5309ece1caedb238d44853 (diff) | |
download | cryptodev-linux-f51d3e8a57786198b301acbe02ca521e1fbb050c.tar.gz cryptodev-linux-f51d3e8a57786198b301acbe02ca521e1fbb050c.tar.xz cryptodev-linux-f51d3e8a57786198b301acbe02ca521e1fbb050c.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; } |