diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-08-21 10:11:16 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-08-31 22:38:33 +0200 |
commit | 5ec36e6f84f80cc24a17dcbd468bd11d6a3e16cd (patch) | |
tree | 8fbac167018f0eabced2927edb6d0311a40a724b | |
parent | dd5317620d70e6b438e40370163257e47ca385a3 (diff) | |
download | cryptodev-linux-5ec36e6f84f80cc24a17dcbd468bd11d6a3e16cd.tar.gz cryptodev-linux-5ec36e6f84f80cc24a17dcbd468bd11d6a3e16cd.tar.xz cryptodev-linux-5ec36e6f84f80cc24a17dcbd468bd11d6a3e16cd.zip |
Prevent usage of wrapping keys for anything else except wrapping.
-rw-r--r-- | ncr-sessions.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ncr-sessions.c b/ncr-sessions.c index c65db2f..f7e5777 100644 --- a/ncr-sessions.c +++ b/ncr-sessions.c @@ -537,6 +537,14 @@ static struct session_item_st *_ncr_session_init(struct ncr_lists *lists, goto fail; } + /* wrapping keys cannot be used for anything except wrapping. + */ + if (ns->key->flags & NCR_KEY_FLAG_WRAPPING) { + err(); + ret = -EINVAL; + goto fail; + } + if (ns->algorithm->is_hmac && ns->key->type == NCR_KEY_TYPE_SECRET) { if (ns->algorithm->is_pk) { err(); |