Lines Matching refs:kctx
165 make_checksum_hmac_md5(struct krb5_ctx *kctx, char *header, int hdrlen, in make_checksum_hmac_md5() argument
180 if (cksumout->len < kctx->gk5e->cksumlength) { in make_checksum_hmac_md5()
182 __func__, cksumout->len, kctx->gk5e->name); in make_checksum_hmac_md5()
203 hmac_md5 = crypto_alloc_ahash(kctx->gk5e->cksum_name, 0, in make_checksum_hmac_md5()
244 err = crypto_ahash_setkey(hmac_md5, cksumkey, kctx->gk5e->keylength); in make_checksum_hmac_md5()
255 memcpy(cksumout->data, checksumdata, kctx->gk5e->cksumlength); in make_checksum_hmac_md5()
256 cksumout->len = kctx->gk5e->cksumlength; in make_checksum_hmac_md5()
276 make_checksum(struct krb5_ctx *kctx, char *header, int hdrlen, in make_checksum() argument
287 if (kctx->gk5e->ctype == CKSUMTYPE_HMAC_MD5_ARCFOUR) in make_checksum()
288 return make_checksum_hmac_md5(kctx, header, hdrlen, in make_checksum()
292 if (cksumout->len < kctx->gk5e->cksumlength) { in make_checksum()
294 __func__, cksumout->len, kctx->gk5e->name); in make_checksum()
302 tfm = crypto_alloc_ahash(kctx->gk5e->cksum_name, 0, CRYPTO_ALG_ASYNC); in make_checksum()
316 kctx->gk5e->keylength); in make_checksum()
338 switch (kctx->gk5e->ctype) { in make_checksum()
340 err = kctx->gk5e->encrypt(kctx->seq, NULL, checksumdata, in make_checksum()
345 checksumdata + checksumlen - kctx->gk5e->cksumlength, in make_checksum()
346 kctx->gk5e->cksumlength); in make_checksum()
349 memcpy(cksumout->data, checksumdata, kctx->gk5e->cksumlength); in make_checksum()
355 cksumout->len = kctx->gk5e->cksumlength; in make_checksum()
373 make_checksum_v2(struct krb5_ctx *kctx, char *header, int hdrlen, in make_checksum_v2() argument
383 if (kctx->gk5e->keyed_cksum == 0) { in make_checksum_v2()
385 __func__, kctx->gk5e->name); in make_checksum_v2()
390 __func__, kctx->gk5e->name); in make_checksum_v2()
398 tfm = crypto_alloc_ahash(kctx->gk5e->cksum_name, 0, CRYPTO_ALG_ASYNC); in make_checksum_v2()
408 err = crypto_ahash_setkey(tfm, cksumkey, kctx->gk5e->keylength); in make_checksum_v2()
431 cksumout->len = kctx->gk5e->cksumlength; in make_checksum_v2()
433 switch (kctx->gk5e->ctype) { in make_checksum_v2()
437 memcpy(cksumout->data, checksumdata, kctx->gk5e->cksumlength); in make_checksum_v2()
731 gss_krb5_aes_encrypt(struct krb5_ctx *kctx, u32 offset, in gss_krb5_aes_encrypt() argument
746 if (kctx->initiate) { in gss_krb5_aes_encrypt()
747 cipher = kctx->initiator_enc; in gss_krb5_aes_encrypt()
748 aux_cipher = kctx->initiator_enc_aux; in gss_krb5_aes_encrypt()
749 cksumkey = kctx->initiator_integ; in gss_krb5_aes_encrypt()
752 cipher = kctx->acceptor_enc; in gss_krb5_aes_encrypt()
753 aux_cipher = kctx->acceptor_enc_aux; in gss_krb5_aes_encrypt()
754 cksumkey = kctx->acceptor_integ; in gss_krb5_aes_encrypt()
761 if (xdr_extend_head(buf, offset, kctx->gk5e->conflen)) in gss_krb5_aes_encrypt()
763 gss_krb5_make_confounder(buf->head[0].iov_base + offset, kctx->gk5e->conflen); in gss_krb5_aes_encrypt()
794 err = make_checksum_v2(kctx, NULL, 0, buf, in gss_krb5_aes_encrypt()
842 buf->tail[0].iov_len += kctx->gk5e->cksumlength; in gss_krb5_aes_encrypt()
843 buf->len += kctx->gk5e->cksumlength; in gss_krb5_aes_encrypt()
852 gss_krb5_aes_decrypt(struct krb5_ctx *kctx, u32 offset, struct xdr_buf *buf, in gss_krb5_aes_decrypt() argument
866 if (kctx->initiate) { in gss_krb5_aes_decrypt()
867 cipher = kctx->acceptor_enc; in gss_krb5_aes_decrypt()
868 aux_cipher = kctx->acceptor_enc_aux; in gss_krb5_aes_decrypt()
869 cksum_key = kctx->acceptor_integ; in gss_krb5_aes_decrypt()
872 cipher = kctx->initiator_enc; in gss_krb5_aes_decrypt()
873 aux_cipher = kctx->initiator_enc_aux; in gss_krb5_aes_decrypt()
874 cksum_key = kctx->initiator_integ; in gss_krb5_aes_decrypt()
883 kctx->gk5e->cksumlength)); in gss_krb5_aes_decrypt()
921 ret = make_checksum_v2(kctx, NULL, 0, &subbuf, 0, in gss_krb5_aes_decrypt()
927 ret = read_bytes_from_xdr_buf(buf, buf->len - kctx->gk5e->cksumlength, in gss_krb5_aes_decrypt()
928 pkt_hmac, kctx->gk5e->cksumlength); in gss_krb5_aes_decrypt()
932 if (crypto_memneq(pkt_hmac, our_hmac, kctx->gk5e->cksumlength) != 0) { in gss_krb5_aes_decrypt()
936 *headskip = kctx->gk5e->conflen; in gss_krb5_aes_decrypt()
937 *tailskip = kctx->gk5e->cksumlength; in gss_krb5_aes_decrypt()
949 krb5_rc4_setup_seq_key(struct krb5_ctx *kctx, struct crypto_skcipher *cipher, in krb5_rc4_setup_seq_key() argument
960 hmac = crypto_alloc_shash(kctx->gk5e->cksum_name, 0, 0); in krb5_rc4_setup_seq_key()
963 __func__, PTR_ERR(hmac), kctx->gk5e->cksum_name); in krb5_rc4_setup_seq_key()
971 __func__, kctx->gk5e->cksum_name); in krb5_rc4_setup_seq_key()
980 err = crypto_shash_setkey(hmac, kctx->Ksess, kctx->gk5e->keylength); in krb5_rc4_setup_seq_key()
989 err = crypto_shash_setkey(hmac, Kseq, kctx->gk5e->keylength); in krb5_rc4_setup_seq_key()
997 err = crypto_skcipher_setkey(cipher, Kseq, kctx->gk5e->keylength); in krb5_rc4_setup_seq_key()
1015 krb5_rc4_setup_enc_key(struct krb5_ctx *kctx, struct crypto_skcipher *cipher, in krb5_rc4_setup_enc_key() argument
1027 hmac = crypto_alloc_shash(kctx->gk5e->cksum_name, 0, 0); in krb5_rc4_setup_enc_key()
1030 __func__, PTR_ERR(hmac), kctx->gk5e->cksum_name); in krb5_rc4_setup_enc_key()
1038 __func__, kctx->gk5e->cksum_name); in krb5_rc4_setup_enc_key()
1047 for (i = 0; i < kctx->gk5e->keylength; i++) in krb5_rc4_setup_enc_key()
1048 Kcrypt[i] = kctx->Ksess[i] ^ 0xf0; in krb5_rc4_setup_enc_key()
1050 err = crypto_shash_setkey(hmac, Kcrypt, kctx->gk5e->keylength); in krb5_rc4_setup_enc_key()
1059 err = crypto_shash_setkey(hmac, Kcrypt, kctx->gk5e->keylength); in krb5_rc4_setup_enc_key()
1072 err = crypto_skcipher_setkey(cipher, Kcrypt, kctx->gk5e->keylength); in krb5_rc4_setup_enc_key()