1 .\" Copyright (c) 1999-2005 Kungliga Tekniska Högskolan
2 .\" (Royal Institute of Technology, Stockholm, Sweden).
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" 3. Neither the name of the Institute nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 .Nm krb5_checksum_disable ,
40 .Nm krb5_checksum_is_collision_proof ,
41 .Nm krb5_checksum_is_keyed ,
42 .Nm krb5_checksumsize ,
43 .Nm krb5_cksumtype_valid ,
44 .Nm krb5_copy_checksum ,
45 .Nm krb5_create_checksum ,
46 .Nm krb5_crypto_get_checksum_type
47 .Nm krb5_free_checksum ,
48 .Nm krb5_free_checksum_contents ,
50 .Nm krb5_verify_checksum
51 .Nd creates, handles and verifies checksums
53 Kerberos 5 Library (libkrb5, -lkrb5)
57 .Li "typedef Checksum krb5_checksum;"
59 .Fo krb5_checksum_disable
60 .Fa "krb5_context context"
61 .Fa "krb5_cksumtype type"
64 .Fo krb5_checksum_is_collision_proof
65 .Fa "krb5_context context"
66 .Fa "krb5_cksumtype type"
69 .Fo krb5_checksum_is_keyed
70 .Fa "krb5_context context"
71 .Fa "krb5_cksumtype type"
74 .Fo krb5_cksumtype_valid
75 .Fa "krb5_context context"
76 .Fa "krb5_cksumtype ctype"
80 .Fa "krb5_context context"
81 .Fa "krb5_cksumtype type"
85 .Fo krb5_create_checksum
86 .Fa "krb5_context context"
87 .Fa "krb5_crypto crypto"
88 .Fa "krb5_key_usage usage"
92 .Fa "Checksum *result"
95 .Fo krb5_verify_checksum
96 .Fa "krb5_context context"
97 .Fa "krb5_crypto crypto"
98 .Fa "krb5_key_usage usage"
101 .Fa "Checksum *cksum"
104 .Fo krb5_crypto_get_checksum_type
105 .Fa "krb5_context context"
106 .Fa "krb5_crypto crypto"
107 .Fa "krb5_cksumtype *type"
110 .Fo krb5_free_checksum
111 .Fa "krb5_context context"
112 .Fa "krb5_checksum *cksum"
115 .Fo krb5_free_checksum_contents
116 .Fa "krb5_context context"
117 .Fa "krb5_checksum *cksum"
121 .Fa "krb5_context context"
122 .Fa "krb5_cksumtype cktype"
123 .Fa "const void *data"
126 .Fa "krb5_keyblock *key"
127 .Fa "Checksum *result"
130 .Fo krb5_copy_checksum
131 .Fa "krb5_context context"
132 .Fa "const krb5_checksum *old"
133 .Fa "krb5_checksum **new"
138 structure holds a Kerberos checksum.
139 There is no component inside
141 that is directly referable.
143 The functions are used to create and verify checksums.
144 .Fn krb5_create_checksum
145 creates a checksum of the specified data, and puts it in
152 specifies the checksum type to use; it must not be keyed. Otherwise
154 is an encryption context created by
155 .Fn krb5_crypto_init ,
158 specifies a key-usage.
160 .Fn krb5_verify_checksum
163 against the provided data.
165 .Fn krb5_checksum_is_collision_proof
166 returns true is the specified checksum is collision proof (that it's
167 very unlikely that two strings has the same hash value, and that it's
168 hard to find two strings that has the same hash). Examples of
169 collision proof checksums are MD5, and SHA1, while CRC32 is not.
171 .Fn krb5_checksum_is_keyed
172 returns true if the specified checksum type is keyed (that the hash
173 value is a function of both the data, and a separate key). Examples of
174 keyed hash algorithms are HMAC-SHA1-DES3, and RSA-MD5-DES. The
176 hash functions MD5, and SHA1 are not keyed.
178 .Fn krb5_crypto_get_checksum_type
179 returns the checksum type that will be used when creating a checksum for the given
182 This function is useful in combination with
183 .Fn krb5_checksumsize
184 when you want to know the size a checksum will
185 use when you create it.
187 .Fn krb5_cksumtype_valid
188 returns 0 or an error if the checksumtype is implemented and not
189 currently disabled in this kerberos library.
191 .Fn krb5_checksumsize
192 returns the size of the outdata of checksum function.
194 .Fn krb5_copy_checksum
195 returns a copy of the checksum
196 .Fn krb5_free_checksum
197 should use used to free the
201 .Fn krb5_free_checksum
202 free the checksum and the content of the checksum.
204 .Fn krb5_free_checksum_contents
205 frees the content of checksum in
209 calculates the HMAC over
217 Note that keyusage is not always used in checksums.
219 .Nm krb5_checksum_disable
220 globally disables the checksum type.
224 .Xr krb5_crypto_init 3 ,
225 .Xr krb5_c_encrypt 3 ,