Ruby 2.0.0p353(2013-11-22revision43784)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

openssl_missing.h
Go to the documentation of this file.
1 /*
2 * $Id: openssl_missing.h 32230 2011-06-26 01:32:03Z emboss $
3 * 'OpenSSL for Ruby' project
4 * Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
5 * All rights reserved.
6 */
7 /*
8 * This program is licenced under the same licence as Ruby.
9 * (See the file 'LICENCE'.)
10 */
11 #if !defined(_OSSL_OPENSSL_MISSING_H_)
12 #define _OSSL_OPENSSL_MISSING_H_
13
14 #if defined(__cplusplus)
15 extern "C" {
16 #endif
17
18 #ifndef TYPEDEF_D2I_OF
19 typedef char *d2i_of_void();
20 #endif
21 #ifndef TYPEDEF_I2D_OF
22 typedef int i2d_of_void();
23 #endif
24
25 /*
26 * These functions are not included in headers of OPENSSL <= 0.9.6b
27 */
28
29 #if !defined(PEM_read_bio_DSAPublicKey)
30 # define PEM_read_bio_DSAPublicKey(bp,x,cb,u) (DSA *)PEM_ASN1_read_bio( \
31 (d2i_of_void *)d2i_DSAPublicKey,PEM_STRING_DSA_PUBLIC,(bp),(void **)(x),(cb),(u))
32 #endif
33
34 #if !defined(PEM_write_bio_DSAPublicKey)
35 # define PEM_write_bio_DSAPublicKey(bp,x) \
36 PEM_ASN1_write_bio((i2d_of_void *)i2d_DSAPublicKey,\
37 PEM_STRING_DSA_PUBLIC,\
38 (bp),(char *)(x), NULL, NULL, 0, NULL, NULL)
39 #endif
40
41 #if !defined(DSAPrivateKey_dup)
42 # define DSAPrivateKey_dup(dsa) (DSA *)ASN1_dup((i2d_of_void *)i2d_DSAPrivateKey, \
43 (d2i_of_void *)d2i_DSAPrivateKey,(char *)(dsa))
44 #endif
45
46 #if !defined(DSAPublicKey_dup)
47 # define DSAPublicKey_dup(dsa) (DSA *)ASN1_dup((i2d_of_void *)i2d_DSAPublicKey, \
48 (d2i_of_void *)d2i_DSAPublicKey,(char *)(dsa))
49 #endif
50
51 #if !defined(X509_REVOKED_dup)
52 # define X509_REVOKED_dup(rev) (X509_REVOKED *)ASN1_dup((i2d_of_void *)i2d_X509_REVOKED, \
53 (d2i_of_void *)d2i_X509_REVOKED, (char *)(rev))
54 #endif
55
56 #if !defined(PKCS7_SIGNER_INFO_dup)
57 # define PKCS7_SIGNER_INFO_dup(si) (PKCS7_SIGNER_INFO *)ASN1_dup((i2d_of_void *)i2d_PKCS7_SIGNER_INFO, \
58 (d2i_of_void *)d2i_PKCS7_SIGNER_INFO, (char *)(si))
59 #endif
60
61 #if !defined(PKCS7_RECIP_INFO_dup)
62 # define PKCS7_RECIP_INFO_dup(ri) (PKCS7_RECIP_INFO *)ASN1_dup((i2d_of_void *)i2d_PKCS7_RECIP_INFO, \
63 (d2i_of_void *)d2i_PKCS7_RECIP_INFO, (char *)(ri))
64 #endif
65
66 #if !defined(HAVE_HMAC_CTX_INIT)
67 void HMAC_CTX_init(HMAC_CTX *ctx);
68 #endif
69
70 #if !defined(HAVE_HMAC_CTX_COPY)
71 void HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
72 #endif
73
74 #if !defined(HAVE_HMAC_CTX_CLEANUP)
75 void HMAC_CTX_cleanup(HMAC_CTX *ctx);
76 #endif
77
78 #if !defined(HAVE_EVP_MD_CTX_CREATE)
79 EVP_MD_CTX *EVP_MD_CTX_create(void);
80 #endif
81
82 #if !defined(HAVE_EVP_MD_CTX_INIT)
83 void EVP_MD_CTX_init(EVP_MD_CTX *ctx);
84 #endif
85
86 #if !defined(HAVE_EVP_MD_CTX_CLEANUP)
87 int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx);
88 #endif
89
90 #if !defined(HAVE_EVP_MD_CTX_DESTROY)
91 void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx);
92 #endif
93
94 #if !defined(HAVE_EVP_CIPHER_CTX_COPY)
95 int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in);
96 #endif
97
98 #if !defined(HAVE_EVP_DIGESTINIT_EX)
99 # define EVP_DigestInit_ex(ctx, md, engine) EVP_DigestInit((ctx), (md))
100 #endif
101 #if !defined(HAVE_EVP_DIGESTFINAL_EX)
102 # define EVP_DigestFinal_ex(ctx, buf, len) EVP_DigestFinal((ctx), (buf), (len))
103 #endif
104
105 #if !defined(HAVE_EVP_CIPHERINIT_EX)
106 # define EVP_CipherInit_ex(ctx, type, impl, key, iv, enc) EVP_CipherInit((ctx), (type), (key), (iv), (enc))
107 #endif
108 #if !defined(HAVE_EVP_CIPHERFINAL_EX)
109 # define EVP_CipherFinal_ex(ctx, outm, outl) EVP_CipherFinal((ctx), (outm), (outl))
110 #endif
111
112 #if !defined(EVP_CIPHER_name)
113 # define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e))
114 #endif
115
116 #if !defined(EVP_MD_name)
117 # define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_type(e))
118 #endif
119
120 #if !defined(HAVE_EVP_HMAC_INIT_EX)
121 # define HMAC_Init_ex(ctx, key, len, digest, engine) HMAC_Init((ctx), (key), (len), (digest))
122 #endif
123
124 #if !defined(PKCS7_is_detached)
125 # define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7))
126 #endif
127
128 #if !defined(PKCS7_type_is_encrypted)
129 # define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted)
130 #endif
131
132 #if !defined(HAVE_OPENSSL_CLEANSE)
133 #define OPENSSL_cleanse(p, l) memset((p), 0, (l))
134 #endif
135
136 #if !defined(HAVE_X509_STORE_GET_EX_DATA)
137 void *X509_STORE_get_ex_data(X509_STORE *str, int idx);
138 #endif
139
140 #if !defined(HAVE_X509_STORE_SET_EX_DATA)
141 int X509_STORE_set_ex_data(X509_STORE *str, int idx, void *data);
142 #endif
143
144 #if !defined(HAVE_X509_CRL_SET_VERSION)
145 int X509_CRL_set_version(X509_CRL *x, long version);
146 #endif
147
148 #if !defined(HAVE_X509_CRL_SET_ISSUER_NAME)
149 int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name);
150 #endif
151
152 #if !defined(HAVE_X509_CRL_SORT)
153 int X509_CRL_sort(X509_CRL *c);
154 #endif
155
156 #if !defined(HAVE_X509_CRL_ADD0_REVOKED)
157 int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
158 #endif
159
160 #if !defined(HAVE_BN_MOD_SQR)
161 int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
162 #endif
163
164 #if !defined(HAVE_BN_MOD_ADD)
165 int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
166 #endif
167
168 #if !defined(HAVE_BN_MOD_SUB)
169 int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
170 #endif
171
172 #if !defined(HAVE_BN_RAND_RANGE)
173 int BN_rand_range(BIGNUM *r, BIGNUM *range);
174 #endif
175
176 #if !defined(HAVE_BN_PSEUDO_RAND_RANGE)
177 int BN_pseudo_rand_range(BIGNUM *r, BIGNUM *range);
178 #endif
179
180 #if !defined(HAVE_CONF_GET1_DEFAULT_CONFIG_FILE)
181 char *CONF_get1_default_config_file(void);
182 #endif
183
184 #if !defined(HAVE_PEM_DEF_CALLBACK)
185 int PEM_def_callback(char *buf, int num, int w, void *key);
186 #endif
187
188 #if !defined(HAVE_ASN1_PUT_EOC)
189 int ASN1_put_eoc(unsigned char **pp);
190 #endif
191
192 #if defined(__cplusplus)
193 }
194 #endif
195
196
197 #endif /* _OSSL_OPENSSL_MISSING_H_ */
198
data
VALUE data
Definition: tcltklib.c:3368
BN_rand_range
int BN_rand_range(BIGNUM *r, BIGNUM *range)
Definition: openssl_missing.c:269
d2i_of_void
char * d2i_of_void()
Definition: openssl_missing.h:19
out
C_block * out
Definition: crypt.c:308
EVP_MD_CTX_destroy
void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx)
Definition: openssl_missing.c:78
a
Real * a
Definition: bigdecimal.c:1182
in
int const char * in
Definition: crypt.c:639
HMAC_CTX_copy
void HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in)
Definition: openssl_missing.c:26
X509_STORE_get_ex_data
void * X509_STORE_get_ex_data(X509_STORE *str, int idx)
Definition: openssl_missing.c:46
BN_mod_add
int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx)
Definition: openssl_missing.c:219
r
r
Definition: bigdecimal.c:1196
BN_mod_sqr
int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx)
Definition: openssl_missing.c:201
X509_CRL_sort
int X509_CRL_sort(X509_CRL *c)
Definition: openssl_missing.c:161
m
BDIGIT m
Definition: bigdecimal.c:5085
str
static VALUE char * str
Definition: tcltklib.c:3547
idx
int idx
Definition: tcltklib.c:9716
range
#define range(low, item, hi)
Definition: date_strftime.c:21
buf
unsigned char buf[MIME_BUF_SIZE]
Definition: nkf.c:4308
X509_CRL_set_issuer_name
int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name)
Definition: openssl_missing.c:152
key
static int VALUE key
Definition: tkutil.c:265
PEM_def_callback
int PEM_def_callback(char *buf, int num, int w, void *key)
Definition: openssl_missing.c:313
EVP_MD_CTX_create
EVP_MD_CTX * EVP_MD_CTX_create(void)
Definition: openssl_missing.c:54
i2d_of_void
int i2d_of_void()
Definition: openssl_missing.h:22
BN_pseudo_rand_range
int BN_pseudo_rand_range(BIGNUM *r, BIGNUM *range)
Definition: openssl_missing.c:277
X509_STORE_set_ex_data
int X509_STORE_set_ex_data(X509_STORE *str, int idx, void *data)
Definition: openssl_missing.c:39
EVP_MD_CTX_init
void EVP_MD_CTX_init(EVP_MD_CTX *ctx)
Definition: openssl_missing.c:87
b
Real * b
Definition: bigdecimal.c:1182
c
VpDivd * c
Definition: bigdecimal.c:1205
HMAC_CTX_init
void HMAC_CTX_init(HMAC_CTX *ctx)
Definition: openssl_missing.c:95
X509_CRL_add0_revoked
int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev)
Definition: openssl_missing.c:186
ASN1_put_eoc
int ASN1_put_eoc(unsigned char **pp)
Definition: openssl_missing.c:347
EVP_MD_CTX_cleanup
int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx)
Definition: openssl_missing.c:67
BN_mod_sub
int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx)
Definition: openssl_missing.c:228
CONF_get1_default_config_file
char * CONF_get1_default_config_file(void)
Definition: openssl_missing.c:286
version
static void version(void)
Definition: nkf.c:898
EVP_CIPHER_CTX_copy
int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in)
Definition: openssl_missing.c:121
X509_CRL_set_version
int X509_CRL_set_version(X509_CRL *x, long version)
Definition: openssl_missing.c:139
name
const char * name
Definition: nkf.c:208
HMAC_CTX_cleanup
void HMAC_CTX_cleanup(HMAC_CTX *ctx)
Definition: openssl_missing.c:105