Skip to content

Commit 3b5cf20

Browse files
committed
sunrpc: Use skcipher and ahash/shash
This patch replaces uses of blkcipher with skcipher and the long obsolete hash interface with either shash (for non-SG users) and ahash. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 2731a94 commit 3b5cf20

File tree

6 files changed

+306
-223
lines changed

6 files changed

+306
-223
lines changed

include/linux/sunrpc/gss_krb5.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
*
3737
*/
3838

39-
#include <linux/crypto.h>
39+
#include <crypto/skcipher.h>
4040
#include <linux/sunrpc/auth_gss.h>
4141
#include <linux/sunrpc/gss_err.h>
4242
#include <linux/sunrpc/gss_asn1.h>
@@ -71,10 +71,10 @@ struct gss_krb5_enctype {
7171
const u32 keyed_cksum; /* is it a keyed cksum? */
7272
const u32 keybytes; /* raw key len, in bytes */
7373
const u32 keylength; /* final key len, in bytes */
74-
u32 (*encrypt) (struct crypto_blkcipher *tfm,
74+
u32 (*encrypt) (struct crypto_skcipher *tfm,
7575
void *iv, void *in, void *out,
7676
int length); /* encryption function */
77-
u32 (*decrypt) (struct crypto_blkcipher *tfm,
77+
u32 (*decrypt) (struct crypto_skcipher *tfm,
7878
void *iv, void *in, void *out,
7979
int length); /* decryption function */
8080
u32 (*mk_key) (const struct gss_krb5_enctype *gk5e,
@@ -98,12 +98,12 @@ struct krb5_ctx {
9898
u32 enctype;
9999
u32 flags;
100100
const struct gss_krb5_enctype *gk5e; /* enctype-specific info */
101-
struct crypto_blkcipher *enc;
102-
struct crypto_blkcipher *seq;
103-
struct crypto_blkcipher *acceptor_enc;
104-
struct crypto_blkcipher *initiator_enc;
105-
struct crypto_blkcipher *acceptor_enc_aux;
106-
struct crypto_blkcipher *initiator_enc_aux;
101+
struct crypto_skcipher *enc;
102+
struct crypto_skcipher *seq;
103+
struct crypto_skcipher *acceptor_enc;
104+
struct crypto_skcipher *initiator_enc;
105+
struct crypto_skcipher *acceptor_enc_aux;
106+
struct crypto_skcipher *initiator_enc_aux;
107107
u8 Ksess[GSS_KRB5_MAX_KEYLEN]; /* session key */
108108
u8 cksum[GSS_KRB5_MAX_KEYLEN];
109109
s32 endtime;
@@ -262,24 +262,24 @@ gss_unwrap_kerberos(struct gss_ctx *ctx_id, int offset,
262262

263263

264264
u32
265-
krb5_encrypt(struct crypto_blkcipher *key,
265+
krb5_encrypt(struct crypto_skcipher *key,
266266
void *iv, void *in, void *out, int length);
267267

268268
u32
269-
krb5_decrypt(struct crypto_blkcipher *key,
269+
krb5_decrypt(struct crypto_skcipher *key,
270270
void *iv, void *in, void *out, int length);
271271

272272
int
273-
gss_encrypt_xdr_buf(struct crypto_blkcipher *tfm, struct xdr_buf *outbuf,
273+
gss_encrypt_xdr_buf(struct crypto_skcipher *tfm, struct xdr_buf *outbuf,
274274
int offset, struct page **pages);
275275

276276
int
277-
gss_decrypt_xdr_buf(struct crypto_blkcipher *tfm, struct xdr_buf *inbuf,
277+
gss_decrypt_xdr_buf(struct crypto_skcipher *tfm, struct xdr_buf *inbuf,
278278
int offset);
279279

280280
s32
281281
krb5_make_seq_num(struct krb5_ctx *kctx,
282-
struct crypto_blkcipher *key,
282+
struct crypto_skcipher *key,
283283
int direction,
284284
u32 seqnum, unsigned char *cksum, unsigned char *buf);
285285

@@ -320,12 +320,12 @@ gss_krb5_aes_decrypt(struct krb5_ctx *kctx, u32 offset,
320320

321321
int
322322
krb5_rc4_setup_seq_key(struct krb5_ctx *kctx,
323-
struct crypto_blkcipher *cipher,
323+
struct crypto_skcipher *cipher,
324324
unsigned char *cksum);
325325

326326
int
327327
krb5_rc4_setup_enc_key(struct krb5_ctx *kctx,
328-
struct crypto_blkcipher *cipher,
328+
struct crypto_skcipher *cipher,
329329
s32 seqnum);
330330
void
331331
gss_krb5_make_confounder(char *p, u32 conflen);

0 commit comments

Comments
 (0)