diff options
author | Miloslav Trmač <mitr@redhat.com> | 2010-08-11 17:46:44 +0200 |
---|---|---|
committer | Miloslav Trmač <mitr@redhat.com> | 2010-08-24 22:51:37 +0200 |
commit | 491fc6dd6fff9b4d9676e03189ae76538184b51d (patch) | |
tree | 8281350eddfda38c245a5983f9594f35a6476365 /examples/ncr.c | |
parent | dbb2f11a32cdde060798c14cdac33f95e22f39bb (diff) | |
download | kernel-crypto-491fc6dd6fff9b4d9676e03189ae76538184b51d.tar.gz kernel-crypto-491fc6dd6fff9b4d9676e03189ae76538184b51d.tar.xz kernel-crypto-491fc6dd6fff9b4d9676e03189ae76538184b51d.zip |
Convert *_KEY_INIT
Diffstat (limited to 'examples/ncr.c')
-rw-r--r-- | examples/ncr.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/examples/ncr.c b/examples/ncr.c index 5169a149e31..8b3320662ea 100644 --- a/examples/ncr.c +++ b/examples/ncr.c @@ -51,7 +51,8 @@ test_ncr_key(int cfd) memcpy(data_bak, data, sizeof(data)); /* convert it to key */ - if (ioctl(cfd, NCRIO_KEY_INIT, &key)) { + key = ioctl(cfd, NCRIO_KEY_INIT); + if (key == -1) { perror("ioctl(NCRIO_KEY_INIT)"); return 1; } @@ -112,7 +113,8 @@ test_ncr_key(int cfd) fprintf(stdout, "\tKey import...\n"); /* convert it to key */ - if (ioctl(cfd, NCRIO_KEY_INIT, &key)) { + key = ioctl(cfd, NCRIO_KEY_INIT); + if (key == -1) { fprintf(stderr, "Error: %s:%d\n", __func__, __LINE__); perror("ioctl(NCRIO_KEY_INIT)"); return 1; @@ -162,7 +164,8 @@ test_ncr_key(int cfd) * try to export it. */ fprintf(stdout, "\tKey protection of non-exportable keys...\n"); - if (ioctl(cfd, NCRIO_KEY_INIT, &key)) { + key = ioctl(cfd, NCRIO_KEY_INIT); + if (key == -1) { fprintf(stderr, "Error: %s:%d\n", __func__, __LINE__); perror("ioctl(NCRIO_KEY_INIT)"); return 1; @@ -224,7 +227,8 @@ test_ncr_wrap_key(int cfd) fprintf(stdout, "\tKey Wrap test...\n"); /* convert it to key */ - if (ioctl(cfd, NCRIO_KEY_INIT, &key)) { + key = ioctl(cfd, NCRIO_KEY_INIT); + if (key == -1) { perror("ioctl(NCRIO_KEY_INIT)"); return 1; } @@ -248,7 +252,8 @@ test_ncr_wrap_key(int cfd) /* convert it to key */ - if (ioctl(cfd, NCRIO_KEY_INIT, &key2)) { + key2 = ioctl(cfd, NCRIO_KEY_INIT); + if (key2 == -1) { perror("ioctl(NCRIO_KEY_INIT)"); return 1; } @@ -315,7 +320,8 @@ test_ncr_wrap_key(int cfd) return 1; } - if (ioctl(cfd, NCRIO_KEY_INIT, &key2)) { + key2 = ioctl(cfd, NCRIO_KEY_INIT); + if (key2 == -1) { perror("ioctl(NCRIO_KEY_INIT)"); return 1; } @@ -474,7 +480,8 @@ test_ncr_store_wrap_key(int cfd) fprintf(stdout, "\tKey Storage wrap test...\n"); /* convert it to key */ - if (ioctl(cfd, NCRIO_KEY_INIT, &key2)) { + key2 = ioctl(cfd, NCRIO_KEY_INIT); + if (key2 == -1) { perror("ioctl(NCRIO_KEY_INIT)"); return 1; } @@ -520,7 +527,8 @@ test_ncr_store_wrap_key(int cfd) return 1; } - if (ioctl(cfd, NCRIO_KEY_INIT, &key2)) { + key2 = ioctl(cfd, NCRIO_KEY_INIT); + if (key2 == -1) { fprintf(stderr, "Error: %s:%d\n", __func__, __LINE__); perror("ioctl(NCRIO_KEY_INIT)"); return 1; @@ -608,7 +616,8 @@ test_ncr_aes(int cfd) int data_size; /* convert it to key */ - if (ioctl(cfd, NCRIO_KEY_INIT, &key)) { + key = ioctl(cfd, NCRIO_KEY_INIT); + if (key == -1) { perror("ioctl(NCRIO_KEY_INIT)"); return 1; } @@ -816,7 +825,8 @@ test_ncr_hash(int cfd) struct ncr_session_once_op_st nop; /* convert it to key */ - if (ioctl(cfd, NCRIO_KEY_INIT, &key)) { + key = ioctl(cfd, NCRIO_KEY_INIT); + if (key == -1) { perror("ioctl(NCRIO_KEY_INIT)"); return 1; } @@ -902,7 +912,8 @@ test_ncr_hash_key(int cfd) const uint8_t *output = (void*)"\xe2\xd7\x2c\x2e\x14\xad\x97\xc8\xd2\xdb\xce\xd8\xb3\x52\x9f\x1c\xb3\x2c\x5c\xec"; /* convert it to key */ - if (ioctl(cfd, NCRIO_KEY_INIT, &key)) { + key = ioctl(cfd, NCRIO_KEY_INIT); + if (key == -1) { perror("ioctl(NCRIO_KEY_INIT)"); return 1; } |