]> git.saurik.com Git - apple/network_cmds.git/blame - eaytest.tproj/crypto_openssl.h
network_cmds-115.tar.gz
[apple/network_cmds.git] / eaytest.tproj / crypto_openssl.h
CommitLineData
7ba0088d
A
1/* $KAME: crypto_openssl.h,v 1.23 2001/08/14 12:26:06 sakane Exp $ */
2
3/*
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * 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.
15 * 3. Neither the name of the project nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 */
31
32#ifdef HAVE_SIGNING_C
33/* X509 Certificate */
34#define GENT_OTHERNAME 0
35#define GENT_EMAIL 1
36#define GENT_DNS 2
37#define GENT_X400 3
38#define GENT_DIRNAME 4
39#define GENT_EDIPARTY 5
40#define GENT_URI 6
41#define GENT_IPADD 7
42#define GENT_RID 8
43
44extern vchar_t *eay_str2asn1dn __P((char *, int));
45extern int eay_cmp_asn1dn __P((vchar_t *, vchar_t *));
46extern int eay_check_x509cert __P((vchar_t *, char *));
47extern vchar_t *eay_get_x509asn1subjectname __P((vchar_t *));
48extern int eay_get_x509subjectaltname __P((vchar_t *, char **, int *, int));
49extern char *eay_get_x509text __P((vchar_t *));
50extern vchar_t *eay_get_x509cert __P((char *));
51extern vchar_t *eay_get_x509sign __P((vchar_t *, vchar_t *, vchar_t *));
52extern int eay_check_x509sign __P((vchar_t *, vchar_t *, vchar_t *));
53extern int eay_check_pkcs7sign __P((vchar_t *, vchar_t *, vchar_t *));
54
55/* RSA */
56extern vchar_t *eay_rsa_sign __P((vchar_t *, vchar_t *));
57extern int eay_rsa_verify __P((vchar_t *, vchar_t *, vchar_t *));
58
59/* ASN.1 */
60extern vchar_t *eay_get_pkcs1privkey __P((char *));
61extern vchar_t *eay_get_pkcs1pubkey __P((char *));
62#endif
63
64/* string error */
65extern char *eay_strerror __P((void));
66extern void eay_init_error __P((void));
67
68/* DES */
69extern vchar_t *eay_des_encrypt __P((vchar_t *, vchar_t *, vchar_t *));
70extern vchar_t *eay_des_decrypt __P((vchar_t *, vchar_t *, vchar_t *));
71extern int eay_des_weakkey __P((vchar_t *));
72extern int eay_des_keylen __P((int));
73
74/* IDEA */
75extern vchar_t *eay_idea_encrypt __P((vchar_t *, vchar_t *, vchar_t *));
76extern vchar_t *eay_idea_decrypt __P((vchar_t *, vchar_t *, vchar_t *));
77extern int eay_idea_weakkey __P((vchar_t *));
78extern int eay_idea_keylen __P((int));
79
80/* blowfish */
81extern vchar_t *eay_bf_encrypt __P((vchar_t *, vchar_t *, vchar_t *));
82extern vchar_t *eay_bf_decrypt __P((vchar_t *, vchar_t *, vchar_t *));
83extern int eay_bf_weakkey __P((vchar_t *));
84extern int eay_bf_keylen __P((int));
85
86/* RC5 */
87extern vchar_t *eay_rc5_encrypt __P((vchar_t *, vchar_t *, vchar_t *));
88extern vchar_t *eay_rc5_decrypt __P((vchar_t *, vchar_t *, vchar_t *));
89extern int eay_rc5_weakkey __P((vchar_t *));
90extern int eay_rc5_keylen __P((int));
91
92/* 3DES */
93extern vchar_t *eay_3des_encrypt __P((vchar_t *, vchar_t *, vchar_t *));
94extern vchar_t *eay_3des_decrypt __P((vchar_t *, vchar_t *, vchar_t *));
95extern int eay_3des_weakkey __P((vchar_t *));
96extern int eay_3des_keylen __P((int));
97
98/* CAST */
99extern vchar_t *eay_cast_encrypt __P((vchar_t *, vchar_t *, vchar_t *));
100extern vchar_t *eay_cast_decrypt __P((vchar_t *, vchar_t *, vchar_t *));
101extern int eay_cast_weakkey __P((vchar_t *));
102extern int eay_cast_keylen __P((int));
103
104/* AES(RIJNDAEL) */
105extern vchar_t *eay_aes_encrypt __P((vchar_t *, vchar_t *, vchar_t *));
106extern vchar_t *eay_aes_decrypt __P((vchar_t *, vchar_t *, vchar_t *));
107extern int eay_aes_weakkey __P((vchar_t *));
108extern int eay_aes_keylen __P((int));
109
110/* misc */
111extern int eay_null_hashlen __P((void));
112extern int eay_kpdk_hashlen __P((void));
113extern int eay_twofish_keylen __P((int));
114
115/* hash */
116/* HMAC SHA2 */
117extern vchar_t *eay_hmacsha2_512_one __P((vchar_t *, vchar_t *));
118extern caddr_t eay_hmacsha2_512_init __P((vchar_t *));
119extern void eay_hmacsha2_512_update __P((caddr_t, vchar_t *));
120extern vchar_t *eay_hmacsha2_512_final __P((caddr_t));
121extern vchar_t *eay_hmacsha2_384_one __P((vchar_t *, vchar_t *));
122extern caddr_t eay_hmacsha2_384_init __P((vchar_t *));
123extern void eay_hmacsha2_384_update __P((caddr_t, vchar_t *));
124extern vchar_t *eay_hmacsha2_384_final __P((caddr_t));
125extern vchar_t *eay_hmacsha2_256_one __P((vchar_t *, vchar_t *));
126extern caddr_t eay_hmacsha2_256_init __P((vchar_t *));
127extern void eay_hmacsha2_256_update __P((caddr_t, vchar_t *));
128extern vchar_t *eay_hmacsha2_256_final __P((caddr_t));
129/* HMAC SHA1 */
130extern vchar_t *eay_hmacsha1_one __P((vchar_t *, vchar_t *));
131extern caddr_t eay_hmacsha1_init __P((vchar_t *));
132extern void eay_hmacsha1_update __P((caddr_t, vchar_t *));
133extern vchar_t *eay_hmacsha1_final __P((caddr_t));
134/* HMAC MD5 */
135extern vchar_t *eay_hmacmd5_one __P((vchar_t *, vchar_t *));
136extern caddr_t eay_hmacmd5_init __P((vchar_t *));
137extern void eay_hmacmd5_update __P((caddr_t, vchar_t *));
138extern vchar_t *eay_hmacmd5_final __P((caddr_t));
139
140/* SHA2 functions */
141extern caddr_t eay_sha2_512_init __P((void));
142extern void eay_sha2_512_update __P((caddr_t, vchar_t *));
143extern vchar_t *eay_sha2_512_final __P((caddr_t));
144extern vchar_t *eay_sha2_512_one __P((vchar_t *));
145extern int eay_sha2_512_hashlen __P((void));
146
147extern caddr_t eay_sha2_384_init __P((void));
148extern void eay_sha2_384_update __P((caddr_t, vchar_t *));
149extern vchar_t *eay_sha2_384_final __P((caddr_t));
150extern vchar_t *eay_sha2_384_one __P((vchar_t *));
151extern int eay_sha2_384_hashlen __P((void));
152
153extern caddr_t eay_sha2_256_init __P((void));
154extern void eay_sha2_256_update __P((caddr_t, vchar_t *));
155extern vchar_t *eay_sha2_256_final __P((caddr_t));
156extern vchar_t *eay_sha2_256_one __P((vchar_t *));
157extern int eay_sha2_256_hashlen __P((void));
158
159/* SHA functions */
160extern caddr_t eay_sha1_init __P((void));
161extern void eay_sha1_update __P((caddr_t, vchar_t *));
162extern vchar_t *eay_sha1_final __P((caddr_t));
163extern vchar_t *eay_sha1_one __P((vchar_t *));
164extern int eay_sha1_hashlen __P((void));
165
166/* MD5 functions */
167extern caddr_t eay_md5_init __P((void));
168extern void eay_md5_update __P((caddr_t, vchar_t *));
169extern vchar_t *eay_md5_final __P((caddr_t));
170extern vchar_t *eay_md5_one __P((vchar_t *));
171extern int eay_md5_hashlen __P((void));
172
173/* eay_set_random */
174extern vchar_t *eay_set_random __P((u_int32_t));
175
176/* DH */
177extern int eay_dh_generate __P((vchar_t *, u_int32_t, u_int, vchar_t **, vchar_t **));
178extern int eay_dh_compute __P((vchar_t *, u_int32_t, vchar_t *, vchar_t *, vchar_t *, vchar_t **));
179
180/* misc */
181extern int eay_revbnl __P((vchar_t *));
182#include <openssl/bn.h>
183extern int eay_v2bn __P((BIGNUM **, vchar_t *));
184extern int eay_bn2v __P((vchar_t **, BIGNUM *));
185
186extern const char *eay_version __P((void));
187
188#define CBC_BLOCKLEN 8
189#define IPSEC_ENCRYPTKEYLEN 8