]>
git.saurik.com Git - apple/xnu.git/blob - bsd/nfs/nfs_gss_crypto.h
2 * Copyright (c) 2008 Apple Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
30 #ifndef _NFS_NFS_GSS_CRYPTO_H_
31 #define _NFS_NFS_GSS_CRYPTO_H_
32 #include <libkern/libkern.h>
33 #include <libkern/crypto/sha1.h>
34 #include <libkern/crypto/md5.h>
35 #include <libkern/crypto/des.h>
37 #define KG_USAGE_SEAL 22
38 #define KG_USAGE_SIGN 23
39 #define KG_USAGE_SEQ 24
41 #define KEY_USAGE_DES3_SEAL (const unsigned char *)"\x00\x00\x00\x16\xaa"
42 #define KEY_USAGE_DES3_SIGN (const unsigned char *)"\x00\x00\x00\x17\x99"
43 #define KEY_USAGE_DES3_SEQ (const unsigned char *)"\x00\x00\x00\x18\x55"
44 #define KEY_USAGE_LEN 5
49 } HMAC_SHA1_DES3KD_CTX
;
53 des_cbc_key_schedule
*sched
;
56 #define MD5_DESCBC_DIGEST_LENGTH 8
60 void krb5_nfold(unsigned int, const unsigned char *, unsigned int, unsigned char *);
61 void des3_make_key(const unsigned char[21], des_cblock
[3]);
62 int des3_derive_key(des_cblock
[3], des_cblock
[3], const unsigned char *, int);
64 void HMAC_SHA1_DES3KD_Init(HMAC_SHA1_DES3KD_CTX
*, des_cblock
[3], int);
65 void HMAC_SHA1_DES3KD_Update(HMAC_SHA1_DES3KD_CTX
*, void *, size_t);
66 void HMAC_SHA1_DES3KD_Final(void *, HMAC_SHA1_DES3KD_CTX
*);
68 void MD5_DESCBC_Init(MD5_DESCBC_CTX
*, des_cbc_key_schedule
*);
69 void MD5_DESCBC_Update(MD5_DESCBC_CTX
*, void *, size_t);
70 void MD5_DESCBC_Final(void *, MD5_DESCBC_CTX
*);
74 #endif /* _NFS_NFS_GSS_CRYPTO_H_ */