Added spec for Kernel#eval with binding from method defined by #eval.
[rbx.git] / stdlib / ext / openssl / openssl_missing.h
blob872e42c292c7512df003ef94bde750fd1169262d
1 /*
2 * $Id: openssl_missing.h 11708 2007-02-12 23:01:19Z shyouhei $
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'.)
11 #if !defined(_OSSL_OPENSSL_MISSING_H_)
12 #define _OSSL_OPENSSL_MISSING_H_
14 #if defined(__cplusplus)
15 extern "C" {
16 #endif
19 * These functions are not included in headers of OPENSSL <= 0.9.6b
22 #if !defined(PEM_read_bio_DSAPublicKey)
23 # define PEM_read_bio_DSAPublicKey(bp,x,cb,u) (DSA *)PEM_ASN1_read_bio( \
24 (char *(*)())d2i_DSAPublicKey,PEM_STRING_DSA_PUBLIC,bp,(char **)x,cb,u)
25 #endif
27 #if !defined(PEM_write_bio_DSAPublicKey)
28 # define PEM_write_bio_DSAPublicKey(bp,x) \
29 PEM_ASN1_write_bio((int (*)())i2d_DSAPublicKey,\
30 PEM_STRING_DSA_PUBLIC,\
31 bp,(char *)x, NULL, NULL, 0, NULL, NULL)
32 #endif
34 #if !defined(DSAPrivateKey_dup)
35 # define DSAPrivateKey_dup(dsa) (DSA *)ASN1_dup((int (*)())i2d_DSAPrivateKey, \
36 (char *(*)())d2i_DSAPrivateKey,(char *)dsa)
37 #endif
39 #if !defined(DSAPublicKey_dup)
40 # define DSAPublicKey_dup(dsa) (DSA *)ASN1_dup((int (*)())i2d_DSAPublicKey, \
41 (char *(*)())d2i_DSAPublicKey,(char *)dsa)
42 #endif
44 #if !defined(X509_REVOKED_dup)
45 # define X509_REVOKED_dup(rev) (X509_REVOKED *)ASN1_dup((int (*)())i2d_X509_REVOKED, \
46 (char *(*)())d2i_X509_REVOKED, (char *)rev)
47 #endif
49 #if !defined(PKCS7_SIGNER_INFO_dup)
50 # define PKCS7_SIGNER_INFO_dup(si) (PKCS7_SIGNER_INFO *)ASN1_dup((int (*)())i2d_PKCS7_SIGNER_INFO, \
51 (char *(*)())d2i_PKCS7_SIGNER_INFO, (char *)si)
52 #endif
54 #if !defined(PKCS7_RECIP_INFO_dup)
55 # define PKCS7_RECIP_INFO_dup(ri) (PKCS7_RECIP_INFO *)ASN1_dup((int (*)())i2d_PKCS7_RECIP_INFO, \
56 (char *(*)())d2i_PKCS7_RECIP_INFO, (char *)ri)
57 #endif
59 void HMAC_CTX_init(HMAC_CTX *ctx);
60 int HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
61 void HMAC_CTX_cleanup(HMAC_CTX *ctx);
63 EVP_MD_CTX *EVP_MD_CTX_create(void);
64 void EVP_MD_CTX_init(EVP_MD_CTX *ctx);
65 int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx);
66 void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx);
68 #if !defined(HAVE_EVP_CIPHER_CTX_COPY)
69 int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in);
70 #endif
72 #if !defined(HAVE_EVP_DIGESTINIT_EX)
73 # define EVP_DigestInit_ex(ctx, md, engine) EVP_DigestInit(ctx, md)
74 #endif
75 #if !defined(HAVE_EVP_DIGESTFINAL_EX)
76 # define EVP_DigestFinal_ex(ctx, buf, len) EVP_DigestFinal(ctx, buf, len)
77 #endif
79 #if !defined(HAVE_EVP_CIPHERINIT_EX)
80 # define EVP_CipherInit_ex(ctx, type, impl, key, iv, enc) EVP_CipherInit(ctx, type, key, iv, enc)
81 #endif
82 #if !defined(HAVE_EVP_CIPHERFINAL_EX)
83 # define EVP_CipherFinal_ex(ctx, outm, outl) EVP_CipherFinal(ctx, outm, outl)
84 #endif
86 #if !defined(EVP_CIPHER_name)
87 # define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e))
88 #endif
90 #if !defined(EVP_MD_name)
91 # define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_type(e))
92 #endif
94 #if !defined(HAVE_EVP_HMAC_INIT_EX)
95 # define HMAC_Init_ex(ctx, key, len, digest, engine) HMAC_Init(ctx, key, len, digest)
96 #endif
98 #if !defined(PKCS7_is_detached)
99 # define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7))
100 #endif
102 #if !defined(PKCS7_type_is_encrypted)
103 # define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted)
104 #endif
106 #if !defined(HAVE_OPENSSL_CLEANSE)
107 #define OPENSSL_cleanse(p, l) memset(p, 0, l)
108 #endif
110 void *X509_STORE_get_ex_data(X509_STORE *str, int idx);
111 int X509_STORE_set_ex_data(X509_STORE *str, int idx, void *data);
112 int X509_CRL_set_version(X509_CRL *x, long version);
113 int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name);
114 int X509_CRL_sort(X509_CRL *c);
115 int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
116 int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
117 int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
118 int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
119 int BN_rand_range(BIGNUM *r, BIGNUM *range);
120 int BN_pseudo_rand_range(BIGNUM *r, BIGNUM *range);
121 char *CONF_get1_default_config_file(void);
122 int PEM_def_callback(char *buf, int num, int w, void *key);
124 #if defined(__cplusplus)
126 #endif
129 #endif /* _OSSL_OPENSSL_MISSING_H_ */