]> git.saurik.com Git - apple/security.git/blob - cdsa/cssm/oidsalg.c
Security-30.1.tar.gz
[apple/security.git] / cdsa / cssm / oidsalg.c
1 /*
2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
3 *
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
8 * using this file.
9 *
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
16 */
17
18
19 /*
20 * oidsalg.c - OIDs defining crypto algorithms
21 */
22
23 #include <Security/oidsbase.h>
24 #include <Security/cssmtype.h>
25
26 static const uint8
27 OID_MD2[] = { OID_RSA_HASH, 2 },
28 OID_MD4[] = { OID_RSA_HASH, 4 },
29 OID_MD5[] = { OID_RSA_HASH, 5 },
30 OID_RSAEncryption[] = { OID_PKCS_1, 1 },
31 OID_MD2WithRSA[] = { OID_PKCS_1, 2 },
32 OID_MD4WithRSA[] = { OID_PKCS_1, 3 },
33 OID_MD5WithRSA[] = { OID_PKCS_1, 4 },
34 OID_SHA1WithRSA[] = { OID_PKCS_1, 5 },
35 OID_DHKeyAgreement[] = { OID_PKCS_3, 1 },
36 OID_OIW_DSA[] = { OID_OIW_ALGORITHM, 12 },
37 OID_OIW_DSAWithSHA1[] = { OID_OIW_ALGORITHM, 27 };
38
39 const CSSM_OID
40 CSSMOID_MD2 = {OID_RSA_HASH_LENGTH+1, (uint8 *)OID_MD2},
41 CSSMOID_MD4 = {OID_RSA_HASH_LENGTH+1, (uint8 *)OID_MD4},
42 CSSMOID_MD5 = {OID_RSA_HASH_LENGTH+1, (uint8 *)OID_MD5},
43 CSSMOID_RSA = {OID_PKCS_1_LENGTH+1, (uint8 *)OID_RSAEncryption},
44 CSSMOID_MD2WithRSA = {OID_PKCS_1_LENGTH+1, (uint8 *)OID_MD2WithRSA},
45 CSSMOID_MD4WithRSA = {OID_PKCS_1_LENGTH+1, (uint8 *)OID_MD4WithRSA},
46 CSSMOID_MD5WithRSA = {OID_PKCS_1_LENGTH+1, (uint8 *)OID_MD5WithRSA},
47 CSSMOID_SHA1WithRSA = {OID_PKCS_1_LENGTH+1, (uint8 *)OID_SHA1WithRSA},
48 CSSMOID_DH = {OID_PKCS_3_LENGTH+1, (uint8 *)OID_DHKeyAgreement},
49 CSSMOID_DSA = {OID_OIW_ALGORITHM_LENGTH+1, (uint8 *)OID_OIW_DSA},
50 CSSMOID_SHA1WithDSA = {OID_OIW_ALGORITHM_LENGTH+1, (uint8 *)OID_OIW_DSAWithSHA1} ;
51
52
53 /* iSignTP OBJECT IDENTIFIER ::=
54 * { appleTrustPolicy 1 }
55 * { 1 2 840 113635 100 1 1 }
56 *
57 * BER = 06 09 2A 86 48 86 F7 63 64 01 01
58 */
59 static const uint8
60 APPLE_TP_ISIGN[] = {APPLE_TP_OID, 1},
61
62 /* AppleX509Basic OBJECT IDENTIFIER ::=
63 * { appleTrustPolicy 2 }
64 * { 1 2 840 113635 100 1 2 }
65 *
66 * BER = 06 09 2A 86 48 86 F7 63 64 01 01
67 */
68 APPLE_TP_X509_BASIC[] = {APPLE_TP_OID, 2},
69
70 /* AppleSSLPolicy := {appleTrustPolicy 3 } */
71 APPLE_TP_SSL[] = {APPLE_TP_OID, 3},
72
73 /*
74 * fee OBJECT IDENTIFIER ::=
75 * { appleSecurityAlgorithm 1 }
76 * { 1 2 840 113635 100 2 1 }
77 *
78 * BER = 06 09 2A 86 48 86 F7 63 64 02 01
79 */
80 APPLE_FEE[] = {APPLE_ALG_OID, 1},
81
82 /*
83 * asc OBJECT IDENTIFIER ::=
84 * { appleSecurityAlgorithm 2 }
85 * { 1 2 840 113635 100 2 2 }
86 *
87 * BER = 06 09 2A 86 48 86 F7 63 64 02 02
88 */
89 APPLE_ASC[] = {APPLE_ALG_OID, 2},
90
91 /*
92 * fee_MD5 OBJECT IDENTIFIER ::=
93 * { appleSecurityAlgorithm 3 }
94 * { 1 2 840 113635 100 2 3 }
95 *
96 * BER = 06 09 2A 86 48 86 F7 63 64 02 03
97 */
98 APPLE_FEE_MD5[] = {APPLE_ALG_OID, 3},
99
100 /*
101 * fee_SHA1 OBJECT IDENTIFIER ::=
102 * { appleSecurityAlgorithm 4 }
103 * { 1 2 840 113635 100 2 4 }
104 *
105 * BER = 06 09 2A 86 48 86 F7 63 64 02 04
106 */
107 APPLE_FEE_SHA1[] = {APPLE_ALG_OID, 4},
108
109 /*
110 * feed OBJECT IDENTIFIER ::=
111 * { appleSecurityAlgorithm 5 }
112 * { 1 2 840 113635 100 2 5 }
113 *
114 * BER = 06 09 2A 86 48 86 F7 63 64 02 05
115 */
116 APPLE_FEED[] = {APPLE_ALG_OID, 5},
117
118 /*
119 * feedExp OBJECT IDENTIFIER ::=
120 * { appleSecurityAlgorithm 6 }
121 * { 1 2 840 113635 100 2 6 }
122 *
123 * BER = 06 09 2A 86 48 86 F7 63 64 02 06
124 */
125 APPLE_FEEDEXP[] = {APPLE_ALG_OID, 6},
126
127 /*
128 * AppleECDSA OBJECT IDENTIFIER ::=
129 * { appleSecurityAlgorithm 7 }
130 * { 1 2 840 113635 100 2 7 }
131 *
132 * BER = 06 09 2A 86 48 86 F7 63 64 02 07
133 */
134 APPLE_ECDSA[] = {APPLE_ALG_OID, 7};
135
136 const CSSM_OID
137
138 CSSMOID_APPLE_ISIGN = {APPLE_TP_OID_LENGTH+1, (uint8 *)APPLE_TP_ISIGN},
139 CSSMOID_APPLE_X509_BASIC = {APPLE_TP_OID_LENGTH+1, (uint8 *)APPLE_TP_X509_BASIC},
140 CSSMOID_APPLE_TP_SSL = {APPLE_TP_OID_LENGTH+1, (uint8 *)APPLE_TP_SSL},
141 CSSMOID_APPLE_FEE = {APPLE_ALG_OID_LENGTH+1, (uint8 *)APPLE_FEE},
142 CSSMOID_APPLE_ASC = {APPLE_ALG_OID_LENGTH+1, (uint8 *)APPLE_ASC},
143 CSSMOID_APPLE_FEE_MD5 = {APPLE_ALG_OID_LENGTH+1, (uint8 *)APPLE_FEE_MD5},
144 CSSMOID_APPLE_FEE_SHA1 = {APPLE_ALG_OID_LENGTH+1, (uint8 *)APPLE_FEE_SHA1},
145 CSSMOID_APPLE_FEED = {APPLE_ALG_OID_LENGTH+1, (uint8 *)APPLE_FEED},
146 CSSMOID_APPLE_FEEDEXP = {APPLE_ALG_OID_LENGTH+1, (uint8 *)APPLE_FEEDEXP},
147 CSSMOID_APPLE_ECDSA = {APPLE_ALG_OID_LENGTH+1, (uint8 *)APPLE_ECDSA};
148
149