| .. | .. |
|---|
| 71 | 71 | const u32 keyed_cksum; /* is it a keyed cksum? */ |
|---|
| 72 | 72 | const u32 keybytes; /* raw key len, in bytes */ |
|---|
| 73 | 73 | const u32 keylength; /* final key len, in bytes */ |
|---|
| 74 | | - u32 (*encrypt) (struct crypto_skcipher *tfm, |
|---|
| 74 | + u32 (*encrypt) (struct crypto_sync_skcipher *tfm, |
|---|
| 75 | 75 | void *iv, void *in, void *out, |
|---|
| 76 | 76 | int length); /* encryption function */ |
|---|
| 77 | | - u32 (*decrypt) (struct crypto_skcipher *tfm, |
|---|
| 77 | + u32 (*decrypt) (struct crypto_sync_skcipher *tfm, |
|---|
| 78 | 78 | void *iv, void *in, void *out, |
|---|
| 79 | 79 | int length); /* decryption function */ |
|---|
| 80 | 80 | u32 (*mk_key) (const struct gss_krb5_enctype *gk5e, |
|---|
| .. | .. |
|---|
| 83 | 83 | u32 (*encrypt_v2) (struct krb5_ctx *kctx, u32 offset, |
|---|
| 84 | 84 | struct xdr_buf *buf, |
|---|
| 85 | 85 | struct page **pages); /* v2 encryption function */ |
|---|
| 86 | | - u32 (*decrypt_v2) (struct krb5_ctx *kctx, u32 offset, |
|---|
| 86 | + u32 (*decrypt_v2) (struct krb5_ctx *kctx, u32 offset, u32 len, |
|---|
| 87 | 87 | struct xdr_buf *buf, u32 *headskip, |
|---|
| 88 | 88 | u32 *tailskip); /* v2 decryption function */ |
|---|
| 89 | 89 | }; |
|---|
| .. | .. |
|---|
| 98 | 98 | u32 enctype; |
|---|
| 99 | 99 | u32 flags; |
|---|
| 100 | 100 | const struct gss_krb5_enctype *gk5e; /* enctype-specific info */ |
|---|
| 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; |
|---|
| 101 | + struct crypto_sync_skcipher *enc; |
|---|
| 102 | + struct crypto_sync_skcipher *seq; |
|---|
| 103 | + struct crypto_sync_skcipher *acceptor_enc; |
|---|
| 104 | + struct crypto_sync_skcipher *initiator_enc; |
|---|
| 105 | + struct crypto_sync_skcipher *acceptor_enc_aux; |
|---|
| 106 | + struct crypto_sync_skcipher *initiator_enc_aux; |
|---|
| 107 | 107 | u8 Ksess[GSS_KRB5_MAX_KEYLEN]; /* session key */ |
|---|
| 108 | 108 | u8 cksum[GSS_KRB5_MAX_KEYLEN]; |
|---|
| 109 | | - s32 endtime; |
|---|
| 110 | | - u32 seq_send; |
|---|
| 111 | | - u64 seq_send64; |
|---|
| 109 | + atomic_t seq_send; |
|---|
| 110 | + atomic64_t seq_send64; |
|---|
| 111 | + time64_t endtime; |
|---|
| 112 | 112 | struct xdr_netobj mech_used; |
|---|
| 113 | 113 | u8 initiator_sign[GSS_KRB5_MAX_KEYLEN]; |
|---|
| 114 | 114 | u8 acceptor_sign[GSS_KRB5_MAX_KEYLEN]; |
|---|
| .. | .. |
|---|
| 117 | 117 | u8 initiator_integ[GSS_KRB5_MAX_KEYLEN]; |
|---|
| 118 | 118 | u8 acceptor_integ[GSS_KRB5_MAX_KEYLEN]; |
|---|
| 119 | 119 | }; |
|---|
| 120 | | - |
|---|
| 121 | | -extern spinlock_t krb5_seq_lock; |
|---|
| 122 | 120 | |
|---|
| 123 | 121 | /* The length of the Kerberos GSS token header */ |
|---|
| 124 | 122 | #define GSS_KRB5_TOK_HDR_LEN (16) |
|---|
| .. | .. |
|---|
| 143 | 141 | SGN_ALG_MD2_5 = 0x0001, |
|---|
| 144 | 142 | SGN_ALG_DES_MAC = 0x0002, |
|---|
| 145 | 143 | SGN_ALG_3 = 0x0003, /* not published */ |
|---|
| 146 | | - SGN_ALG_HMAC_MD5 = 0x0011, /* microsoft w2k; no support */ |
|---|
| 147 | 144 | SGN_ALG_HMAC_SHA1_DES3_KD = 0x0004 |
|---|
| 148 | 145 | }; |
|---|
| 149 | 146 | enum seal_alg { |
|---|
| 150 | 147 | SEAL_ALG_NONE = 0xffff, |
|---|
| 151 | 148 | SEAL_ALG_DES = 0x0000, |
|---|
| 152 | 149 | SEAL_ALG_1 = 0x0001, /* not published */ |
|---|
| 153 | | - SEAL_ALG_MICROSOFT_RC4 = 0x0010,/* microsoft w2k; no support */ |
|---|
| 154 | 150 | SEAL_ALG_DES3KD = 0x0002 |
|---|
| 155 | 151 | }; |
|---|
| 156 | 152 | |
|---|
| .. | .. |
|---|
| 257 | 253 | struct xdr_buf *outbuf, struct page **pages); |
|---|
| 258 | 254 | |
|---|
| 259 | 255 | u32 |
|---|
| 260 | | -gss_unwrap_kerberos(struct gss_ctx *ctx_id, int offset, |
|---|
| 256 | +gss_unwrap_kerberos(struct gss_ctx *ctx_id, int offset, int len, |
|---|
| 261 | 257 | struct xdr_buf *buf); |
|---|
| 262 | 258 | |
|---|
| 263 | 259 | |
|---|
| 264 | 260 | u32 |
|---|
| 265 | | -krb5_encrypt(struct crypto_skcipher *key, |
|---|
| 261 | +krb5_encrypt(struct crypto_sync_skcipher *key, |
|---|
| 266 | 262 | void *iv, void *in, void *out, int length); |
|---|
| 267 | 263 | |
|---|
| 268 | 264 | u32 |
|---|
| 269 | | -krb5_decrypt(struct crypto_skcipher *key, |
|---|
| 265 | +krb5_decrypt(struct crypto_sync_skcipher *key, |
|---|
| 270 | 266 | void *iv, void *in, void *out, int length); |
|---|
| 271 | 267 | |
|---|
| 272 | 268 | int |
|---|
| 273 | | -gss_encrypt_xdr_buf(struct crypto_skcipher *tfm, struct xdr_buf *outbuf, |
|---|
| 269 | +gss_encrypt_xdr_buf(struct crypto_sync_skcipher *tfm, struct xdr_buf *outbuf, |
|---|
| 274 | 270 | int offset, struct page **pages); |
|---|
| 275 | 271 | |
|---|
| 276 | 272 | int |
|---|
| 277 | | -gss_decrypt_xdr_buf(struct crypto_skcipher *tfm, struct xdr_buf *inbuf, |
|---|
| 273 | +gss_decrypt_xdr_buf(struct crypto_sync_skcipher *tfm, struct xdr_buf *inbuf, |
|---|
| 278 | 274 | int offset); |
|---|
| 279 | 275 | |
|---|
| 280 | 276 | s32 |
|---|
| 281 | 277 | krb5_make_seq_num(struct krb5_ctx *kctx, |
|---|
| 282 | | - struct crypto_skcipher *key, |
|---|
| 278 | + struct crypto_sync_skcipher *key, |
|---|
| 283 | 279 | int direction, |
|---|
| 284 | 280 | u32 seqnum, unsigned char *cksum, unsigned char *buf); |
|---|
| 285 | 281 | |
|---|
| .. | .. |
|---|
| 314 | 310 | struct page **pages); |
|---|
| 315 | 311 | |
|---|
| 316 | 312 | u32 |
|---|
| 317 | | -gss_krb5_aes_decrypt(struct krb5_ctx *kctx, u32 offset, |
|---|
| 313 | +gss_krb5_aes_decrypt(struct krb5_ctx *kctx, u32 offset, u32 len, |
|---|
| 318 | 314 | struct xdr_buf *buf, u32 *plainoffset, |
|---|
| 319 | 315 | u32 *plainlen); |
|---|
| 320 | 316 | |
|---|
| 321 | | -int |
|---|
| 322 | | -krb5_rc4_setup_seq_key(struct krb5_ctx *kctx, |
|---|
| 323 | | - struct crypto_skcipher *cipher, |
|---|
| 324 | | - unsigned char *cksum); |
|---|
| 325 | | - |
|---|
| 326 | | -int |
|---|
| 327 | | -krb5_rc4_setup_enc_key(struct krb5_ctx *kctx, |
|---|
| 328 | | - struct crypto_skcipher *cipher, |
|---|
| 329 | | - s32 seqnum); |
|---|
| 330 | 317 | void |
|---|
| 331 | 318 | gss_krb5_make_confounder(char *p, u32 conflen); |
|---|