From fe14a65cbd856408ae57e617190c994dae85d5f5 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Fri, 19 Feb 2010 17:18:56 +0100 Subject: [PATCH] Corrected example --- example-cipher.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/example-cipher.c b/example-cipher.c index c6aa55d..500d773 100644 --- a/example-cipher.c +++ b/example-cipher.c @@ -54,10 +54,18 @@ test_crypto(int cfd) perror("ioctl(CIOCCRYPT)"); return 1; } + + if (ioctl(cfd, CIOCGSESSION, &sess)) { + perror("ioctl(CIOCGSESSION)"); + return 1; + } /* Decrypt data.encrypted to data.decrypted */ + cryp.ses = sess.ses; + cryp.len = sizeof(plaintext); cryp.src = ciphertext; cryp.dst = ciphertext; + cryp.iv = iv; cryp.op = COP_DECRYPT; if (ioctl(cfd, CIOCCRYPT, &cryp)) { perror("ioctl(CIOCCRYPT)"); -- 2.11.4.GIT