Commit 1afe593b authored by Herbert Xu's avatar Herbert Xu

rxrpc: Use skcipher

This patch replaces uses of blkcipher with skcipher.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 96953718
...@@ -252,7 +252,7 @@ struct rxrpc_connection { ...@@ -252,7 +252,7 @@ struct rxrpc_connection {
struct rxrpc_security *security; /* applied security module */ struct rxrpc_security *security; /* applied security module */
struct key *key; /* security for this connection (client) */ struct key *key; /* security for this connection (client) */
struct key *server_key; /* security for this service */ struct key *server_key; /* security for this service */
struct crypto_blkcipher *cipher; /* encryption handle */ struct crypto_skcipher *cipher; /* encryption handle */
struct rxrpc_crypt csum_iv; /* packet checksum base */ struct rxrpc_crypt csum_iv; /* packet checksum base */
unsigned long events; unsigned long events;
#define RXRPC_CONN_CHALLENGE 0 /* send challenge packet */ #define RXRPC_CONN_CHALLENGE 0 /* send challenge packet */
......
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
* "afs@CAMBRIDGE.REDHAT.COM> * "afs@CAMBRIDGE.REDHAT.COM>
*/ */
#include <crypto/skcipher.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/net.h> #include <linux/net.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include <linux/key-type.h> #include <linux/key-type.h>
#include <linux/crypto.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <net/sock.h> #include <net/sock.h>
...@@ -824,7 +824,7 @@ static void rxrpc_free_preparse(struct key_preparsed_payload *prep) ...@@ -824,7 +824,7 @@ static void rxrpc_free_preparse(struct key_preparsed_payload *prep)
*/ */
static int rxrpc_preparse_s(struct key_preparsed_payload *prep) static int rxrpc_preparse_s(struct key_preparsed_payload *prep)
{ {
struct crypto_blkcipher *ci; struct crypto_skcipher *ci;
_enter("%zu", prep->datalen); _enter("%zu", prep->datalen);
...@@ -833,13 +833,13 @@ static int rxrpc_preparse_s(struct key_preparsed_payload *prep) ...@@ -833,13 +833,13 @@ static int rxrpc_preparse_s(struct key_preparsed_payload *prep)
memcpy(&prep->payload.data[2], prep->data, 8); memcpy(&prep->payload.data[2], prep->data, 8);
ci = crypto_alloc_blkcipher("pcbc(des)", 0, CRYPTO_ALG_ASYNC); ci = crypto_alloc_skcipher("pcbc(des)", 0, CRYPTO_ALG_ASYNC);
if (IS_ERR(ci)) { if (IS_ERR(ci)) {
_leave(" = %ld", PTR_ERR(ci)); _leave(" = %ld", PTR_ERR(ci));
return PTR_ERR(ci); return PTR_ERR(ci);
} }
if (crypto_blkcipher_setkey(ci, prep->data, 8) < 0) if (crypto_skcipher_setkey(ci, prep->data, 8) < 0)
BUG(); BUG();
prep->payload.data[0] = ci; prep->payload.data[0] = ci;
...@@ -853,7 +853,7 @@ static int rxrpc_preparse_s(struct key_preparsed_payload *prep) ...@@ -853,7 +853,7 @@ static int rxrpc_preparse_s(struct key_preparsed_payload *prep)
static void rxrpc_free_preparse_s(struct key_preparsed_payload *prep) static void rxrpc_free_preparse_s(struct key_preparsed_payload *prep)
{ {
if (prep->payload.data[0]) if (prep->payload.data[0])
crypto_free_blkcipher(prep->payload.data[0]); crypto_free_skcipher(prep->payload.data[0]);
} }
/* /*
...@@ -870,7 +870,7 @@ static void rxrpc_destroy(struct key *key) ...@@ -870,7 +870,7 @@ static void rxrpc_destroy(struct key *key)
static void rxrpc_destroy_s(struct key *key) static void rxrpc_destroy_s(struct key *key)
{ {
if (key->payload.data[0]) { if (key->payload.data[0]) {
crypto_free_blkcipher(key->payload.data[0]); crypto_free_skcipher(key->payload.data[0]);
key->payload.data[0] = NULL; key->payload.data[0] = NULL;
} }
} }
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment