| 1 | /* |
|---|
| 2 | Copyright (c) 2007-2009 Cyrus Daboo. All rights reserved. |
|---|
| 3 | |
|---|
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
|---|
| 5 | you may not use this file except in compliance with the License. |
|---|
| 6 | You may obtain a copy of the License at |
|---|
| 7 | |
|---|
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
|---|
| 9 | |
|---|
| 10 | Unless required by applicable law or agreed to in writing, software |
|---|
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
|---|
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|---|
| 13 | See the License for the specific language governing permissions and |
|---|
| 14 | limitations under the License. |
|---|
| 15 | */ |
|---|
| 16 | |
|---|
| 17 | #include "CDLLFunctions.h" |
|---|
| 18 | |
|---|
| 19 | #if __dest_os == __mac_os || __dest_os == __mac_os_x |
|---|
| 20 | //#define USE_CMS |
|---|
| 21 | #endif |
|---|
| 22 | |
|---|
| 23 | //#if __dest_os == __win32_os |
|---|
| 24 | //#define USE_CMS |
|---|
| 25 | //#endif |
|---|
| 26 | |
|---|
| 27 | #include <openssl/asn1.h> |
|---|
| 28 | #include <openssl/bio.h> |
|---|
| 29 | #ifdef USE_CMS |
|---|
| 30 | #include <openssl/cms.h> |
|---|
| 31 | #endif |
|---|
| 32 | #include <openssl/crypto.h> |
|---|
| 33 | #include <openssl/err.h> |
|---|
| 34 | #include <openssl/md5.h> |
|---|
| 35 | #include <openssl/objects.h> |
|---|
| 36 | #include <openssl/pkcs12.h> |
|---|
| 37 | #include <openssl/rc4.h> |
|---|
| 38 | #include <openssl/stack.h> |
|---|
| 39 | #include <openssl/x509.h> |
|---|
| 40 | #include <openssl/x509v3.h> |
|---|
| 41 | |
|---|
| 42 | #include <openssl/ssl.h> |
|---|
| 43 | //#include <openssl/ssl_locl.h> |
|---|
| 44 | |
|---|
| 45 | extern CDLLLoader* sSSLLoader; |
|---|
| 46 | |
|---|
| 47 | #pragma mark ______________________crypto |
|---|
| 48 | |
|---|
| 49 | // void ASN1_HEADER_free(ASN1_HEADER *a); |
|---|
| 50 | IMPORT_FUNCTION_VOID(sSSLLoader, void, ASN1_HEADER_free, (ASN1_HEADER *a), (a)) |
|---|
| 51 | |
|---|
| 52 | //int ASN1_OCTET_STRING_cmp(ASN1_OCTET_STRING *a, ASN1_OCTET_STRING *b); |
|---|
| 53 | IMPORT_FUNCTION(sSSLLoader, int, ASN1_OCTET_STRING_cmp, (ASN1_OCTET_STRING *a, ASN1_OCTET_STRING *b), (a, b)) |
|---|
| 54 | |
|---|
| 55 | //ASN1_STRING * ASN1_STRING_dup(ASN1_STRING *a); |
|---|
| 56 | IMPORT_FUNCTION(sSSLLoader, ASN1_STRING *, ASN1_STRING_dup, (ASN1_STRING *a), (a)) |
|---|
| 57 | |
|---|
| 58 | //int ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b); |
|---|
| 59 | IMPORT_FUNCTION(sSSLLoader, int, ASN1_STRING_cmp, (ASN1_STRING *a, ASN1_STRING *b), (a, b)) |
|---|
| 60 | |
|---|
| 61 | //int ASN1_STRING_length(ASN1_STRING *x); |
|---|
| 62 | IMPORT_FUNCTION(sSSLLoader, int, ASN1_STRING_length, (ASN1_STRING *x), (x)) |
|---|
| 63 | |
|---|
| 64 | //int ASN1_TIME_print(BIO *fp, ASN1_TIME *a); |
|---|
| 65 | IMPORT_FUNCTION(sSSLLoader, int, ASN1_TIME_print, (BIO *fp, ASN1_TIME *a), (fp, a)) |
|---|
| 66 | |
|---|
| 67 | //unsigned char * ASN1_STRING_data(ASN1_STRING *x); |
|---|
| 68 | IMPORT_FUNCTION(sSSLLoader, unsigned char *, ASN1_STRING_data, (ASN1_STRING *x), (x)) |
|---|
| 69 | |
|---|
| 70 | //long BIO_callback_ctrl(BIO *b, int cmd, void (*fp)(struct bio_st *, int, const char *, int, long, long)); |
|---|
| 71 | IMPORT_FUNCTION(sSSLLoader, long, BIO_callback_ctrl, (BIO *b, int cmd, void (*fp)(struct bio_st *, int, const char *, int, long, long)), (b, cmd, fp)) |
|---|
| 72 | |
|---|
| 73 | //void BIO_copy_next_retry(BIO *b); |
|---|
| 74 | IMPORT_FUNCTION_VOID(sSSLLoader, void, BIO_copy_next_retry, (BIO *b), (b)) |
|---|
| 75 | |
|---|
| 76 | //long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg); |
|---|
| 77 | IMPORT_FUNCTION(sSSLLoader, long, BIO_ctrl, (BIO *bp,int cmd,long larg,void *parg), (bp, cmd, larg, parg)) |
|---|
| 78 | |
|---|
| 79 | //int BIO_free(BIO *a); |
|---|
| 80 | IMPORT_FUNCTION(sSSLLoader, int, BIO_free, (BIO *a), (a)) |
|---|
| 81 | |
|---|
| 82 | //void BIO_clear_flags(BIO *b, int flags); |
|---|
| 83 | IMPORT_FUNCTION_VOID(sSSLLoader, void, BIO_clear_flags, (BIO *b, int flags), (b, flags)) |
|---|
| 84 | |
|---|
| 85 | //BIO_METHOD *BIO_f_base64(void); |
|---|
| 86 | IMPORT_FUNCTION(sSSLLoader, BIO_METHOD *, BIO_f_base64, (void), ()) |
|---|
| 87 | |
|---|
| 88 | //int BIO_gets(BIO *bp,char *buf, int size); |
|---|
| 89 | IMPORT_FUNCTION(sSSLLoader, int, BIO_gets, (BIO *bp,char *buf, int size), (bp, buf, size)) |
|---|
| 90 | |
|---|
| 91 | //BIO * BIO_new(BIO_METHOD *type); |
|---|
| 92 | IMPORT_FUNCTION(sSSLLoader, BIO *, BIO_new, (BIO_METHOD *type), (type)) |
|---|
| 93 | |
|---|
| 94 | //BIO *BIO_new_file(const char *filename, const char *mode); |
|---|
| 95 | IMPORT_FUNCTION(sSSLLoader, BIO *, BIO_new_file, (const char *filename, const char *mode), (filename, mode)) |
|---|
| 96 | |
|---|
| 97 | //unsigned long BIO_number_written(BIO *bio); |
|---|
| 98 | IMPORT_FUNCTION(sSSLLoader, unsigned long, BIO_number_written, (BIO *bio), (bio)) |
|---|
| 99 | |
|---|
| 100 | // int BIO_read(BIO *b, void *data, int len); |
|---|
| 101 | IMPORT_FUNCTION(sSSLLoader, int, BIO_read, (BIO *b, void *data, int len), (b, data, len)) |
|---|
| 102 | |
|---|
| 103 | //BIO * BIO_pop(BIO *b); |
|---|
| 104 | IMPORT_FUNCTION(sSSLLoader, BIO *, BIO_pop, (BIO *b), (b)) |
|---|
| 105 | |
|---|
| 106 | //BIO * BIO_push(BIO *b,BIO *append); |
|---|
| 107 | IMPORT_FUNCTION(sSSLLoader, BIO *, BIO_push, (BIO *b,BIO *append), (b, append)) |
|---|
| 108 | |
|---|
| 109 | //int BIO_write(BIO *b, const void *data, int len); |
|---|
| 110 | IMPORT_FUNCTION(sSSLLoader, int, BIO_write, (BIO *b, const void *data, int len), (b, data, len)) |
|---|
| 111 | |
|---|
| 112 | //BIO_METHOD *BIO_s_file(void ); |
|---|
| 113 | IMPORT_FUNCTION(sSSLLoader, BIO_METHOD *, BIO_s_file, (void), ()) |
|---|
| 114 | |
|---|
| 115 | //BIO_METHOD *BIO_s_mem(void); |
|---|
| 116 | IMPORT_FUNCTION(sSSLLoader, BIO_METHOD *, BIO_s_mem, (void), ()) |
|---|
| 117 | |
|---|
| 118 | // void BUF_MEM_free(BUF_MEM *a); |
|---|
| 119 | IMPORT_FUNCTION_VOID(sSSLLoader, void, BUF_MEM_free, (BUF_MEM *a), (a)) |
|---|
| 120 | |
|---|
| 121 | // int BUF_MEM_grow(BUF_MEM *str, int len); |
|---|
| 122 | IMPORT_FUNCTION(sSSLLoader, int, BUF_MEM_grow, (BUF_MEM *str, int len), (str, len)) |
|---|
| 123 | |
|---|
| 124 | // BUF_MEM *BUF_MEM_new(void); |
|---|
| 125 | IMPORT_FUNCTION(sSSLLoader, BUF_MEM *, BUF_MEM_new, (void), ()) |
|---|
| 126 | |
|---|
| 127 | //int CRYPTO_add_lock(int *pointer,int amount,int type, const char *file, int line); |
|---|
| 128 | IMPORT_FUNCTION(sSSLLoader, int, CRYPTO_add_lock, (int *pointer, int amount, int type, const char *file, int line), (pointer, amount, type, file, line)) |
|---|
| 129 | |
|---|
| 130 | //void CRYPTO_free(void *); |
|---|
| 131 | IMPORT_FUNCTION_VOID(sSSLLoader, void, CRYPTO_free, (void *v), (v)) |
|---|
| 132 | |
|---|
| 133 | //void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad,int idx); |
|---|
| 134 | IMPORT_FUNCTION(sSSLLoader, void *, CRYPTO_get_ex_data, (const CRYPTO_EX_DATA *ad,int idx), (ad, idx)) |
|---|
| 135 | |
|---|
| 136 | //void *CRYPTO_malloc(int num, const char *file, int line); |
|---|
| 137 | IMPORT_FUNCTION(sSSLLoader, void *, CRYPTO_malloc, (int num, const char *file, int line), (num, file, line)) |
|---|
| 138 | |
|---|
| 139 | //int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val); |
|---|
| 140 | IMPORT_FUNCTION(sSSLLoader, int, CRYPTO_set_ex_data, (CRYPTO_EX_DATA *ad, int idx, void *val), (ad, idx, val)) |
|---|
| 141 | |
|---|
| 142 | // ASN1_HEADER *d2i_ASN1_HEADER(ASN1_HEADER **a,const unsigned char **pp, long length); |
|---|
| 143 | IMPORT_FUNCTION(sSSLLoader, ASN1_HEADER *, d2i_ASN1_HEADER, (ASN1_HEADER **a, const unsigned char **pp, long length), (a, pp, length)) |
|---|
| 144 | |
|---|
| 145 | // PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12); |
|---|
| 146 | IMPORT_FUNCTION(sSSLLoader, PKCS12 *, d2i_PKCS12_bio, (BIO *bp, PKCS12 **p12), (bp, p12)) |
|---|
| 147 | |
|---|
| 148 | //PKCS7 *d2i_PKCS7_bio(BIO *bp,PKCS7 **p7); |
|---|
| 149 | IMPORT_FUNCTION(sSSLLoader, PKCS7 *, d2i_PKCS7_bio, (BIO *bp,PKCS7 **p7), (bp, p7)) |
|---|
| 150 | |
|---|
| 151 | #ifdef USE_CMS |
|---|
| 152 | //CMS *d2i_CMS_bio(BIO *bp,CMS **p7); |
|---|
| 153 | IMPORT_FUNCTION(sSSLLoader, CMS *, d2i_CMS_bio, (BIO *bp,CMS **p7), (bp, p7)) |
|---|
| 154 | #endif |
|---|
| 155 | |
|---|
| 156 | //EVP_PKEY * d2i_PrivateKey(int type,EVP_PKEY **a, const unsigned char **pp, long length); |
|---|
| 157 | IMPORT_FUNCTION(sSSLLoader, EVP_PKEY *, d2i_PrivateKey, (int type,EVP_PKEY **a, const unsigned char **pp, long length), (type, a, pp, length)) |
|---|
| 158 | |
|---|
| 159 | // X509 *d2i_X509_bio(BIO *bp,X509 **x509); |
|---|
| 160 | IMPORT_FUNCTION(sSSLLoader, X509 *, d2i_X509_bio, (BIO *bp,X509 **x509), (bp, x509)) |
|---|
| 161 | |
|---|
| 162 | //char *ERR_error_string(unsigned long e,char *buf); |
|---|
| 163 | IMPORT_FUNCTION(sSSLLoader, char *, ERR_error_string, (unsigned long e,char *buf), (e, buf)) |
|---|
| 164 | |
|---|
| 165 | //unsigned long ERR_get_error_line_data(const char **file, int *line, const char **data, int *flags); |
|---|
| 166 | IMPORT_FUNCTION(sSSLLoader, unsigned long, ERR_get_error_line_data, (const char **file, int *line, const char **data, int *flags), (file, line, data, flags)) |
|---|
| 167 | |
|---|
| 168 | //unsigned long ERR_get_error(void ); |
|---|
| 169 | IMPORT_FUNCTION(sSSLLoader, unsigned long, ERR_get_error, (void), ()) |
|---|
| 170 | |
|---|
| 171 | //void ERR_error_string_n(unsigned long e, char *buf, size_t len); |
|---|
| 172 | IMPORT_FUNCTION_VOID(sSSLLoader, void, ERR_error_string_n, (unsigned long e, char *buf, size_t len), (e, buf, len)) |
|---|
| 173 | |
|---|
| 174 | //void ERR_free_strings(void); |
|---|
| 175 | IMPORT_FUNCTION_VOID(sSSLLoader, void, ERR_free_strings, (void), ()) |
|---|
| 176 | |
|---|
| 177 | //unsigned long ERR_get_error_line(const char **file,int *line); |
|---|
| 178 | IMPORT_FUNCTION(sSSLLoader, unsigned long, ERR_get_error_line, (const char **file, int *line), (file, line)) |
|---|
| 179 | |
|---|
| 180 | //const char *ERR_lib_error_string(unsigned long e); |
|---|
| 181 | IMPORT_FUNCTION(sSSLLoader, const char *, ERR_lib_error_string, (unsigned long e), (e)) |
|---|
| 182 | |
|---|
| 183 | //unsigned long ERR_peek_error(void ); |
|---|
| 184 | IMPORT_FUNCTION(sSSLLoader, unsigned long, ERR_peek_error, (void ), ()) |
|---|
| 185 | |
|---|
| 186 | //const char *ERR_reason_error_string(unsigned long e); |
|---|
| 187 | IMPORT_FUNCTION(sSSLLoader, const char *, ERR_reason_error_string, (unsigned long e), (e)) |
|---|
| 188 | |
|---|
| 189 | //void ERR_print_errors(BIO *bp) |
|---|
| 190 | IMPORT_FUNCTION_VOID(sSSLLoader, void, ERR_print_errors, (BIO *bp), (bp)) |
|---|
| 191 | |
|---|
| 192 | //const EVP_CIPHER *EVP_des_ede3_cbc(void); |
|---|
| 193 | IMPORT_FUNCTION(sSSLLoader, const EVP_CIPHER *, EVP_des_ede3_cbc, (void), ()) |
|---|
| 194 | |
|---|
| 195 | //void EVP_cleanup(void); |
|---|
| 196 | IMPORT_FUNCTION_VOID(sSSLLoader, void, EVP_cleanup, (void), ()) |
|---|
| 197 | |
|---|
| 198 | //void EVP_PKEY_free(EVP_PKEY *pkey); |
|---|
| 199 | IMPORT_FUNCTION_VOID(sSSLLoader, void, EVP_PKEY_free, (EVP_PKEY *pkey), (pkey)) |
|---|
| 200 | |
|---|
| 201 | //void GENERAL_NAMES_free(STACK_OF(GENERAL_NAME) *a); |
|---|
| 202 | IMPORT_FUNCTION_VOID(sSSLLoader, void, GENERAL_NAMES_free, (STACK_OF(GENERAL_NAME) *a), (a)) |
|---|
| 203 | |
|---|
| 204 | //int i2d_PKCS7_bio(BIO *bp,PKCS7 *p7); |
|---|
| 205 | IMPORT_FUNCTION(sSSLLoader, int, i2d_PKCS7_bio, (BIO *bp,PKCS7 *p7), (bp, p7)) |
|---|
| 206 | |
|---|
| 207 | #ifdef USE_CMS |
|---|
| 208 | //int i2d_CMS_bio(BIO *bp,CMS *p7); |
|---|
| 209 | IMPORT_FUNCTION(sSSLLoader, int, i2d_CMS_bio, (BIO *bp,CMS *p7), (bp, p7)) |
|---|
| 210 | #endif |
|---|
| 211 | |
|---|
| 212 | //unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md); |
|---|
| 213 | IMPORT_FUNCTION(sSSLLoader, unsigned char *, MD5, (const unsigned char *d, size_t n, unsigned char *md), (d, n, md)) |
|---|
| 214 | |
|---|
| 215 | //void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); |
|---|
| 216 | IMPORT_FUNCTION_VOID(sSSLLoader, void, RC4_set_key, (RC4_KEY *key, int len, const unsigned char *data), (key, len, data)) |
|---|
| 217 | |
|---|
| 218 | //void RC4(RC4_KEY *key, unsigned long len, const unsigned char *indata, unsigned char *outdata); |
|---|
| 219 | IMPORT_FUNCTION_VOID(sSSLLoader, void, RC4, (RC4_KEY *key, unsigned long len, const unsigned char *indata, unsigned char *outdata), (key, len, indata, outdata)) |
|---|
| 220 | |
|---|
| 221 | //int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name); |
|---|
| 222 | IMPORT_FUNCTION(sSSLLoader, int, OBJ_obj2txt, (char *buf, int buf_len, const ASN1_OBJECT *a, int no_name), (buf, buf_len, a, no_name)) |
|---|
| 223 | |
|---|
| 224 | //int OBJ_obj2nid(const ASN1_OBJECT *o); |
|---|
| 225 | IMPORT_FUNCTION(sSSLLoader, int, OBJ_obj2nid, (const ASN1_OBJECT *o), (o)) |
|---|
| 226 | |
|---|
| 227 | //const char * OBJ_nid2sn(int n); |
|---|
| 228 | IMPORT_FUNCTION(sSSLLoader, const char *, OBJ_nid2sn, (int n), (n)) |
|---|
| 229 | |
|---|
| 230 | //void OPENSSL_add_all_algorithms_noconf(void); |
|---|
| 231 | IMPORT_FUNCTION_VOID(sSSLLoader, void, OPENSSL_add_all_algorithms_noconf, (void), ()) |
|---|
| 232 | |
|---|
| 233 | //EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u) |
|---|
| 234 | IMPORT_FUNCTION(sSSLLoader, EVP_PKEY *, PEM_read_bio_PrivateKey, (BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u), (bp, x, cb, u)) |
|---|
| 235 | |
|---|
| 236 | //X509 *PEM_read_bio_X509_AUX(BIO *bp, X509 **x, pem_password_cb *cb, void *u); |
|---|
| 237 | IMPORT_FUNCTION(sSSLLoader, X509 *, PEM_read_bio_X509_AUX, (BIO *bp, X509 **x, pem_password_cb *cb, void *u), (bp, x, cb, u)) |
|---|
| 238 | |
|---|
| 239 | //X509 *PEM_read_X509(FILE *fp, X509 **x, pem_password_cb *cb, void *u); |
|---|
| 240 | IMPORT_FUNCTION(sSSLLoader, X509 *, PEM_read_X509, (FILE *fp, X509 **x, pem_password_cb *cb, void *u), (fp, x,cb, u)) |
|---|
| 241 | |
|---|
| 242 | //int PEM_write_PrivateKey(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,unsigned char *kstr, int klen,pem_password_cb *cb, void *u); |
|---|
| 243 | IMPORT_FUNCTION(sSSLLoader, int, PEM_write_PrivateKey, (FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc,unsigned char *kstr,int klen, pem_password_cb *callback, void *u), (fp, x, enc, kstr, klen, callback, u)) |
|---|
| 244 | |
|---|
| 245 | //int PEM_write_X509(FILE *fp, X509 *x); |
|---|
| 246 | IMPORT_FUNCTION(sSSLLoader, int, PEM_write_X509, (FILE *fp, X509 *x), (fp, x)) |
|---|
| 247 | |
|---|
| 248 | //STACK_OF(X509_INFO) * PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u); |
|---|
| 249 | IMPORT_FUNCTION(sSSLLoader, STACK_OF(X509_INFO) *, PEM_X509_INFO_read_bio, (BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u), (bp, sk, cb, u)) |
|---|
| 250 | |
|---|
| 251 | |
|---|
| 252 | // void PKCS12_free(PKCS12 *a); |
|---|
| 253 | IMPORT_FUNCTION_VOID(sSSLLoader, void, PKCS12_free, (PKCS12 *a), (a)) |
|---|
| 254 | |
|---|
| 255 | // int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca); |
|---|
| 256 | IMPORT_FUNCTION(sSSLLoader, int, PKCS12_parse, (PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca), (p12, pass, pkey, cert, ca)) |
|---|
| 257 | |
|---|
| 258 | //int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags); |
|---|
| 259 | IMPORT_FUNCTION(sSSLLoader, int, PKCS7_decrypt, (PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags), (p7, pkey, cert, data, flags)) |
|---|
| 260 | |
|---|
| 261 | //PKCS7 *PKCS7_encrypt(STACK *certs, BIO *in, const EVP_CIPHER *cipher, int flags); |
|---|
| 262 | IMPORT_FUNCTION(sSSLLoader, PKCS7 *, PKCS7_encrypt, (STACK *certs, BIO *in, const EVP_CIPHER *cipher, int flags), (certs, in, cipher, flags)) |
|---|
| 263 | |
|---|
| 264 | //void PKCS7_free(PKCS7 *a); |
|---|
| 265 | IMPORT_FUNCTION_VOID(sSSLLoader, void, PKCS7_free, (PKCS7 *a), (a)) |
|---|
| 266 | |
|---|
| 267 | //STACK *PKCS7_get0_signers(PKCS7 *p7, STACK *certs, int flags); |
|---|
| 268 | IMPORT_FUNCTION(sSSLLoader, STACK *, PKCS7_get0_signers, (PKCS7 *p7, STACK *certs, int flags), (p7, certs, flags)) |
|---|
| 269 | |
|---|
| 270 | //PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK *certs, BIO *data, int flags); |
|---|
| 271 | IMPORT_FUNCTION(sSSLLoader, PKCS7 *, PKCS7_sign, (X509 *signcert, EVP_PKEY *pkey, STACK *certs, BIO *data, int flags), (signcert, pkey, certs, data, flags)) |
|---|
| 272 | |
|---|
| 273 | //int PKCS7_verify(PKCS7 *p7, STACK *certs, X509_STORE *store, BIO *indata, BIO *out, int flags) |
|---|
| 274 | IMPORT_FUNCTION(sSSLLoader, int, PKCS7_verify, (PKCS7 *p7, STACK *certs, X509_STORE *store, BIO *indata, BIO *out, int flags), (p7, certs, store, indata, out, flags)) |
|---|
| 275 | |
|---|
| 276 | #ifdef USE_CMS |
|---|
| 277 | //int CMS_decrypt(CMS *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags); |
|---|
| 278 | IMPORT_FUNCTION(sSSLLoader, int, CMS_decrypt, (CMS *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags), (p7, pkey, cert, data, flags)) |
|---|
| 279 | |
|---|
| 280 | //CMS *CMS_encrypt(STACK *certs, BIO *in, const EVP_CIPHER *cipher, int flags); |
|---|
| 281 | IMPORT_FUNCTION(sSSLLoader, CMS *, CMS_encrypt, (STACK *certs, BIO *in, const EVP_CIPHER *cipher, int flags), (certs, in, cipher, flags)) |
|---|
| 282 | |
|---|
| 283 | //void CMS_free(CMS *a); |
|---|
| 284 | IMPORT_FUNCTION_VOID(sSSLLoader, void, CMS_free, (CMS *a), (a)) |
|---|
| 285 | |
|---|
| 286 | //STACK *CMS_get0_signers(CMS *p7, STACK *certs, int flags); |
|---|
| 287 | IMPORT_FUNCTION(sSSLLoader, STACK *, CMS_get0_signers, (CMS *p7, STACK *certs, int flags), (p7, certs, flags)) |
|---|
| 288 | |
|---|
| 289 | //CMS *CMS_sign(X509 *signcert, EVP_PKEY *pkey, STACK *certs, BIO *data, int flags); |
|---|
| 290 | IMPORT_FUNCTION(sSSLLoader, CMS *, CMS_sign, (X509 *signcert, EVP_PKEY *pkey, STACK *certs, BIO *data, int flags), (signcert, pkey, certs, data, flags)) |
|---|
| 291 | |
|---|
| 292 | //int CMS_verify(CMS *p7, STACK *certs, X509_STORE *store, BIO *indata, BIO *out, int flags) |
|---|
| 293 | IMPORT_FUNCTION(sSSLLoader, int, CMS_verify, (CMS *p7, STACK *certs, X509_STORE *store, BIO *indata, BIO *out, int flags), (p7, certs, store, indata, out, flags)) |
|---|
| 294 | |
|---|
| 295 | //int CMS_RECIP_INFO_contains(const CMS_RECIP_INFO *cmsi, X509 *x509) |
|---|
| 296 | IMPORT_FUNCTION(sSSLLoader, int, CMS_RECIP_INFO_contains, (const CMS_RECIP_INFO *cmsi, X509 *x509), (cmsi, x509)) |
|---|
| 297 | #endif |
|---|
| 298 | |
|---|
| 299 | #if __dest_os == __linux_os |
|---|
| 300 | |
|---|
| 301 | //int RAND_load_rsrc() |
|---|
| 302 | IMPORT_FUNCTION(sSSLLoader, int, RAND_load_rsrc, (void), ()) |
|---|
| 303 | |
|---|
| 304 | //int RAND_egd(const char *path); |
|---|
| 305 | IMPORT_FUNCTION(sSSLLoader, int, RAND_egd, (const char *path), (path)) |
|---|
| 306 | |
|---|
| 307 | //const char *RAND_file_name(char *file,size_t num); |
|---|
| 308 | IMPORT_FUNCTION(sSSLLoader, const char*, RAND_file_name, (char *file,size_t num), (file,num)) |
|---|
| 309 | |
|---|
| 310 | //int RAND_load_file(const char *file,long max_bytes); |
|---|
| 311 | IMPORT_FUNCTION(sSSLLoader, int, RAND_load_file, (const char *file,long max_bytes), (file,max_bytes)) |
|---|
| 312 | |
|---|
| 313 | //int RAND_status(void); |
|---|
| 314 | IMPORT_FUNCTION(sSSLLoader, int, RAND_status, (void), ()) |
|---|
| 315 | |
|---|
| 316 | //int RAND_write_file(const char *file); |
|---|
| 317 | IMPORT_FUNCTION(sSSLLoader, int, RAND_write_file, (const char *file), (file)) |
|---|
| 318 | |
|---|
| 319 | #endif |
|---|
| 320 | |
|---|
| 321 | //RSA * RSA_generate_key(int bits, unsigned long e,void (*callback)(int,int,void *),void *cb_arg); |
|---|
| 322 | IMPORT_FUNCTION(sSSLLoader, RSA *, RSA_generate_key, (int bits, unsigned long e, void (*callback)(int,int,void *), void *cb_arg), (bits, e, callback, cb_arg)) |
|---|
| 323 | |
|---|
| 324 | //void sk_free(STACK *); |
|---|
| 325 | IMPORT_FUNCTION_VOID(sSSLLoader, void, sk_free, (STACK *s), (s)) |
|---|
| 326 | |
|---|
| 327 | //STACK *sk_new_null(void); |
|---|
| 328 | IMPORT_FUNCTION(sSSLLoader, STACK *, sk_new_null, (void), ()) |
|---|
| 329 | |
|---|
| 330 | //int sk_num(const STACK *); |
|---|
| 331 | IMPORT_FUNCTION(sSSLLoader, int, sk_num, (const STACK *s), (s)) |
|---|
| 332 | |
|---|
| 333 | //void sk_pop_free(STACK *st, void (*func)(void *)); |
|---|
| 334 | IMPORT_FUNCTION_VOID(sSSLLoader, void, sk_pop_free, (STACK *st, void (*func)(void *)), (st, func)) |
|---|
| 335 | |
|---|
| 336 | //int sk_push(STACK *st,char *data); |
|---|
| 337 | IMPORT_FUNCTION(sSSLLoader, int, sk_push, (STACK *st,char *data), (st, data)) |
|---|
| 338 | |
|---|
| 339 | //char *sk_value(const STACK *, int); |
|---|
| 340 | IMPORT_FUNCTION(sSSLLoader, char *, sk_value, (const STACK *s, int i), (s, i)) |
|---|
| 341 | |
|---|
| 342 | // ASN1_METHOD *X509_asn1_meth(void); |
|---|
| 343 | IMPORT_FUNCTION(sSSLLoader, ASN1_METHOD *, X509_asn1_meth, (void), ()) |
|---|
| 344 | |
|---|
| 345 | //int X509_check_issued(X509 *issuer, X509 *subject); |
|---|
| 346 | IMPORT_FUNCTION(sSSLLoader, int, X509_check_issued, (X509 *issuer, X509 *subject), (issuer, subject)) |
|---|
| 347 | |
|---|
| 348 | //int X509_cmp(const X509 *a, const X509 *b); |
|---|
| 349 | IMPORT_FUNCTION(sSSLLoader, int, X509_cmp, (const X509 *a, const X509 *b), (a, b)) |
|---|
| 350 | |
|---|
| 351 | //int X509_cmp_current_time(ASN1_TIME *s); |
|---|
| 352 | IMPORT_FUNCTION(sSSLLoader, int, X509_cmp_current_time, (ASN1_TIME *s), (s)) |
|---|
| 353 | |
|---|
| 354 | //X509 *X509_dup(X509 *x509); |
|---|
| 355 | IMPORT_FUNCTION(sSSLLoader, X509 *, X509_dup, (X509 *x), (x)) |
|---|
| 356 | |
|---|
| 357 | //void X509_free(X509 *a); |
|---|
| 358 | IMPORT_FUNCTION_VOID(sSSLLoader, void, X509_free, (X509 *a), (a)) |
|---|
| 359 | |
|---|
| 360 | //const char * X509_get_default_cert_dir(void); |
|---|
| 361 | IMPORT_FUNCTION(sSSLLoader, const char *, X509_get_default_cert_dir, (void), ()) |
|---|
| 362 | |
|---|
| 363 | //const char * X509_get_default_cert_dir_env(void); |
|---|
| 364 | IMPORT_FUNCTION(sSSLLoader, const char *, X509_get_default_cert_dir_env, (void), ()) |
|---|
| 365 | |
|---|
| 366 | //X509_EXTENSION *X509_get_ext(X509 *x, int loc); |
|---|
| 367 | IMPORT_FUNCTION(sSSLLoader, X509_EXTENSION *, X509_get_ext, (X509 *x, int loc), (x, loc)) |
|---|
| 368 | |
|---|
| 369 | //int X509_get_ext_by_NID(X509 *x, int nid, int lastpos); |
|---|
| 370 | IMPORT_FUNCTION(sSSLLoader, int, X509_get_ext_by_NID, (X509 *x, int nid, int lastpos), (x, nid, lastpos)) |
|---|
| 371 | |
|---|
| 372 | //X509_NAME * X509_get_issuer_name(X509 *a); |
|---|
| 373 | IMPORT_FUNCTION(sSSLLoader, X509_NAME *, X509_get_issuer_name, (X509 *a), (a)) |
|---|
| 374 | |
|---|
| 375 | //X509_NAME * X509_get_subject_name(X509 *a); |
|---|
| 376 | IMPORT_FUNCTION(sSSLLoader, X509_NAME *, X509_get_subject_name, (X509 *a), (a)) |
|---|
| 377 | |
|---|
| 378 | //int X509_print(BIO *bp, X509 *x); |
|---|
| 379 | IMPORT_FUNCTION(sSSLLoader, int, X509_print, (BIO *bp, X509 *x), (bp, x)) |
|---|
| 380 | |
|---|
| 381 | //unsigned long X509_subject_name_hash(X509 *x); |
|---|
| 382 | IMPORT_FUNCTION(sSSLLoader, unsigned long, X509_subject_name_hash, (X509 *x), (x)) |
|---|
| 383 | |
|---|
| 384 | //const char *X509_verify_cert_error_string(long n); |
|---|
| 385 | IMPORT_FUNCTION(sSSLLoader, const char *, X509_verify_cert_error_string, (long n), (n)) |
|---|
| 386 | |
|---|
| 387 | //void X509_INFO_free(X509_INFO *a); |
|---|
| 388 | IMPORT_FUNCTION_VOID(sSSLLoader, void, X509_INFO_free, (X509_INFO *a), (a)) |
|---|
| 389 | |
|---|
| 390 | //int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, long argl, char **ret); |
|---|
| 391 | IMPORT_FUNCTION(sSSLLoader, int, X509_LOOKUP_ctrl, (X509_LOOKUP *ctx, int cmd, const char *argc, long argl, char **ret), (ctx, cmd, argc, argl, ret)) |
|---|
| 392 | |
|---|
| 393 | //X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void); |
|---|
| 394 | IMPORT_FUNCTION(sSSLLoader, X509_LOOKUP_METHOD *, X509_LOOKUP_hash_dir, (void), ()) |
|---|
| 395 | |
|---|
| 396 | //int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b); |
|---|
| 397 | IMPORT_FUNCTION(sSSLLoader, int, X509_NAME_cmp, (const X509_NAME *a, const X509_NAME *b), (a, b)) |
|---|
| 398 | |
|---|
| 399 | //int X509_NAME_entry_count(X509_NAME *name); |
|---|
| 400 | IMPORT_FUNCTION(sSSLLoader, int, X509_NAME_entry_count, (X509_NAME *name), (name)) |
|---|
| 401 | |
|---|
| 402 | //X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc); |
|---|
| 403 | IMPORT_FUNCTION(sSSLLoader, X509_NAME_ENTRY *, X509_NAME_get_entry, (X509_NAME *name, int loc), (name, loc)) |
|---|
| 404 | |
|---|
| 405 | //int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf,int len); |
|---|
| 406 | IMPORT_FUNCTION(sSSLLoader, int, X509_NAME_get_text_by_NID, (X509_NAME *name, int nid, char *buf,int len), (name, nid, buf, len)) |
|---|
| 407 | |
|---|
| 408 | //char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); |
|---|
| 409 | IMPORT_FUNCTION(sSSLLoader, char *, X509_NAME_oneline, (X509_NAME *a,char *buf,int size), (a, buf, size)) |
|---|
| 410 | |
|---|
| 411 | //ASN1_STRING * X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne); |
|---|
| 412 | IMPORT_FUNCTION(sSSLLoader, ASN1_STRING *, X509_NAME_ENTRY_get_data, (X509_NAME_ENTRY *ne), (ne)) |
|---|
| 413 | |
|---|
| 414 | //ASN1_OBJECT * X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne); |
|---|
| 415 | IMPORT_FUNCTION(sSSLLoader, ASN1_OBJECT *, X509_NAME_ENTRY_get_object, (X509_NAME_ENTRY *ne), (ne)) |
|---|
| 416 | |
|---|
| 417 | //X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m); |
|---|
| 418 | IMPORT_FUNCTION(sSSLLoader, X509_LOOKUP *, X509_STORE_add_lookup, (X509_STORE *v, X509_LOOKUP_METHOD *m), (v, m)) |
|---|
| 419 | |
|---|
| 420 | //void X509_STORE_free(X509_STORE *v); |
|---|
| 421 | IMPORT_FUNCTION_VOID(sSSLLoader, void, X509_STORE_free, (X509_STORE *v), (v)) |
|---|
| 422 | |
|---|
| 423 | //X509_STORE *X509_STORE_new(void); |
|---|
| 424 | IMPORT_FUNCTION(sSSLLoader, X509_STORE *, X509_STORE_new, (void), ()) |
|---|
| 425 | |
|---|
| 426 | //int X509_STORE_set_default_paths(X509_STORE *ctx); |
|---|
| 427 | IMPORT_FUNCTION(sSSLLoader, int, X509_STORE_set_default_paths, (X509_STORE *ctx), (ctx)) |
|---|
| 428 | |
|---|
| 429 | //X509 * X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx); |
|---|
| 430 | IMPORT_FUNCTION(sSSLLoader, X509 *, X509_STORE_CTX_get_current_cert, (X509_STORE_CTX *ctx), (ctx)) |
|---|
| 431 | |
|---|
| 432 | //int X509_STORE_CTX_get_error(X509_STORE_CTX *ctx); |
|---|
| 433 | IMPORT_FUNCTION(sSSLLoader, int, X509_STORE_CTX_get_error, (X509_STORE_CTX *ctx), (ctx)) |
|---|
| 434 | |
|---|
| 435 | //int X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx); |
|---|
| 436 | IMPORT_FUNCTION(sSSLLoader, int, X509_STORE_CTX_get_error_depth, (X509_STORE_CTX *ctx), (ctx)) |
|---|
| 437 | |
|---|
| 438 | //void * X509_STORE_CTX_get_ex_data(X509_STORE_CTX *ctx,int idx); |
|---|
| 439 | IMPORT_FUNCTION(sSSLLoader, void *, X509_STORE_CTX_get_ex_data, (X509_STORE_CTX *ctx,int idx), (ctx, idx)) |
|---|
| 440 | |
|---|
| 441 | //X509_VAL * X509_VAL_new(void); |
|---|
| 442 | IMPORT_FUNCTION(sSSLLoader, X509_VAL *, X509_VAL_new, (void), ()) |
|---|
| 443 | |
|---|
| 444 | //void X509_VAL_free(X509_VAL *a); |
|---|
| 445 | IMPORT_FUNCTION_VOID(sSSLLoader, void, X509_VAL_free, (X509_VAL *a), (a)) |
|---|
| 446 | |
|---|
| 447 | //void *X509V3_EXT_d2i(X509_EXTENSION *ext); |
|---|
| 448 | IMPORT_FUNCTION(sSSLLoader, void *, X509V3_EXT_d2i, (X509_EXTENSION *ext), (ext)) |
|---|
| 449 | |
|---|
| 450 | //int X509V3_add_standard_extensions(void); |
|---|
| 451 | IMPORT_FUNCTION(sSSLLoader, int, X509V3_add_standard_extensions, (void), ()) |
|---|
| 452 | |
|---|
| 453 | #pragma mark ______________________ssl |
|---|
| 454 | |
|---|
| 455 | //int SSL_accept(SSL *ssl); |
|---|
| 456 | IMPORT_FUNCTION(sSSLLoader, int, SSL_accept, (SSL *ssl), (ssl)) |
|---|
| 457 | |
|---|
| 458 | int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs, const char *dir); |
|---|
| 459 | IMPORT_FUNCTION(sSSLLoader, int, SSL_add_dir_cert_subjects_to_stack, (STACK_OF(X509_NAME) *stackCAs, const char *dir), (stackCAs, dir)) |
|---|
| 460 | |
|---|
| 461 | //const char *SSL_alert_desc_string_long(int value); |
|---|
| 462 | IMPORT_FUNCTION(sSSLLoader, const char *, SSL_alert_desc_string_long, (int value), (value)) |
|---|
| 463 | |
|---|
| 464 | //const char *SSL_alert_type_string_long(int value); |
|---|
| 465 | IMPORT_FUNCTION(sSSLLoader, const char *, SSL_alert_type_string_long, (int value), (value)) |
|---|
| 466 | |
|---|
| 467 | //int SSL_connect(SSL *ssl); |
|---|
| 468 | IMPORT_FUNCTION(sSSLLoader, int, SSL_connect, (SSL *ssl), (ssl)) |
|---|
| 469 | |
|---|
| 470 | //void SSL_free(SSL *ssl); |
|---|
| 471 | IMPORT_FUNCTION_VOID(sSSLLoader, void, SSL_free, (SSL *ssl), (ssl)) |
|---|
| 472 | |
|---|
| 473 | //X509 *SSL_get_certificate(SSL *ssl); |
|---|
| 474 | #if OPENSSL_VERSION_NUMBER == 0x0090704fL |
|---|
| 475 | IMPORT_FUNCTION(sSSLLoader, X509 *, SSL_get_certificate, (SSL *ssl), (ssl)) |
|---|
| 476 | #else |
|---|
| 477 | IMPORT_FUNCTION(sSSLLoader, X509 *, SSL_get_certificate, (const SSL *ssl), (ssl)) |
|---|
| 478 | #endif |
|---|
| 479 | |
|---|
| 480 | //SSL_CIPHER *SSL_get_current_cipher(SSL *s); |
|---|
| 481 | #if OPENSSL_VERSION_NUMBER == 0x0090704fL |
|---|
| 482 | IMPORT_FUNCTION(sSSLLoader, SSL_CIPHER *, SSL_get_current_cipher, (SSL *ssl), (ssl)) |
|---|
| 483 | #else |
|---|
| 484 | IMPORT_FUNCTION(sSSLLoader, SSL_CIPHER *, SSL_get_current_cipher, (const SSL *ssl), (ssl)) |
|---|
| 485 | #endif |
|---|
| 486 | |
|---|
| 487 | //int SSL_get_error(SSL *s,int ret_code); |
|---|
| 488 | #if OPENSSL_VERSION_NUMBER == 0x0090704fL |
|---|
| 489 | IMPORT_FUNCTION(sSSLLoader, int, SSL_get_error, (SSL *s,int ret_code), (s, ret_code)) |
|---|
| 490 | #else |
|---|
| 491 | IMPORT_FUNCTION(sSSLLoader, int, SSL_get_error, (const SSL *s,int ret_code), (s, ret_code)) |
|---|
| 492 | #endif |
|---|
| 493 | |
|---|
| 494 | //void *SSL_get_ex_data(SSL *ssl,int idx); |
|---|
| 495 | #if OPENSSL_VERSION_NUMBER == 0x0090704fL |
|---|
| 496 | IMPORT_FUNCTION(sSSLLoader, void *, SSL_get_ex_data, (SSL *ssl,int idx), (ssl, idx)) |
|---|
| 497 | #else |
|---|
| 498 | IMPORT_FUNCTION(sSSLLoader, void *, SSL_get_ex_data, (const SSL *ssl,int idx), (ssl, idx)) |
|---|
| 499 | #endif |
|---|
| 500 | |
|---|
| 501 | //int SSL_get_ex_data_X509_STORE_CTX_idx(void ); |
|---|
| 502 | IMPORT_FUNCTION(sSSLLoader, int, SSL_get_ex_data_X509_STORE_CTX_idx, (void), ()) |
|---|
| 503 | |
|---|
| 504 | //X509 *SSL_get_peer_certificate(SSL *s); |
|---|
| 505 | #if OPENSSL_VERSION_NUMBER == 0x0090704fL |
|---|
| 506 | IMPORT_FUNCTION(sSSLLoader, X509 *, SSL_get_peer_certificate, (SSL *ssl), (ssl)) |
|---|
| 507 | #else |
|---|
| 508 | IMPORT_FUNCTION(sSSLLoader, X509 *, SSL_get_peer_certificate, (const SSL *ssl), (ssl)) |
|---|
| 509 | #endif |
|---|
| 510 | |
|---|
| 511 | //long SSL_get_verify_result(SSL *ssl); |
|---|
| 512 | #if OPENSSL_VERSION_NUMBER == 0x0090704fL |
|---|
| 513 | IMPORT_FUNCTION(sSSLLoader, long, SSL_get_verify_result, (SSL *ssl), (ssl)) |
|---|
| 514 | #else |
|---|
| 515 | IMPORT_FUNCTION(sSSLLoader, long, SSL_get_verify_result, (const SSL *ssl), (ssl)) |
|---|
| 516 | #endif |
|---|
| 517 | |
|---|
| 518 | //int SSL_library_init(void); |
|---|
| 519 | IMPORT_FUNCTION(sSSLLoader, int, SSL_library_init, (void), ()) |
|---|
| 520 | |
|---|
| 521 | //STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file); |
|---|
| 522 | IMPORT_FUNCTION(sSSLLoader, STACK_OF(X509_NAME) *, SSL_load_client_CA_file, (const char *file), (file)) |
|---|
| 523 | |
|---|
| 524 | //void SSL_load_error_strings(void); |
|---|
| 525 | IMPORT_FUNCTION_VOID(sSSLLoader, void, SSL_load_error_strings, (void), ()) |
|---|
| 526 | |
|---|
| 527 | //SSL *SSL_new(SSL_CTX *ctx); |
|---|
| 528 | IMPORT_FUNCTION(sSSLLoader, SSL *, SSL_new, (SSL_CTX *ctx), (ctx)) |
|---|
| 529 | |
|---|
| 530 | //int SSL_pending(SSL *s); |
|---|
| 531 | #if OPENSSL_VERSION_NUMBER == 0x0090704fL |
|---|
| 532 | IMPORT_FUNCTION(sSSLLoader, int, SSL_pending, (SSL *ssl), (ssl)) |
|---|
| 533 | #else |
|---|
| 534 | IMPORT_FUNCTION(sSSLLoader, int, SSL_pending, (const SSL *ssl), (ssl)) |
|---|
| 535 | #endif |
|---|
| 536 | |
|---|
| 537 | //int SSL_read(SSL *ssl,void *buf,int num); |
|---|
| 538 | IMPORT_FUNCTION(sSSLLoader, int, SSL_read, (SSL *ssl,void *buf,int num), (ssl, buf, num)) |
|---|
| 539 | |
|---|
| 540 | //int SSL_shutdown(SSL *s); |
|---|
| 541 | IMPORT_FUNCTION(sSSLLoader, int, SSL_shutdown, (SSL *ssl), (ssl)) |
|---|
| 542 | |
|---|
| 543 | //void SSL_set_bio(SSL *s, BIO *rbio,BIO *wbio); |
|---|
| 544 | IMPORT_FUNCTION_VOID(sSSLLoader, void, SSL_set_bio, (SSL *s, BIO *rbio,BIO *wbio), (s, rbio, wbio)) |
|---|
| 545 | |
|---|
| 546 | //int SSL_set_ex_data(SSL *ssl,int idx,void *data); |
|---|
| 547 | IMPORT_FUNCTION(sSSLLoader, int, SSL_set_ex_data, (SSL *ssl,int idx,void *data), (ssl, idx, data)) |
|---|
| 548 | |
|---|
| 549 | //int SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); |
|---|
| 550 | IMPORT_FUNCTION(sSSLLoader, int, SSL_get_ex_new_index, (long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func), (argl, argp, new_func, dup_func, free_func)) |
|---|
| 551 | |
|---|
| 552 | //int SSL_set_fd(SSL *s, int fd); |
|---|
| 553 | IMPORT_FUNCTION(sSSLLoader, int, SSL_set_fd, (SSL *s, int fd), (s, fd)) |
|---|
| 554 | |
|---|
| 555 | //int SSL_state(SSL *ssl); |
|---|
| 556 | #if OPENSSL_VERSION_NUMBER == 0x0090704fL |
|---|
| 557 | IMPORT_FUNCTION(sSSLLoader, int, SSL_state, (SSL *ssl), (ssl)) |
|---|
| 558 | #else |
|---|
| 559 | IMPORT_FUNCTION(sSSLLoader, int, SSL_state, (const SSL *ssl), (ssl)) |
|---|
| 560 | #endif |
|---|
| 561 | |
|---|
| 562 | //const char * SSL_state_string_long(const SSL *s); |
|---|
| 563 | IMPORT_FUNCTION(sSSLLoader, const char *, SSL_state_string_long, (const SSL *ssl), (ssl)) |
|---|
| 564 | |
|---|
| 565 | //int SSL_use_certificate(SSL *ssl, X509 *x) |
|---|
| 566 | IMPORT_FUNCTION(sSSLLoader, int, SSL_use_certificate, (SSL *ssl, X509 *x), (ssl, x)) |
|---|
| 567 | |
|---|
| 568 | //int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey) |
|---|
| 569 | IMPORT_FUNCTION(sSSLLoader, int, SSL_use_PrivateKey, (SSL *ssl, EVP_PKEY *pkey), (ssl, pkey)) |
|---|
| 570 | |
|---|
| 571 | //int SSL_version(SSL *ssl); |
|---|
| 572 | #if OPENSSL_VERSION_NUMBER == 0x0090704fL |
|---|
| 573 | IMPORT_FUNCTION(sSSLLoader, int, SSL_version, (SSL *ssl), (ssl)) |
|---|
| 574 | #else |
|---|
| 575 | IMPORT_FUNCTION(sSSLLoader, int, SSL_version, (const SSL *ssl), (ssl)) |
|---|
| 576 | #endif |
|---|
| 577 | |
|---|
| 578 | //int SSL_write(SSL *ssl,const void *buf,int num); |
|---|
| 579 | IMPORT_FUNCTION(sSSLLoader, int, SSL_write, (SSL *ssl,const void *buf,int num), (ssl, buf, num)) |
|---|
| 580 | |
|---|
| 581 | //char *SSL_CIPHER_description(SSL_CIPHER *s,char *buf,int size); |
|---|
| 582 | // argument was constified in 0.9.8m |
|---|
| 583 | #if OPENSSL_VERSION_NUMBER >= 0x009080dfL |
|---|
| 584 | IMPORT_FUNCTION(sSSLLoader, char *, SSL_CIPHER_description, (const SSL_CIPHER *s,char *buf,int size), (s, buf, size)) |
|---|
| 585 | #else |
|---|
| 586 | IMPORT_FUNCTION(sSSLLoader, char *, SSL_CIPHER_description, (SSL_CIPHER *s,char *buf,int size), (s, buf, size)) |
|---|
| 587 | #endif |
|---|
| 588 | |
|---|
| 589 | //int SSL_CIPHER_get_bits(SSL_CIPHER *c,int *alg_bits); |
|---|
| 590 | #if OPENSSL_VERSION_NUMBER == 0x0090704fL |
|---|
| 591 | IMPORT_FUNCTION(sSSLLoader, int, SSL_CIPHER_get_bits, (SSL_CIPHER *c,int *alg_bits), (c, alg_bits)) |
|---|
| 592 | #else |
|---|
| 593 | IMPORT_FUNCTION(sSSLLoader, int, SSL_CIPHER_get_bits, (const SSL_CIPHER *c,int *alg_bits), (c, alg_bits)) |
|---|
| 594 | #endif |
|---|
| 595 | |
|---|
| 596 | //int SSL_CTX_check_private_key(SSL_CTX *ctx); |
|---|
| 597 | #if OPENSSL_VERSION_NUMBER == 0x0090704fL |
|---|
| 598 | IMPORT_FUNCTION(sSSLLoader, int, SSL_CTX_check_private_key, (SSL_CTX *ctx), (ctx)) |
|---|
| 599 | #else |
|---|
| 600 | IMPORT_FUNCTION(sSSLLoader, int, SSL_CTX_check_private_key, (const SSL_CTX *ctx), (ctx)) |
|---|
| 601 | #endif |
|---|
| 602 | |
|---|
| 603 | //long SSL_CTX_ctrl(SSL_CTX *ctx,int cmd, long larg, void *parg); |
|---|
| 604 | IMPORT_FUNCTION(sSSLLoader, long, SSL_CTX_ctrl, (SSL_CTX *ctx,int cmd, long larg, void *parg), (ctx, cmd, larg, parg)) |
|---|
| 605 | |
|---|
| 606 | //void SSL_CTX_free(SSL_CTX *); |
|---|
| 607 | IMPORT_FUNCTION_VOID(sSSLLoader, void, SSL_CTX_free, (SSL_CTX *ctx), (ctx)) |
|---|
| 608 | |
|---|
| 609 | //int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, const char *CApath); |
|---|
| 610 | IMPORT_FUNCTION(sSSLLoader, int, SSL_CTX_load_verify_locations, (SSL_CTX *ctx, const char *CAfile, const char *CApath), (ctx, CAfile, CApath)) |
|---|
| 611 | |
|---|
| 612 | //SSL_CTX *SSL_CTX_new(SSL_METHOD *meth); |
|---|
| 613 | IMPORT_FUNCTION(sSSLLoader, SSL_CTX *, SSL_CTX_new, (SSL_METHOD *meth), (meth)) |
|---|
| 614 | |
|---|
| 615 | //int SSL_CTX_set_cipher_list(SSL_CTX *,const char *str); |
|---|
| 616 | IMPORT_FUNCTION(sSSLLoader, int, SSL_CTX_set_cipher_list, (SSL_CTX *ctx,const char *str), (ctx, str)) |
|---|
| 617 | |
|---|
| 618 | //void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *list); |
|---|
| 619 | IMPORT_FUNCTION_VOID(sSSLLoader, void, SSL_CTX_set_client_CA_list, (SSL_CTX *ctx, STACK_OF(X509_NAME) *list), (ctx, list)) |
|---|
| 620 | |
|---|
| 621 | //int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx); |
|---|
| 622 | IMPORT_FUNCTION(sSSLLoader, int, SSL_CTX_set_default_verify_paths, (SSL_CTX *ctx), (ctx)) |
|---|
| 623 | |
|---|
| 624 | //int SSL_CTX_set_session_id_context(SSL_CTX *ctx,const unsigned char *sid_ctx, unsigned int sid_ctx_len); |
|---|
| 625 | IMPORT_FUNCTION(sSSLLoader, int, SSL_CTX_set_session_id_context, (SSL_CTX *ctx,const unsigned char *sid_ctx, unsigned int sid_ctx_len), (ctx, sid_ctx, sid_ctx_len)) |
|---|
| 626 | |
|---|
| 627 | //void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx, RSA *(*cb)(SSL *ssl,int is_export, int keylength)); |
|---|
| 628 | IMPORT_FUNCTION_VOID(sSSLLoader, void, SSL_CTX_set_tmp_rsa_callback, (SSL_CTX *ctx, RSA *(*cb)(SSL *ssl,int is_export, int keylength)), (ctx, cb)) |
|---|
| 629 | |
|---|
| 630 | //void SSL_CTX_set_verify(SSL_CTX *ctx,int mode, int (*callback)(int, X509_STORE_CTX *)); |
|---|
| 631 | IMPORT_FUNCTION_VOID(sSSLLoader, void, SSL_CTX_set_verify, (SSL_CTX *ctx,int mode, int (*callback)(int, X509_STORE_CTX *)), (ctx, mode, callback)) |
|---|
| 632 | |
|---|
| 633 | //int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type); |
|---|
| 634 | IMPORT_FUNCTION(sSSLLoader, int, SSL_CTX_use_certificate_file, (SSL_CTX *ctx, const char *file, int type), (ctx, file, type)) |
|---|
| 635 | |
|---|
| 636 | //int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type); |
|---|
| 637 | IMPORT_FUNCTION(sSSLLoader, int, SSL_CTX_use_PrivateKey_file, (SSL_CTX *ctx, const char *file, int type), (ctx, file, type)) |
|---|
| 638 | |
|---|
| 639 | //SSL_METHOD *SSLv23_method(void); |
|---|
| 640 | IMPORT_FUNCTION(sSSLLoader, SSL_METHOD *, SSLv23_method, (void), ()) |
|---|
| 641 | |
|---|
| 642 | //SSL_METHOD *SSLv23_client_method(void); |
|---|
| 643 | IMPORT_FUNCTION(sSSLLoader, SSL_METHOD *, SSLv23_client_method, (void), ()) |
|---|
| 644 | |
|---|
| 645 | //SSL_METHOD *SSLv3_client_method(void); |
|---|
| 646 | IMPORT_FUNCTION(sSSLLoader, SSL_METHOD *, SSLv3_client_method, (void), ()) |
|---|
| 647 | |
|---|
| 648 | //SSL_METHOD *TLSv1_client_method(void); |
|---|
| 649 | IMPORT_FUNCTION(sSSLLoader, SSL_METHOD *, TLSv1_client_method, (void), ()) |
|---|
| 650 | |
|---|
| 651 | //void ssl3_send_alert(SSL *s,int level, int desc); |
|---|
| 652 | IMPORT_FUNCTION_VOID(sSSLLoader, void, ssl3_send_alert, (SSL *s,int level, int desc), (s, level, desc)) |
|---|