Ruby 1.9.3p327(2012-11-10revision37606)
ext/openssl/openssl_missing.h
Go to the documentation of this file.
00001 /*
00002  * $Id: openssl_missing.h 32230 2011-06-26 01:32:03Z emboss $
00003  * 'OpenSSL for Ruby' project
00004  * Copyright (C) 2001-2002  Michal Rokos <m.rokos@sh.cvut.cz>
00005  * All rights reserved.
00006  */
00007 /*
00008  * This program is licenced under the same licence as Ruby.
00009  * (See the file 'LICENCE'.)
00010  */
00011 #if !defined(_OSSL_OPENSSL_MISSING_H_)
00012 #define _OSSL_OPENSSL_MISSING_H_
00013 
00014 #if defined(__cplusplus)
00015 extern "C" {
00016 #endif
00017 
00018 #ifndef TYPEDEF_D2I_OF
00019 typedef char *d2i_of_void();
00020 #endif
00021 #ifndef TYPEDEF_I2D_OF
00022 typedef int i2d_of_void();
00023 #endif
00024 
00025 /*
00026  * These functions are not included in headers of OPENSSL <= 0.9.6b
00027  */
00028 
00029 #if !defined(PEM_read_bio_DSAPublicKey)
00030 # define PEM_read_bio_DSAPublicKey(bp,x,cb,u) (DSA *)PEM_ASN1_read_bio( \
00031         (d2i_of_void *)d2i_DSAPublicKey,PEM_STRING_DSA_PUBLIC,(bp),(void **)(x),(cb),(u))
00032 #endif
00033 
00034 #if !defined(PEM_write_bio_DSAPublicKey)
00035 # define PEM_write_bio_DSAPublicKey(bp,x) \
00036         PEM_ASN1_write_bio((i2d_of_void *)i2d_DSAPublicKey,\
00037                 PEM_STRING_DSA_PUBLIC,\
00038                 (bp),(char *)(x), NULL, NULL, 0, NULL, NULL)
00039 #endif
00040 
00041 #if !defined(DSAPrivateKey_dup)
00042 # define DSAPrivateKey_dup(dsa) (DSA *)ASN1_dup((i2d_of_void *)i2d_DSAPrivateKey, \
00043         (d2i_of_void *)d2i_DSAPrivateKey,(char *)(dsa))
00044 #endif
00045 
00046 #if !defined(DSAPublicKey_dup)
00047 # define DSAPublicKey_dup(dsa) (DSA *)ASN1_dup((i2d_of_void *)i2d_DSAPublicKey, \
00048         (d2i_of_void *)d2i_DSAPublicKey,(char *)(dsa))
00049 #endif
00050 
00051 #if !defined(X509_REVOKED_dup)
00052 # define X509_REVOKED_dup(rev) (X509_REVOKED *)ASN1_dup((i2d_of_void *)i2d_X509_REVOKED, \
00053         (d2i_of_void *)d2i_X509_REVOKED, (char *)(rev))
00054 #endif
00055 
00056 #if !defined(PKCS7_SIGNER_INFO_dup)
00057 #  define PKCS7_SIGNER_INFO_dup(si) (PKCS7_SIGNER_INFO *)ASN1_dup((i2d_of_void *)i2d_PKCS7_SIGNER_INFO, \
00058         (d2i_of_void *)d2i_PKCS7_SIGNER_INFO, (char *)(si))
00059 #endif
00060 
00061 #if !defined(PKCS7_RECIP_INFO_dup)
00062 #  define PKCS7_RECIP_INFO_dup(ri) (PKCS7_RECIP_INFO *)ASN1_dup((i2d_of_void *)i2d_PKCS7_RECIP_INFO, \
00063         (d2i_of_void *)d2i_PKCS7_RECIP_INFO, (char *)(ri))
00064 #endif
00065 
00066 #if !defined(HAVE_HMAC_CTX_INIT)
00067 void HMAC_CTX_init(HMAC_CTX *ctx);
00068 #endif
00069 
00070 #if !defined(HAVE_HMAC_CTX_COPY)
00071 void HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
00072 #endif
00073 
00074 #if !defined(HAVE_HMAC_CTX_CLEANUP)
00075 void HMAC_CTX_cleanup(HMAC_CTX *ctx);
00076 #endif
00077 
00078 #if !defined(HAVE_EVP_MD_CTX_CREATE)
00079 EVP_MD_CTX *EVP_MD_CTX_create(void);
00080 #endif
00081 
00082 #if !defined(HAVE_EVP_MD_CTX_INIT)
00083 void EVP_MD_CTX_init(EVP_MD_CTX *ctx);
00084 #endif
00085 
00086 #if !defined(HAVE_EVP_MD_CTX_CLEANUP)
00087 int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx);
00088 #endif
00089 
00090 #if !defined(HAVE_EVP_MD_CTX_DESTROY)
00091 void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx);
00092 #endif
00093 
00094 #if !defined(HAVE_EVP_CIPHER_CTX_COPY)
00095 int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in);
00096 #endif
00097 
00098 #if !defined(HAVE_EVP_DIGESTINIT_EX)
00099 #  define EVP_DigestInit_ex(ctx, md, engine) EVP_DigestInit((ctx), (md))
00100 #endif
00101 #if !defined(HAVE_EVP_DIGESTFINAL_EX)
00102 #  define EVP_DigestFinal_ex(ctx, buf, len) EVP_DigestFinal((ctx), (buf), (len))
00103 #endif
00104 
00105 #if !defined(HAVE_EVP_CIPHERINIT_EX)
00106 #  define EVP_CipherInit_ex(ctx, type, impl, key, iv, enc) EVP_CipherInit((ctx), (type), (key), (iv), (enc))
00107 #endif
00108 #if !defined(HAVE_EVP_CIPHERFINAL_EX)
00109 #  define EVP_CipherFinal_ex(ctx, outm, outl) EVP_CipherFinal((ctx), (outm), (outl))
00110 #endif
00111 
00112 #if !defined(EVP_CIPHER_name)
00113 #  define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e))
00114 #endif
00115 
00116 #if !defined(EVP_MD_name)
00117 #  define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_type(e))
00118 #endif
00119 
00120 #if !defined(HAVE_EVP_HMAC_INIT_EX)
00121 #  define HMAC_Init_ex(ctx, key, len, digest, engine) HMAC_Init((ctx), (key), (len), (digest))
00122 #endif
00123 
00124 #if !defined(PKCS7_is_detached)
00125 #  define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7))
00126 #endif
00127 
00128 #if !defined(PKCS7_type_is_encrypted)
00129 #  define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted)
00130 #endif
00131 
00132 #if !defined(HAVE_OPENSSL_CLEANSE)
00133 #define OPENSSL_cleanse(p, l) memset((p), 0, (l))
00134 #endif
00135 
00136 #if !defined(HAVE_X509_STORE_GET_EX_DATA)
00137 void *X509_STORE_get_ex_data(X509_STORE *str, int idx);
00138 #endif
00139 
00140 #if !defined(HAVE_X509_STORE_SET_EX_DATA)
00141 int X509_STORE_set_ex_data(X509_STORE *str, int idx, void *data);
00142 #endif
00143 
00144 #if !defined(HAVE_X509_CRL_SET_VERSION)
00145 int X509_CRL_set_version(X509_CRL *x, long version);
00146 #endif
00147 
00148 #if !defined(HAVE_X509_CRL_SET_ISSUER_NAME)
00149 int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name);
00150 #endif
00151 
00152 #if !defined(HAVE_X509_CRL_SORT)
00153 int X509_CRL_sort(X509_CRL *c);
00154 #endif
00155 
00156 #if !defined(HAVE_X509_CRL_ADD0_REVOKED)
00157 int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
00158 #endif
00159 
00160 #if !defined(HAVE_BN_MOD_SQR)
00161 int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
00162 #endif
00163 
00164 #if !defined(HAVE_BN_MOD_ADD)
00165 int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
00166 #endif
00167 
00168 #if !defined(HAVE_BN_MOD_SUB)
00169 int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
00170 #endif
00171 
00172 #if !defined(HAVE_BN_RAND_RANGE)
00173 int BN_rand_range(BIGNUM *r, BIGNUM *range);
00174 #endif
00175 
00176 #if !defined(HAVE_BN_PSEUDO_RAND_RANGE)
00177 int BN_pseudo_rand_range(BIGNUM *r, BIGNUM *range);
00178 #endif
00179 
00180 #if !defined(HAVE_CONF_GET1_DEFAULT_CONFIG_FILE)
00181 char *CONF_get1_default_config_file(void);
00182 #endif
00183 
00184 #if !defined(HAVE_PEM_DEF_CALLBACK)
00185 int PEM_def_callback(char *buf, int num, int w, void *key);
00186 #endif
00187 
00188 #if !defined(HAVE_ASN1_PUT_EOC)
00189 int ASN1_put_eoc(unsigned char **pp);
00190 #endif
00191 
00192 #if defined(__cplusplus)
00193 }
00194 #endif
00195 
00196 
00197 #endif /* _OSSL_OPENSSL_MISSING_H_ */
00198 
00199