/linux-4.1.27/net/sunrpc/auth_gss/ |
H A D | gss_krb5_wrap.c | 158 gss_wrap_kerberos_v1(struct krb5_ctx *kctx, int offset, gss_wrap_kerberos_v1() argument 171 u32 conflen = kctx->gk5e->conflen; gss_wrap_kerberos_v1() 177 blocksize = crypto_blkcipher_blocksize(kctx->enc); gss_wrap_kerberos_v1() 182 headlen = g_token_size(&kctx->mech_used, gss_wrap_kerberos_v1() 183 GSS_KRB5_TOK_HDR_LEN + kctx->gk5e->cksumlength + plainlen) - gss_wrap_kerberos_v1() 193 g_make_token_header(&kctx->mech_used, gss_wrap_kerberos_v1() 195 kctx->gk5e->cksumlength + plainlen, &ptr); gss_wrap_kerberos_v1() 202 msg_start = ptr + GSS_KRB5_TOK_HDR_LEN + kctx->gk5e->cksumlength; gss_wrap_kerberos_v1() 209 *(__le16 *)(ptr + 2) = cpu_to_le16(kctx->gk5e->signalg); gss_wrap_kerberos_v1() 210 *(__le16 *)(ptr + 4) = cpu_to_le16(kctx->gk5e->sealalg); gss_wrap_kerberos_v1() 216 if (kctx->gk5e->keyed_cksum) gss_wrap_kerberos_v1() 217 cksumkey = kctx->cksum; gss_wrap_kerberos_v1() 224 if (make_checksum(kctx, ptr, 8, buf, offset + headlen - conflen, gss_wrap_kerberos_v1() 232 seq_send = kctx->seq_send++; gss_wrap_kerberos_v1() 237 if ((krb5_make_seq_num(kctx, kctx->seq, kctx->initiate ? 0 : 0xff, gss_wrap_kerberos_v1() 241 if (kctx->enctype == ENCTYPE_ARCFOUR_HMAC) { gss_wrap_kerberos_v1() 244 cipher = crypto_alloc_blkcipher(kctx->gk5e->encrypt_name, 0, gss_wrap_kerberos_v1() 249 krb5_rc4_setup_enc_key(kctx, cipher, seq_send); gss_wrap_kerberos_v1() 257 if (gss_encrypt_xdr_buf(kctx->enc, buf, gss_wrap_kerberos_v1() 262 return (kctx->endtime < now) ? GSS_S_CONTEXT_EXPIRED : GSS_S_COMPLETE; gss_wrap_kerberos_v1() 266 gss_unwrap_kerberos_v1(struct krb5_ctx *kctx, int offset, struct xdr_buf *buf) gss_unwrap_kerberos_v1() argument 281 u32 conflen = kctx->gk5e->conflen; gss_unwrap_kerberos_v1() 288 if (g_verify_token_header(&kctx->mech_used, &bodysize, &ptr, gss_unwrap_kerberos_v1() 301 if (signalg != kctx->gk5e->signalg) gss_unwrap_kerberos_v1() 305 if (sealalg != kctx->gk5e->sealalg) gss_unwrap_kerberos_v1() 315 crypt_offset = ptr + (GSS_KRB5_TOK_HDR_LEN + kctx->gk5e->cksumlength) - gss_unwrap_kerberos_v1() 321 if (krb5_get_seq_num(kctx, ptr + GSS_KRB5_TOK_HDR_LEN, gss_unwrap_kerberos_v1() 325 if ((kctx->initiate && direction != 0xff) || gss_unwrap_kerberos_v1() 326 (!kctx->initiate && direction != 0)) gss_unwrap_kerberos_v1() 329 if (kctx->enctype == ENCTYPE_ARCFOUR_HMAC) { gss_unwrap_kerberos_v1() 333 cipher = crypto_alloc_blkcipher(kctx->gk5e->encrypt_name, 0, gss_unwrap_kerberos_v1() 338 krb5_rc4_setup_enc_key(kctx, cipher, seqnum); gss_unwrap_kerberos_v1() 345 if (gss_decrypt_xdr_buf(kctx->enc, buf, crypt_offset)) gss_unwrap_kerberos_v1() 349 if (kctx->gk5e->keyed_cksum) gss_unwrap_kerberos_v1() 350 cksumkey = kctx->cksum; gss_unwrap_kerberos_v1() 354 if (make_checksum(kctx, ptr, 8, buf, crypt_offset, gss_unwrap_kerberos_v1() 359 kctx->gk5e->cksumlength)) gss_unwrap_kerberos_v1() 366 if (now > kctx->endtime) gss_unwrap_kerberos_v1() 374 blocksize = crypto_blkcipher_blocksize(kctx->enc); gss_unwrap_kerberos_v1() 375 data_start = ptr + (GSS_KRB5_TOK_HDR_LEN + kctx->gk5e->cksumlength) + gss_unwrap_kerberos_v1() 440 gss_wrap_kerberos_v2(struct krb5_ctx *kctx, u32 offset, gss_wrap_kerberos_v2() argument 453 if (kctx->gk5e->encrypt_v2 == NULL) gss_wrap_kerberos_v2() 465 if ((kctx->flags & KRB5_CTX_FLAG_INITIATOR) == 0) gss_wrap_kerberos_v2() 467 if ((kctx->flags & KRB5_CTX_FLAG_ACCEPTOR_SUBKEY) != 0) gss_wrap_kerberos_v2() 476 blocksize = crypto_blkcipher_blocksize(kctx->acceptor_enc); gss_wrap_kerberos_v2() 483 *be64ptr = cpu_to_be64(kctx->seq_send64++); gss_wrap_kerberos_v2() 486 err = (*kctx->gk5e->encrypt_v2)(kctx, offset, buf, pages); gss_wrap_kerberos_v2() 491 return (kctx->endtime < now) ? GSS_S_CONTEXT_EXPIRED : GSS_S_COMPLETE; gss_wrap_kerberos_v2() 495 gss_unwrap_kerberos_v2(struct krb5_ctx *kctx, int offset, struct xdr_buf *buf) gss_unwrap_kerberos_v2() argument 509 if (kctx->gk5e->decrypt_v2 == NULL) gss_unwrap_kerberos_v2() 518 if ((!kctx->initiate && (flags & KG2_TOKEN_FLAG_SENTBYACCEPTOR)) || gss_unwrap_kerberos_v2() 519 (kctx->initiate && !(flags & KG2_TOKEN_FLAG_SENTBYACCEPTOR))) gss_unwrap_kerberos_v2() 541 err = (*kctx->gk5e->decrypt_v2)(kctx, offset, buf, gss_unwrap_kerberos_v2() 567 if (now > kctx->endtime) gss_unwrap_kerberos_v2() 594 struct krb5_ctx *kctx = gctx->internal_ctx_id; gss_wrap_kerberos() local 596 switch (kctx->enctype) { gss_wrap_kerberos() 602 return gss_wrap_kerberos_v1(kctx, offset, buf, pages); gss_wrap_kerberos() 605 return gss_wrap_kerberos_v2(kctx, offset, buf, pages); gss_wrap_kerberos() 612 struct krb5_ctx *kctx = gctx->internal_ctx_id; gss_unwrap_kerberos() local 614 switch (kctx->enctype) { gss_unwrap_kerberos() 620 return gss_unwrap_kerberos_v1(kctx, offset, buf); gss_unwrap_kerberos() 623 return gss_unwrap_kerberos_v2(kctx, offset, buf); gss_unwrap_kerberos()
|
H A D | gss_krb5_seqnum.c | 43 krb5_make_rc4_seq_num(struct krb5_ctx *kctx, int direction, s32 seqnum, krb5_make_rc4_seq_num() argument 51 cipher = crypto_alloc_blkcipher(kctx->gk5e->encrypt_name, 0, krb5_make_rc4_seq_num() 65 code = krb5_rc4_setup_seq_key(kctx, cipher, cksum); krb5_make_rc4_seq_num() 75 krb5_make_seq_num(struct krb5_ctx *kctx, krb5_make_seq_num() argument 83 if (kctx->enctype == ENCTYPE_ARCFOUR_HMAC) krb5_make_seq_num() 84 return krb5_make_rc4_seq_num(kctx, direction, seqnum, krb5_make_seq_num() 101 krb5_get_rc4_seq_num(struct krb5_ctx *kctx, unsigned char *cksum, krb5_get_rc4_seq_num() argument 109 cipher = crypto_alloc_blkcipher(kctx->gk5e->encrypt_name, 0, krb5_get_rc4_seq_num() 114 code = krb5_rc4_setup_seq_key(kctx, cipher, cksum); krb5_get_rc4_seq_num() 138 krb5_get_seq_num(struct krb5_ctx *kctx, krb5_get_seq_num() argument 145 struct crypto_blkcipher *key = kctx->seq; krb5_get_seq_num() 149 if (kctx->enctype == ENCTYPE_ARCFOUR_HMAC) krb5_get_seq_num() 150 return krb5_get_rc4_seq_num(kctx, cksum, buf, krb5_get_seq_num()
|
H A D | gss_krb5_crypto.c | 151 make_checksum_hmac_md5(struct krb5_ctx *kctx, char *header, int hdrlen, make_checksum_hmac_md5() argument 166 if (cksumout->len < kctx->gk5e->cksumlength) { make_checksum_hmac_md5() 168 __func__, cksumout->len, kctx->gk5e->name); make_checksum_hmac_md5() 181 hmac_md5 = crypto_alloc_hash(kctx->gk5e->cksum_name, 0, make_checksum_hmac_md5() 217 err = crypto_hash_setkey(hmac_md5, cksumkey, kctx->gk5e->keylength); make_checksum_hmac_md5() 227 memcpy(cksumout->data, checksumdata, kctx->gk5e->cksumlength); make_checksum_hmac_md5() 228 cksumout->len = kctx->gk5e->cksumlength; make_checksum_hmac_md5() 241 make_checksum(struct krb5_ctx *kctx, char *header, int hdrlen, make_checksum() argument 251 if (kctx->gk5e->ctype == CKSUMTYPE_HMAC_MD5_ARCFOUR) make_checksum() 252 return make_checksum_hmac_md5(kctx, header, hdrlen, make_checksum() 256 if (cksumout->len < kctx->gk5e->cksumlength) { make_checksum() 258 __func__, cksumout->len, kctx->gk5e->name); make_checksum() 262 desc.tfm = crypto_alloc_hash(kctx->gk5e->cksum_name, 0, CRYPTO_ALG_ASYNC); make_checksum() 271 kctx->gk5e->keylength); make_checksum() 291 switch (kctx->gk5e->ctype) { make_checksum() 293 err = kctx->gk5e->encrypt(kctx->seq, NULL, checksumdata, make_checksum() 298 checksumdata + checksumlen - kctx->gk5e->cksumlength, make_checksum() 299 kctx->gk5e->cksumlength); make_checksum() 302 memcpy(cksumout->data, checksumdata, kctx->gk5e->cksumlength); make_checksum() 308 cksumout->len = kctx->gk5e->cksumlength; make_checksum() 322 make_checksum_v2(struct krb5_ctx *kctx, char *header, int hdrlen, make_checksum_v2() argument 332 if (kctx->gk5e->keyed_cksum == 0) { make_checksum_v2() 334 __func__, kctx->gk5e->name); make_checksum_v2() 339 __func__, kctx->gk5e->name); make_checksum_v2() 343 desc.tfm = crypto_alloc_hash(kctx->gk5e->cksum_name, 0, make_checksum_v2() 350 err = crypto_hash_setkey(desc.tfm, cksumkey, kctx->gk5e->keylength); make_checksum_v2() 371 cksumout->len = kctx->gk5e->cksumlength; make_checksum_v2() 373 switch (kctx->gk5e->ctype) { make_checksum_v2() 377 memcpy(cksumout->data, checksumdata, kctx->gk5e->cksumlength); make_checksum_v2() 643 gss_krb5_aes_encrypt(struct krb5_ctx *kctx, u32 offset, gss_krb5_aes_encrypt() argument 658 if (kctx->initiate) { gss_krb5_aes_encrypt() 659 cipher = kctx->initiator_enc; gss_krb5_aes_encrypt() 660 aux_cipher = kctx->initiator_enc_aux; gss_krb5_aes_encrypt() 661 cksumkey = kctx->initiator_integ; gss_krb5_aes_encrypt() 664 cipher = kctx->acceptor_enc; gss_krb5_aes_encrypt() 665 aux_cipher = kctx->acceptor_enc_aux; gss_krb5_aes_encrypt() 666 cksumkey = kctx->acceptor_integ; gss_krb5_aes_encrypt() 673 if (xdr_extend_head(buf, offset, kctx->gk5e->conflen)) gss_krb5_aes_encrypt() 675 gss_krb5_make_confounder(buf->head[0].iov_base + offset, kctx->gk5e->conflen); gss_krb5_aes_encrypt() 706 err = make_checksum_v2(kctx, NULL, 0, buf, gss_krb5_aes_encrypt() 750 buf->tail[0].iov_len += kctx->gk5e->cksumlength; gss_krb5_aes_encrypt() 751 buf->len += kctx->gk5e->cksumlength; gss_krb5_aes_encrypt() 760 gss_krb5_aes_decrypt(struct krb5_ctx *kctx, u32 offset, struct xdr_buf *buf, gss_krb5_aes_decrypt() argument 774 if (kctx->initiate) { gss_krb5_aes_decrypt() 775 cipher = kctx->acceptor_enc; gss_krb5_aes_decrypt() 776 aux_cipher = kctx->acceptor_enc_aux; gss_krb5_aes_decrypt() 777 cksum_key = kctx->acceptor_integ; gss_krb5_aes_decrypt() 780 cipher = kctx->initiator_enc; gss_krb5_aes_decrypt() 781 aux_cipher = kctx->initiator_enc_aux; gss_krb5_aes_decrypt() 782 cksum_key = kctx->initiator_integ; gss_krb5_aes_decrypt() 791 kctx->gk5e->cksumlength)); gss_krb5_aes_decrypt() 825 ret = make_checksum_v2(kctx, NULL, 0, &subbuf, 0, gss_krb5_aes_decrypt() 831 ret = read_bytes_from_xdr_buf(buf, buf->len - kctx->gk5e->cksumlength, gss_krb5_aes_decrypt() 832 pkt_hmac, kctx->gk5e->cksumlength); gss_krb5_aes_decrypt() 836 if (memcmp(pkt_hmac, our_hmac, kctx->gk5e->cksumlength) != 0) { gss_krb5_aes_decrypt() 840 *headskip = kctx->gk5e->conflen; gss_krb5_aes_decrypt() 841 *tailskip = kctx->gk5e->cksumlength; gss_krb5_aes_decrypt() 853 krb5_rc4_setup_seq_key(struct krb5_ctx *kctx, struct crypto_blkcipher *cipher, krb5_rc4_setup_seq_key() argument 865 hmac = crypto_alloc_hash(kctx->gk5e->cksum_name, 0, CRYPTO_ALG_ASYNC); krb5_rc4_setup_seq_key() 868 __func__, PTR_ERR(hmac), kctx->gk5e->cksum_name); krb5_rc4_setup_seq_key() 880 err = crypto_hash_setkey(hmac, kctx->Ksess, kctx->gk5e->keylength); krb5_rc4_setup_seq_key() 892 err = crypto_hash_setkey(hmac, Kseq, kctx->gk5e->keylength); krb5_rc4_setup_seq_key() 902 err = crypto_blkcipher_setkey(cipher, Kseq, kctx->gk5e->keylength); krb5_rc4_setup_seq_key() 916 * Set the key of cipher kctx->enc. 919 krb5_rc4_setup_enc_key(struct krb5_ctx *kctx, struct crypto_blkcipher *cipher, krb5_rc4_setup_enc_key() argument 932 hmac = crypto_alloc_hash(kctx->gk5e->cksum_name, 0, CRYPTO_ALG_ASYNC); krb5_rc4_setup_enc_key() 935 __func__, PTR_ERR(hmac), kctx->gk5e->cksum_name); krb5_rc4_setup_enc_key() 947 for (i = 0; i < kctx->gk5e->keylength; i++) krb5_rc4_setup_enc_key() 948 Kcrypt[i] = kctx->Ksess[i] ^ 0xf0; krb5_rc4_setup_enc_key() 950 err = crypto_hash_setkey(hmac, Kcrypt, kctx->gk5e->keylength); krb5_rc4_setup_enc_key() 962 err = crypto_hash_setkey(hmac, Kcrypt, kctx->gk5e->keylength); krb5_rc4_setup_enc_key() 977 err = crypto_blkcipher_setkey(cipher, Kcrypt, kctx->gk5e->keylength); krb5_rc4_setup_enc_key()
|
H A D | gss_krb5_mech.c | 711 struct krb5_ctx *kctx = internal_ctx; gss_delete_sec_context_kerberos() local 713 crypto_free_blkcipher(kctx->seq); gss_delete_sec_context_kerberos() 714 crypto_free_blkcipher(kctx->enc); gss_delete_sec_context_kerberos() 715 crypto_free_blkcipher(kctx->acceptor_enc); gss_delete_sec_context_kerberos() 716 crypto_free_blkcipher(kctx->initiator_enc); gss_delete_sec_context_kerberos() 717 crypto_free_blkcipher(kctx->acceptor_enc_aux); gss_delete_sec_context_kerberos() 718 crypto_free_blkcipher(kctx->initiator_enc_aux); gss_delete_sec_context_kerberos() 719 kfree(kctx->mech_used.data); gss_delete_sec_context_kerberos() 720 kfree(kctx); gss_delete_sec_context_kerberos()
|
/linux-4.1.27/include/linux/sunrpc/ |
H A D | gss_krb5.h | 83 u32 (*encrypt_v2) (struct krb5_ctx *kctx, u32 offset, 86 u32 (*decrypt_v2) (struct krb5_ctx *kctx, u32 offset, 240 make_checksum(struct krb5_ctx *kctx, char *header, int hdrlen, 281 krb5_make_seq_num(struct krb5_ctx *kctx, 287 krb5_get_seq_num(struct krb5_ctx *kctx, 312 gss_krb5_aes_encrypt(struct krb5_ctx *kctx, u32 offset, 317 gss_krb5_aes_decrypt(struct krb5_ctx *kctx, u32 offset, 322 krb5_rc4_setup_seq_key(struct krb5_ctx *kctx, 327 krb5_rc4_setup_enc_key(struct krb5_ctx *kctx,
|
/linux-4.1.27/block/ |
H A D | blk-mq.c | 1886 * but we can't group ctx/kctx kobj without it.
|
/linux-4.1.27/drivers/infiniband/hw/qib/ |
H A D | qib_iba7322.c | 129 MODULE_PARM_DESC(krcvq01_no_msi, "No MSI for kctx < 2"); 3519 QIB_DRV_NAME "%d (kctx)", dd->unit); qib_setup_7322_interrupt()
|