summaryrefslogtreecommitdiffstats
path: root/src/lib/crypto/cryptoconf.c
blob: 85b44380b1932ca73ea0b76922ef4c208afd66d5 (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
/*
 * $Source$
 * $Author$
 *
 * Copyright 1990 by the Massachusetts Institute of Technology.
 *
 * For copying and distribution information, please see the file
 * <krb5/copyright.h>.
 *
 * Cryptosystem configurations
 */

#if !defined(lint) && !defined(SABER)
static char rcsid_cryptoconf_c[] =
"$Id$";
#endif	/* !lint & !SABER */

#include <krb5/copyright.h>
#include <krb5/config.h>
#include <krb5/osconf.h>
#include <krb5/krb5.h>

#if defined(PROVIDE_DES_CBC_CRC) || defined(PROVIDE_LUCIFER_CRC) || defined(PROVIDE_CRC32)
#include <krb5/crc-32.h>
#define CRC32_CKENTRY &crc32_cksumtable_entry
#else
#define CRC32_CKENTRY 0
#endif

#ifdef PROVIDE_RSA_MD4
#include <krb5/rsa-md4.h>
#define MD4_CKENTRY &rsa_md4_cksumtable_entry
#define MD4_DES_CKENTRY &rsa_md4_des_cksumtable_entry
#else
#define MD4_CKENTRY 0
#define MD4_DES_CKENTRY 0
#endif

#ifdef PROVIDE_SNEFRU
#define XEROX_CKENTRY &snefru_cksumtable_entry
#else
#define XEROX_CKENTRY 0
#endif

#ifdef PROVIDE_DES_CBC_CKSUM
#include <krb5/mit-des.h>
#define _DES_DONE__
#define DES_CBC_CKENTRY &mit_des_cbc_cksumtable_entry
#else
#define DES_CBC_CKENTRY 0
#endif

#ifdef PROVIDE_DES_CBC_CRC
#ifndef _DES_DONE__
#include <krb5/mit-des.h>
#define _DES_DONE__
#endif
static krb5_cs_table_entry mit_des_cbc_crc_csentry = {
    &mit_des_cryptosystem_entry, 0 };
#define DES_CBC_CRC_CSENTRY &mit_des_cbc_crc_csentry
#else
#define DES_CBC_CRC_CSENTRY 0
#endif

#ifdef PROVIDE_LUCIFER_CRC
static krb5_cs_table_entry lucifer_crc_csentry = {
    &lucifer_cryptosystem_entry, 0 };
#define LUCIFER_CRC_CSENTRY &lucifer_crc_csentry
#else
#define LUCIFER_CRC_CSENTRY 0
#endif

/* WARNING:
   make sure the order of entries in these tables matches the #defines in
   <krb5/encryption.h>
 */

krb5_cs_table_entry *krb5_csarray[] = {
    0,
    DES_CBC_CRC_CSENTRY,
    LUCIFER_CRC_CSENTRY,
};

int krb5_max_cryptosystem = sizeof(krb5_csarray)/sizeof(krb5_csarray[0]) - 1;

krb5_cs_table_entry *krb5_keytype_array[] = {
    0,
    DES_CBC_CRC_CSENTRY,
    LUCIFER_CRC_CSENTRY,
};

int krb5_max_keytype = sizeof(krb5_keytype_array)/sizeof(krb5_keytype_array[0]) - 1;

krb5_checksum_entry *krb5_cksumarray[] = {
    0,
    CRC32_CKENTRY,
    MD4_CKENTRY,
    MD4_DES_CKENTRY,
    DES_CBC_CKENTRY,
};

int krb5_max_cksum = sizeof(krb5_cksumarray)/sizeof(krb5_cksumarray[0]);

#undef _DES_DONE__