summarylogtreecommitdiffstats
path: root/0014-Linux-6.8-Add-function-prototypes-for-krb5.patch
blob: b43c366dcd0da79823e2320cb598676ad694f644 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
From e8e23ccf9d81e5c7df49d4e28441d7c986e47886 Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Wed, 7 Feb 2024 15:25:10 -0700
Subject: [PATCH 14/29] Linux 6.8: Add function prototypes for krb5

The external files for heimdal/krb5 do not provide function prototypes
in a header file that is used when building files that we use from
heimdal/krb5 (e.g. crypto.c).

These functions are flagged due to missing prototypes when building
against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).

When building against a kernel with CONFIG_WERROR=y, the build fails.

We cannot modify the external source files, however there is the local
OpenAFS include file, krb5_locl.h, that does contain OpenAFS specific
changes.

Add declarations to krb5_locl.h for the functions defined in the
heimdal/krb5 source.

There are no functional changes with this commit.

Reviewed-on: https://gerrit.openafs.org/15621
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 612927dd1dd44bbd08eda790de12b24213583156)

Change-Id: Iaae28186a24c3c5ca4407de9563c8cfed9644921
---
 src/crypto/rfc3961/krb5_locl.h | 132 +++++++++++++++++++++++++++++++++
 1 file changed, 132 insertions(+)

diff --git a/src/crypto/rfc3961/krb5_locl.h b/src/crypto/rfc3961/krb5_locl.h
index 6e706737c..04292eefa 100644
--- a/src/crypto/rfc3961/krb5_locl.h
+++ b/src/crypto/rfc3961/krb5_locl.h
@@ -287,6 +287,138 @@ krb5_error_code krb5_enctype_to_string(krb5_context context,
 				       krb5_enctype etype,
 				       char **string);
 
