xref: /linux/net/sunrpc/auth_gss/gss_krb5_internal.h (revision d50b8152c992ac88c5f1f0cc8ade6ee0aa0a3704)
17f675ca7SChuck Lever /* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */
27f675ca7SChuck Lever /*
37f675ca7SChuck Lever  * SunRPC GSS Kerberos 5 mechanism internal definitions
47f675ca7SChuck Lever  *
57f675ca7SChuck Lever  * Copyright (c) 2022 Oracle and/or its affiliates.
67f675ca7SChuck Lever  */
77f675ca7SChuck Lever 
87f675ca7SChuck Lever #ifndef _NET_SUNRPC_AUTH_GSS_KRB5_INTERNAL_H
97f675ca7SChuck Lever #define _NET_SUNRPC_AUTH_GSS_KRB5_INTERNAL_H
107f675ca7SChuck Lever 
11e01b2c79SChuck Lever /*
12e01b2c79SChuck Lever  * GSS Kerberos 5 mechanism Per-Message calls.
13e01b2c79SChuck Lever  */
14e01b2c79SChuck Lever 
15e01b2c79SChuck Lever u32 gss_krb5_get_mic_v1(struct krb5_ctx *ctx, struct xdr_buf *text,
16e01b2c79SChuck Lever 			struct xdr_netobj *token);
17e01b2c79SChuck Lever u32 gss_krb5_get_mic_v2(struct krb5_ctx *ctx, struct xdr_buf *text,
18e01b2c79SChuck Lever 			struct xdr_netobj *token);
19e01b2c79SChuck Lever 
20e01b2c79SChuck Lever u32 gss_krb5_verify_mic_v1(struct krb5_ctx *ctx, struct xdr_buf *message_buffer,
21e01b2c79SChuck Lever 			   struct xdr_netobj *read_token);
22e01b2c79SChuck Lever u32 gss_krb5_verify_mic_v2(struct krb5_ctx *ctx, struct xdr_buf *message_buffer,
23e01b2c79SChuck Lever 			   struct xdr_netobj *read_token);
24e01b2c79SChuck Lever 
25e01b2c79SChuck Lever u32 gss_krb5_wrap_v1(struct krb5_ctx *kctx, int offset,
26e01b2c79SChuck Lever 		     struct xdr_buf *buf, struct page **pages);
27e01b2c79SChuck Lever u32 gss_krb5_wrap_v2(struct krb5_ctx *kctx, int offset,
28e01b2c79SChuck Lever 		     struct xdr_buf *buf, struct page **pages);
29e01b2c79SChuck Lever 
30e01b2c79SChuck Lever u32 gss_krb5_unwrap_v1(struct krb5_ctx *kctx, int offset, int len,
31e01b2c79SChuck Lever 		       struct xdr_buf *buf, unsigned int *slack,
32e01b2c79SChuck Lever 		       unsigned int *align);
33e01b2c79SChuck Lever u32 gss_krb5_unwrap_v2(struct krb5_ctx *kctx, int offset, int len,
34e01b2c79SChuck Lever 		       struct xdr_buf *buf, unsigned int *slack,
35e01b2c79SChuck Lever 		       unsigned int *align);
36e01b2c79SChuck Lever 
37e01b2c79SChuck Lever /*
38e01b2c79SChuck Lever  * Implementation internal functions
39e01b2c79SChuck Lever  */
40e01b2c79SChuck Lever 
417f675ca7SChuck Lever void krb5_make_confounder(u8 *p, int conflen);
427f675ca7SChuck Lever 
432dbe0cacSChuck Lever u32 gss_krb5_checksum(struct crypto_ahash *tfm, char *header, int hdrlen,
442dbe0cacSChuck Lever 		      const struct xdr_buf *body, int body_offset,
452dbe0cacSChuck Lever 		      struct xdr_netobj *cksumout);
462dbe0cacSChuck Lever 
47*d50b8152SChuck Lever u32 krb5_encrypt(struct crypto_sync_skcipher *key, void *iv, void *in,
48*d50b8152SChuck Lever 		 void *out, int length);
49*d50b8152SChuck Lever 
50*d50b8152SChuck Lever u32 krb5_decrypt(struct crypto_sync_skcipher *key, void *iv, void *in,
51*d50b8152SChuck Lever 		 void *out, int length);
52*d50b8152SChuck Lever 
537f675ca7SChuck Lever #endif /* _NET_SUNRPC_AUTH_GSS_KRB5_INTERNAL_H */
54