summaryrefslogtreecommitdiffstats
path: root/example-cipher.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-02-19 17:18:56 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-02-19 17:18:56 +0100
commitfe14a65cbd856408ae57e617190c994dae85d5f5 (patch)
tree3de6c451c32cf33014aa69d16f1abb50731aaced /example-cipher.c
parent12883105566c38cf0b0ccd2a258311435283a97b (diff)
downloadcryptodev-linux-fe14a65cbd856408ae57e617190c994dae85d5f5.tar.gz
cryptodev-linux-fe14a65cbd856408ae57e617190c994dae85d5f5.tar.xz
cryptodev-linux-fe14a65cbd856408ae57e617190c994dae85d5f5.zip
Corrected example
Diffstat (limited to 'example-cipher.c')
-rw-r--r--example-cipher.c8
1 files changed, 8 insertions, 0 deletions
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)");