summaryrefslogtreecommitdiffstats
path: root/examples/pk.c
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-08-25 00:28:25 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-08-25 00:28:25 +0200
commitd9c91873ac6dee10aeb7e165dee3aefc5f79bba8 (patch)
tree55cd455c5b6b8cc3a532a36bcd21b135425afda5 /examples/pk.c
parentcc60983067194a6e7bdc12c7771aeaff6762a253 (diff)
parent1ba66cab0563708d551e3462c249f1da21695882 (diff)
downloadcryptodev-linux-d9c91873ac6dee10aeb7e165dee3aefc5f79bba8.tar.gz
cryptodev-linux-d9c91873ac6dee10aeb7e165dee3aefc5f79bba8.tar.xz
cryptodev-linux-d9c91873ac6dee10aeb7e165dee3aefc5f79bba8.zip
Merge branch 'bugfixes' into nlattr
Conflicts: cryptodev_main.c examples/ncr.c examples/pk.c ncr-int.h ncr-key-wrap.c ncr-key.c ncr.c ncr.h
Diffstat (limited to 'examples/pk.c')
-rw-r--r--examples/pk.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/pk.c b/examples/pk.c
index 1db7aaf..1ad5873 100644
--- a/examples/pk.c
+++ b/examples/pk.c
@@ -626,6 +626,8 @@ test_ncr_wrap_key3(int cfd)
char wrap_algo[sizeof(NCR_WALG_AES_RFC5649)] ALIGN_NL;
struct nlattr algo_head ALIGN_NL;
char algo[sizeof(ALG_RSA)] ALIGN_NL;
+ struct nlattr type_head ALIGN_NL;
+ uint32_t type ALIGN_NL;
} kunwrap;
struct __attribute__((packed)) {
struct ncr_key_generate_pair f;
@@ -781,6 +783,10 @@ test_ncr_wrap_key3(int cfd)
= NLA_HDRLEN + sizeof(kunwrap.algo);
kunwrap.algo_head.nla_type = NCR_ATTR_ALGORITHM;
strcpy(kunwrap.algo, ALG_RSA);
+ kunwrap.type_head.nla_len
+ = NLA_HDRLEN + sizeof(kunwrap.type);
+ kunwrap.type_head.nla_type = NCR_ATTR_KEY_TYPE;
+ kunwrap.type = NCR_KEY_TYPE_PRIVATE;
ret = ioctl(cfd, NCRIO_KEY_UNWRAP, &kunwrap);
if (ret) {