1 /* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */ 2 /* 3 * SunRPC GSS Kerberos 5 mechanism internal definitions 4 * 5 * Copyright (c) 2022 Oracle and/or its affiliates. 6 */ 7 8 #ifndef _NET_SUNRPC_AUTH_GSS_KRB5_INTERNAL_H 9 #define _NET_SUNRPC_AUTH_GSS_KRB5_INTERNAL_H 10 11 /* 12 * GSS Kerberos 5 mechanism Per-Message calls. 13 */ 14 15 u32 gss_krb5_get_mic_v1(struct krb5_ctx *ctx, struct xdr_buf *text, 16 struct xdr_netobj *token); 17 u32 gss_krb5_get_mic_v2(struct krb5_ctx *ctx, struct xdr_buf *text, 18 struct xdr_netobj *token); 19 20 u32 gss_krb5_verify_mic_v1(struct krb5_ctx *ctx, struct xdr_buf *message_buffer, 21 struct xdr_netobj *read_token); 22 u32 gss_krb5_verify_mic_v2(struct krb5_ctx *ctx, struct xdr_buf *message_buffer, 23 struct xdr_netobj *read_token); 24 25 u32 gss_krb5_wrap_v1(struct krb5_ctx *kctx, int offset, 26 struct xdr_buf *buf, struct page **pages); 27 u32 gss_krb5_wrap_v2(struct krb5_ctx *kctx, int offset, 28 struct xdr_buf *buf, struct page **pages); 29 30 u32 gss_krb5_unwrap_v1(struct krb5_ctx *kctx, int offset, int len, 31 struct xdr_buf *buf, unsigned int *slack, 32 unsigned int *align); 33 u32 gss_krb5_unwrap_v2(struct krb5_ctx *kctx, int offset, int len, 34 struct xdr_buf *buf, unsigned int *slack, 35 unsigned int *align); 36 37 /* 38 * Implementation internal functions 39 */ 40 41 void krb5_make_confounder(u8 *p, int conflen); 42 43 u32 gss_krb5_checksum(struct crypto_ahash *tfm, char *header, int hdrlen, 44 const struct xdr_buf *body, int body_offset, 45 struct xdr_netobj *cksumout); 46 47 u32 krb5_encrypt(struct crypto_sync_skcipher *key, void *iv, void *in, 48 void *out, int length); 49 50 u32 krb5_decrypt(struct crypto_sync_skcipher *key, void *iv, void *in, 51 void *out, int length); 52 53 #endif /* _NET_SUNRPC_AUTH_GSS_KRB5_INTERNAL_H */ 54