+/*
+ * Unused prototypes from heimdal/krb5.  These are functions that are not used
+ * outside of their compilation unit at all, but we may need to declare them to
+ * avoid compiler warnings.
+ */
+struct _krb5_key_data;
+struct _krb5_encryption_type;
+/* heimdal/krb5/crypto.c */
+KRB5_LIB_FUNCTION krb5_error_code _krb5_derive_key(krb5_context context,
+						   struct _krb5_encryption_type *et,
+						   struct _krb5_key_data *key,
+						   const void *constant,
+						   size_t len);
+KRB5_LIB_FUNCTION krb5_error_code krb5_allow_weak_crypto(krb5_context context,
+							 krb5_boolean enable);
+KRB5_LIB_FUNCTION krb5_error_code krb5_checksum_disable(krb5_context context,
+							krb5_cksumtype type);
+KRB5_LIB_FUNCTION krb5_boolean krb5_checksum_is_keyed(krb5_context context,
+						      krb5_cksumtype type);
+KRB5_LIB_FUNCTION krb5_error_code krb5_cksumtype_valid(krb5_context context,
+						       krb5_cksumtype ctype);
+KRB5_LIB_FUNCTION krb5_error_code krb5_create_checksum_iov(krb5_context context,
+							   krb5_crypto crypto,
+							   unsigned usage,
+							   krb5_crypto_iov *data,
+							   unsigned int num_data,
+							   krb5_cksumtype *type);
+KRB5_LIB_FUNCTION krb5_error_code krb5_crypto_getblocksize(krb5_context context,
+							   krb5_crypto crypto,
+							   size_t *blocksize);
+KRB5_LIB_FUNCTION krb5_error_code krb5_crypto_getenctype(krb5_context context,
+							 krb5_crypto crypto,
+							 krb5_enctype *enctype);
+KRB5_LIB_FUNCTION krb5_error_code krb5_crypto_getpadsize(krb5_context context,
+							 krb5_crypto crypto,
+							 size_t *padsize);
+KRB5_LIB_FUNCTION krb5_error_code krb5_crypto_length(krb5_context context,
+						     krb5_crypto crypto,
+						     int type,
+						     size_t *len);
+KRB5_LIB_FUNCTION krb5_error_code krb5_crypto_length_iov(krb5_context context,
+							 krb5_crypto crypto,
+							 krb5_crypto_iov *data,
+							 unsigned int num_data);
+KRB5_LIB_FUNCTION krb5_error_code krb5_decrypt_iov_ivec(krb5_context context,
+							krb5_crypto crypto,
+							unsigned usage,
+							krb5_crypto_iov *data,
+							unsigned int num_data,
+							void *ivec);
+KRB5_LIB_FUNCTION krb5_error_code krb5_decrypt_ivec(krb5_context context,
+						    krb5_crypto crypto,
+						    unsigned usage,
+						    void *data,
+						    size_t len,
+						    krb5_data *result,
+						    void *ivec);
+KRB5_LIB_FUNCTION krb5_error_code krb5_encrypt_iov_ivec(krb5_context context,
+							krb5_crypto crypto,
+							unsigned usage,
+							krb5_crypto_iov *data,
+							int num_data,
+							void *ivec);
+KRB5_LIB_FUNCTION krb5_error_code krb5_encrypt_ivec(krb5_context context,
+						    krb5_crypto crypto,
+						    unsigned usage,
+						    const void *data,
+						    size_t len,
+						    krb5_data *result,
+						    void *ivec);
+KRB5_LIB_FUNCTION krb5_error_code krb5_enctype_disable(krb5_context context,
+						       krb5_enctype enctype);
+KRB5_LIB_FUNCTION krb5_error_code krb5_enctype_enable(krb5_context context,
+						      krb5_enctype enctype);
+KRB5_LIB_FUNCTION krb5_error_code krb5_enctype_to_keytype(krb5_context context,
+							  krb5_enctype etype,
+							  krb5_keytype *keytype);
+KRB5_LIB_FUNCTION size_t krb5_get_wrapped_length (krb5_context context,
+						  krb5_crypto  crypto,
+						  size_t       data_len);
+KRB5_LIB_FUNCTION krb5_error_code krb5_hmac(krb5_context context,
+					    krb5_cksumtype cktype,
+					    const void *data,
+					    size_t len,
+					    unsigned usage,
+					    krb5_keyblock *key,
+					    Checksum *result);
+KRB5_LIB_FUNCTION krb5_boolean krb5_is_enctype_weak(krb5_context context,
+						    krb5_enctype enctype);
+KRB5_LIB_FUNCTION krb5_error_code krb5_string_to_enctype(krb5_context context,
+							 const char *string,
+							 krb5_enctype *etype);
+KRB5_LIB_FUNCTION krb5_error_code krb5_verify_checksum_iov(krb5_context context,
+							   krb5_crypto crypto,
+							   unsigned usage,
+							   krb5_crypto_iov *data,
+							   unsigned int num_data,
+							   krb5_cksumtype *type);
+KRB5_LIB_FUNCTION krb5_error_code krb5_generate_random_keyblock(krb5_context context,
+								krb5_enctype type,
+								krb5_keyblock *key);
+KRB5_LIB_FUNCTION krb5_boolean krb5_checksum_is_collision_proof(krb5_context context,
+								krb5_cksumtype type);
+
+KRB5_LIB_FUNCTION krb5_error_code krb5_cksumtype_to_enctype(krb5_context context,
+							    krb5_cksumtype ctype,
+							    krb5_enctype *etype);
+KRB5_LIB_FUNCTION krb5_error_code krb5_encrypt_EncryptedData(krb5_context context,
+							     krb5_crypto crypto,
+							     unsigned usage,
+							     void *data,
+							     size_t len,
+							     int kvno,
+							     EncryptedData *result);
+KRB5_LIB_FUNCTION krb5_error_code krb5_crypto_getconfoundersize(krb5_context context,
+								krb5_crypto crypto,
+								size_t *confoundersize);
+
+KRB5_LIB_FUNCTION krb5_error_code krb5_decrypt_EncryptedData(krb5_context context,
+							     krb5_crypto crypto,
+							     unsigned usage,
+							     const EncryptedData *e,
+							     krb5_data *result);
+/* heimdal/krb5/data.c */
+KRB5_LIB_FUNCTION krb5_error_code krb5_data_realloc(krb5_data *p, int len);
+KRB5_LIB_FUNCTION krb5_error_code krb5_copy_data(krb5_context context,
+						 const krb5_data *indata,
+						 krb5_data **outdata);
+KRB5_LIB_FUNCTION int krb5_data_cmp(const krb5_data *data1, const krb5_data *data2);
+/* heimdal/krb5/store-int.c */
+KRB5_LIB_FUNCTION krb5_ssize_t _krb5_get_int(void *buffer, unsigned long *value, size_t size);
+
 #include "crypto.h"
 
 struct _krb5_checksum_type * _krb5_find_checksum (krb5_cksumtype);
-- 
2.44.0